evaluateItem.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="comment-item">
  3. <!-- 头像 + 昵称 -->
  4. <view class="header">
  5. <image class="avatar"
  6. :src="item.userAvatar || 'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/my_heads_icon.png'"
  7. mode="aspectFill" />
  8. <text class="nick ellipsis">{{item.nickName}}</text>
  9. <text class="date">{{item.createTime}}</text>
  10. </view>
  11. <!-- 星级 -->
  12. <view class="stars">
  13. <u-rate active-color="#FF6633" :count="item.rating" v-model="item.rating" readonly size="14"></u-rate>
  14. </view>
  15. <!-- 文字评价 -->
  16. <text class="content ellipsis2">{{item.content}}</text>
  17. <!-- 图片缩略图 -->
  18. <view class="pics" v-if="item.imageUrl && item.imageUrl.length">
  19. <image v-for="(img,idx) in item.imageUrl.split(',')" :key="idx" class="pic" :src="img" mode="aspectFill"
  20. @tap="preview(item.imageUrl,idx)" />
  21. </view>
  22. <view class="merchantReply" v-show="item.merchantReply">
  23. 商家回复: {{item.merchantReply}}
  24. </view>
  25. <view v-show="showLine!=0">
  26. <u-line margin="20rpx 0rpx"></u-line>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. props: ['item','showLine'],
  33. data() {
  34. return {
  35. }
  36. },
  37. methods: {
  38. preview(img, current) {
  39. const urls = img.split(',')
  40. uni.previewImage({
  41. urls,
  42. current
  43. });
  44. },
  45. }
  46. }
  47. </script>
  48. <style scoped lang="scss">
  49. .merchantReply {
  50. padding: 20rpx;
  51. font-size: 28rpx;
  52. color: #999;
  53. background: #f5f5f5;
  54. margin-top: 6rpx;
  55. border-radius: 10rpx;
  56. }
  57. .comment-item {
  58. margin-bottom: 20rpx;
  59. background-color: #ffff;
  60. border-radius: 10rpx;
  61. .header {
  62. display: flex;
  63. align-items: center;
  64. }
  65. .avatar {
  66. width: 64rpx;
  67. height: 64rpx;
  68. border-radius: 50%;
  69. margin-right: 16rpx;
  70. }
  71. .nick {
  72. flex: 1;
  73. font-size: 28rpx;
  74. color: #333;
  75. display: block;
  76. }
  77. .date {
  78. font-size: 24rpx;
  79. color: #999;
  80. }
  81. .stars {
  82. margin: 12rpx 0;
  83. }
  84. .content {
  85. font-size: 30rpx;
  86. color: #555;
  87. margin-top: 12rpx;
  88. line-height: 1.6;
  89. }
  90. .pics {
  91. display: flex;
  92. flex-wrap: wrap;
  93. margin-top: 16rpx;
  94. }
  95. .pic {
  96. width: 160rpx;
  97. height: 160rpx;
  98. margin-right: 12rpx;
  99. margin-bottom: 12rpx;
  100. border-radius: 8rpx;
  101. }
  102. }
  103. </style>