diff --git a/pages/goods/components/detail/detail-comment-card.vue b/pages/goods/components/detail/detail-comment-card.vue index 10b4fa37..9068d402 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 c53262c2..27bb45c4 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 824c1b38..f9a00ad8 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: {