国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

紅米手機搶購的js代碼

2024-05-06 16:02:37
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了紅米手機搶購時返回的js代碼,制作紅米搶購軟件時可以用到,,需要的朋友可以參考下

以下就是小米搶購時的JS代碼,分析一下就可以用它實現一個紅米搶購軟件,大家根據這個代碼實現自己想要的功能吧!

復制代碼 代碼如下:


hdcontrol({"stime":1381645438,"status":{"allow":false,"miphone":{"hdstart":false,"hdstop":false,"hdurl":"","duration":null},"mibox":{"hdstart":false,"hdstop":false,"hdurl":"","duration":null}}})

復制代碼 代碼如下:


function forNum(a){
return 10>a?"0"+a:a
}
function countdown(a,b){
varc=newDate(b).getTime()/1e3,
d=c-a,
e=parseInt(d%60),
f=parseInt(d/60%60),g=parseInt(d/3600%24),
h=parseInt(d/3600/24),
i=[e.toString(),
f.toString(),
g.toString()];

return0>=d?["00小時00分00秒",!0]:h>0?(window._timestr=h+"天"+forNum(i[2])+"時"+forNum(i[1])+"分"+forNum(i[0])+"秒",[h+"<span>天</span>"+forNum(i[2])+"<span>時</span>"+forNum(i[1])+"<span>分</span>"+forNum(i[0])+"<span>秒</span>",!1]):(window._timestr=forNum(i[2])+"時"+forNum(i[1])+"分"+forNum(i[0])+"秒",[forNum(i[2])+"<span>時</span>"+forNum(i[1])+"<span>分</span>"+forNum(i[0])+"<span>秒</span>",!1])}
functionWebEventTrigger(a,b){
try{
if(WE&&WE.trigger)
return"string"!=typeofb&&(b=JSON.stringify(b)),WE.trigger(a,b)
}catch(c){}
return!1
}
functionisApp(){
try{
if(WE)return!0
}catch(a){}
return!1
}
varquickBuy={init:function(){
vara=this;
this.config={},
this.config.hdurl={miphone:"m3/840410D8656D74E5F334591BD8A408A726799AEC13477D90B5E48DAD36547351/4334F49A1EE391261005E8AC5A0C9D2FDA23BB72A2D20AB3F58343496FD4983D/tip_SaledOverAll.html",mibox:"tv/B1CF7B57BFEAE1EBC37700694C123D894C668BF11F6F25D59311FD36942B3D6A/130F1B18D11F53CA1D0147B24E926C5A9B7676E57BE3D47959D6557545E8A339/tip_SaledOverAll.html"
},
this.config.mode="",
this.mode={miphone:!1,mibox:!1},
this.modeModals={miphone:"#modal_miphone",mibox:"#modal_mibox"},
this.modeCookies={miphone:"xm_hd_so_phone",mibox:"xm_hd_so_box"},
this.config.startDate=+newDate("10/15/201312:00:00"),
this.maskLoad=$("#maskLoad"),
this.config.minSignTime=120,
this.results=null,
this.timer=null,
this.timeCount=Math.floor(Math.abs(10*Math.random()-5))+5;
varb=!0;
for(varcinthis.mode)
$.cookie(this.modeCookies[c])||(b=!1),$.cookie(this.modeCookies[c])&&this.saleOut();
b||($.cookie("xm_diff_hd")?(this.config.serverTime=this.localTime()+parseInt($.cookie("xm_diff_hd"),10),this.config.serverTime>=parseInt(this.config.startDate/1e3,10)?$.cookie("xm_hd_so_phone")&&$.cookie("xm_hd_so_box")||this.getData(!0,function(){a.goBuy()}):this.launch()):this.getData())},getData:function(a,b){
varc=this,a=a||null;
b&&(b=b),
$.ajax({
url:"http://tc.hd.xiaomi.com/hdget",
dataType:"jsonp",
jsonpCallback:"hdcontrol",
timeout:7e3,
beforeSend:function(){
c.maskLoad.css("display","block")},
error:function(){
c.maskLoad.css("display","none"),
alert("服務器壓力山大,請您重新刷新頁面!")
},
success:function(d){
if(c.maskLoad.css("display","none"),"undefined"==typeofd)
returnalert("服務器壓力山大,請您重新刷新頁面!"),
void0;
if(c.results=d,a||(c.config.serverTime=c.results.stime),!$.cookie("xm_diff_hd")){
vare=parseInt(c.config.serverTime-c.localTime(),10);
$.cookie("xm_diff_hd",e,{
path:"http://www.survivalescaperooms.com/",
domain:".xiaomi.com",
expires:1
})
}
if(a){
c.initialData();
for(varfinc.mode)
if(c.config[f].hdstart===!1&&c.config[f].hdstop===!0){
varg=c.modeCookies[f];
$.cookie(g,1,{path:"http://www.survivalescaperooms.com/",domain:".xiaomi.com",expires:1}),
c.saleOut()
}elseb&&b.call()
}
a||c.launch()
}})},
initialData:function(){
this.config.allow=this.results.status.allow,
this.config.mibox=this.results.status.mibox,
this.config.miphone=this.results.status.miphone
},
launch:function(){
this.timeStart(),
this.countdown()
},
timeStart:function(){
vara=this,
b=1e3*a.config.serverTime,
c=a.config.startDate,
d=c-1e3*60*a.config.minSignTime;
b>=d&&c>b&&!isApp()?
$.cookie("userId")?
($("#view_button").css("visibility","hidden"),
$("#purchase_btn_1").html('<aclass="btn_buy"),
b.toProcess(a)
})})}};


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 洪泽县| 洪泽县| 禄劝| 哈密市| 麦盖提县| 湘潭县| 深水埗区| 新竹县| 崇仁县| 越西县| 杭锦旗| 砀山县| 澄城县| 盘锦市| 马龙县| 广元市| 句容市| 翁源县| 沾益县| 赤水市| 翁牛特旗| 富川| 太谷县| 肥城市| 饶阳县| 平江县| 曲靖市| 陆丰市| 漳平市| 勐海县| 璧山县| 民勤县| 时尚| 昆明市| 长寿区| 苗栗县| 东光县| 马公市| 化州市| 梅河口市| 扎赉特旗|