接入秒杀100%

This commit is contained in:
owen
2024-01-11 11:08:14 +08:00
parent c2f29333dc
commit 1694a6f554
5 changed files with 45 additions and 33 deletions
@@ -281,7 +281,7 @@
// 判断所有 property 大类是否选择完成
if (choosePropertyId.length === propertyList.length && newSkuList.length) {
newSkuList[0].goods_num = state.selectedSku.goods_num || 1;
newSkuList[0].count = state.selectedSku.count || 1;
state.selectedSku = newSkuList[0];
} else {
state.selectedSku = {};
+21
View File
@@ -1,5 +1,7 @@
// ========== MALL - 营销模块 ==========
import dayjs from "dayjs";
/**
* 优惠类型枚举
*/
@@ -45,3 +47,22 @@ export const PromotionProductScopeEnum = {
name: '品类劵'
}
}
// 时间段的状态枚举
export const TimeStatusEnum = {
WAIT_START: '即将开始',
STARTED: '进行中',
END: '已结束',
}
export const getTimeStatusEnum = (startTime, endTime) => {
const now = dayjs();
if (now.isBefore(startTime)) {
return TimeStatusEnum.WAIT_START;
} else if (now.isAfter(endTime)) {
return TimeStatusEnum.END;
} else {
return TimeStatusEnum.STARTED;
}
}