洛阳学员端
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.

163 lines
3.6 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
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: 3},
  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: [{id: 1}],
  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. if(this.params.orderStatus==3) {
  91. delete obj.orderStatus
  92. if(obj.orderType) {
  93. obj.feeType = obj.orderType
  94. delete obj.orderType
  95. }
  96. var {data: res} = await refundPage(obj)
  97. }else {
  98. var {data: res} = await applyOrderPage(obj)
  99. }
  100. this.list.push(...res.list)
  101. this.params.pageNo ++
  102. this.total = res.total
  103. if(this.total==this.list.length) {
  104. this.status = 'nomore'
  105. }
  106. uni.stopPullDownRefresh()
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .card {
  113. padding: 0 24rpx;
  114. margin-bottom: 20rpx;
  115. }
  116. .navs {
  117. display: flex;
  118. justify-content: space-between;
  119. color: #fff;
  120. font-size: 28rpx;
  121. padding: 10rpx 30rpx 20rpx 30rpx;
  122. color: $themC;
  123. background: #fff;
  124. .nav {
  125. height: 80rpx;
  126. line-height: 80rpx;
  127. padding: 0 20rpx;
  128. flex: 1;
  129. text-align: center;
  130. &.active {
  131. font-weight: 500;
  132. position: relative;
  133. &::before {
  134. position: absolute;
  135. left: 50%;
  136. transform: translateX(-50%);
  137. bottom: 6rpx;
  138. content: '';
  139. width: 56rpx;
  140. height: 6rpx;
  141. background: $themC;
  142. border-radius: 3rpx;
  143. }
  144. }
  145. }
  146. }
  147. .tabCon {
  148. padding: 20rpx 0 0 0;
  149. }
  150. .recordTotal {
  151. font-size: 24rpx;
  152. padding: 0rpx 0 28rpx 0;
  153. text-align: right;
  154. }
  155. </style>