myAppraiseDetail.vue 7.8 KB

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