This article mainly introduces the red Rice mobile phone when the return of the JS code, the production of red rice snapping software can be used, the need for friends can refer to the following
The following is a millet snapped up the JS code, analysis can be used to achieve a red rice snapping software, everyone according to the code to achieve their desired function! Code as follows: Hdcontrol ({"Stime": 1381645438, "status": {"Allow": false, "Miphone": {"Hdstart": false, "hdstop": False, "Hdurl": "", "duration": null}, "Mibox": {"Hdstart": false, "hdstop": false, "Hdurl": "", "duration": null}}) Code as follows: 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 parseint (d/3600%24), H=parseint (D/3600/24), i=[e.tostring (), f.tostring (), g.tostring ()]; Return0>=d? [00 hours, 00 minutes, 00 seconds,!0]:h>0? (window._timestr=h+ "Day" +fornum (i[2]) + "Time" +fornum (i[1]) + "min" +fornum (i[0)) + "seconds", [h+ "<span> Day </span>" + Fornum (i[2]) + "<span> </span>" +fornum (i[1]) + "<span> </span>" +fornum (i[0)) + "<span> SEC </span> ",!1]):(Window._timestr=fornum (i[2]) +" when "+fornum (i[1)) +" Min "+fornum (i[0]) +" seconds ", [Fornum (i[2]) +" < Span> </span> "+fornum (i[1]) + <span> min </span>" +fornum (i[0]) + "<span> sec </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/4334 F49a1ee391261005e8ac5a0c9d2fda23bb72a2d20ab3f58343496fd4983d/tip_saledoverall.html ", Mibo x:" tv/ B1cf7b57bfeae1ebc37700694c123d894c668bf11f6f25d59311fd36942b3d6a/130f1b18d11f53 Ca1d0147b24e926c5a9b7676e57be3d47959d6557545e8a339/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"), 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 ("Server pressure Alexander, please refresh the page!") ")}, Success:function (d) {if (C.maskload.css (" Display "," none ")," undefined "==typeofd) returnalert (" Server pressure Alexander, please refresh the page! ") "), 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: "/", 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: "/", 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 ' href= ' http:// Bbs.xiaomi.cn/thread-8205768-1-1.html "> Event Details </a>"), $ ("#purchase_btn_2"). html (' <aclass= ' btn_buybtn_ "href=" javascript:; " > already signed in </a>): A.TOlogin (): B>=c&&a.tobuy ()}, Tologin:function () {$ ("#view_button"). CSS ("visibility", "hidden"), $ ("# Purchase_btn_1 "). html (' <aclass=" btn_buy "href=" http://bbs.xiaomi.cn/thread-8205768-1-1.html "> Event details </a > '), $ ("#purchase_btn_2"). html (' <aclass= "btn_buybtn_02" href= "javascript:;" > Advance Login </a> '), $ ("#purchase_btn_2"). Find (". btn_02"). On ("click", Function () {Webeventtrigger ("login", null) | | (window.location.href= "http://m.xiaomi.com/mshopapi/index.php/v1/authorize/sso?client_id=180100031013& callback= "+encodeuricomponent (Window.location.href)})}, Countdown:function () {vara=this, 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=countdown (b,c); F[1]? ( Clearinterval (e), $ ("#countdown"). CSS ("display", "none"), A.tobuy ()):(1e3*b!=d| | Isapp () | | ($.cookie ("UserId")? ($ ("#view_button"). CSS ("visibility", "hidden"), $ ("#purchase_btn_1"). html (' <aclass= ' btn_buy ' href="Http://bbs.xiaomi.cn/thread-8205768-1-1.html" > Event Details </a> '), $ ("#purchase_btn_2"). html (' <aclass= ' btn_ Buy "href=" javascript:; " > already signed in </a> '): A.tologin ()), b++, $ ("#countdown"). html (f[0])},1e3)}, Tobuy:function () {vara=this; 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: "#purchase_btn_2", Mibox: "#purchase_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:" Pay Millet mobile phone 3 ", Mibox:" Pay Millet TV "}; for (Vardinthis.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=this, c=b.Timer, d=b.timecount| | 10,e=$ (B.modemodals[a]). Find (". Re_countdown"), f=$ (B.modemodals[a]). Find (". Modal_btn"), G=function () {0==d? ( F.html (' <aclass= "into_buy_btn" href= "javascript:;" > Enter Activity </a> '), B.tobuygo (B.config.mode), C&&window.cleartimeout (c), C=null):(e.html ("(" +d+ ")"), d-- , B.timer=window.settimeout (function () {g ()},1e3)}; C&&window.cleartimeout (c), G ()}, Gobuy:function () {vara=this, b={miphone: "Buy Millet Mobile 3", Mibox: "Buy Millet TV"}, c={ Miphone: "#purchase_btn_2", Mibox: "#purchase_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 ($.cookie ("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 (Window.location.href)}}"}, Tobuygo: function (a) {varb=this; 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,function () {if ($ (b.modemodals[a)). CSS (" Display "," block "), B.config.allow) 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)}else{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 (' < aclass= "Re_enter" href= "javascript:;" > Re-entry </a> '), B.toprocess (A)})}};