dt_goods_comment.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="comment_list">
  3. <view class="comment_item" v-for="(item,index) in dataList" :key="index">
  4. <view class="comment_user_box">
  5. <view class="commemt-user">
  6. <image :src="item.member.icon || 'http://139.9.103.171:1888/img/image/avatar.png'" mode="aspectFill"></image>
  7. <text class="comment_name">{{item.member.username}}</text>
  8. </view>
  9. <text class="comment_time">{{item.createdDate}}</text>
  10. </view>
  11. <view class="comment_context">{{item.content}}</view>
  12. <view class="comment_pics">
  13. <image v-for="(img,idx) in item.imageUrls" :key="idx" :src="img" mode="aspectFill" @tap="tapImage(img)"></image>
  14. </view>
  15. <view class="comment_star">
  16. <view class="star_list">
  17. <block v-for="(sitem,sidx) in 5" :key="sidx">
  18. <image :src="sidx < item.score?'http://139.9.103.171:1888/img/image/star_selected_icon.png':'http://139.9.103.171:1888/img/image/star_no_selected_icon.png'"></image>
  19. </block>
  20. </view>
  21. <view class="score">{{item.score}}</view>
  22. </view>
  23. <view class="comment_sku">
  24. <view class="comment_sku_item" v-for="(skustr,id) in item.specifications" :key="id">
  25. <view class="sku_text"></view>
  26. <view class="sku_value">{{skustr}}</view>
  27. </view>
  28. <!-- <view class="comment_sku_item">
  29. <view class="sku_text">颜色:</view>
  30. <view class="sku_value">白色</view>
  31. </view> -->
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. props: {
  39. dataList: {
  40. type: Array,
  41. default: []
  42. }
  43. },
  44. data() {
  45. return {
  46. };
  47. },
  48. methods: {
  49. tapImage(img){
  50. this.$emit('tapImage',img)
  51. }
  52. }
  53. };
  54. </script>
  55. <style lang="scss">
  56. .comment_list {
  57. .comment_item {
  58. display: flex;
  59. flex-direction: column;
  60. padding: 0 30upx;
  61. border-bottom: 1upx solid #e5e5e5;
  62. box-sizing: border-box;
  63. background: #fff;
  64. .comment_user_box {
  65. display: flex;
  66. flex-direction: row;
  67. justify-content: space-between;
  68. align-items: center;
  69. padding:25upx 0 10upx;
  70. .commemt-user {
  71. display: flex;
  72. flex-direction: row;
  73. align-items: center;
  74. image {
  75. width: 60upx;
  76. height: 60upx;
  77. border-radius: 50%;
  78. margin-right: 20upx;
  79. }
  80. .comment_name {
  81. font-size: 28upx;
  82. }
  83. }
  84. .comment_time {
  85. margin-left: 20upx;
  86. font-size: 24upx;
  87. color: #888;
  88. }
  89. }
  90. .comment_context {
  91. font-size: 28upx;
  92. color: #333;
  93. overflow: hidden;
  94. line-height: 40upx;
  95. text-overflow: ellipsis;
  96. display: -webkit-box;
  97. -webkit-box-orient: vertical;
  98. margin-top: 10upx;
  99. letter-spacing: 1upx;
  100. text-align: justify;
  101. }
  102. .comment_pics {
  103. display: flex;
  104. flex-direction: row;
  105. flex-wrap: wrap;
  106. margin-top: 10upx;
  107. image {
  108. width: 188upx;
  109. height: 188upx;
  110. margin-right: 20upx;
  111. margin-bottom: 20upx;
  112. }
  113. }
  114. .comment_star {
  115. display: flex;
  116. flex-direction: row;
  117. align-items: center;
  118. .star_list {
  119. display: flex;
  120. flex-direction: row;
  121. align-items: center;
  122. image {
  123. width: 23upx;
  124. height: 23upx;
  125. margin-right: 10upx;
  126. }
  127. }
  128. .score {
  129. color: #999999;
  130. font-size: 24upx;
  131. margin-left: 10upx;
  132. }
  133. }
  134. .comment_sku {
  135. height: 60upx;
  136. line-height: 60upx;
  137. font-size: 24upx;
  138. color: #999;
  139. display: flex;
  140. flex-direction: row;
  141. margin-bottom: 10upx;
  142. .comment_sku_item {
  143. display: flex;
  144. flex-direction: row;
  145. align-items: center;
  146. margin-right: 20upx;
  147. }
  148. }
  149. }
  150. .comment_item:last-child {
  151. border: none;
  152. }
  153. }
  154. </style>