myAppraise.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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.PhotoPath' v-if="item.PhotoPath" class="storeImg"></image>
  11. <image src="../../static/img/pic_def_ava.png" mode="" class="storeImg" v-else></image>
  12. <view class="nickName">{{userInfo.nickName?userInfo.nickName:'微信昵称'}}</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. userInfo: '',
  74. }
  75. },
  76. onLoad(opt) {
  77. this.userInfo = uni.getStorageSync("userInfo");
  78. },
  79. onShow() {
  80. this.itemData = []
  81. this.page = 1
  82. this.getItemData()
  83. },
  84. methods: {
  85. goOrder(item) {
  86. uni.navigateTo({
  87. url: 'historyDetail?id=' + 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/listOpenEvaluatePage',
  139. params = {
  140. page: this.page,
  141. limit: 20,
  142. }
  143. this.$http(url, params, 'GET').then(res => {
  144. uni.hideLoading();
  145. var list = res.data.Items
  146. // 处理 undefined和null转为空白字符串
  147. // list.forEach((item, index) => {
  148. // for (const key in item) {
  149. // item[key] = this.$praseStrEmpty(item[key])
  150. // }
  151. // })
  152. if (this.page == 1) {
  153. this.itemData = list
  154. } else {
  155. this.itemData = this.itemData.concat(list)
  156. }
  157. if (list.length < 10) {
  158. this.noMoreShow = false
  159. } else {
  160. this.noMoreShow = true
  161. }
  162. })
  163. },
  164. },
  165. // 下拉刷新 上拉加载更多
  166. onPullDownRefresh() {
  167. this.page = 1
  168. this.getItemData()
  169. setTimeout(function() {
  170. uni.stopPullDownRefresh();
  171. }, 1000);
  172. },
  173. onReachBottom() {
  174. this.page++;
  175. this.getItemData()
  176. },
  177. }
  178. </script>
  179. <style scoped>
  180. .content {
  181. background: #f4f5f7;
  182. min-height: 100vh;
  183. padding-top: 20rpx;
  184. padding-bottom: 60rpx;
  185. }
  186. .item {
  187. border-radius: 10rpx;
  188. padding: 20rpx;
  189. background-color: #FFFFFF;
  190. margin: 0 24rpx 20rpx;
  191. }
  192. .firstView,
  193. .secondView {
  194. display: flex;
  195. justify-content: space-between;
  196. align-items: center;
  197. }
  198. .left {
  199. display: flex;
  200. align-items: center;
  201. }
  202. .storeImg {
  203. width: 56rpx;
  204. height: 56rpx;
  205. border-radius: 8rpx;
  206. margin-right: 10rpx;
  207. }
  208. .nickName {
  209. font-weight: 500;
  210. font-size: 26rpx;
  211. color: #333333;
  212. }
  213. .firstView {
  214. margin-bottom: 24rpx;
  215. }
  216. .time {
  217. font-size: 26rpx;
  218. color: #999999;
  219. }
  220. .fen {
  221. font-size: 22rpx;
  222. color: #999999;
  223. }
  224. .count {
  225. font-size: 22rpx;
  226. color: #999999;
  227. margin-right: 20rpx;
  228. }
  229. .thirdView {
  230. display: flex;
  231. justify-content: flex-start;
  232. padding-top: 10rpx;
  233. padding-bottom: 20rpx;
  234. }
  235. .contentMes {
  236. font-size: 26rpx;
  237. color: #333333;
  238. line-height: 37rpx;
  239. padding: 16rpx 0;
  240. }
  241. .imgBg {
  242. display: flex;
  243. justify-content: flex-start;
  244. padding: 20rpx 0rpx;
  245. flex-wrap: wrap;
  246. }
  247. .img {
  248. width: 150rpx;
  249. height: 150rpx;
  250. margin-right: 20rpx;
  251. border-radius: 8rpx;
  252. }
  253. .img4R {
  254. margin-right: 0;
  255. }
  256. .writeBack {
  257. font-size: 26rpx;
  258. color: #666666;
  259. line-height: 37rpx;
  260. padding: 20rpx;
  261. background-color: #F4F5F7;
  262. margin-bottom: 20rpx;
  263. border-radius: 10rpx;
  264. }
  265. .title{
  266. display: flex;
  267. justify-content: space-between;
  268. margin-bottom: 10rpx;
  269. }
  270. .bottom {
  271. padding-top: 27rpx;
  272. padding-bottom: 7rpx;
  273. border-top: 1rpx solid #EEEEEE;
  274. display: flex;
  275. justify-content: flex-end;
  276. align-items: center;
  277. }
  278. .btnBox {
  279. display: flex;
  280. align-items: center;
  281. margin-left: 40rpx;
  282. }
  283. .btnImg {
  284. width: 24rpx;
  285. height: 24rpx;
  286. }
  287. .btn {
  288. color: #666666;
  289. font-size: 24rpx;
  290. margin-left: 5rpx;
  291. }
  292. .noMore {
  293. text-align: center;
  294. line-height: 50rpx;
  295. color: #999999;
  296. font-size: 28rpx;
  297. }
  298. </style>