다음은 Xiaomi가 구매를 시작하면 Redmi Rush를 구현 하여이 코드를 구매할 수 있습니다.
코드 사본은 다음과 같습니다.
hdControl ({ "stime": 1381645438, "status": { "allow": false, "miphone": { "hdstart": false, "hdstop": false, "hdurl": "", "duration": null} , "mibox": { "hdstart": false, "hdstop": false, "hdurl": "", "duration": null}}})).
코드 사본은 다음과 같습니다.
기능 fornum (a) {
반환 10> a? "0"+a : a
}
기능 카운트 다운 (A, B) {
varc = newdate (b) .gettime ()/1e3,
d = ca,
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? ]))+"minute"+fornum (i [0])+"second", [h+"<pan> day </span>"+fornum (i [2])+"<span> time </span>" +fornum (i [1])+"<Span> min </span>"+Fornum (i [0])+"<Span> Second </span>",! 1])) :( Window._TIMESTER = FORNUM (i [2])+"time"+fornum (i [1])+"minute"+fornum (i [0])+"second", [Fornum (i [2])+"<span> /span > "+Fornum (i [1])+"<pan> min </span> "+fornum (i [0])+"<pan> second </span> ",! 1])}
functionwebeventtrigger (a, b) {
노력하다{
if (We && We.trigger)
return "string"! = typeofb && (b = json.stringify (b)), we.trigger (a, b)
} catch (c) {}
반환! 1
}
functionisApp () {
노력하다{
if (우리) 반환! 0
} catch (a) {}
반환! 1
}
varquickbuy = {init : function () {
vara = 이것;
this.config = {},
this.config.hdurl = {Miphone : "M3/840410D8656D74E5F334591BD8A408A726799AEC13477D90B5E48DAD36547351/4334F49A1EE3912615E8A0C9 2FDA 20AB3F58343496FD4983D/TIP_SALEDOVERALL.HTML ", MIBOX :"TV/B1CF7BFEAE1EBC37700694C123D894C668BF11F6F25D59311FD369 42B3D6A/130B18D11F5343434434331F 4E926C5A9B7676E57BE3D47959D657545E8A339/TIP_SALEDOVERALL.HTML "
},
this.config.mode = "",
this.mode = {miphone :! 1, mibox :! 1},
this.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), $. 쿠키 (this.modecookies [c]) && this.saleout ();
b || ($. 쿠키 ( "xm_diff_hd")? .config.startDate/1e3,10)? $. 쿠키 ( "xm_hd_so_phone") && $. 쿠키 ( "xm_hd_so_box") || this.getData (! 0, function () {a.gobuy ()}) : this. : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : this.getData ())}, getData : function (a, b) {
varc = this, a = a || null;
b && (b = b),
$ .ajax ({
URL : "http://tc.hd.xiaomi.com/hdget",
데이터 유형 : "JSONP",
JSONPCALLBACK : "HDControl",
타임 아웃 : 7E3,
beforesend : function () {
c.maskload.css ( "display", "block")},
오류 : function () {
c.maskload.css ( "display", "none"),
ALERT ( "서버는 큰 압력을 받고 있습니다. 페이지를 새로 고침하십시오!")
},
성공 : 기능 (d) {
if (c.maskload.css ( "display", "none"), "undefined"== typeofd)
returnLert ( "서버는 큰 압력을 받고 있습니다. 페이지를 새로 고침하십시오!"),
void0;
if (c.results = d, a || (c.config.servertime = c.results.stime),! $. 쿠키 ( "xm_diff_hd") {
vare = parseint (c.config.servertime-c.localtime (), 10);
$ .cookie ( "xm_diff_hd", e, {
길:"/",
도메인 : ". xiaomi.com",
만료 : 1
})
}
경우 (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 : "/", domain : ". xiaomi.com", 만료 : 1}),
c.saleout ()
} elseb && b.call ()
}
a || c.launch ()
}})},
이니셜 데이터 : function () {
this.config.allow = this.results.status.allow,
this.config.mibox = this.results.status.mibox,
this.config.miphone = this.results.status.miphone
},
발사 : function () {
this.timestart (),
this.countdown ()
},
Timestart : function () {
vara = 이것,
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 ( "가시성", "숨겨진"),
$ ( "#buyure_btn_1") .html ( '<class = "btn_buy"href = "http://bbs.xiaomi.cn/thread-8205768-1-1.html"> 활동 세부 정보 </a>'),
$ ( "#buyure_btn_2"). html ( '<class = "btn_buybtn_02"href = "javaScript :;"> login </a>')) : a.tologin () : b> = c && a.tobuy ()
},
Tologin : function () {
$ ( "#view_button"). css ( "가시성", "숨겨진"),
$ ( "#buyure_btn_1") .html ( '<class = "btn_buy"href = "http://bbs.xiaomi.cn/thread-8205768-1-1.html"> 활동 세부 정보 </a>'),
$ ( "#buyure_btn_2"). html ( '<aclass = "btn_buybtn_02"href = "javaScript :;"> 사전에 로그인 </a>'),
$ ( "#buyure_btn_2"). find ( ". btn_02"). on ( "click", function () {
webeventtrigger ( "로그인", null) || (wind . 위치 .href))}
)},
카운트 다운 : function () {
vara = 이것,
b = null,
c = a.config.startDate;
b = a.config.servertime? a.config.servertime : parseint (+newdate/1e3,10);
vard = c-1e3*60*A.Config.minsigntime,
e = setInterVal (function () {
varf = 카운트 다운 (b, c);
f [1]? (clearinterval (e), $ ( "#countdown"). css ( "display", "none"), a.tobuy ()) :( 1e3*b! = d || isapp () | | ($. 쿠키 ( "userId")?
$ ( "#buyure_btn_1") .html ( '<class = "btn_buy"href = "http://bbs.xiaomi.cn/thread-8205768-1-1.html"> 활동 세부 정보 </a>'),
$ ( "#buyure_btn_2"). html ( '<aclass = "btn_buy"href = "javaScript :;"> login </a>')) : a.tologin ()), b ++),
$ ( "#countdown"). html (f [0])}, 1e3)},
Tobuy : function () {
vara = 이것;
a.gobuy ();
varb = a.modemodals [a.config.mode];
$ (b) .find ( ". Close"). on ( "click", function () {
$ (b) .css ( "display", "none"),
Window.ClearTimeout (A.Timer),
A. Timer = null})},
Saleout : function () {
vara = {miphone : "#buyure_btn_2", mibox : "#buyure_btn_1"},
b = {miphone : "http://t.hd.xiaomi.com/r/?_a=payment_check&_m=1", mibox : "http://m.xiaomi.com/index.html#ac=home&op=addcart&product_id = 2505 "},
C = {Miphone : "Xiaomi Mobile 3 Pay", Mibox : "Xiaomi TV를 지불"};
for (vardintthis.mode)
$ .cookie (this.modecookies [d]) && ($ (a [d]). html ( '<aclass = "btn_buy"href = "'+b [d]+'">'+c [d]+ "</a>"),
$ (this.modemodals [d]). is ( ": visible") && $ (this.modemodals [d]). find ( ". close"). click ())},
localtime : function () {
vara = parseint (+newdate/1e3,10);
returna
},
toprocess : function (a) {
varb = 이것,
C = B. Timer,
d = B. timeountount || 10, e = $ (B.modemodals [a]). 찾기 ( ". re_countdown"),
f = $ (b.modemodals [a]). 찾기 ( ". modal_btn"),
g = function () {0 == d?
B.Tobuygo (b.config.mode),
C && Window.ClearTimeout (C),
c = null) :( e.html ( "("+d+")"),
디--,
b.timer = window.settimeout (function () {g ()}, 1e3))};
C && Window.ClearTimeout (C), g ()},
gobuy : function () {
vara = 이것,
B = {Miphone : "Xiaomi Mobile 3 구매", Mibox : "Xiaomi TV 구매"},
c = {miphone : "#buyure_btn_2", mibox : "#buyure_btn_1"};
for (vardina.mode)
$ .cookie (a.modecookies [d]) || ($ (c [d]). html ( '<aclass = "btn_buybtn_buy_go"data-type = "'+d+'"href = "javascript :;">' +b [d]+"</a>"),
$ (c [d]). is ( ": hidden") && $ (c [d]). css ( "display", "block");
$ ( "#Open_BUTTON"). find ( ". btn_buy_go"). on ( "click", function () {a.mode [$ (this) .attr ( "data-type")] =! 0;
varb = a.config.mode = $ (this) .attr ( "data-type");
if ($. 쿠키 ( "userId")) a.getData (! 0, function () {
$ (a.modemodals [b]). css ( "display", "block"),
$ (a.modemodals [b]). find ( ". close"). on ( "click", function () {
$ (a.modemodals [b]). css ( "display", "none"), window.cleartimeout (a.timer), a.timer = null}), a.toprocess (b)});
else {if (webeventtrigger ( "login", null)) return;
Window.location.href = "http://m.xiaomi.com/mshopapi/index.php/v1/authorize/sso?client_id=180100031013&callback="+encodeUricomponent (w indow.location.href)})},
Tobuygo : 기능 (a) {
varb = 이것;
Window.ClearTimeout (B.Timer),
B. timer = null,
$ (b.modemodals [a]). find ( ". modal_btn"). find ( ". into_buy_btn"). on ( "click", function (c) {c.preventDefault (), b.getData (! 0, 기능(){
if ($ (b.modemodals [a]). css ( "display", "block"), b.config.alow) if (b.config [a] .hdurl) {
varc = "http://t.hd.xiaomi.com/s/"+b.config [a] .hdurl+"& _m = 1";
Window.settimeout (function () {window.location.href = c}, 500)
}또 다른{
vard = "http://p.www.xiaomi.com/m/activities/open/"+b.config.hdurl [a];
Window.settimeout (function () {window.location.href = d}, 500)
} elseif (
b.config [a] .hdstart ===! 1 && b.config [a] .hdstop ===! 0) {
vard = "http://p.www.xiaomi.com/m/activities/open/"+b.config.hdurl [a];
Window.settimeout (function () {window.location.href = d}, 500)
} else $ (b.modemodals [a]). find ( ". modal_btn"). html ( '<class = "re_enter"href = "javaScript :;"> Reent </a>'),
B. 공약 (a)
})})}};