ShopAppraiseList.vue 7.1 KB

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