洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
3.4 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="navs">
  4. <view class="nav" v-for="(item,index) in tabList" :key="index" :class="{active: params.orderStatus==item.id}" @click="changeTab(item)">{{ item.text }}</view>
  5. </view>
  6. <view class="pad">
  7. <view class="tabCon">
  8. <view class="card" v-for="(item,index) in list" :key="index" @click="goDetail(item)">
  9. <opera :item="item"></opera>
  10. </view>
  11. </view>
  12. <view style="padding-bottom: 20rpx;" v-if="list.length>2">
  13. <u-loadmore :status="status" />
  14. </view>
  15. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import opera from './comp/opera'
  21. import { applyOrderPage, refundPage } from '@/config/api.js'
  22. export default {
  23. components: { opera },
  24. data() {
  25. return {
  26. tabList: [
  27. {text: '已完成',id: 1},
  28. {text: '待付款',id: 0},
  29. {text: '退款',id: -1},
  30. ],//0:待支付,1:已支付,-1:已取消,2:支付失败
  31. navList: [
  32. {text: '全部', id: 0},
  33. {text: '学费', id: 1},
  34. {text: '考场模拟费', id: 3}
  35. ],//1:驾校培训费用,2:理科培训费用,3:考场适应性费用,4:额外学时购买
  36. params: {
  37. pageNo: 1,
  38. pageSize: 20,
  39. orderStatus: 1,
  40. orderType: 0,
  41. sercheValue: ''
  42. },
  43. list: [],
  44. total: 0,
  45. status: 'loading'
  46. }
  47. },
  48. onLoad() {
  49. this.params.studentId = this.studentId
  50. this.applyOrderPageFn()
  51. },
  52. onPullDownRefresh() {
  53. this.initList()
  54. },
  55. onReachBottom() {
  56. if(this.total>this.list.length) {
  57. this.applyOrderPageFn()
  58. }
  59. },
  60. methods: {
  61. goDetail(item) {
  62. if(this.params.orderStatus==3) {
  63. this.$goPage('/pages/mineEntry/myOrder/detail/detail?refundId='+ item.id+'&orderId='+item.orderId)
  64. }else {
  65. this.$goPage('/pages/mineEntry/myOrder/detail/detail?orderId='+ item.orderId)
  66. }
  67. },
  68. searchFn(val) {
  69. this.params.sercheValue = val
  70. this.initList()
  71. },
  72. changeTab(item) {
  73. this.params.orderStatus = item.id
  74. this.initList()
  75. },
  76. changeNav(item) {
  77. this.params.orderType = item.id
  78. this.initList()
  79. },
  80. initList() {
  81. this.params.pageNo = 1
  82. this.list = []
  83. this.status = 'loading'
  84. this.applyOrderPageFn()
  85. },
  86. async applyOrderPageFn() {
  87. let obj = Object.assign({},this.params)
  88. if(obj.orderType==0) delete obj.orderType
  89. if(!obj.sercheValue) delete obj.sercheValue
  90. let {data: res} = await applyOrderPage(obj)
  91. this.list.push(...res.list)
  92. this.params.pageNo ++
  93. this.total = res.total
  94. if(this.total==this.list.length) {
  95. this.status = 'nomore'
  96. }
  97. uni.stopPullDownRefresh()
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .card {
  104. padding: 0 24rpx;
  105. margin-bottom: 20rpx;
  106. }
  107. .navs {
  108. display: flex;
  109. justify-content: space-between;
  110. color: #fff;
  111. font-size: 28rpx;
  112. padding: 10rpx 30rpx 20rpx 30rpx;
  113. color: $themC;
  114. background: #fff;
  115. .nav {
  116. height: 80rpx;
  117. line-height: 80rpx;
  118. padding: 0 20rpx;
  119. flex: 1;
  120. text-align: center;
  121. &.active {
  122. font-weight: 500;
  123. position: relative;
  124. &::before {
  125. position: absolute;
  126. left: 50%;
  127. transform: translateX(-50%);
  128. bottom: 6rpx;
  129. content: '';
  130. width: 56rpx;
  131. height: 6rpx;
  132. background: $themC;
  133. border-radius: 3rpx;
  134. }
  135. }
  136. }
  137. }
  138. .tabCon {
  139. padding: 20rpx 0 0 0;
  140. }
  141. .recordTotal {
  142. font-size: 24rpx;
  143. padding: 0rpx 0 28rpx 0;
  144. text-align: right;
  145. }
  146. </style>