myAppraiseDetail.vue 6.8 KB

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