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

155 lines
3.4 KiB

8 months ago
8 months ago
6 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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: 10},
  28. {text: '待付款',id: 0},
  29. {text: '退款',id: 30},
  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: 10,
  40. orderType: 1,
  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. .pageBg {
  104. width: 100vw;
  105. overflow: hidden;
  106. }
  107. .card {
  108. padding: 0 24rpx;
  109. margin-bottom: 20rpx;
  110. }
  111. .navs {
  112. display: flex;
  113. justify-content: space-between;
  114. color: #fff;
  115. font-size: 28rpx;
  116. padding: 10rpx 30rpx 20rpx 30rpx;
  117. color: $themC;
  118. background: #fff;
  119. .nav {
  120. height: 80rpx;
  121. line-height: 80rpx;
  122. padding: 0 20rpx;
  123. flex: 1;
  124. text-align: center;
  125. &.active {
  126. font-weight: 500;
  127. position: relative;
  128. &::before {
  129. position: absolute;
  130. left: 50%;
  131. transform: translateX(-50%);
  132. bottom: 6rpx;
  133. content: '';
  134. width: 56rpx;
  135. height: 6rpx;
  136. background: $themC;
  137. border-radius: 3rpx;
  138. }
  139. }
  140. }
  141. }
  142. .tabCon {
  143. padding: 20rpx 0 0 0;
  144. }
  145. .recordTotal {
  146. font-size: 24rpx;
  147. padding: 0rpx 0 28rpx 0;
  148. text-align: right;
  149. }
  150. </style>