shopAppraise.vue 5.3 KB

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