coalitionList.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="container-order">
  3. <navbar :config="config" backColor="#666666"></navbar>
  4. <view class="top" :style="{'top': sticky + 'px'}">
  5. <view class="tabs">
  6. <view class="tab" :class="{'activeTab': currentTab == index}" v-for="(item, index) in tabs" :key="item.i"
  7. @click="changeTab(index)">
  8. <view class="">{{item.label}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. <view style="height: 90rpx;"></view>
  13. <view class="list" v-if="list.length">
  14. <z-order-list :list="list" :isMine="true"></z-order-list>
  15. <u-loadmore :status="status" />
  16. </view>
  17. <noData v-if="list.length<=0"></noData>
  18. </view>
  19. </template>
  20. <script>
  21. import zOrderList from '@/pages/workbench/z-order-list.vue';
  22. import noData from "@/components/noData/nodata.vue"
  23. export default {
  24. components: {
  25. zOrderList,
  26. noData
  27. },
  28. data() {
  29. return {
  30. config: {
  31. back: true,
  32. title: '订单列表',
  33. color: '#1A1A1A',
  34. backgroundColor: [1, "#fff"],
  35. statusBarFontColor: '#1A1A1A',
  36. leftSlot: true,
  37. backPage: '/pages/order/index'
  38. },
  39. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  40. sticky: uni.getSystemInfoSync().statusBarHeight + 44,
  41. tabs: [{
  42. id: '-1',
  43. i: 0,
  44. label: '全部'
  45. },
  46. {
  47. id: '0',
  48. i: 1,
  49. label: '待评价'
  50. },
  51. {
  52. id: '1',
  53. i: 2,
  54. label: '已评价'
  55. }
  56. ],
  57. currentTab: 0,
  58. list: [],
  59. comment: '-1',
  60. params: {
  61. page: 1,
  62. limit: 10
  63. },
  64. totalPage: 0,
  65. currPage: 1,
  66. refresh: false,
  67. status: 'more',
  68. }
  69. },
  70. onShow() {
  71. this.getOrderlist(true)
  72. },
  73. onPullDownRefresh() {
  74. this.getOrderlist(true)
  75. setTimeout(() => {
  76. uni.stopPullDownRefresh();
  77. }, 1000);
  78. },
  79. onReachBottom() {
  80. if (this.currPage == this.totalPage) {
  81. return this.status = 'nomore';
  82. } else {
  83. this.getOrderlist(false)
  84. }
  85. },
  86. methods: {
  87. changeTab(i) {
  88. if (this.currentTab == i) {
  89. return false
  90. }
  91. this.currentTab = i
  92. this.comment = this.tabs[i].id
  93. this.getOrderlist(true)
  94. },
  95. getOrderlist(refresh) {
  96. this.params.page = refresh ? 1 : this.params.page
  97. if (this.currPage == this.totalPage) {
  98. this.status = 'nomore';
  99. }
  100. this.$http.get('/offlineorder/my_page', {
  101. comment: this.comment,
  102. ...this.params
  103. }).then(res => {
  104. if (res.code == 200) {
  105. if (this.params.page == 1) this.list = []
  106. this.list = [...this.list, ...res.page.list]
  107. this.totalPage = res.page.totalPage
  108. this.currPage = res.page.currPage
  109. this.params.page++
  110. if (this.currPage == this.totalPage) return this.status = 'nomore';
  111. }
  112. })
  113. },
  114. orderDetail() {
  115. uni.navigateTo({
  116. url: `/pages/workbench/order/detail`
  117. })
  118. },
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .container-order {
  124. .top {
  125. position: fixed;
  126. width: 100%;
  127. height: 90rpx;
  128. font-size: 32rpx;
  129. border-bottom: 1rpx solid #f2f2f2;
  130. font-family: PingFang SC, PingFang SC-Bold;
  131. font-weight: 700;
  132. color: #1a1a1a;
  133. z-index: 9;
  134. background-color: #fff;
  135. .tabs {
  136. height: 100%;
  137. display: flex;
  138. align-items: center;
  139. justify-content: space-around;
  140. .tab {
  141. line-height: 90rpx;
  142. height: 100%;
  143. position: relative;
  144. }
  145. .activeTab {
  146. color: #FA6138;
  147. &::after {
  148. display: block;
  149. content: '';
  150. position: absolute;
  151. bottom: 0;
  152. width: 100%;
  153. height: 4rpx;
  154. background: #FA6138;
  155. border-radius: 2rpx;
  156. }
  157. }
  158. }
  159. }
  160. .list {
  161. padding: 0 30rpx 100rpx;
  162. .order-item {
  163. height: 130rpx;
  164. display: flex;
  165. justify-content: space-between;
  166. align-items: center;
  167. border-bottom: 1rpx solid #f2f2f2;
  168. .item-info {
  169. font-size: 28rpx;
  170. font-family: PingFang SC, PingFang SC-Regular;
  171. font-weight: 400;
  172. color: #808080;
  173. .order-num {
  174. margin-bottom: 10rpx;
  175. .num {
  176. color: #1A1A1A;
  177. }
  178. }
  179. .order-time-price {
  180. font-size: 24rpx;
  181. .time {
  182. margin-right: 89rpx;
  183. }
  184. }
  185. }
  186. .item-icon {
  187. width: 32rpx;
  188. height: 32rpx;
  189. transform: rotate(-90deg);
  190. flex-shrink: 0;
  191. }
  192. }
  193. }
  194. }
  195. </style>