接入秒杀100%
This commit is contained in:
@@ -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 = {};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user