湘妃到家前端代码仓库
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.

158 lines
2.9 KiB

1 month ago
  1. <template>
  2. <view class="review-list">
  3. <view v-for="(item,index) in list" :key="index" class="review-item">
  4. <view class="user-info">
  5. <view class="left box-s">
  6. <view class="img-box">
  7. <image src="" mode="aspectFill"></image>
  8. </view>
  9. <view class="user-name-and-time box-s">
  10. <view class="user-name">
  11. 匿名用户
  12. </view>
  13. <view class="peview-time">
  14. {{ item.createTime }}
  15. </view>
  16. </view>
  17. </view>
  18. <view class="more">
  19. <van-icon name="weapp-nav" size="40rpx" color="#DDDADA" />
  20. </view>
  21. </view>
  22. <view class="mark">
  23. <van-rate v-model="item.serviceNum" size="25rpx" color="#FCD618" />
  24. <text class="desc">{{ getSatisfaction(item.serviceNum) }}</text>
  25. </view>
  26. <view class="tags">
  27. <view class="tag" v-for="(t) in item.labelText.split(',')">
  28. {{ t }}
  29. </view>
  30. </view>
  31. <view class="comment-content">
  32. <view class="content">
  33. {{ item.content }}
  34. </view>
  35. <!-- <view class="like already-liked">
  36. {{ item.num | 0 }}
  37. <van-icon v-if="false" name="good-job-o" />
  38. <van-icon name="good-job-o" color="#FC9A37" size="40rpx" />
  39. </view> -->
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. mark: 3
  49. }
  50. },
  51. props: {
  52. list: {
  53. type: Array,
  54. default: function() {
  55. return []
  56. }
  57. }
  58. },
  59. methods: {
  60. //获取满意度
  61. getSatisfaction(num){
  62. let satisfaction = ['不满意','不满意','较满意','满意','非常满意']
  63. return satisfaction[num - 1]
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .review-list {
  70. .box-s {
  71. box-sizing: border-box;
  72. }
  73. .review-item {
  74. background: #F5F5F5;
  75. padding: 15rpx 25rpx;
  76. border-radius: 15rpx;
  77. margin-bottom: 20rpx;
  78. .user-info {
  79. display: flex;
  80. .left {
  81. width: calc(100% - 40rpx);
  82. display: flex;
  83. .img-box {
  84. width: 100rpx;
  85. height: 100rpx;
  86. background: #ccc;
  87. border-radius: 50rpx;
  88. }
  89. .user-name-and-time {
  90. display: flex;
  91. flex-direction: column;
  92. justify-content: space-around;
  93. padding: 10rpx 15rpx;
  94. .user-name {
  95. font-size: 30rpx;
  96. }
  97. .peview-time {
  98. font-size: 24rpx;
  99. color: #D1CDCD;
  100. }
  101. }
  102. }
  103. }
  104. .mark {
  105. display: flex;
  106. align-items: center;
  107. .desc {
  108. margin-left: 5rpx;
  109. color: #D1CDCD;
  110. font-size: 26rpx;
  111. }
  112. }
  113. .tags {
  114. padding-top: 15rpx;
  115. display: flex;
  116. .tag {
  117. background: #ECFCF1;
  118. color: #55B16E;
  119. font-size: 22rpx;
  120. padding: 5rpx 20rpx;
  121. border-radius: 10rpx;
  122. margin-right: 5px;
  123. }
  124. }
  125. .comment-content {
  126. font-size: 22rpx;
  127. margin-top: 15rpx;
  128. .content {
  129. color: #474441;
  130. }
  131. .like {
  132. display: flex;
  133. color: #BDBCBC;
  134. justify-content: flex-end;
  135. align-items: center;
  136. padding: 10rpx 0rpx;
  137. }
  138. .already-liked {
  139. color: #FC9A37;
  140. }
  141. }
  142. }
  143. }
  144. </style>