diff --git a/pages.json b/pages.json index 78d7c311..88ac0f4a 100644 --- a/pages.json +++ b/pages.json @@ -120,6 +120,17 @@ "group": "商品" } }, + { + "path": "point", + "style": { + "navigationBarTitleText": "积分商品" + }, + "meta": { + "sync": true, + "title": "积分商品", + "group": "商品" + } + }, { "path": "list", "style": { diff --git a/pages/activity/point/list.vue b/pages/activity/point/list.vue new file mode 100644 index 00000000..8b1e1bf9 --- /dev/null +++ b/pages/activity/point/list.vue @@ -0,0 +1,77 @@ + + + diff --git a/pages/goods/point.vue b/pages/goods/point.vue new file mode 100644 index 00000000..b49f7a21 --- /dev/null +++ b/pages/goods/point.vue @@ -0,0 +1,525 @@ + + + + + + diff --git a/pages/order/confirm.vue b/pages/order/confirm.vue index d090aecd..697f6b1d 100644 --- a/pages/order/confirm.vue +++ b/pages/order/confirm.vue @@ -294,6 +294,7 @@ combinationActivityId: state.orderPayload.combinationActivityId, combinationHeadId: state.orderPayload.combinationHeadId, seckillActivityId: state.orderPayload.seckillActivityId, + pointActivityId: state.orderPayload.pointActivityId, }); if (code !== 0) { return; @@ -324,6 +325,7 @@ combinationActivityId: state.orderPayload.combinationActivityId, combinationHeadId: state.orderPayload.combinationHeadId, seckillActivityId: state.orderPayload.seckillActivityId, + pointActivityId: state.orderPayload.pointActivityId, }); if (code !== 0) { return; diff --git a/pages/order/pickUpVerify.vue b/pages/order/pickUpVerify.vue index 1e8bb6e8..4b4db375 100644 --- a/pages/order/pickUpVerify.vue +++ b/pages/order/pickUpVerify.vue @@ -19,15 +19,15 @@ {{ orderInfo.pickUpVerifyCode }} - - - - - - - - - + + + 核销时间 + + + 每日: + 2020-2-+52 + + @@ -138,7 +138,6 @@ diff --git a/sheep/components/s-point-card/s-point-card.vue b/sheep/components/s-point-card/s-point-card.vue new file mode 100644 index 00000000..c7380de5 --- /dev/null +++ b/sheep/components/s-point-card/s-point-card.vue @@ -0,0 +1,458 @@ + + + + diff --git a/sheep/components/s-select-seckill-sku/s-select-seckill-sku.vue b/sheep/components/s-select-seckill-sku/s-select-seckill-sku.vue index 99b28a50..dfaf875e 100644 --- a/sheep/components/s-select-seckill-sku/s-select-seckill-sku.vue +++ b/sheep/components/s-select-seckill-sku/s-select-seckill-sku.vue @@ -19,8 +19,11 @@ {{ state.goodsInfo.name }} - - {{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }} + + {{ getShowPriceText }} + + + ¥{{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }} @@ -92,12 +95,15 @@ import { computed, reactive, watch } from 'vue'; import sheep from '@/sheep'; import { convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods'; - import { min } from 'lodash-es'; + import { isEmpty, min } from 'lodash-es'; + import { PromotionActivityTypeEnum } from '@/sheep/util/const'; + const emits = defineEmits(['change', 'addCart', 'buy', 'close']); const props = defineProps({ modelValue: { type: Object, - default() {}, + default() { + }, }, show: { type: Boolean, @@ -114,7 +120,14 @@ selectedSku: {}, currentPropertyArray: [], }); - + const getShowPriceText = computed(() => { + let priceText = `¥${fen2yuan(state.goodsInfo.price)}`; + if (!isEmpty(state.selectedSku)) { + const sku = state.selectedSku; + priceText = `${sku.point}积分${!sku.pointPrice ? '' : `+¥${fen2yuan(sku.pointPrice)}`}`; + } + return priceText; + }); const propertyList = convertProductPropertyList(state.goodsInfo.skus); // SKU 列表 const skuList = computed(() => { @@ -344,11 +357,6 @@ font-weight: 500; color: $red; font-family: OPPOSANS; - - &::before { - content: '¥'; - font-size: 24rpx; - } } .stock-text { diff --git a/sheep/util/const.js b/sheep/util/const.js index 9cf98bf3..ec6078db 100644 --- a/sheep/util/const.js +++ b/sheep/util/const.js @@ -33,78 +33,100 @@ export const getTerminal = () => { // ========== MALL - 营销模块 ========== -import dayjs from "dayjs"; +import dayjs from 'dayjs'; /** * 优惠类型枚举 */ export const PromotionDiscountTypeEnum = { - PRICE: { - type: 1, - name: '满减' - }, - PERCENT: { - type: 2, - name: '折扣' - } -} + PRICE: { + type: 1, + name: '满减', + }, + PERCENT: { + type: 2, + name: '折扣', + }, +}; /** * 优惠劵模板的有限期类型的枚举 */ export const CouponTemplateValidityTypeEnum = { - DATE: { - type: 1, - name: '固定日期可用' - }, - TERM: { - type: 2, - name: '领取之后可用' - } -} + DATE: { + type: 1, + name: '固定日期可用', + }, + TERM: { + type: 2, + name: '领取之后可用', + }, +}; /** * 营销的商品范围枚举 */ export const PromotionProductScopeEnum = { - ALL: { - scope: 1, - name: '通用劵' - }, - SPU: { - scope: 2, - name: '商品劵' - }, - CATEGORY: { - scope: 3, - name: '品类劵' - } -} + ALL: { + scope: 1, + name: '通用劵', + }, + SPU: { + scope: 2, + name: '商品劵', + }, + CATEGORY: { + scope: 3, + name: '品类劵', + }, +}; // 时间段的状态枚举 export const TimeStatusEnum = { - WAIT_START: '即将开始', - STARTED: '进行中', - END: '已结束', -} + WAIT_START: '即将开始', + STARTED: '进行中', + END: '已结束', +}; /** * 微信小程序的订阅模版 */ export const WxaSubscribeTemplate = { - TRADE_ORDER_DELIVERY: "订单发货通知", - PROMOTION_COMBINATION_SUCCESS: "拼团结果通知", - PAY_WALLET_RECHARGER_SUCCESS: "充值成功通知", -} + TRADE_ORDER_DELIVERY: '订单发货通知', + PROMOTION_COMBINATION_SUCCESS: '拼团结果通知', + PAY_WALLET_RECHARGER_SUCCESS: '充值成功通知', +}; +export const PromotionActivityTypeEnum = { + NORMAL: { + type: 0, + name: '普通', + }, + SECKILL: { + type: 1, + name: '秒杀', + }, + BARGAIN: { + type: 2, + name: '砍价', + }, + COMBINATION: { + type: 3, + name: '拼团', + }, + POINT: { + type: 4, + name: '积分商城', + }, +}; 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; - } -} + const now = dayjs(); + if (now.isBefore(startTime)) { + return TimeStatusEnum.WAIT_START; + } else if (now.isAfter(endTime)) { + return TimeStatusEnum.END; + } else { + return TimeStatusEnum.STARTED; + } +};