...
|
...
|
@@ -6,6 +6,9 @@ var $wOdetail = $('.w-odetail'), |
|
|
$wPayment = $('.w-payment'),
|
|
|
$wAddrinfo = $('.w-addrinfo'),
|
|
|
$wPerm = $('.w-p-erm'),
|
|
|
time = $('.js-time').data('time'),
|
|
|
timeInterval,
|
|
|
$timer = $('.js-timer'),
|
|
|
orderCode = $wPayment.data('order');
|
|
|
|
|
|
require('../simple-header');
|
...
|
...
|
@@ -20,6 +23,10 @@ wxPage = { |
|
|
});
|
|
|
this.setEvent();
|
|
|
inter = setInterval(this.checkPayStatus, 3000);
|
|
|
this.setTimer();
|
|
|
timeInterval = setInterval(() => {
|
|
|
this.setTimer();
|
|
|
}, 1000);
|
|
|
},
|
|
|
setEvent: function() {
|
|
|
$wOdetail.on('click', function() {
|
...
|
...
|
@@ -61,6 +68,25 @@ wxPage = { |
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
setTimer: function() {
|
|
|
if (time < 0) {
|
|
|
return clearInterval(timeInterval);
|
|
|
}
|
|
|
|
|
|
let hour = Math.floor(time / 3600);
|
|
|
let minus = Math.floor((time % 3600) / 60);
|
|
|
let second = time % 60;
|
|
|
let text = '';
|
|
|
|
|
|
if (hour > 0) {
|
|
|
text += hour + '小时';
|
|
|
}
|
|
|
|
|
|
text += minus + '分' + second + '秒';
|
|
|
|
|
|
$timer.text(text);
|
|
|
time--;
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|