普兆健康管家前端代码仓库
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.

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