Authored by 张丽霞

优化订单倒倒计时JS逻辑

Signed-off-by: 🍓 <lixia.zhang@yoho.cn>
... ... @@ -45,8 +45,8 @@ function downCount(options) {
// set new Date object
return utc;
},
difference = targetDateFunction() - currentDateFunction();// difference of dates
difference = targetDateFunction() - currentDateFunction(),// difference of dates
interval;
// Throw error if date is not set
if (!settings) {
... ... @@ -68,11 +68,10 @@ function downCount(options) {
_minute = _second * 60,
_hour = _minute * 60,
_day = _hour * 24,
interval,
days,
hours,
minutes,
seconds;
seconds;
// calculate dates
days = Math.floor(difference / _day),
... ... @@ -97,7 +96,6 @@ function downCount(options) {
return;
}
}
countdown();
interval = setInterval(countdown, 1000);// start
}
... ...