鸿宇研学生前端代码
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.

209 lines
3.6 KiB

  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.headImage" mode="scaleToFill"></image>
  7. </view>
  8. <view class="info">
  9. <view class="name">{{ data.user.nickName }}</view>
  10. <view>{{ $dayjs(data.createTime).format('YYYY-MM-DD') }}</view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="section content">{{ data.content }}</view>
  15. <view class="flex section imgs">
  16. <image class="img"
  17. v-for="(url, iIdx) in images"
  18. :key="iIdx" :src="url"
  19. mode="scaleToFill"
  20. ></image>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import formRate from '@/pages_order/components/formRate.vue'
  26. export default {
  27. components: {
  28. formRate,
  29. },
  30. props: {
  31. data: {
  32. type: Object,
  33. default() {
  34. return {}
  35. }
  36. },
  37. mode: {
  38. type: String,
  39. default: 'read' // read | edit
  40. }
  41. },
  42. computed: {
  43. images() {
  44. const { image } = this.data || {}
  45. return image?.split?.(',')?.filter(val => val)
  46. },
  47. disabled() {
  48. return this.mode !== 'edit'
  49. },
  50. },
  51. methods: {
  52. },
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. .card {
  57. width: 100%;
  58. padding: 32rpx;
  59. box-sizing: border-box;
  60. background: #FAFAFF;
  61. border: 2rpx solid #FFFFFF;
  62. border-radius: 32rpx;
  63. }
  64. .header {
  65. .left {
  66. flex: 1;
  67. justify-content: flex-start;
  68. column-gap: 24rpx;
  69. }
  70. .avatar {
  71. width: 100rpx;
  72. height: 100rpx;
  73. border: 4rpx solid #FFFFFF;
  74. border-radius: 50%;
  75. overflow: hidden;
  76. &-img {
  77. width: 100%;
  78. height: 100%;
  79. }
  80. }
  81. .info {
  82. font-family: PingFang SC;
  83. font-weight: 400;
  84. font-size: 24rpx;
  85. line-height: 1.5;
  86. color: #8B8B8B;
  87. .name {
  88. font-weight: 600;
  89. font-size: 36rpx;
  90. line-height: 1.2;
  91. color: #252545;
  92. margin-bottom: 8rpx;
  93. }
  94. }
  95. .btn {
  96. &-icon {
  97. width: 44rpx;
  98. height: auto;
  99. }
  100. }
  101. }
  102. .section {
  103. margin-top: 24rpx;
  104. }
  105. .content {
  106. white-space: pre-wrap;
  107. font-family: PingFang SC;
  108. font-weight: 400;
  109. font-size: 32rpx;
  110. line-height: 1.4;
  111. color: #181818;
  112. }
  113. .imgs {
  114. justify-content: flex-start;
  115. flex-wrap: wrap;
  116. gap: 24rpx;
  117. .img {
  118. width: 190rpx;
  119. height: 190rpx;
  120. }
  121. }
  122. .score {
  123. &-item {
  124. padding: 12rpx 0;
  125. justify-content: space-between;
  126. & + & {
  127. margin-top: 4rpx;
  128. }
  129. &-label {
  130. font-family: PingFang SC;
  131. font-weight: 400;
  132. font-size: 26rpx;
  133. line-height: 1.4;
  134. color: #181818;
  135. }
  136. }
  137. }
  138. .operate {
  139. justify-content: flex-start;
  140. column-gap: 24rpx;
  141. .btn {
  142. column-gap: 8rpx;
  143. font-size: 24rpx;
  144. color: #999999;
  145. .icon {
  146. width: 32rpx;
  147. height: auto;
  148. }
  149. }
  150. }
  151. .comment {
  152. &-user {
  153. column-gap: 16rpx;
  154. .avatar {
  155. width: 48rpx;
  156. height: 48rpx;
  157. border-radius: 50%;
  158. &-img {
  159. width: 100%;
  160. height: 100%;
  161. }
  162. }
  163. .name {
  164. font-size: 26rpx;
  165. font-weight: 600;
  166. color: #000000;
  167. }
  168. .time {
  169. flex: 1;
  170. text-align: right;
  171. font-size: 24rpx;
  172. color: #999999;
  173. }
  174. }
  175. &-content {
  176. margin-top: 28rpx;
  177. font-size: 26rpx;
  178. color: #666666;
  179. }
  180. }
  181. </style>