Authored by QC-L

更新提交订单页面去支付时的错误信息 review by 黄敬囿

... ... @@ -51,8 +51,11 @@ attached: function () {
if(timer > 0){
let interval = setInterval(() => {
timer = timer - 1;
timer = timer - 1;
leftTime = formatTimeByMin(timer, 'm:s');
if (timer <= 0) {
leftTime = '00:00'
}
that.setData({
lefttime: leftTime,
timer: timer
... ...
... ... @@ -122,7 +122,10 @@ Page({
}
})
.catch(error => {
console.log(error)
wx.showToast({
title: error.message,
icon: 'none'
})
})
},
... ...
... ... @@ -117,6 +117,9 @@ Page({
interval = setInterval(() => {
leftTime = leftTime - 1;
timer = formatTimeByMin(leftTime, 'm:s');
if (timer <= 0) {
timer = '00:00'
}
that.setData({
timer: timer,
});
... ...
... ... @@ -92,24 +92,7 @@ function formatTimeByMin(time, format) {
returnArr.push(formatNumber(date.getMinutes()));
returnArr.push(formatNumber(date.getSeconds()));
// if (time >= 0) {
// // int_day = Math.floor(time / 86400000)
// // time -= int_day * 86400000;
// // int_hour = Math.floor(time / 3600000)
// // time -= int_hour * 3600000;
// int_minute = Math.floor(time / 60000)
// if (time < 60000) {
// int_minute = Math.floor(0);
// } else {
// time -= int_minute * 60000;
// }
// int_second = Math.floor(time / 1000)
// }
// // returnArr.push(formatNumber(int_day));
// // returnArr.push(formatNumber(int_hour));
// returnArr.push(formatNumber(int_minute));
// returnArr.push(formatNumber(int_second));
for (var i in returnArr) {
format = format.replace(formateArr[i], returnArr[i]);
}
... ...