From 33311ae19cb2e855d058a2e5fb2e814db15f35f8 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 10 Jun 2023 00:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E3=80=91=201.=20=E6=8E=A5=E5=85=A5=E8=AF=84=E8=AE=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/product/comment.js | 15 +++++++ components/userEvaluation/index.vue | 61 +++++++++++++++-------------- pages/goods_details/index.vue | 54 +++++++++++-------------- 3 files changed, 69 insertions(+), 61 deletions(-) create mode 100644 api/product/comment.js diff --git a/api/product/comment.js b/api/product/comment.js new file mode 100644 index 00000000..ce88089f --- /dev/null +++ b/api/product/comment.js @@ -0,0 +1,15 @@ +import request from "@/utils/request.js"; + +// 获得商品的评价统计 +export function getCommentStatistics(spuId) { + return request.get('app-api/product/comment/statistics', { + spuId + }); +} + +// 获得最近的 n 条商品评价 +export function getCommentList(spuId) { + return request.get('app-api/product/comment/list', { + spuId + }); +} diff --git a/components/userEvaluation/index.vue b/components/userEvaluation/index.vue index dabc11ce..6d36f879 100644 --- a/components/userEvaluation/index.vue +++ b/components/userEvaluation/index.vue @@ -1,39 +1,37 @@ @@ -61,11 +62,11 @@ border-bottom-left-radius: 14rpx; border-bottom-right-radius: 14rpx; } - + .evaluateWtapper .evaluateItem~.evaluateItem { border-top: 1rpx solid #f5f5f5; } - + .evaluateWtapper .evaluateItem .pic-text { font-size: 26rpx; color: #282828; @@ -74,26 +75,26 @@ margin-left: 20rpx; } } - + .evaluateWtapper .evaluateItem .pic-text .pictrue { width: 62rpx; height: 62rpx; } - + .evaluateWtapper .evaluateItem .pic-text .pictrue image { width: 100%; height: 100%; border-radius: 50%; } - + .evaluateWtapper .evaluateItem .pic-text .name { max-width: 450rpx; } - + .evaluateWtapper .evaluateItem .time { font-size: 24rpx; color: #999999; - + } .sku{ font-size: 24rpx; @@ -105,12 +106,12 @@ color: #333; margin-bottom: 14rpx; } - - .evaluateWtapper .evaluateItem .imgList {/* + + .evaluateWtapper .evaluateItem .imgList {/* padding: 0 24rpx; margin-top: 16rpx; */ } - + .evaluateWtapper .evaluateItem .imgList .pictrue { width: 102rpx; height: 102rpx; @@ -119,14 +120,14 @@ margin-bottom: 16rpx; /* margin: 0 0 15rpx 15rpx; */ } - + .evaluateWtapper .evaluateItem .imgList .pictrue image { width: 100%; height: 100%; background-color: #f7f7f7; border-radius: 14rpx; } - + .evaluateWtapper .evaluateItem .reply { font-size: 26rpx; color: #454545; @@ -136,7 +137,7 @@ padding: 20rpx; position: relative; } - + .evaluateWtapper .evaluateItem .reply::before { content: ""; width: 0; diff --git a/pages/goods_details/index.vue b/pages/goods_details/index.vue index 615502d4..e69e67be 100644 --- a/pages/goods_details/index.vue +++ b/pages/goods_details/index.vue @@ -43,12 +43,6 @@ 销量:{{ spu.salesCount}} {{ spu.unitName }} - @@ -94,14 +88,13 @@ - + 用户评价({{replyCount}}) - - 好评 {{replyChance || 0}}% + + 好评  {{ replyChance || 0 }}% @@ -173,7 +166,7 @@ - + @@ -285,11 +278,7 @@