myAppraise.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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. <view class="leftView">
  8. <image :src='item.PhotoPath' v-if="item.PhotoPath" class="storeImg"></image>
  9. <image src="../../static/img/pic_def_ava.png" mode="" class="storeImg" v-else></image>
  10. </view>
  11. <view class="rightView">
  12. <!-- 第一行 -->
  13. <view class="firstView">
  14. <view class="shopName">{{item.ShopName}}</view>
  15. <!-- 时间截取 -->
  16. <!-- <view class="time">2021-9-05</view> -->
  17. <view class="time">{{item.CreateTime.slice(0,item.CreateTime.length-8)}}</view>
  18. </view>
  19. <!-- 第2行 -->
  20. <view class="secondView">
  21. <!-- 星星 -->
  22. <uni-rate :value="item.Overallevaluation" :max="5" color="#EEEEEE" active-color="#FF4F00"
  23. :size="16" :margin="4" :readonly="true" />
  24. <image src="../../static/img/icon_del.png" class="deleteBtn"
  25. @click.stop="deleteItem(item, index)"></image>
  26. </view>
  27. <view class="thirdView">
  28. <view class="count">服务态度:{{item.Serviceevaluation}}</view>
  29. <view class="count">施工质量:{{item.Constructionevaluation}}</view>
  30. <view class="count">店面环境:{{item.Storeevaluation}}</view>
  31. </view>
  32. <view class="contentMes">{{item.EContent}}</view>
  33. <!-- 照片 -->
  34. <view class="imgBg">
  35. <view v-for="(itemImg,indexImg) in item.imgs" :key="indexImg">
  36. <image :src="itemImg.imageUrl" class="img"
  37. @click.stop="previewImage(itemImg.imageUrl,item.imgs)"></image>
  38. </view>
  39. </view>
  40. <!-- 商家回复 -->
  41. <view class="writeBack" v-if="item.ReplyContent">商家回复:{{item.ReplyContent}}</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. }
  65. },
  66. onLoad(opt) {
  67. },
  68. onShow() {
  69. this.itemData=[]
  70. this.page = 1
  71. this.getItemData()
  72. },
  73. methods: {
  74. // goDetail(item){
  75. // uni.navigateTo({
  76. // url:'myAppraiseDetail?id='+item.SheetID
  77. // })
  78. // },
  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 = 'worldKeepCar/keepCarMy/deleteMyTMEvaluate',
  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 = 'worldKeepCar/keepCarMy/listTMEvaluatePage',
  128. params = {
  129. page: this.page,
  130. limit: 20,
  131. }
  132. this.$http(url, params, 'GET').then(res => {
  133. uni.hideLoading();
  134. var list = res.data.Items
  135. // 处理 undefined和null转为空白字符串
  136. list.forEach((item, index) => {
  137. for (const key in item) {
  138. item[key] = this.$praseStrEmpty(item[key])
  139. }
  140. })
  141. if (this.page == 1) {
  142. this.itemData = list
  143. } else {
  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: #FFFFFF;
  171. min-height: 100vh;
  172. }
  173. .item {
  174. display: flex;
  175. justify-content: flex-start;
  176. padding: 0 24rpx;
  177. background-color: #FFFFFF;
  178. }
  179. .leftView {
  180. width: 117rpx;
  181. padding-right: 20rpx;
  182. }
  183. .storeImg {
  184. width: 72rpx;
  185. height: 72rpx;
  186. border-radius: 8rpx;
  187. margin-top: 30rpx;
  188. }
  189. .rightView {
  190. border-bottom: 1rpx #EEEEEE solid;
  191. width: 100vw;
  192. }
  193. .firstView,
  194. .secondView {
  195. display: flex;
  196. justify-content: space-between;
  197. align-items: center;
  198. }
  199. .firstView {
  200. padding-top: 30rpx;
  201. }
  202. .secondView {
  203. padding-top: 12rpx;
  204. padding-bottom: 20rpx;
  205. }
  206. .shopName {
  207. /* padding-top: 30rpx;
  208. padding-bottom: 10rpx; */
  209. font-size: 26rpx;
  210. font-weight: bold;
  211. color: #333333;
  212. }
  213. .time {
  214. font-size: 26rpx;
  215. color: #999999;
  216. }
  217. .deleteBtn {
  218. width: 36rpx;
  219. height: 36rpx;
  220. }
  221. .thirdView{
  222. display: flex;
  223. justify-content: flex-start;
  224. padding-top: 10rpx;
  225. padding-bottom: 20rpx;
  226. }
  227. .count{
  228. font-size: 24rpx;
  229. color: #999999;
  230. margin-right: 20rpx;
  231. }
  232. .contentMes {
  233. font-size: 26rpx;
  234. color: #333333;
  235. line-height: 37rpx;
  236. /* padding-top: 20rpx; */
  237. }
  238. .imgBg {
  239. display: flex;
  240. justify-content: flex-start;
  241. padding: 30rpx 0rpx;
  242. flex-wrap: wrap;
  243. }
  244. .img {
  245. width: 140rpx;
  246. height: 140rpx;
  247. margin-right: 5rpx;
  248. border-radius: 8rpx;
  249. }
  250. .writeBack {
  251. font-size: 26rpx;
  252. color: #666666;
  253. line-height: 37rpx;
  254. padding: 20rpx;
  255. background-color: #F4F5F7;
  256. padding-bottom: 20rpx;
  257. }
  258. .noMore {
  259. text-align: center;
  260. line-height: 50rpx;
  261. color: #999999;
  262. font-size: 28rpx;
  263. }
  264. </style>