diff --git a/pages/index/user.vue b/pages/index/user.vue index a1425311..b51e5fdb 100644 --- a/pages/index/user.vue +++ b/pages/index/user.vue @@ -3,13 +3,13 @@ title="我的" tabbar="/pages/index/user" navbar="custom" - :bgStyle="template.style?.background" + :bgStyle="template.page" :navbarStyle="template.style?.navbar" onShareAppMessage :showFloatButton="true" > - - + + 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/article.js b/sheep/api/promotion/article.js new file mode 100644 index 00000000..36b037d0 --- /dev/null +++ b/sheep/api/promotion/article.js @@ -0,0 +1,12 @@ +import request from '@/sheep/request'; + +export default { + // 获得文章详情 + getArticle: (id) => { + return request({ + url: '/app-api/promotion/article/get', + method: 'GET', + params: { id } + }); + } +} diff --git a/sheep/api/promotion/combination.js b/sheep/api/promotion/combination.js new file mode 100644 index 00000000..eeeb9a0a --- /dev/null +++ b/sheep/api/promotion/combination.js @@ -0,0 +1,67 @@ +import request2 from "@/sheep/request2"; + +// 拼团 API +const CombinationApi = { + // 获得拼团活动列表 + getCombinationActivityList: (count) => { + return request2({ + url: "promotion/combination-activity/list", + method: 'GET', + params: {count} + }); + }, + + // 获得拼团活动分页 + getCombinationActivityPage: (params) => { + return request2({ + url: "promotion/combination-activity/page", + method: 'GET', + params + }); + }, + + // 获得拼团活动明细 + getCombinationActivity: (id) => { + return request2({ + url: "promotion/combination-activity/get-detail", + method: 'GET', + params: { + id + } + }); + }, + + // 获得最近 n 条拼团记录(团长发起的) + getHeadCombinationRecordList: (activityId, status, count) => { + return request2({ + url: "promotion/combination-record/get-head-list", + method: 'GET', + params: { + activityId, + status, + count + } + }); + }, + + // 获得拼团记录明细 + getCombinationRecordDetail: (id) => { + return request2({ + url: "promotion/combination-record/get-detail", + method: 'GET', + params: { + id + } + }); + }, + + // 获得拼团记录的概要信息 + getCombinationRecordSummary: () => { + return request2({ + url: "promotion/combination-record/get-summary", + method: 'GET', + }); + } +} + +export default CombinationApi 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 21fe32da..a9c795b8 100644 --- a/sheep/components/s-block-item/s-block-item.vue +++ b/sheep/components/s-block-item/s-block-item.vue @@ -21,10 +21,8 @@ - - - - + + @@ -34,24 +32,26 @@ - + - - - - - + + + + + + + - - - - - - - - + + + + + + + + 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, - } - }) +