diff --git a/sheep/api/product/spu.js b/sheep/api/product/spu.js index 83766668..87bf1fa5 100644 --- a/sheep/api/product/spu.js +++ b/sheep/api/product/spu.js @@ -1,6 +1,6 @@ import request from '@/sheep/request'; -export default { +const SpuApi = { // 获得商品 SPU 列表 getSpuList: (recommendType) => { return request({ @@ -34,3 +34,4 @@ export default { }); } }; +export default SpuApi; diff --git a/sheep/api/promotion/seckill.js b/sheep/api/promotion/seckill.js new file mode 100644 index 00000000..ecbb4c1f --- /dev/null +++ b/sheep/api/promotion/seckill.js @@ -0,0 +1,33 @@ +import request2 from "@/sheep/request2"; + +const SeckillApi = { + // 获得秒杀时间段列表 + getSeckillConfigList: () => { + return request2({ url: 'promotion/seckill-config/list', method: 'GET' }); + }, + + // 获得当前秒杀活动 + getNowSeckillActivity: () => { + return request2({ url: 'promotion/seckill-activity/get-now', method: 'GET' }); + }, + + // 获得秒杀活动分页 + getSeckillActivityPage: () => { + return request2({ url: 'promotion/seckill-activity/page', method: 'GET' }); + }, + + /** + * 获得秒杀活动明细 + * @param {number} id 秒杀活动编号 + * @return {*} + */ + getSeckillActivity: (id) => { + return request2({ + url: 'promotion/seckill-activity/get-detail', + method: 'GET', + params: { id } + }); + } +} + +export default SeckillApi; diff --git a/sheep/components/s-block-item/s-block-item.vue b/sheep/components/s-block-item/s-block-item.vue index 45228c0a..b39337b3 100644 --- a/sheep/components/s-block-item/s-block-item.vue +++ b/sheep/components/s-block-item/s-block-item.vue @@ -34,11 +34,11 @@ - - - - - + + + + + diff --git a/sheep/components/s-goods-card/s-goods-card.vue b/sheep/components/s-goods-card/s-goods-card.vue index 91441647..b51706f7 100644 --- a/sheep/components/s-goods-card/s-goods-card.vue +++ b/sheep/components/s-goods-card/s-goods-card.vue @@ -12,8 +12,8 @@ { - return { - title: props.data.fields.name, - subtitle: props.data.fields.introduction, - price: props.data.fields.price, - original_price: props.data.fields.marketPrice, - stock: props.data.fields.stock, - salesCount: props.data.fields.salesCount, - } - }) - - // 角标,todo @owen 规范命名,这里先转换,后期重构时再修改 - const badge = computed(() => { - return { - show: props.data.badge.show, - src: props.data.badge.imgUrl, - } - }) - //region 商品瀑布流布局 // 下一个要处理的商品索引 let count = 0; diff --git a/sheep/components/s-goods-column/s-goods-column.vue b/sheep/components/s-goods-column/s-goods-column.vue index e82b870d..40a9cec9 100644 --- a/sheep/components/s-goods-column/s-goods-column.vue +++ b/sheep/components/s-goods-column/s-goods-column.vue @@ -9,15 +9,15 @@ @tap="onClick" > - + @@ -37,16 +37,16 @@ - + - + {{ data.title || data.name }} - + {{ data.title || data.name }} @@ -135,7 +135,7 @@ @tap="onClick" > - + 秒杀 @@ -145,14 +145,14 @@ {{ data.title || data.name }} @@ -201,7 +201,7 @@ - + @@ -209,14 +209,14 @@ {{ data.title || data.name }} @@ -307,12 +307,25 @@ type: [Array, Object], default() { return { + // 商品名称(旧) title: { show: true }, + // 商品介绍(旧) subtitle: { show: true }, + // 商品价格 price: { show: true }, + // 市场价(旧) original_price: { show: true }, + // 销量(旧) sales: { show: true }, + // 库存 stock: { show: true }, + // 商品名称(新) + name: { show: true }, + // 商品介绍(新) + introduction: { show: true }, + // 市场价(新) + marketPrice: { show: true }, + // 销量(新) salesCount: { show: true }, }; }, diff --git a/sheep/components/s-goods-shelves/s-goods-shelves.vue b/sheep/components/s-goods-shelves/s-goods-shelves.vue index 2992807a..01129a33 100644 --- a/sheep/components/s-goods-shelves/s-goods-shelves.vue +++ b/sheep/components/s-goods-shelves/s-goods-shelves.vue @@ -19,10 +19,10 @@ @@ -105,7 +105,7 @@ default() {}, }, }); - const { layoutType, tagStyle, spuIds } = props.data; + const { layoutType, spuIds } = props.data; let { marginLeft, marginRight } = props.styles; const goodsList = ref([]); onMounted(async () => { @@ -114,26 +114,6 @@ goodsList.value = data; } }); - - // 商品字段配置,todo @owen 字段名称与服务端对齐,这里先转换,后期重构时再修改 - const productFields = computed(() => { - return { - title: props.data.fields.name, - subtitle: props.data.fields.introduction, - price: props.data.fields.price, - original_price: props.data.fields.marketPrice, - stock: props.data.fields.stock, - salesCount: props.data.fields.salesCount, - } - }) - - // 角标,todo @owen 规范命名,这里先转换,后期重构时再修改 - const badge = computed(() => { - return { - show: props.data.badge.show, - src: props.data.badge.imgUrl, - } - })