1 line
3.8 KiB
Plaintext
1 line
3.8 KiB
Plaintext
{"version":3,"file":"detail-comment-card.js","sources":["../../../../../../../../src/modules/mall/goods/components/detail/detail-comment-card.vue","../../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9tb2R1bGVzL21hbGwvZ29vZHMvY29tcG9uZW50cy9kZXRhaWwvZGV0YWlsLWNvbW1lbnQtY2FyZC52dWU"],"sourcesContent":["<!-- 商品评论的卡片 -->\r\n<template>\r\n <view class=\"detail-comment-card bg-white\">\r\n <view class=\"card-header ss-flex ss-col-center ss-row-between ss-p-b-30\">\r\n <view class=\"ss-flex ss-col-center\">\r\n <view class=\"line\"></view>\r\n <view class=\"title ss-m-l-20 ss-m-r-10\">评价</view>\r\n <view class=\"des\">({{ state.total }})</view>\r\n </view>\r\n <view\r\n class=\"ss-flex ss-col-center\"\r\n @tap=\"sheep.$router.go('/modules/mall/goods/comment/list', { id: goodsId })\"\r\n v-if=\"state.commentList.length > 0\"\r\n >\r\n <button class=\"ss-reset-button more-btn\">查看全部</button>\r\n <text class=\"cicon-forward\" />\r\n </view>\r\n </view>\r\n <!-- 评论列表 -->\r\n <view class=\"card-content\">\r\n <view class=\"comment-box ss-p-y-30\" v-for=\"item in state.commentList\" :key=\"item.id\">\r\n <comment-item :item=\"item\" />\r\n </view>\r\n <s-empty\r\n v-if=\"state.commentList.length === 0\"\r\n paddingTop=\"0\"\r\n icon=\"/static/comment-empty.png\"\r\n text=\"期待您的第一个评价\"\r\n />\r\n </view>\r\n </view>\r\n</template>\r\n\r\n<script setup>\r\nimport { reactive, onBeforeMount } from 'vue'\r\nimport sheep from '@/sheep'\r\nimport CommentApi from '@/sheep/api/product/comment'\r\nimport commentItem from './comment-item.vue'\r\n\r\nconst props = defineProps({\r\n goodsId: {\r\n type: [Number, String],\r\n default: 0,\r\n },\r\n})\r\n\r\nconst state = reactive({\r\n commentList: [], // 评论列表,只展示最近的 3 条\r\n total: 0, // 总评论数\r\n})\r\n\r\nasync function getComment(id) {\r\n const { data } = await CommentApi.getCommentPage(id, 1, 3, 0)\r\n state.commentList = data.list\r\n state.total = data.total\r\n}\r\n\r\nonBeforeMount(() => {\r\n getComment(props.goodsId)\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.detail-comment-card {\r\n padding: 20rpx 20rpx 0 20rpx;\r\n margin: 0 20rpx 20rpx 20rpx;\r\n .card-header {\r\n .line {\r\n width: 6rpx;\r\n height: 30rpx;\r\n background: linear-gradient(180deg, var(--ui-BG-Main) 0%, var(--ui-BG-Main-gradient) 100%);\r\n border-radius: 3rpx;\r\n }\r\n\r\n .title {\r\n font-size: 30rpx;\r\n font-weight: bold;\r\n line-height: normal;\r\n }\r\n\r\n .des {\r\n font-size: 24rpx;\r\n color: $dark-9;\r\n }\r\n\r\n .more-btn {\r\n font-size: 24rpx;\r\n line-height: normal;\r\n color: var(--ui-BG-Main);\r\n }\r\n\r\n .cicon-forward {\r\n margin-top: 4rpx;\r\n font-size: 24rpx;\r\n line-height: normal;\r\n color: var(--ui-BG-Main);\r\n }\r\n }\r\n}\r\n.comment-box {\r\n border-bottom: 2rpx solid #eeeeee;\r\n &:last-child {\r\n border: none;\r\n }\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/modules/mall/goods/components/detail/detail-comment-card.vue'\nwx.createComponent(Component)"],"names":["reactive","CommentApi","onBeforeMount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,cAAc,MAAW;;;;;;;;;;AAE/B,UAAM,QAAQ;AAOd,UAAM,QAAQA,cAAAA,SAAS;AAAA,MACrB,aAAa,CAAE;AAAA;AAAA,MACf,OAAO;AAAA;AAAA,IACT,CAAC;AAED,aAAe,WAAW,IAAI;AAAA;AAC5B,cAAM,EAAE,KAAM,IAAG,MAAMC,0BAAU,WAAC,eAAe,IAAI,GAAG,GAAG,CAAC;AAC5D,cAAM,cAAc,KAAK;AACzB,cAAM,QAAQ,KAAK;AAAA,MACrB;AAAA;AAEAC,kBAAAA,cAAc,MAAM;AAClB,iBAAW,MAAM,OAAO;AAAA,IAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1DD,GAAG,gBAAgB,SAAS;"} |