From 6a327ac0e7d19e02d328e69a6d3f2061dc0669a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=BD=E6=97=A5=E6=99=9A=E9=A3=8E?= <1811466536@qq.com> Date: Tue, 31 Oct 2023 10:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=EF=BC=8C=E8=AF=A6=E6=83=85=E9=A1=B5=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/components/detail/detail-comment-card.vue | 3 ++- pages/goods/index.vue | 8 +++++--- sheep/api/goods.js | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pages/goods/components/detail/detail-comment-card.vue b/pages/goods/components/detail/detail-comment-card.vue index 10b4fa3..9068d40 100644 --- a/pages/goods/components/detail/detail-comment-card.vue +++ b/pages/goods/components/detail/detail-comment-card.vue @@ -47,7 +47,8 @@ const { data } = await sheep.$api.goods.comment(id, { list_rows: 3, }); - state.commentList = data.data; + console.log(data) + state.commentList = data; state.total = data.total; } onBeforeMount(() => { diff --git a/pages/goods/index.vue b/pages/goods/index.vue index c53262c..27bb45c 100644 --- a/pages/goods/index.vue +++ b/pages/goods/index.vue @@ -256,10 +256,12 @@ if (res.code === 0) { // 在此处对数据做出转换 res.data.sales=res.data.salesCount - res.data.original_price=res.data.price - res.data.introduction=res.data.title + res.data.original_price=res.data.marketPrice/100 + res.data.subtitle=res.data.introduction + res.data.title=res.data.name + res.data.price=[res.data.price/100] state.goodsInfo = res.data; - state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.picUrl.split(',')); + state.goodsSwiper = formatGoodsSwiper(state.goodsInfo.sliderPicUrls); } else { // 未找到商品 state.goodsInfo = null; diff --git a/sheep/api/goods.js b/sheep/api/goods.js index 824c1b3..f9a00ad 100644 --- a/sheep/api/goods.js +++ b/sheep/api/goods.js @@ -40,8 +40,8 @@ export default { // 商品评价列表 comment: (id, params = {}) => - request({ - url: 'goods/comment/' + id, + request2({ + url: 'product/comment/list?spuId=' + id, method: 'GET', params, custom: {