evaluate.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. <template>
  2. <view class="evaluate">
  3. <view class="top"></view>
  4. <view class="head">
  5. <span class="cuIcon-back" @click="back"></span>
  6. <view class="case">
  7. 客户评价
  8. </view>
  9. </view>
  10. <view class="center">
  11. <view class="score">
  12. <view class="picture">
  13. <view class="left">
  14. <view class="mark">
  15. {{statistics.grade}}
  16. </view>
  17. <view class="num">
  18. <u-rate :count="count" v-model="statistics.grade" active-icon="heart-fill" inactive-icon="heart"
  19. size="20"></u-rate>
  20. <span>{{statistics.sum}}条评价</span>
  21. </view>
  22. </view>
  23. <view class="separate"></view>
  24. <view class="right">
  25. <view class="line" v-for="(item,index) in statistics.commentAppSumVos" :key="index">
  26. <span>{{item.name}}</span><u-line-progress :percent="item.percent" active-color="#FF5D39"
  27. style="width: 230rpx;margin-right:5rpx"></u-line-progress>{{item.percent}}%
  28. </view>
  29. </view>
  30. </view>
  31. <view class="people_num">
  32. <view class="statis" v-for="(item,index) in statistics.commentAppSumVos" :key="index">
  33. {{item.value}}人{{item.name}}<span></span>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="appraise">
  38. <view class="select">
  39. <view class="type" :class="curremtIndex == index?'active':''" v-for="(item,index) in typeList" :key="index"
  40. @click="change(item,index)">
  41. {{item.name}}
  42. </view>
  43. <view style="width: 144rpx;"></view>
  44. </view>
  45. <mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getcommentList" @init="mescrollInit"
  46. style="height: 64vh;" :use="false">
  47. <view class="item" v-for=" (item,index) in appraiseList" :key="index">
  48. <view class=" headr">
  49. <view class="left">
  50. <view class="img">
  51. <image :src="item.userAvatar" mode=""></image>
  52. </view>
  53. <view class="name">
  54. {{item.userName}}<br />
  55. <span>{{item.commentTime}}发布</span>
  56. </view>
  57. </view>
  58. <view class="right">
  59. <u-rate :count="count" v-model="item.commentGrade" active-icon="heart-fill" size="20" :disabled="true"
  60. inactive-icon="heart"></u-rate><span>{{item.grade}}</span>
  61. </view>
  62. </view>
  63. <view class="product">
  64. {{item.productName}}
  65. </view>
  66. <view class="content">
  67. {{item.commentContent}}
  68. </view>
  69. <view class="image" v-if="item.imagesList">
  70. <view class="img" v-for="(row,index) in item.imagesList" :key="index">
  71. <image :src="row" mode=""></image>
  72. </view>
  73. </view>
  74. <view class="recover" v-if="item.commentsReply">
  75. 商家回复:{{item.commentContent}}
  76. </view>
  77. <view class="reply">
  78. <input v-model="reply" placeholder="回复..." style="height: 36rpx;" />
  79. </view>
  80. <view class="remove" v-if="item.commentsReply">
  81. {{item.time}}{{item.commentContent}}
  82. <view class="btn">删除回复</view>
  83. </view>
  84. </view>
  85. </mescroll-uni>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. // import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  92. export default {
  93. // mixins: [MescrollMixin], // 使用mixin
  94. data() {
  95. return {
  96. merchantId: '',
  97. statistics: {},
  98. curremtIndex: 0,
  99. timestamp: 86400,
  100. checked: true,
  101. count: 5,
  102. value: 3,
  103. icons: ['thumb-down-fill', 'thumb-down-fill', 'thumb-up-fill', 'thumb-up-fill'],
  104. typeList: [{
  105. name: '全部',
  106. commentGrade: 0
  107. },
  108. {
  109. name: '推荐',
  110. commentGrade: 1
  111. },
  112. {
  113. name: '一般',
  114. commentGrade: 2
  115. },
  116. {
  117. name: '差评',
  118. commentGrade: 3
  119. },
  120. {
  121. name: '未回复',
  122. commentGrade: 4
  123. },
  124. {
  125. name: '有文字',
  126. commentGrade: 5
  127. },
  128. {
  129. name: '图/视频',
  130. commentGrade: 6
  131. },
  132. ],
  133. appraiseList: [],
  134. reply: '',
  135. commentGrade: 0,
  136. upOption: {
  137. page: {
  138. num: 0,
  139. size: 10 // 每页数据的数量,默认10
  140. },
  141. noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  142. empty: {
  143. tip: '暂无相关数据'
  144. }
  145. },
  146. };
  147. },
  148. mounted() {
  149. this.getcomment()
  150. this.mescroll.optDown.use = false
  151. // this.getcommentList()
  152. },
  153. methods: {
  154. mescrollInit(mescroll) {
  155. this.mescroll = mescroll;
  156. },
  157. //返回
  158. back() {
  159. uni.navigateBack({
  160. delta: 1
  161. });
  162. },
  163. //切换条件
  164. change(item, index) {
  165. this.curremtIndex = index
  166. this.commentGrade = item.commentGrade
  167. let page = {
  168. num: 1,
  169. size: 10
  170. }
  171. this.appraiseList = []
  172. this.getcommentList(page)
  173. },
  174. //获取用户评论数据
  175. getcomment() {
  176. this.$http.get("/app/comments/statistics?merchantId=" + this.merchantId).then(res => {
  177. if (res.data.code == 200) {
  178. this.statistics = res.data.result
  179. }
  180. })
  181. },
  182. //获取用户评论列表
  183. getcommentList(page) {
  184. console.log(page)
  185. this.$http.get("/app/comments/list?merchantId=" + this.merchantId + '&commentGrade=' + this.commentGrade +
  186. '&pageNo=' + page.num + '&pageSize=' + page.size).then(
  187. res => {
  188. if (res.data.code == 200) {
  189. console.log(res)
  190. this.appraiseList = this.appraiseList.concat(res.data.result.records)
  191. this.mescroll.endSuccess(res.data.result.records.length, res.data.result.total);; // 结束下拉刷新状态
  192. }
  193. }).catch(() => {
  194. this.mescroll.endErr()
  195. })
  196. },
  197. },
  198. onShow() {
  199. let that = this
  200. uni.getStorage({
  201. key: 'login_user_info',
  202. success: function(res) {
  203. that.merchantId = res.data.merchantId
  204. }
  205. })
  206. }
  207. };
  208. </script>
  209. <style lang="scss" scoped>
  210. .evaluate {
  211. width: 100vw;
  212. height: 100vh;
  213. background: #F7F8FC;
  214. display: flex;
  215. flex-direction: column;
  216. overflow: hidden;
  217. /*#ifdef APP-PLUS*/
  218. .top {
  219. width: 100%;
  220. height: var(--status-bar-height);
  221. background: linear-gradient(90deg, #DCF0FF 4%, #FFE3CE 67%, #FFFCE6 100%), linear-gradient(0, #F7F8FC 0%, rgba(247, 248, 252, 0) 100%);
  222. }
  223. /*#endif*/
  224. .head {
  225. width: 100%;
  226. height: 112rpx;
  227. padding: 20rpx;
  228. display: flex;
  229. align-items: center;
  230. background: linear-gradient(90deg, #DCF0FF 4%, #FFE3CE 67%, #FFFCE6 100%), linear-gradient(0, #F7F8FC 0%, rgba(247, 248, 252, 0) 100%);
  231. position: relative;
  232. .cuIcon-back {
  233. font-size: 40rpx;
  234. margin-right: 40rpx;
  235. }
  236. .case {
  237. position: absolute;
  238. left: 50%;
  239. transform: translateX(-50%);
  240. font-size: 36rpx;
  241. font-weight: 600;
  242. }
  243. }
  244. /*#ifdef APP-PLUS*/
  245. .head {
  246. width: 100%;
  247. height: var(--status-bar-height);
  248. background: linear-gradient(90deg, #DCF0FF 4%, #FFE3CE 67%, #FFFCE6 100%), linear-gradient(0, #F7F8FC 0%, rgba(247, 248, 252, 0) 100%);
  249. }
  250. /*#endif*/
  251. .center {
  252. flex: 1;
  253. padding: 0px 22rpx 10rpx;
  254. overflow-y: auto;
  255. .score {
  256. width: 100%;
  257. margin: 20rpx auto 0px;
  258. background: #FFFFFF;
  259. border-radius: 16rpx;
  260. padding: 16rpx;
  261. .picture {
  262. display: flex;
  263. justify-content: space-between;
  264. border-bottom: 1px solid #eeeeee;
  265. padding-bottom: 10rpx;
  266. .left {
  267. width: 225rpx;
  268. height: 93rpx;
  269. display: flex;
  270. align-items: center;
  271. .mark {
  272. flex: 1;
  273. font-size: 64rpx;
  274. font-weight: 600;
  275. margin-right: 16rpx;
  276. }
  277. .num {
  278. font-size: 22rpx;
  279. color: #999999;
  280. span {
  281. display: block;
  282. margin-top: 8rpx;
  283. }
  284. }
  285. }
  286. .separate {
  287. width: 1px;
  288. height: 92rpx;
  289. background-color: #eeeeee;
  290. }
  291. .right {
  292. width: 354rpx;
  293. // padding: 20rpx;
  294. display: flex;
  295. flex-direction: column;
  296. // align-items: center;
  297. justify-content: space-between;
  298. font-size: 20rpx;
  299. color: #999999;
  300. .line {
  301. width: 100%;
  302. display: flex;
  303. align-items: center;
  304. span {
  305. margin-right: 10rpx;
  306. }
  307. }
  308. }
  309. }
  310. .people_num {
  311. width: 100%;
  312. display: flex;
  313. align-items: center;
  314. font-size: 22rpx;
  315. color: #999999;
  316. margin-top: 10rpx;
  317. .statis {
  318. display: flex;
  319. align-items: center;
  320. span {
  321. display: block;
  322. width: 1rpx;
  323. height: 22rpx;
  324. background-color: #999999;
  325. margin: 0px 16rpx;
  326. }
  327. }
  328. }
  329. }
  330. .appraise {
  331. width: 100%;
  332. margin-top: 20rpx;
  333. .select {
  334. width: 100%;
  335. display: flex;
  336. justify-content: space-between;
  337. flex-wrap: wrap;
  338. gap: 33rpx;
  339. margin-bottom: 10rpx;
  340. .type {
  341. width: 144rpx;
  342. height: 52rpx;
  343. display: flex;
  344. align-items: center;
  345. justify-content: center;
  346. background-color: #ccc;
  347. // margin-right: 20rpx;
  348. // margin-bottom: 20rpx;
  349. background: #FFFFFF;
  350. border-radius: 4rpx;
  351. }
  352. .active {
  353. background: rgba(68, 154, 255, 0.1);
  354. border: 1px solid #449AFF;
  355. color: #2983EC;
  356. }
  357. }
  358. .list {
  359. .item {
  360. margin-top: 20rpx;
  361. background: #ffffff;
  362. padding: 16rpx;
  363. border-radius: 16rpx;
  364. box-shadow: 0px 2px 8px 0px rgba(214, 225, 237, 0.1);
  365. }
  366. .headr {
  367. display: flex;
  368. justify-content: space-between;
  369. .left {
  370. display: flex;
  371. .img {
  372. width: 70rpx;
  373. height: 70rpx;
  374. border-radius: 8rpx;
  375. overflow: hidden;
  376. margin-right: 12rpx;
  377. image {
  378. width: 100%;
  379. height: 100%;
  380. }
  381. }
  382. }
  383. .name {
  384. font-size: 24rpx;
  385. color: #000000;
  386. span {
  387. font-size: 22rpx;
  388. color: #999999;
  389. }
  390. }
  391. .right {
  392. width: 200rpx;
  393. display: flex;
  394. align-items: center;
  395. justify-content: space-between;
  396. font-size: 24rpx;
  397. color: #FF2848;
  398. span {
  399. display: block;
  400. }
  401. }
  402. }
  403. .product {
  404. width: 50%;
  405. height: 36rpx;
  406. background: #F4F4F4;
  407. border-radius: 4rpx;
  408. font-size: 22rpx;
  409. color: #666666;
  410. display: flex;
  411. align-items: center;
  412. padding: 0 12rpx;
  413. margin: 10rpx 0px;
  414. }
  415. .type {
  416. margin-top: 20rpx;
  417. }
  418. .content {
  419. margin-top: 20rpx;
  420. }
  421. .recover {
  422. background: #F7F8FC;
  423. border-radius: 4rpx;
  424. padding: 12rpx;
  425. margin: 16rpx 0px 10rpx;
  426. }
  427. .image {
  428. display: flex;
  429. align-items: center;
  430. margin: 10rpx 0px 16rpx;
  431. .img {
  432. width: 156rpx;
  433. height: 156rpx;
  434. border-radius: 4rpx;
  435. overflow: hidden;
  436. margin-right: 7rpx;
  437. }
  438. .img:nth-child(4n) {
  439. margin: 0;
  440. }
  441. image {
  442. width: 156rpx;
  443. height: 156rpx;
  444. }
  445. }
  446. .time {
  447. margin-top: 20rpx;
  448. }
  449. .reply {
  450. height: 60rpx;
  451. background: #F7F8FC;
  452. margin-top: 16rpx;
  453. padding: 12rpx;
  454. font-size: 24rpx;
  455. display: flex;
  456. align-items: center;
  457. input {
  458. font-size: 22rpx;
  459. }
  460. }
  461. .remove {
  462. display: flex;
  463. align-items: center;
  464. justify-content: space-between;
  465. font-size: 22rpx;
  466. color: #999999;
  467. .btn {
  468. margin-top: 10rpx;
  469. width: 144rpx;
  470. height: 47rpx;
  471. border-radius: 47rpx;
  472. border: 1px solid #449AFF;
  473. font-size: 24rpx;
  474. color: #449AFF;
  475. display: flex;
  476. align-items: center;
  477. justify-content: center;
  478. }
  479. }
  480. }
  481. }
  482. }
  483. }
  484. /deep/.u-iconfont {
  485. font-size: 20rpx;
  486. width: 20rpx;
  487. height: 20rpx;
  488. }
  489. /deep/.u-progress {
  490. height: 12rpx !important;
  491. border-radius: 53rpx;
  492. }
  493. </style>