diff --git a/pages/goods/groupon.vue b/pages/goods/groupon.vue
index 3f464ed..ae333cf 100644
--- a/pages/goods/groupon.vue
+++ b/pages/goods/groupon.vue
@@ -80,7 +80,7 @@
-
+
@@ -90,6 +90,7 @@
{{
- fen2yuan(state.activity.price || state.goodsInfo.price)
+ fen2yuan(state.selectedSku.price * state.selectedSku.count || state.activity.price * state.selectedSku.count || state.goodsInfo.price * state.selectedSku.count || state.goodsInfo.price)
}}
未开始
已结束
@@ -168,7 +169,7 @@
goodsInfo: {}, // 商品信息
goodsSwiper: [], // 商品轮播图
showSelectSku: false, // 显示规格弹框
- selectedSkuPrice: {}, // 选中的规格价格
+ selectedSku: {}, // 选中的规格属性
activity: {}, // 团购活动
grouponId: 0, // 团购ID
grouponNum: 0, // 团购人数
@@ -183,7 +184,7 @@
// 规格变更
function onSkuChange(e) {
- state.selectedSkuPrice = e;
+ state.selectedSku = e;
}
function onSkuClose() {
diff --git a/sheep/components/s-groupon-block/s-groupon-block.vue b/sheep/components/s-groupon-block/s-groupon-block.vue
index 67da2e1..d7e6fcf 100644
--- a/sheep/components/s-groupon-block/s-groupon-block.vue
+++ b/sheep/components/s-groupon-block/s-groupon-block.vue
@@ -1,37 +1,38 @@
-
-
-
+
+
+
+
-
-
+
+
@@ -47,6 +48,7 @@
import {
computed,
onMounted,
+ reactive,
ref
} from 'vue';
import sheep from '@/sheep';
@@ -55,28 +57,46 @@
// 接收参数
const props = defineProps({
+ // 装修数据
data: {
type: Object,
- default () {},
+ default: () => ({}),
},
+ // 装修样式
styles: {
type: Object,
- default () {},
+ default: () => ({}),
},
});
+
+ // 设置相关信息是否显示
+ const goodsFields = reactive({
+ // 商品价格
+ price: { show: true },
+ // 库存
+ stock: { show: true },
+ // 商品名称
+ name: { show: true },
+ // 商品介绍
+ introduction: { show: true },
+ // 市场价
+ marketPrice: { show: true },
+ // 销量
+ salesCount: { show: true },
+ });
let {
layoutType,
- tagStyle,
+ badge,
btnBuy,
- space
+ space,
} = props.data;
let {
marginLeft,
marginRight
} = props.styles;
- // 购买按钮样式
+ // 购买按钮样式(暂未实现)
const buyStyle = computed(() => {
let btnBuy = props.data.btnBuy;
if (btnBuy?.type === 'text') {
@@ -106,7 +126,7 @@
} = await SpuApi.getSpuDetail(activity.spuId)
// 循环活动信息,赋值拼团最低价格
activity.products.forEach((product) => {
- spu.price = Math.min(spu.price, product.combinationPrice); // 设置 SPU 的最低价格
+ spu.price = Math.min(spu.price, product.combinationPrice); // 设置 SPU 的最低价格
});
productList.value = [spu];
});
@@ -127,6 +147,7 @@
border-radius: 25rpx;
font-size: 24rpx;
color: #fff;
+ background: linear-gradient(90deg, #ff6600 0%, #fe832a 100%);
}
}
diff --git a/sheep/components/s-seckill-block/s-seckill-block.vue b/sheep/components/s-seckill-block/s-seckill-block.vue
index a83ce75..50cef6d 100644
--- a/sheep/components/s-seckill-block/s-seckill-block.vue
+++ b/sheep/components/s-seckill-block/s-seckill-block.vue
@@ -2,37 +2,39 @@
-
-
-
+
+
+
+
-
+
@@ -50,6 +52,7 @@
import {
computed,
onMounted,
+ reactive,
ref
} from 'vue';
import sheep from '@/sheep';
@@ -58,21 +61,39 @@
// 接收参数
const props = defineProps({
+ // 装修数据
data: {
type: Object,
- default () {},
+ default: () => ({}),
},
+ // 装修样式
styles: {
type: Object,
- default () {},
+ default: () => ({}),
},
});
-
+
+ // 设置相关信息是否显示
+ const goodsFields = reactive({
+ // 商品价格
+ price: { show: true },
+ // 库存
+ stock: { show: true },
+ // 商品名称
+ name: { show: true },
+ // 商品介绍
+ introduction: { show: true },
+ // 市场价
+ marketPrice: { show: true },
+ // 销量
+ salesCount: { show: true },
+ });
+
let {
layoutType,
- tagStyle,
+ badge,
btnBuy,
- space
+ space,
} = props.data;
let {
marginLeft,
@@ -139,6 +160,7 @@
border-radius: 25rpx;
font-size: 24rpx;
color: #fff;
+ background: linear-gradient(90deg, #ff6600 0%, #fe832a 100%);
}
}
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 e2a2950..6259a08 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
@@ -22,7 +22,7 @@