reviews.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <view class="content">
  3. <view class="topView">
  4. <!-- 切换tab -->
  5. <view class="tabBox">
  6. <scroll-view scroll-x="true" class="scroll">
  7. <view class="tabCotn">
  8. <view class="tabLine" :class="{tabactive:tabIndex==0}" @click="tabClick(0)">待点评</view>
  9. <view class="tabLine" :class="{tabactive:tabIndex==1}" @click="tabClick(1)">历史点评</view>
  10. </view>
  11. </scroll-view>
  12. </view>
  13. </view>
  14. <!-- 列表 -->
  15. <view class="shopList">
  16. <view v-for="(item,index) in shopData" :key="index">
  17. <!-- shopBox -->
  18. <view class="shopBox" @click="goAppraise(item)" >
  19. <view class=" shopTop">
  20. <view class="shopName">{{item.ShopName}}</view>
  21. <!-- 订单状态 1 待提交 2 待作业 3 待点评 4 待回复 5 已完成 -->
  22. <view class="type" v-if="item.State == 1">待提交</view>
  23. <view class="type" v-if="item.State == 2">待作业</view>
  24. <view class="type" v-if="item.State == 3">待点评</view>
  25. <view class="type" v-if="item.State == 4">待回复</view>
  26. <view class="type" v-if="item.State == 5">已完成</view>
  27. </view>
  28. <!-- 第2行 -->
  29. <view class="bottomView">
  30. <!-- 运营经理 -->
  31. <view class="manager">{{item.ManagerName}} · {{item.CheckTime}}</view>
  32. <!-- 评分 -->
  33. <view class="score" v-if="item.ShopScore">{{item.ShopScore}}分</view>
  34. </view>
  35. <!-- 点评 -->
  36. <view class="reviews" @click="goReviews(item)">点评</view>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 上拉 加载更多 -->
  41. <view class="noMore" v-if="noMoreShow">没有更多数据</view>
  42. <!-- 无数据空白页 -->
  43. <view class="nodataBox" v-if="shopData.length == 0">
  44. <image src="../../../static/img/pic_empty_def.png" mode="widthFix" class="nodataImg"></image>
  45. <view class="noTxt">暂无数据</view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. tabIndex: 0,
  54. status: '',
  55. shopData: [],
  56. page: 1,
  57. noMoreShow: false,
  58. }
  59. },
  60. onShow() {
  61. this.page = 1
  62. this.getShopData()
  63. },
  64. methods: {
  65. goAppraise(item){
  66. uni.navigateTo({
  67. url:'reportDetail?id='+item.ID
  68. })
  69. },
  70. tabClick(num) {
  71. this.tabIndex = num;
  72. this.status = num;
  73. this.page = 1;
  74. this.getShopData()
  75. },
  76. getShopData() {
  77. uni.showLoading({
  78. title: '加载中'
  79. })
  80. let url = 'accompany/SuperCheckSheet/listMyStayCheckPage',
  81. params = {
  82. page: this.page,
  83. limit: 20,
  84. userEvaState: this.status,
  85. }
  86. this.$http(url, params, 'GET').then(res => {
  87. var list = res.data.Items
  88. // 处理 undefined和null转为空白字符串
  89. list.forEach((item, index) => {
  90. for (const key in item) {
  91. item[key] = this.$praseStrEmpty(item[key])
  92. }
  93. })
  94. if (this.page == 1 && list.length == 0) {
  95. this.noMoreShow = false
  96. } else if (list.length < 20) {
  97. this.noMoreShow = true
  98. }
  99. if (this.page == 1) {
  100. this.shopData = list
  101. } else {
  102. this.shopData = this.shopData.concat(list)
  103. }
  104. })
  105. },
  106. },
  107. // 下拉刷新 上拉加载更多
  108. onPullDownRefresh() {
  109. this.page = 1
  110. this.getShopData()
  111. setTimeout(function() {
  112. uni.stopPullDownRefresh();
  113. }, 1000);
  114. },
  115. onReachBottom() {
  116. this.page++;
  117. this.getShopData()
  118. },
  119. }
  120. </script>
  121. <style>
  122. .content {
  123. background-color: #F4F5F7;
  124. min-height: 100vh;
  125. }
  126. .topView {
  127. width: 100%;
  128. height: 105rpx;
  129. background-color: #FFFFFF;
  130. left: 0rpx;
  131. top: 0rpx;
  132. position: fixed;
  133. z-index: 99;
  134. }
  135. /* #ifdef H5 */
  136. .topView {
  137. top: 44px;
  138. }
  139. /* #endif */
  140. .tabBox {
  141. width: 100%;
  142. }
  143. .tabCotn {
  144. display: flex;
  145. justify-content: space-around;
  146. }
  147. .tabLine {
  148. text-align: center;
  149. color: #3C3C3C;
  150. font-size: 30rpx;
  151. line-height: 104rpx;
  152. }
  153. .tabactive {
  154. color: #FF4F00;
  155. border-bottom: 4rpx solid #FF4F00;
  156. }
  157. .shopList {
  158. background-color: #F4F5F7;
  159. padding: 0rpx 24rpx;
  160. padding-top: 105rpx;
  161. }
  162. .shopBox {
  163. background-color: #FFFFFF;
  164. border-radius: 10rpx;
  165. margin: 20rpx 0rpx;
  166. }
  167. .shopTop {
  168. display: flex;
  169. padding: 30rpx 20rpx 10rpx 20rpx;
  170. justify-content: space-between;
  171. }
  172. .shopName {
  173. font-size: 28rpx;
  174. color: #3C3C3C;
  175. font-weight: bold;
  176. width: 500rpx;
  177. }
  178. .type {
  179. font-size: 28rpx;
  180. color: #FF4F00;
  181. margin-left: 10rpx;
  182. }
  183. .bottomView {
  184. padding: 28rpx 20rpx;
  185. display: flex;
  186. justify-content: space-between;
  187. border-bottom: 1rpx #EEEEEE solid;
  188. }
  189. .manager {
  190. font-size: 24rpx;
  191. color: #666666;
  192. }
  193. .score {
  194. font-size: 28rpx;
  195. color: #B98B5D;
  196. }
  197. .reviews{
  198. width: 150rpx;
  199. height: 56rpx;
  200. color: #FF4F00;
  201. font-size: 28rpx;
  202. line-height: 56rpx;
  203. text-align: center;
  204. border-radius: 28rpx;
  205. border: 2rpx #FF4F00 solid;
  206. position: relative;
  207. right: 20rpx;
  208. top: 20rpx;
  209. }
  210. /* 空白页css */
  211. .nodataBox {
  212. text-align: center;
  213. }
  214. .nodataImg {
  215. width: 400rpx;
  216. padding-top: 290rpx;
  217. }
  218. .noTxt {
  219. font-size: 30rpx;
  220. color: #999999;
  221. padding-top: 50rpx;
  222. }
  223. .noMore {
  224. text-align: center;
  225. line-height: 50rpx;
  226. color: #999999;
  227. font-size: 28rpx;
  228. }
  229. </style>