myAppraise.vue 7.0 KB

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