appraise.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="appraise-card">
  3. <view class="appraise-title">
  4. <view class="title">评价</view>
  5. <view class="comments">
  6. <view class="a-star">
  7. <zzx-icon name="star" size="10"></zzx-icon>
  8. <text>{{ listData.averageScore }}</text>
  9. </view>
  10. <view class="a-text">| {{ listData.scoreNum }}人评论</view>
  11. </view>
  12. </view>
  13. <view class="appraise-info" v-for="item in listData.records" :key="item.id" @click="check_detail">
  14. <view class="a-user-info">
  15. <view class="info">
  16. <image :src="item.avatar" mode=""></image>
  17. <view class="name">{{ item.username }}</view>
  18. </view>
  19. <view class="time">{{ DateUtils.formatDateToMMDD(item.createTime) }}</view>
  20. </view>
  21. <view class="a-score">
  22. <text>{{ item.score.toFixed(1) }}</text>
  23. <uni-rate :readonly="true" size="16" :value="item.score" />
  24. </view>
  25. <view class="a-content">
  26. {{ item.evaluateContent }}
  27. </view>
  28. <scroll-view class="scroll-view_H" scroll-x="true" :show-scrollbar="false">
  29. <view class="scroll-view-item_H uni-bg-red" v-for="(img, idx) in item.images.split(',')" :key="idx">
  30. <image @click="_previewImage(item.images.split(','), img)" :src="img" mode=""></image>
  31. </view>
  32. </scroll-view>
  33. </view>
  34. <view class="not-data" v-if="!listData.records.length">暂无评价数据</view>
  35. </view>
  36. </template>
  37. <script lang="ts" setup>
  38. import { _previewImage } from '@/utils/util';
  39. interface Props {
  40. listData?: any;
  41. }
  42. const props = withDefaults(defineProps<Props>(), {
  43. listData: [],
  44. });
  45. const check_detail = () => {
  46. uni.navigateTo({
  47. url: '/pages/index/commentsDetail/index'
  48. })
  49. }
  50. </script>
  51. <style lang="less" scoped>
  52. .appraise-card {
  53. padding: 20rpx;
  54. background: #FFFFFF;
  55. border-radius: 32rpx;
  56. margin-top: 20rpx;
  57. .appraise-title {
  58. display: flex;
  59. align-items: center;
  60. justify-content: space-between;
  61. .title {
  62. font-weight: 800;
  63. font-size: 32rpx;
  64. color: #222222;
  65. }
  66. .comments {
  67. display: flex;
  68. align-items: center;
  69. gap: 16rpx;
  70. .a-star {
  71. font-size: 24rpx;
  72. color: #FDD143;
  73. }
  74. .a-text {
  75. font-size: 24rpx;
  76. color: #AAAAAA;
  77. }
  78. }
  79. }
  80. .appraise-info {
  81. margin-top: 20rpx;
  82. .a-user-info {
  83. display: flex;
  84. align-items: center;
  85. justify-content: space-between;
  86. .info {
  87. display: flex;
  88. align-items: center;
  89. gap: 20rpx;
  90. &>image {
  91. width: 60rpx;
  92. height: 60rpx;
  93. border-radius: 50%;
  94. }
  95. .name {
  96. font-weight: bold;
  97. font-size: 24rpx;
  98. color: #222222;
  99. }
  100. }
  101. .time {
  102. font-size: 24rpx;
  103. color: #AAAAAA;
  104. }
  105. }
  106. .a-score {
  107. font-size: 24rpx;
  108. color: #AAAAAA;
  109. display: flex;
  110. align-items: center;
  111. gap: 20rpx;
  112. margin-top: 20rpx;
  113. }
  114. .a-content {
  115. margin-top: 20rpx;
  116. font-size: 28rpx;
  117. color: #222222;
  118. }
  119. .scroll-view_H {
  120. white-space: nowrap;
  121. width: 100%;
  122. height: 220rpx;
  123. margin-top: 20rpx;
  124. border-bottom: 1rpx solid #F0F0F0;
  125. .scroll-view-item_H {
  126. display: inline-block;
  127. text-align: center;
  128. margin-right: 14rpx;
  129. &>image {
  130. width: 202rpx;
  131. height: 200rpx;
  132. background: #D8D8D8;
  133. border-radius: 32rpx;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. </style>