myAppraise.vue 6.3 KB

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