list.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="content">
  3. <view class="tab-menu">
  4. <view :class="orderState==0?'tab-item active':'tab-item'" @click="orderStatus(0)">全部</view>
  5. <view :class="orderState==1?'tab-item active':'tab-item'" @click="orderStatus(1)">已受理</view>
  6. <view :class="orderState==2?'tab-item active':'tab-item'" @click="orderStatus(2)">已回复</view>
  7. </view>
  8. <scroll-view class="order-body" scroll-y scroll-with-animation @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower" upper-threshold="80">
  9. <view class="order-list" v-if="orderList.length == 0 && orderData.loading">
  10. <view class="order-item" v-for="(item,indx) in 3" :key="indx">
  11. <view class="item-header">
  12. <view class="item-store" style="flex: 1;"><view class="skeleton-line animate"></view></view>
  13. </view>
  14. <view class="item-goods">
  15. <view class="image">
  16. <view class="skeleton-line animate"></view>
  17. </view>
  18. <view class="info">
  19. <view class="title">
  20. <view class="skeleton-line animate"></view>
  21. </view>
  22. <view class="tags">
  23. <view class="skeleton-line animate"></view>
  24. </view>
  25. <view class="tags">
  26. <view class="skeleton-line animate"></view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="mt15">
  31. <view class="skeleton-line animate"></view>
  32. </view>
  33. <view class="item-footer mt15">
  34. <view class="footer-left" style="width: 30%;">
  35. <view class="skeleton-line animate"></view>
  36. </view>
  37. <view class="footer-group-btn" style="width: 30%;">
  38. <view class="skeleton-line animate"></view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="order-list" v-else>
  44. <view class="empty-body" v-if="orderList.length == 0">
  45. <view class="imgs">
  46. <image src="/static/image/empty.png" mode="widthFix"></image>
  47. <view class="tip">没有更多数据啦~</view>
  48. </view>
  49. </view>
  50. <view v-else>
  51. <navigator hover-class="none" :url="'/pages/complaint/detail?id='+item.id" class="order-item" v-for="(item,indx) in orderList" :key="indx">
  52. <view class="order-info">
  53. <view class="info-item">
  54. <view class="name">订单编号</view>
  55. <view class="item-content">{{ item.order_sn }}</view>
  56. </view>
  57. <view class="info-item">
  58. <view class="name">投诉事项</view>
  59. <view class="item-content">{{ item.question }}</view>
  60. </view>
  61. <view class="order-status" v-if="item.status == 0">
  62. <image src="https://jymini.oss-cn-guangzhou.aliyuncs.com/mini/complaint-2.svg"></image>
  63. </view>
  64. <view class="order-status" v-if="item.status == 1">
  65. <image src="https://jymini.oss-cn-guangzhou.aliyuncs.com/mini/complaint-3.svg"></image>
  66. </view>
  67. </view>
  68. <view class="order-footer">
  69. <view class="footer-l">{{item.create_at}}</view>
  70. <view class="footer-r">
  71. <view class="btn danger">查看详情</view>
  72. </view>
  73. </view>
  74. </navigator>
  75. </view>
  76. </view>
  77. <view class="line-height"></view>
  78. </scroll-view>
  79. </view>
  80. </template>
  81. <script>
  82. var app;
  83. const pageSize = 10;
  84. export default {
  85. data() {
  86. return {
  87. orderState:0,
  88. poiId:0,
  89. orderData:{
  90. size:pageSize,
  91. page:1,
  92. loading:true,
  93. isDone:false
  94. },
  95. orderList:[],
  96. }
  97. },
  98. onLoad({poi}) {
  99. app = this;
  100. app.poiId = poi;
  101. app.getOrder()
  102. },
  103. methods: {
  104. scrolltoupper(){},
  105. scrolltolower(e){
  106. if (app.orderData.isDone || app.orderList.length == 0) return ;
  107. app.getOrder()
  108. },
  109. toDetail(order){
  110. uni.navigateTo({
  111. url:"/pages/order/detail?order="+order
  112. })
  113. },
  114. orderStatus(state) {
  115. app.orderState = state
  116. app.orderList = [];
  117. app.orderData = {
  118. size:pageSize,
  119. page:1,
  120. loading:false,
  121. isDone:false
  122. };
  123. app.getOrder()
  124. },
  125. async getOrder(){
  126. app.orderData.loading = true;
  127. var formData = {};
  128. formData.poi = app.poiId;
  129. formData.page = app.orderData.page;
  130. formData.size = app.orderData.size;
  131. formData.status = app.orderState;
  132. var resp = await app.$api.complaint.list.get(formData)
  133. app.orderData.loading = false;
  134. if (resp.code == 401) {
  135. app.isLogin = false;
  136. return ;
  137. }
  138. if (resp.code == 0) {
  139. return app.$dialog.showSuccess(resp.msg)
  140. }
  141. app.isLogin = true;
  142. if (resp.data.rows.length > 0) {
  143. app.orderData.page ++;
  144. app.orderList = [...app.orderList,...resp.data.rows];
  145. } else {
  146. app.orderData.isDone = true;
  147. }
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .tab-menu{
  154. height: 80rpx;
  155. line-height: 80rpx;
  156. background-color: #fff;
  157. display: flex;
  158. align-items: center;
  159. font-size: 28rpx;
  160. color: #666;
  161. justify-content: space-around;
  162. .tab-item{
  163. position: relative;
  164. color: $main-text-color;
  165. &.active{
  166. color: $main-color;
  167. font-weight: 700;
  168. &::after{
  169. position: absolute;
  170. content: "";
  171. width: 30%;
  172. left: 35%;
  173. height: 4rpx;
  174. bottom: 0;
  175. background-color: $main-color;
  176. }
  177. }
  178. }
  179. }
  180. .order-body{
  181. height: 0;
  182. flex: 1;
  183. }
  184. .content{
  185. position: fixed;
  186. z-index: 1;
  187. top: 0;
  188. left: 0;
  189. bottom: 0;
  190. right: 0;
  191. background-color: #ededed;
  192. display: flex;
  193. flex-direction: column;
  194. .line-height{
  195. height: 40rpx;
  196. width: 100%;
  197. }
  198. }
  199. .empty-body{
  200. display: flex;align-items: center;justify-content: center;flex-direction: column;height: calc(100vh - 100upx);
  201. .imgs{
  202. text-align: center;font-size: 28upx;color: #666;
  203. image{height: 160upx;width: 160upx;}
  204. .tip{margin-top: 20upx;}
  205. }
  206. .re-btn{
  207. width: 180upx;
  208. height: 80upx;
  209. line-height: 80upx;
  210. text-align: center;
  211. font-size: 28upx;
  212. color: #fff;
  213. background-color: $main-color;
  214. border-radius: 10upx;
  215. margin-top: 60upx;
  216. }
  217. }
  218. .order-item{background-color: #fff;padding: 20upx;border-radius: 10upx;width: calc(100% - 40upx);margin: 20upx auto;}
  219. .order-item .item-header{display: flex;align-items: center;height: 60upx;line-height: 60upx;}
  220. .order-item .item-header .order-status{font-size: 28upx;color: #f00;}
  221. .order-item .item-header .order-status.success{color: #007aff;}
  222. .order-item .item-header .order-time{font-size: 24upx;color: #999;margin-left: auto;margin-right: 0;}
  223. .order-footer{display: flex;text-align: right;padding: 20upx 0;border-top: 2upx solid #f8f8f8;align-items: center;margin-top: 20rpx;}
  224. .order-footer .footer-l{font-size: 28upx;color: #666;}
  225. .order-footer .footer-r{display: flex;margin-left: auto;margin-right: 0;flex: 1;justify-content: end;gap: 20upx;}
  226. .order-footer .btn{width: 160upx;height: 60upx;line-height: 60upx;text-align: center;border: 2upx solid #ccc;color: #333;font-size: 28upx;border-radius: 10upx;}
  227. .order-footer .btn.danger{border:2upx solid #f00;color: #f00;}
  228. .order-footer .btn.blue{border:2upx solid #007aff;color: #007aff;}
  229. .order-info{position: relative;}
  230. .order-info .order-status{position: absolute;right: 20upx;top: 20upx;}
  231. .order-info .order-status image{width: 120upx;height: 120upx;transform: rotate(45deg);}
  232. .order-info .name{font-size: 28upx;color: #666;padding: 20upx 0;}
  233. .order-info .item-content{font-size: 28upx;color: #000;}
  234. .order-info .item-content .order-status{font-size: 28upx;color: #f00;}
  235. .order-info .item-content .order-status.success{color: #007aff;}
  236. </style>