学员端小程序
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.

177 lines
4.4 KiB

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