evaluateList.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="container">
  3. <scroll-view class="message-list-box" scroll-y="true" @scrolltolower="handleLoadMore()">
  4. <view class="assess-row" v-for="(item, index1) in assessList" :key="index1">
  5. <cover-image class="assess-head" :src="item.headimg"></cover-image>
  6. <view class="assess-info">
  7. <view class="assess-name">{{item.nickname}}</view>
  8. <view class="assess-date">{{item.evaluateTime}}</view>
  9. <view class="assess-sore-box">
  10. <u-rate v-model="item.score" active-color="#FFAE21" disabled></u-rate>
  11. </view>
  12. <view class="assess-text">{{item.evaluateContent}}</view>
  13. <view class="assess-img-box">
  14. <cover-image class="img-col" v-for="(site, index2) in item.evaluateImgs" :key="index2" :src="site.imgUrl"></cover-image>
  15. </view>
  16. </view>
  17. <view class="shop-reply-box" v-if="item.replyContent">
  18. <view class="shop-head">
  19. <view class="iconfont icondianpu"></view>
  20. <view class="shop-name">店家回复</view>
  21. </view>
  22. <view class="shop-reply">{{item.replyContent}}</view>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. <u-top-tips ref="uTips"></u-top-tips>
  27. </view>
  28. </template>
  29. <script>
  30. const NET = require('@/utils/request')
  31. const API = require('@/config/api')
  32. export default {
  33. data() {
  34. return {
  35. goodId: '',
  36. pageIndex: 1,
  37. isOver: false,
  38. assessList: [],
  39. }
  40. },
  41. onLoad(options) {
  42. this.goodId = options.goodId
  43. },
  44. onShow() {
  45. this.getMessageList()
  46. },
  47. methods: {
  48. // 懒加载
  49. handleLoadMore() {
  50. if (!this.isOver) {
  51. this.pageIndex++
  52. this.getMessageList()
  53. }
  54. },
  55. // 获取全部留言
  56. getMessageList() {
  57. NET.request(API.getAssessList + this.goodId + '/' + this.pageIndex + '/10', {}, 'GET').then(res => {
  58. this.isOver = res.data.list.length != 10
  59. this.assessList = this.assessList.concat(res.data.list)
  60. }).catch(error => {
  61. this.$refs.uTips.show({
  62. title: error.data.msg,
  63. type: 'warning',
  64. })
  65. })
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="less" scoped>
  71. page {
  72. width: 100%;
  73. height: 100%;
  74. }
  75. .container {
  76. width: 100%;
  77. height: 100%;
  78. float: left;
  79. position: relative;
  80. .message-list-box {
  81. width: 100%;
  82. height: 100%;
  83. float: left;
  84. .assess-row {
  85. width: calc(100% - 30px);
  86. margin: 0 15px;
  87. float: left;
  88. border-top: 1px solid #F6F6F6;
  89. padding: 12px 0;
  90. .assess-head {
  91. width: 50px;
  92. height: 50px;
  93. float: left;
  94. object-fit: cover;
  95. border-radius: 50%;
  96. }
  97. .assess-info {
  98. width: calc(100% - 62px);
  99. margin-left: 12px;
  100. float: left;
  101. .assess-name {
  102. height: 18px;
  103. float: left;
  104. line-height: 18px;
  105. font-size: 15px;
  106. font-family: PingFang SC;
  107. font-weight: bold;
  108. color: #343434;
  109. }
  110. .assess-date {
  111. height: 18px;
  112. float: right;
  113. line-height: 18px;
  114. font-size: 12px;
  115. font-family: PingFang SC;
  116. font-weight: bold;
  117. color: #666666;
  118. }
  119. .assess-sore-box {
  120. width: 100%;
  121. height: 16px;
  122. float: left;
  123. margin: 6px 0;
  124. }
  125. .assess-text {
  126. width: 100%;
  127. float: left;
  128. font-size: 12px;
  129. font-family: PingFang SC;
  130. font-weight: bold;
  131. color: #666666;
  132. line-height: 16px;
  133. margin: 8px 0 10px 0;
  134. overflow: hidden;
  135. text-overflow: ellipsis;
  136. display: -webkit-box;
  137. -webkit-line-clamp: 2;
  138. -webkit-box-orient: vertical;
  139. word-wrap: break-word;
  140. }
  141. .assess-img-box {
  142. width: 100%;
  143. float: left;
  144. display: flex;
  145. .img-col {
  146. height: 60px;
  147. width: 60px;
  148. object-fit: cover;
  149. margin: 0 10px 10px 0;
  150. }
  151. }
  152. }
  153. .shop-reply-box {
  154. width: 100%;
  155. float: left;
  156. background: #F5F5F5;
  157. border-radius: 5px;
  158. margin-top: 10px;
  159. .shop-head {
  160. width: 100%;
  161. height: 36px;
  162. float: left;
  163. box-sizing: border-box;
  164. padding: 10px 12px;
  165. .icondianpu {
  166. width: 16px;
  167. height: 16px;
  168. float: left;
  169. color: #52A63A;
  170. font-size: 20px;
  171. margin-right: 8px;
  172. }
  173. .shop-name {
  174. height: 16px;
  175. float: left;
  176. font-size: 15px;
  177. font-family: PingFang SC;
  178. color: #52A63A;
  179. line-height: 16px;
  180. }
  181. }
  182. .shop-reply {
  183. width: 100%;
  184. float: left;
  185. box-sizing: border-box;
  186. padding: 0 12px 12px 12px;
  187. font-size: 12px;
  188. font-family: PingFang SC;
  189. color: #666666;
  190. line-height: 16px;
  191. }
  192. }
  193. }
  194. .assess-row:first-child {
  195. border-top: none;
  196. }
  197. }
  198. }
  199. </style>