diff --git a/pages/activity/seckill/list.vue b/pages/activity/seckill/list.vue index 49fe147..81edf7c 100644 --- a/pages/activity/seckill/list.vue +++ b/pages/activity/seckill/list.vue @@ -264,7 +264,7 @@ // 时间段轮播图 .header { - width: 710rpx; + width: 100%; height: 330rpx; margin: 0 auto 0 auto; border-radius: 14rpx; diff --git a/pages/goods/groupon.vue b/pages/goods/groupon.vue index d384eb2..93a7441 100644 --- a/pages/goods/groupon.vue +++ b/pages/goods/groupon.vue @@ -90,7 +90,7 @@ - @@ -115,7 +115,7 @@ state.activity.status === 0 && state.goodsInfo.stock !== 0 ? 'check-btn-box' : 'disabled-btn-box' - " :disabled="state.goodsInfo.stock === 0 || state.activity.status !== 0"> + " :disabled="state.goodsInfo.stock === 0 || state.activity.status !== 0 || state.activity.remainingPurchases == 0""> {{ fen2yuan(state.activity.price || state.goodsInfo.price) }} @@ -263,6 +263,7 @@ data: activity } = await CombinationApi.getCombinationActivity(state.grouponId); state.activity = activity; + // console.log(activity,"activity") // 加载商品信息 const { data: spu diff --git a/pages/goods/seckill.vue b/pages/goods/seckill.vue index e9ca676..be78f9d 100644 --- a/pages/goods/seckill.vue +++ b/pages/goods/seckill.vue @@ -68,7 +68,7 @@ - @@ -102,14 +102,16 @@ timeStatusEnum === TimeStatusEnum.STARTED && state.goodsInfo.stock != 0 ? 'check-btn-box' : 'disabled-btn-box' - " :disabled="state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED"> + " :disabled="state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED || activity.remainingPurchases == 0"> {{ fen2yuan(state.goodsInfo.price) }} 已售罄 + 立即秒杀 {{ timeStatusEnum }} + @@ -223,6 +225,7 @@ data } = await SeckillApi.getSeckillActivity(id); activity.value = data; + // console.log(activity.value,"activity.value") timeStatusEnum.value = getTimeStatusEnum(activity.startTime, activity.endTime); // 查询商品 diff --git a/sheep/components/s-block-item/s-block-item.vue b/sheep/components/s-block-item/s-block-item.vue index 572959a..85a3af3 100644 --- a/sheep/components/s-block-item/s-block-item.vue +++ b/sheep/components/s-block-item/s-block-item.vue @@ -81,7 +81,7 @@ - + diff --git a/sheep/components/s-select-groupon-sku/s-select-groupon-sku.vue b/sheep/components/s-select-groupon-sku/s-select-groupon-sku.vue index ebfded8..fcb6672 100644 --- a/sheep/components/s-select-groupon-sku/s-select-groupon-sku.vue +++ b/sheep/components/s-select-groupon-sku/s-select-groupon-sku.vue @@ -65,7 +65,7 @@ 购买数量 import { computed, reactive, watch } from 'vue'; import sheep from '@/sheep'; + import { isEmpty, min } from 'lodash-es'; import { convertProductPropertyList, fen2yuan } from '@/sheep/hooks/useGoods'; const headerBg = sheep.$url.css('/static/img/shop/goods/groupon-btn-long.png'); @@ -118,6 +119,10 @@ type: [Number, String], default: 0, }, + activity:{ + type: Array, + default: 0, + } }); const state = reactive({ selectedSku: {}, // 选中的 SKU @@ -133,6 +138,7 @@ for (let price of skuPrices) { price.value_id_array = price.properties.map((item) => item.valueId); } + console.log(props.activity,"skuPrices") return skuPrices; }); @@ -152,8 +158,8 @@ if (e === 0) return; if (state.selectedSku.count === e) return; state.selectedSku.count = e; + console.log(state.selectedSku) } - // 点击购买 function onBuy() { if (!state.selectedSku.id || state.selectedSku.id <= 0) { @@ -166,7 +172,6 @@ } emits('buy', state.selectedSku); } - // 改变禁用状态:计算每个 property 属性值的按钮,是否禁用 function changeDisabled(isChecked = false, propertyId = 0, valueId = 0) { let newSkus = []; // 所有可以选择的 sku 数组 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 1233cbf..05b85c2 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 @@ -75,7 +75,7 @@ 购买数量 props.modelValue), selectedSku: {}, currentPropertyArray: [], }); + // console.log(props.activity,"activity"); const getShowPriceText = computed(() => { let priceText = `¥${fen2yuan(state.goodsInfo.price)}`; if (!isEmpty(state.selectedSku)) {