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

173 lines
3.7 KiB

8 months ago
8 months ago
6 months ago
6 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
6 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="pad">
  4. <view class="searcBox">
  5. <searchRow placeholder="搜索考场名称、车牌号" @searchFn="searchFn" ref="searchRef"/>
  6. </view>
  7. <view class="navs">
  8. <view class="nav" v-for="(item,index) in navList" :key="index" :class="{active: currentNav===item.id}" @click="changeNav(item)">{{ item.text }}</view>
  9. </view>
  10. <view class="recordTotal" ><text v-if="total">{{total}}条记录</text></view>
  11. <view class="card" v-for="(item,index) in list" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail?id='+item.id)">
  12. <opera :item="item"></opera>
  13. </view>
  14. <view style="padding: 10rpx 0 20rpx 0;" v-if="list.length">
  15. <u-loadmore :status="status" />
  16. </view>
  17. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import imitate from './comp/imitate'
  23. import opera from './comp/opera'
  24. import examin from './comp/examin'
  25. import { examSimulationRecord, simulationPage, masterPage } from '@/config/api.js'
  26. export default {
  27. components: { imitate, opera, examin},
  28. data() {
  29. return {
  30. navList: [
  31. {text: '全部', id: -1},
  32. {text: '已签到', id: 1},
  33. {text: '已签退', id: 2},
  34. {text: '已取消', id: 9},
  35. {text: '已过期', id: 3},
  36. ],
  37. // 0:未签到,1:已签到,2:已签退,3:旷课,9:已取消
  38. currentTab: 2,
  39. currentNav: 0,
  40. params: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '0',studentId: '', keyWord: ''},
  41. list: [{id: 1}],
  42. total: 20,
  43. status: 'loading'
  44. }
  45. },
  46. onLoad(options) {
  47. this.params.studentId = this.studentId
  48. },
  49. onShow() {
  50. this.inintList()
  51. },
  52. onReachBottom() {
  53. if(this.total>this.list.length) {
  54. this.masterPageFn()
  55. }
  56. },
  57. onPullDownRefresh() {
  58. this.inintList()
  59. },
  60. methods: {
  61. inintList(type) {
  62. this.params.pageNo = 1
  63. this.list = []
  64. this.total = 0
  65. this.masterPageFn()
  66. },
  67. changeNav(item) {
  68. this.currentNav = item.id
  69. this.list = []
  70. this.params.pageNo = 1
  71. if(item.id==-1) {
  72. this.params.status = ''
  73. }else {
  74. this.params.status = this.currentNav
  75. }
  76. this.inintList()
  77. },
  78. // 实操预约
  79. async masterPageFn() {
  80. let obj = {}
  81. for(let k in this.params) {
  82. if(this.params[k]!=='') {
  83. obj[k] = this.params[k]
  84. }
  85. }
  86. const {data: res} = await masterPage(obj)
  87. this.params.pageNo ++
  88. this.list.push(...res.list)
  89. this.total = res.total
  90. if(this.list.length>=this.total) this.status = 'nomore'
  91. },
  92. // 搜索
  93. searchFn(val) {
  94. this.params.keyWord = val
  95. this.inintList()
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .searcBox {
  102. margin: 0 0 10rpx 0;
  103. }
  104. .card {
  105. padding: 0 24rpx;
  106. margin-bottom: 20rpx;
  107. }
  108. .tabs {
  109. display: flex;
  110. width: 100%;
  111. height: 72rpx;
  112. background: #FFFFFF;
  113. border-radius: 16rpx;
  114. margin-top: 20rpx;
  115. .tab {
  116. flex: 1;
  117. text-align: center;
  118. line-height: 72rpx;
  119. color: #ADADAD;
  120. &.active {
  121. background: rgba(25,137,250,0.1);
  122. border-radius: 16rpx;
  123. border: 2rpx solid #1989FA;
  124. color: $themC;
  125. font-weight: 600;
  126. }
  127. }
  128. }
  129. .navs {
  130. display: flex;
  131. justify-content: space-between;
  132. color: #fff;
  133. font-size: 28rpx;
  134. color: $themC;
  135. .nav {
  136. height: 80rpx;
  137. line-height: 80rpx;
  138. padding: 0 20rpx;
  139. &.active {
  140. font-weight: 500;
  141. position: relative;
  142. &::before {
  143. position: absolute;
  144. left: 50%;
  145. transform: translateX(-50%);
  146. bottom: 0;
  147. content: '';
  148. width: 56rpx;
  149. height: 6rpx;
  150. background: $themC;
  151. border-radius: 3rpx;
  152. }
  153. }
  154. }
  155. }
  156. .recordTotal {
  157. font-size: 24rpx;
  158. padding: 20rpx 0 20rpx 0;
  159. text-align: right;
  160. }
  161. .pad {
  162. padding-bottom: 40rpx;
  163. }
  164. </style>