ShopAppraiseList.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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. <!-- 第一行 -->
  8. <view class="firstView">
  9. <view class="left">
  10. <image :src='item.HeadUrl' v-if="item.HeadUrl" class="storeImg"></image>
  11. <image src="../../static/img/pic_def_ava.png" mode="" class="storeImg" v-else></image>
  12. <view class="nickName">{{item.Name?item.Name:'微信昵称'}}</view>
  13. </view>
  14. <!-- 时间截取 -->
  15. <view class="time">{{item.CreateTime.slice(0,item.CreateTime.length-8)}}</view>
  16. </view>
  17. <!-- 第2行 -->
  18. <view class="secondView">
  19. <view class="fen">总分</view>
  20. <!-- 星星 -->
  21. <uni-rate :value="item.Overallevaluation" :max="5" color="#EEEEEE" active-color="#FF0000"
  22. :size="13" :margin="2" :readonly="true" />
  23. <view class="count">服务态度{{item.ServiceEvaluation}}星</view>
  24. <view class="count">施工质量{{item.ConstructionEvaluation}}星</view>
  25. <view class="count">店面环境{{item.StoreEvaluation}}星</view>
  26. </view>
  27. <view class="contentMes">{{item.EContent}}</view>
  28. <!-- 照片 -->
  29. <view v-if="item.imgs.length > 0" class="imgBg">
  30. <view v-for="(itemImg,indexImg) in item.imgs" :key="indexImg">
  31. <image :src="itemImg.imageUrl" class="img" :class="{'img4R':(indexImg+1)%4==0&&indexImg!=0}"
  32. @click.stop="previewImage(itemImg.imageUrl,item.imgs)"></image>
  33. </view>
  34. </view>
  35. <!-- 商家回复 -->
  36. <view v-if="item.ReplyContent" class="writeBack">
  37. <view class="title">
  38. <view style="font-weight: bold;">商家回复</view>
  39. <view>{{item.ReplyTime.slice(0,item.ReplyTime.length-8)}}</view>
  40. </view>
  41. <view>{{item.ReplyContent}}</view>
  42. </view>
  43. <!-- <view class="bottom">
  44. <view class="btnBox" @click.stop="goOrder(item)">
  45. <image src="../../static/img/icon_ding.png" class="btnImg"></image>
  46. <view class="btn">查看订单</view>
  47. </view>
  48. <view class="btnBox" @click.stop="deleteItem(item, index)">
  49. <image src="../../static/img/icon_del.png" class="btnImg"></image>
  50. <view class="btn">删除</view>
  51. </view>
  52. </view> -->
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 上拉 加载更多 -->
  57. <view class="noMore" v-if="noMoreShow">没有更多数据</view>
  58. <!-- 无数据空白页 -->
  59. <nodata v-if="itemData.length==0"></nodata>
  60. </view>
  61. </template>
  62. <script>
  63. import nodata from '../../components/nodata/nodata.vue'
  64. export default {
  65. components: {
  66. nodata,
  67. },
  68. data() {
  69. return {
  70. itemData: [],
  71. page: 1,
  72. noMoreShow: false,
  73. shopID: '',
  74. }
  75. },
  76. onLoad(opt) {
  77. // console.log('opt===',opt);
  78. this.shopID = opt.shopID;
  79. },
  80. onShow() {
  81. this.itemData = []
  82. this.page = 1
  83. this.getItemData()
  84. },
  85. methods: {
  86. goOrder(item) {
  87. uni.navigateTo({
  88. url: 'historyDetail?id=' + item.SheetID
  89. })
  90. },
  91. previewImage(img, arrDic) {
  92. var arr = [];
  93. arrDic.forEach(item => {
  94. arr.push(item.imageUrl)
  95. })
  96. // 预览图片
  97. uni.previewImage({
  98. urls: arr,
  99. current: img,
  100. longPressActions: {
  101. itemList: ['发送给朋友', '保存图片', '收藏'],
  102. success: function(data) {
  103. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  104. },
  105. fail: function(err) {
  106. console.log(err.errMsg);
  107. }
  108. }
  109. });
  110. },
  111. deleteItem(item, index) {
  112. var that = this;
  113. uni.showModal({
  114. title: '提示',
  115. content: '确定删除该条评价吗?',
  116. success: function(res) {
  117. if (res.confirm) {
  118. that.itemData.splice(index, 1);
  119. uni.showLoading({
  120. title: '删除中'
  121. })
  122. let url = 'openMiniEvaluate/deleteMyOpenEvaluate',
  123. params = {
  124. id: item.ID,
  125. }
  126. that.$http(url, params, 'POST').then(res => {
  127. uni.hideLoading();
  128. that.page = 1
  129. that.getItemData()
  130. })
  131. }
  132. }
  133. });
  134. },
  135. getItemData() {
  136. uni.showLoading({
  137. title: '加载中'
  138. })
  139. let url = 'openMiniEvaluate/listShopOpenEvaluatePage',
  140. params = {
  141. page: this.page,
  142. limit: 20,
  143. shopId: this.shopID,
  144. }
  145. this.$http(url, params, 'GET').then(res => {
  146. uni.hideLoading();
  147. var list = res.data.Items
  148. // 处理 undefined和null转为空白字符串
  149. // list.forEach((item, index) => {
  150. // for (const key in item) {
  151. // item[key] = this.$praseStrEmpty(item[key])
  152. // }
  153. // })
  154. if (this.page == 1) {
  155. this.itemData = list
  156. } else {
  157. this.itemData = this.itemData.concat(list)
  158. }
  159. if (list.length < 10) {
  160. this.noMoreShow = false
  161. } else {
  162. this.noMoreShow = true
  163. }
  164. })
  165. },
  166. },
  167. // 下拉刷新 上拉加载更多
  168. onPullDownRefresh() {
  169. this.page = 1
  170. this.getItemData()
  171. setTimeout(function() {
  172. uni.stopPullDownRefresh();
  173. }, 1000);
  174. },
  175. onReachBottom() {
  176. this.page++;
  177. this.getItemData()
  178. },
  179. }
  180. </script>
  181. <style scoped>
  182. .content {
  183. background: #f4f5f7;
  184. min-height: 100vh;
  185. padding-top: 20rpx;
  186. padding-bottom: 60rpx;
  187. }
  188. .item {
  189. border-radius: 10rpx;
  190. padding: 20rpx;
  191. background-color: #FFFFFF;
  192. margin: 0 24rpx 20rpx;
  193. }
  194. .firstView,
  195. .secondView {
  196. display: flex;
  197. justify-content: space-between;
  198. align-items: center;
  199. }
  200. .left {
  201. display: flex;
  202. align-items: center;
  203. }
  204. .storeImg {
  205. width: 56rpx;
  206. height: 56rpx;
  207. border-radius: 8rpx;
  208. margin-right: 10rpx;
  209. }
  210. .nickName {
  211. font-weight: 500;
  212. font-size: 26rpx;
  213. color: #333333;
  214. }
  215. .firstView {
  216. margin-bottom: 24rpx;
  217. }
  218. .time {
  219. font-size: 26rpx;
  220. color: #999999;
  221. }
  222. .fen {
  223. font-size: 22rpx;
  224. color: #999999;
  225. }
  226. .count {
  227. font-size: 22rpx;
  228. color: #999999;
  229. margin-right: 20rpx;
  230. }
  231. .thirdView {
  232. display: flex;
  233. justify-content: flex-start;
  234. padding-top: 10rpx;
  235. padding-bottom: 20rpx;
  236. }
  237. .contentMes {
  238. font-size: 26rpx;
  239. color: #333333;
  240. line-height: 37rpx;
  241. padding: 16rpx 0;
  242. }
  243. .imgBg {
  244. display: flex;
  245. justify-content: flex-start;
  246. padding: 20rpx 0rpx;
  247. flex-wrap: wrap;
  248. }
  249. .img {
  250. width: 150rpx;
  251. height: 150rpx;
  252. margin-right: 20rpx;
  253. border-radius: 8rpx;
  254. }
  255. .img4R {
  256. margin-right: 0;
  257. }
  258. .writeBack {
  259. font-size: 26rpx;
  260. color: #666666;
  261. line-height: 37rpx;
  262. padding: 20rpx;
  263. background-color: #F4F5F7;
  264. margin-bottom: 20rpx;
  265. border-radius: 10rpx;
  266. }
  267. .title {
  268. display: flex;
  269. justify-content: space-between;
  270. margin-bottom: 10rpx;
  271. }
  272. .bottom {
  273. padding-top: 27rpx;
  274. padding-bottom: 7rpx;
  275. border-top: 1rpx solid #EEEEEE;
  276. display: flex;
  277. justify-content: flex-end;
  278. align-items: center;
  279. }
  280. .btnBox {
  281. display: flex;
  282. align-items: center;
  283. margin-left: 40rpx;
  284. }
  285. .btnImg {
  286. width: 24rpx;
  287. height: 24rpx;
  288. }
  289. .btn {
  290. color: #666666;
  291. font-size: 24rpx;
  292. margin-left: 5rpx;
  293. }
  294. .noMore {
  295. text-align: center;
  296. line-height: 50rpx;
  297. color: #999999;
  298. font-size: 28rpx;
  299. }
  300. </style>