shopAppraise.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="content">
  3. <!-- 列表 -->
  4. <view class="itemContent">
  5. <view v-for="(item,index) in itemData" :key="index">
  6. <view class="item">
  7. <view class="leftView">
  8. <image :src='item.HeadUrl' v-if="item.HeadUrl" class="storeImg"></image>
  9. <image src="../../static/img/pic_def_ava.png" mode="" class="storeImg" v-else></image>
  10. </view>
  11. <view class="rightView">
  12. <!-- 第一行 -->
  13. <view class="firstView">
  14. <view class="shopName">{{item.Evaluator}}</view>
  15. </view>
  16. <!-- 第2行 -->
  17. <view class="secondView">
  18. <!-- 星星 -->
  19. <uni-rate :value="item.Overallevaluation" :max="5" color="#EEEEEE" active-color="#FF4F00"
  20. :size="16" :margin="4" :readonly="true" />
  21. <view class="time">{{item.CreateTime.slice(0,item.CreateTime.length-8)}}</view>
  22. </view>
  23. <view class="contentMes">{{item.EContent}}</view>
  24. <!-- 照片 -->
  25. <view class="imgBg">
  26. <view v-for="(itemImg,indexImg) in item.imgs" :key="indexImg">
  27. <image :src="itemImg.imageUrl" class="img"
  28. @click="previewImage(itemImg.imageUrl,item.imgs)"></image>
  29. </view>
  30. </view>
  31. <!-- 商家回复 -->
  32. <view class="writeBack" v-if="item.ReplyContent">商家回复:{{item.ReplyContent}}</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 上拉 加载更多 -->
  38. <view class="noMore" v-if="noMoreShow">没有更多数据</view>
  39. <!-- 无数据空白页 -->
  40. <nodata v-if="itemData.length==0"></nodata>
  41. </view>
  42. </template>
  43. <script>
  44. import nodata from '../../components/nodata/nodata.vue'
  45. export default {
  46. components: {
  47. nodata,
  48. },
  49. data() {
  50. return {
  51. itemData: [],
  52. page: 1,
  53. noMoreShow: false,
  54. imgArr: [],
  55. shopId:'',
  56. }
  57. },
  58. onLoad(opt) {
  59. this.page = 1
  60. this.shopId = opt.shopId
  61. this.getItemData()
  62. },
  63. methods: {
  64. previewImage(img, arrDic) {
  65. var arr = [];
  66. arrDic.forEach(item => {
  67. arr.push(item.imageUrl)
  68. })
  69. // 预览图片
  70. uni.previewImage({
  71. urls: arr,
  72. current: img,
  73. longPressActions: {
  74. itemList: ['发送给朋友', '保存图片', '收藏'],
  75. success: function(data) {
  76. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  77. },
  78. fail: function(err) {
  79. console.log(err.errMsg);
  80. }
  81. }
  82. });
  83. },
  84. getItemData() {
  85. uni.showLoading({
  86. title: '加载中'
  87. })
  88. let url = 'worldKeepCar/worldHome/listShopTMEvaluatePage',
  89. params = {
  90. page: this.page,
  91. limit: 20,
  92. shopId:this.shopId,
  93. }
  94. this.$http(url, params, 'GET').then(res => {
  95. uni.hideLoading();
  96. var list = res.data.Items
  97. // 处理 undefined和null转为空白字符串
  98. list.forEach((item, index) => {
  99. for (const key in item) {
  100. item[key] = this.$praseStrEmpty(item[key])
  101. }
  102. })
  103. if (this.page == 1) {
  104. this.itemData = list
  105. } else {
  106. this.itemData = this.itemData.concat(list)
  107. }
  108. if (list.length < 10) {
  109. this.noMoreShow = false
  110. } else {
  111. this.noMoreShow = true
  112. }
  113. })
  114. },
  115. },
  116. // 下拉刷新 上拉加载更多
  117. onPullDownRefresh() {
  118. this.page = 1
  119. this.getItemData()
  120. setTimeout(function() {
  121. uni.stopPullDownRefresh();
  122. }, 1000);
  123. },
  124. onReachBottom() {
  125. this.page++;
  126. this.getItemData()
  127. },
  128. }
  129. </script>
  130. <style scoped>
  131. .content {
  132. background: #FFFFFF;
  133. min-height: 100vh;
  134. }
  135. .item {
  136. display: flex;
  137. justify-content: flex-start;
  138. padding: 0 24rpx;
  139. background-color: #FFFFFF;
  140. }
  141. .leftView {
  142. width: 117rpx;
  143. padding-right: 20rpx;
  144. }
  145. .storeImg {
  146. width: 72rpx;
  147. height: 72rpx;
  148. border-radius: 8rpx;
  149. margin-top: 30rpx;
  150. }
  151. .rightView {
  152. border-bottom: 1rpx #EEEEEE solid;
  153. width: 100vw;
  154. }
  155. .firstView,
  156. .secondView {
  157. display: flex;
  158. justify-content: space-between;
  159. align-items: center;
  160. }
  161. .firstView {
  162. padding-top: 30rpx;
  163. }
  164. .secondView {
  165. padding-top: 12rpx;
  166. padding-bottom: 20rpx;
  167. }
  168. .shopName {
  169. /* padding-top: 30rpx;
  170. padding-bottom: 10rpx; */
  171. font-size: 26rpx;
  172. font-weight: bold;
  173. color: #333333;
  174. }
  175. .time {
  176. font-size: 26rpx;
  177. color: #999999;
  178. }
  179. .deleteBtn {
  180. width: 36rpx;
  181. height: 36rpx;
  182. }
  183. .contentMes {
  184. font-size: 26rpx;
  185. color: #666666;
  186. line-height: 37rpx;
  187. /* padding-top: 20rpx; */
  188. }
  189. .imgBg {
  190. display: flex;
  191. justify-content: flex-start;
  192. padding: 30rpx 0rpx;
  193. flex-wrap: wrap;
  194. }
  195. .img {
  196. width: 140rpx;
  197. height: 140rpx;
  198. margin-right: 5rpx;
  199. border-radius: 8rpx;
  200. }
  201. .writeBack {
  202. font-size: 26rpx;
  203. color: #666666;
  204. line-height: 37rpx;
  205. padding: 20rpx;
  206. background-color: #F4F5F7;
  207. padding-bottom: 20rpx;
  208. }
  209. .noMore {
  210. text-align: center;
  211. line-height: 50rpx;
  212. color: #999999;
  213. font-size: 28rpx;
  214. }
  215. </style>