普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
4.3 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="card">
  3. <!-- todo: delete -->
  4. <view class="flex header">
  5. <view class="flex left">
  6. <view class="avatar">
  7. <!-- todo: check key -->
  8. <image class="avatar-img" :src="data.user.avatar"></image>
  9. </view>
  10. <view class="info">
  11. <view class="name">{{ data.user.name }}</view>
  12. <view>{{ $dayjs(data.createTime).format('YYYY-MM-DD') }}</view>
  13. <!-- todo: check key -->
  14. <!-- <view>{{ `${data.countDesc || ''} | ${$dayjs(data.createTime).format('YYYY-MM-DD')}` }}</view> -->
  15. </view>
  16. </view>
  17. <view class="right" v-if="mode == 'edit'">
  18. <button class="btn" @click="onDelete">
  19. <image class="btn-icon" src="@/pages_order/static/comment/icon-delete.png" mode="widthFix"></image>
  20. </button>
  21. </view>
  22. </view>
  23. <view class="section content">{{ data.content }}</view>
  24. <view class="flex section imgs">
  25. <image class="img"
  26. v-for="(url, iIdx) in images"
  27. :key="iIdx" :src="url"
  28. mode="scaleToFill"
  29. ></image>
  30. </view>
  31. <view class="section score">
  32. <view class="flex score-item">
  33. <view class="score-item-label">产品服务度</view>
  34. <uv-rate :value="data.productNum" size="48rpx" gutter="16rpx" activeColor="#F7BA1E" :allowHalf="true" :minCount="0.5" readonly></uv-rate>
  35. </view>
  36. <view class="flex score-item">
  37. <view class="score-item-label">问卷体验</view>
  38. <uv-rate :value="data.paperNum" size="48rpx" gutter="16rpx" activeColor="#F7BA1E" :allowHalf="true" :minCount="0.5" readonly></uv-rate>
  39. </view>
  40. <view class="flex score-item">
  41. <view class="score-item-label">物流速度</view>
  42. <uv-rate :value="data.logisticsNum" size="48rpx" gutter="16rpx" activeColor="#F7BA1E" :allowHalf="true" :minCount="0.5" readonly></uv-rate>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. props: {
  50. data: {
  51. type: Object,
  52. default() {
  53. return {}
  54. }
  55. },
  56. mode: {
  57. type: String,
  58. default: 'read' // read | edit
  59. }
  60. },
  61. computed: {
  62. images() {
  63. const { image } = this.data || {}
  64. return image?.split?.(',')
  65. }
  66. },
  67. methods: {
  68. async fetchDelete() {
  69. uni.showToast({
  70. icon: 'loading',
  71. title: '正在删除',
  72. });
  73. try {
  74. await this.$fetch('deleteEvaluate', { id: this.data.id })
  75. uni.showToast({
  76. icon: 'success',
  77. title: '删除成功',
  78. });
  79. this.$emit('deleteSucc')
  80. } catch (err) {
  81. }
  82. },
  83. onDelete() {
  84. uni.showModal({
  85. title: '确认删除?',
  86. success : e => {
  87. if(e.confirm){
  88. this.fetchDelete()
  89. }
  90. }
  91. })
  92. }
  93. },
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .card {
  98. width: 100%;
  99. padding: 32rpx;
  100. box-sizing: border-box;
  101. background: #FAFAFF;
  102. border: 2rpx solid #FFFFFF;
  103. border-radius: 32rpx;
  104. }
  105. .header {
  106. .left {
  107. flex: 1;
  108. justify-content: flex-start;
  109. column-gap: 24rpx;
  110. }
  111. .avatar {
  112. width: 100rpx;
  113. height: 100rpx;
  114. border: 4rpx solid #FFFFFF;
  115. border-radius: 50%;
  116. overflow: hidden;
  117. &-img {
  118. width: 100%;
  119. height: 100%;
  120. }
  121. }
  122. .info {
  123. font-family: PingFang SC;
  124. font-weight: 400;
  125. font-size: 24rpx;
  126. line-height: 1.5;
  127. color: #8B8B8B;
  128. .name {
  129. font-weight: 600;
  130. font-size: 36rpx;
  131. line-height: 1.2;
  132. color: #252545;
  133. margin-bottom: 8rpx;
  134. }
  135. }
  136. .btn {
  137. &-icon {
  138. width: 44rpx;
  139. height: auto;
  140. }
  141. }
  142. }
  143. .section {
  144. margin-top: 24rpx;
  145. }
  146. .content {
  147. font-family: PingFang SC;
  148. font-weight: 400;
  149. font-size: 32rpx;
  150. line-height: 1.4;
  151. color: #181818;
  152. }
  153. .imgs {
  154. justify-content: flex-start;
  155. flex-wrap: wrap;
  156. gap: 24rpx;
  157. .img {
  158. width: 190rpx;
  159. height: 190rpx;
  160. }
  161. }
  162. .score {
  163. &-item {
  164. padding: 12rpx 0;
  165. justify-content: space-between;
  166. & + & {
  167. margin-top: 4rpx;
  168. }
  169. &-label {
  170. font-family: PingFang SC;
  171. font-weight: 400;
  172. font-size: 26rpx;
  173. line-height: 1.4;
  174. color: #181818;
  175. }
  176. }
  177. }
  178. </style>