...
|
...
|
@@ -11,7 +11,9 @@ var $ = require('yoho-jquery'), |
|
|
lazyload = require('yoho-jquery-lazyload'),
|
|
|
tip = require('plugin/tip');
|
|
|
|
|
|
loading.init($(document.body));
|
|
|
loading.init($(document.body), {
|
|
|
className: 'loading-mask-opactiy'
|
|
|
});
|
|
|
|
|
|
var seckillObj = {};
|
|
|
|
...
|
...
|
@@ -22,6 +24,7 @@ seckillObj = { |
|
|
$productList: null, // DOMContentLoaded的时候 赋值,即init
|
|
|
pageTemplate: require('product/seckill/index.hbs'),
|
|
|
listTemplate: require('product/seckill/product-list.hbs'),
|
|
|
diff: 0, // 客户端与服务端时间的误差
|
|
|
|
|
|
el: {},
|
|
|
|
...
|
...
|
@@ -277,7 +280,8 @@ seckillObj = { |
|
|
second = offsetTime % 60;
|
|
|
|
|
|
if (offsetTime <= 0) { // 结束倒计时刷新状态
|
|
|
that.refreshList(elem);
|
|
|
// that.refreshList(elem);
|
|
|
location.reload();
|
|
|
} else {
|
|
|
$(elem).find('.tick.hour').text(hour < 0 ? '00' : (hour < 10 ? ('0' + hour) : hour));
|
|
|
$(elem).find('.tick.minute').text(minute < 0 ? '00' : (minute < 10 ? ('0' + minute) : minute));
|
...
|
...
|
@@ -286,7 +290,7 @@ seckillObj = { |
|
|
$el.currentTick = setTimeout(function() {
|
|
|
var curSec = Math.floor(Date.now() / 1000);
|
|
|
|
|
|
offsetTime = offsetTime - (curSec - nowTime);
|
|
|
offsetTime = offsetTime - (curSec - nowTime) - that.diff;
|
|
|
that.startTick(elem, offsetTime, curSec);
|
|
|
}, 1000);
|
|
|
}
|
...
|
...
|
@@ -387,6 +391,10 @@ seckillObj = { |
|
|
isApp: yoho.isApp
|
|
|
}))
|
|
|
);
|
|
|
if (result && result.currentTime) {
|
|
|
self.diff = Math.round((Date.now() - result.currentTime) / 1000);
|
|
|
}
|
|
|
|
|
|
lazyload('img.lazy');
|
|
|
window.rePosFooter();
|
|
|
callback();
|
...
|
...
|
|