1 line
5.5 KiB
Plaintext
1 line
5.5 KiB
Plaintext
{"version":3,"file":"add.js","sources":["../../../../../../../src/modules/mall/goods/comment/add.vue","../../../../../../../uniPage:/bW9kdWxlc1xtYWxsXGdvb2RzXGNvbW1lbnRcYWRkLnZ1ZQ"],"sourcesContent":["<!-- 评价 -->\r\n<template>\r\n <s-layout title=\"评价\">\r\n <view>\r\n <view v-for=\"(item, index) in state.orderInfo.items\" :key=\"item.id\">\r\n <view>\r\n <view class=\"commont-from-wrap\">\r\n <!-- 评价商品 -->\r\n <s-goods-item\r\n :img=\"item.picUrl\"\r\n :title=\"item.spuName\"\r\n :skuText=\"item.properties.map((property) => property.valueName).join(' ')\"\r\n :price=\"item.payPrice\"\r\n :num=\"item.count\"\r\n />\r\n </view>\r\n\r\n <view class=\"form-item\">\r\n <!-- 评分 -->\r\n <view class=\"star-box ss-flex ss-col-center\">\r\n <view class=\"star-title ss-m-r-40\">商品质量</view>\r\n <uni-rate v-model=\"state.commentList[index].descriptionScores\" />\r\n </view>\r\n <view class=\"star-box ss-flex ss-col-center\">\r\n <view class=\"star-title ss-m-r-40\">服务态度</view>\r\n <uni-rate v-model=\"state.commentList[index].benefitScores\" />\r\n </view>\r\n <!-- 评价 -->\r\n <view class=\"area-box\">\r\n <uni-easyinput\r\n :inputBorder=\"false\"\r\n type=\"textarea\"\r\n maxlength=\"120\"\r\n autoHeight\r\n v-model=\"state.commentList[index].content\"\r\n placeholder=\"宝贝满足你的期待吗?说说你的使用心得,分享给想买的他们吧~\"\r\n />\r\n <!-- TODO 芋艿:文件上传 -->\r\n <view class=\"img-box\">\r\n <s-uploader\r\n v-model:url=\"state.commentList[index].images\"\r\n fileMediatype=\"image\"\r\n limit=\"9\"\r\n mode=\"grid\"\r\n :imageStyles=\"{ width: '168rpx', height: '168rpx' }\"\r\n />\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n </view>\r\n <!-- TODO 芋艿:是否匿名 -->\r\n\r\n <su-fixed bottom placeholder>\r\n <view class=\"foot_box ss-flex ss-row-center ss-col-center\">\r\n <button class=\"ss-reset-button post-btn ui-BG-Main-Gradient ui-Shadow-Main\" @tap=\"onSubmit\">\r\n 发布\r\n </button>\r\n </view>\r\n </su-fixed>\r\n </s-layout>\r\n</template>\r\n\r\n<script setup>\r\nimport sheep from '@/sheep'\r\nimport { onLoad } from '@dcloudio/uni-app'\r\nimport { reactive } from 'vue'\r\nimport OrderApi from '@/sheep/api/trade/order'\r\n\r\nconst state = reactive({\r\n orderInfo: {},\r\n commentList: [],\r\n id: null,\r\n})\r\n\r\nasync function onSubmit() {\r\n // 顺序提交评论\r\n for (const comment of state.commentList) {\r\n await OrderApi.createOrderItemComment(comment)\r\n }\r\n // 都评论好,返回\r\n sheep.$router.back()\r\n}\r\n\r\nonLoad(async (options) => {\r\n if (!options.id) {\r\n sheep.$helper.toast(`缺少订单信息,请检查`)\r\n return\r\n }\r\n state.id = options.id\r\n\r\n const { code, data } = await OrderApi.getOrder(state.id)\r\n if (code !== 0) {\r\n sheep.$helper.toast('无待评价订单')\r\n return\r\n }\r\n // 处理评论\r\n data.items.forEach((item) => {\r\n state.commentList.push({\r\n anonymous: false,\r\n orderItemId: item.id,\r\n descriptionScores: 5,\r\n benefitScores: 5,\r\n content: '',\r\n picUrls: [],\r\n })\r\n })\r\n state.orderInfo = data\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n// 评价商品\r\n.goods-card {\r\n padding: 20rpx;\r\n margin: 10rpx 0;\r\n background: #fff;\r\n}\r\n\r\n// 评论,选择图片\r\n.form-item {\r\n background: #fff;\r\n\r\n .star-box {\r\n height: 100rpx;\r\n padding: 0 25rpx;\r\n }\r\n\r\n .star-title {\r\n font-weight: 600;\r\n }\r\n}\r\n\r\n.area-box {\r\n width: 690rpx;\r\n min-height: 306rpx;\r\n padding: 28rpx;\r\n margin: auto;\r\n background: rgba(249, 250, 251, 1);\r\n border-radius: 20rpx;\r\n\r\n .img-box {\r\n margin-top: 20rpx;\r\n }\r\n}\r\n\r\n.post-btn {\r\n width: 690rpx;\r\n margin-bottom: 20rpx;\r\n line-height: 80rpx;\r\n color: rgba(#fff, 0.9);\r\n border-radius: 40rpx;\r\n}\r\n</style>\r\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/modules/mall/goods/comment/add.vue'\nwx.createPage(MiniProgramPage)"],"names":["reactive","OrderApi","sheep","onLoad"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEA,UAAA,QAAAA,cAAAA,SAAA;AAAA,MACA,WAAA,CAAA;AAAA,MACA,aAAA,CAAA;AAAA,MACA,IAAA;AAAA,IACA,CAAA;AAEA,aAAA,WAAA;AAAA;AAEA,mBAAA,WAAA,MAAA,aAAA;AACA,gBAAAC,sBAAA,SAAA,uBAAA,OAAA;AAAA,QACA;AAEAC,oBAAA,MAAA,QAAA,KAAA;AAAA,MACA;AAAA;AAEAC,kBAAA,OAAA,CAAA,YAAA;AACA,UAAA,CAAA,QAAA,IAAA;AACAD,oBAAAA,MAAA,QAAA,MAAA,YAAA;AACA;AAAA,MACA;AACA,YAAA,KAAA,QAAA;AAEA,YAAA,EAAA,MAAA,KAAA,IAAA,MAAAD,sBAAAA,SAAA,SAAA,MAAA,EAAA;AACA,UAAA,SAAA,GAAA;AACAC,0BAAA,QAAA,MAAA,QAAA;AACA;AAAA,MACA;AAEA,WAAA,MAAA,QAAA,CAAA,SAAA;AACA,cAAA,YAAA,KAAA;AAAA,UACA,WAAA;AAAA,UACA,aAAA,KAAA;AAAA,UACA,mBAAA;AAAA,UACA,eAAA;AAAA,UACA,SAAA;AAAA,UACA,SAAA,CAAA;AAAA,QACA,CAAA;AAAA,MACA,CAAA;AACA,YAAA,YAAA;AAAA,IACA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5GA,GAAG,WAAW,eAAe;"} |