<script>
JQuery (function ($) {
(function () {
var $bnBar = $ ('),
$topBn = $ (' #J_topBn '),
$topBnBackdrop = $ (' #J_topBackdrop '),
$counter = $ ('. J_counter '),
$closeBnTrigger = $ ('. J_closebn '),
TIMEOUTTOPBN,
Bncounter = 10;
function Countdown () {
Bncounter-= 1;
if (Bncounter < 1) {
CLOSEBN ();
}
else {
$counter. Text (Bncounter + ' seconds later ');
}
}
function Closebn () {
Window.clearinterval (TIMEOUTTOPBN);
$counter. Remove ();
$topBn. Animate ({
' Top ':-$topBn. Height ()
}, the function () {
$topBn. Hide ();
$topBnBackdrop. Hide ();
});
var expiredate;
ExpireDate = new Date (Math.Round (new Date (). GetTime ()) + 1000 * 60 * 60 * 6);
XIAOMI.app.cookie (' Indextopbn ', ' 1 ', {
Expires:expiredate
});
}
$bnBar. InsertBefore ($ ('. Site-topbar '));
if (XIAOMI.app.cookie (' indextopbn ')!== ' 1 ') {
$topBn. Show ();
$topBnBackdrop. Height ($ (document). Height ()). Show ();
TIMEOUTTOPBN = Window.setinterval (function () {
Countdown ();
}, 1000);
$closeBnTrigger. On (' click ', Function (e) {
E.preventdefault ();
CLOSEBN ();
});
}
}());
(function () {
if (!$ ('. Site-bn '). Length) {
if (Window.location.href.split ('? '). Length < 2) {
return false;
}
if (Window.location.href.split ('? ') [1].indexof (' F=xiaomi ')!==-1) {
var timeoutmodalfrom,
Modalfromcounter = 5,
$modalFrom = $ (' <div class= "modal Modal-from-xiaomi" ><div class= "modal-body" ><a class= "Btn-enter J_ Closemodalfrom "href=" javascript:void (0); " ><span class= "J_xmcounter" >10 seconds </span> enter Xiaomi net </a><span class= "Close J_closemodalfrom" Data-dismiss= "modal" ><i class= "Iconfont" >& #xe617;</i></span></div></div> ') ;
function Modalcountdown () {
Modalfromcounter-= 1;
if (Modalfromcounter < 1) {
Closemodalfrom ();
}
else {
$ ('. J_xmcounter '). Text (Modalfromcounter + ' seconds after ');
}
}
function Closemodalfrom () {
Window.clearinterval (Timeoutmodalfrom);
$modalFrom. Modal (' hide ');
var expiredate = new Date (Math.Round (new Date (). GetTime ()) + 1000 * 60 * 60 * 2);
XIAOMI.app.cookie (' Indexfromxiaomi ', ' 1 ', {
Expires:expiredate
});
}
if (XIAOMI.app.cookie (' Indexfromxiaomi ')!== ' 1 ') {
$ (' body '). Append ($modalFrom);
$modalFrom. Modal ({
' Show ': true
});
Timeoutmodalfrom = Window.setinterval (function () {
Modalcountdown ();
}, 1000);
$ ('. J_closemodalfrom '). On (' click ', Function (e) {
E.preventdefault ();
Closemodalfrom ();
});
}
}
}
}());
});
</script>