mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 07:55:53 +08:00
修复购物车添加促销商品出现的Bug
This commit is contained in:
@@ -236,12 +236,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 倒数计时
|
||||
*/
|
||||
* 倒数计时
|
||||
*/
|
||||
getCountDownTime(val) {
|
||||
let date = new Date(val.replace(/-/g, "/"));
|
||||
let timeSimple = new Date(date).getTime() / 1000;
|
||||
return timeSimple - new Date().getTime() / 1000;
|
||||
if (val.promotionMap) {
|
||||
let key = Object.keys(val.promotionMap).find((child, index) => {
|
||||
return child.split("-")[0] == 'SECKILL'
|
||||
});
|
||||
return val.promotionMap[key].endTime / 1000 - (new Date().getTime() / 1000)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user