修改秒杀处理

master
于肖磊 2025-04-27 10:26:33 +08:00
parent 56e84be682
commit 3e0eb6bc6f
1 changed files with 10 additions and 8 deletions

View File

@ -299,7 +299,7 @@
if (!isEmpty(data.current.goods)) {
new_list = data.current.goods;
}
const { status, time_first_text } = data.current.time;
const { status = '1', time_first_text = '已结束' } = data?.current?.time || {};
this.setData({
seckill_time: {
time_end_number: Number(data.current.time_end_number + '000'),
@ -308,13 +308,15 @@
time_first_text: time_first_text,
},
});
//
setTimeout(() => {
this.updateCountdown();
}, 0);
this.setData({
intervalId: setInterval(this.updateCountdown, 1000),
});
if (time_first_text !== '已结束') {
//
setTimeout(() => {
this.updateCountdown();
}, 0);
this.setData({
intervalId: setInterval(this.updateCountdown, 1000),
});
}
}
//
const product_style_list = [