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 @@