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

174 lines
3.8 KiB

8 months ago
8 months ago
6 months ago
6 months ago
8 months ago
8 months ago
6 months ago
8 months ago
8 months ago
8 months ago
8 months ago
6 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: -1,
  40. params: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '',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. if(this.currentNav == item.id) return
  69. this.currentNav = item.id
  70. this.list = []
  71. this.params.pageNo = 1
  72. if(item.id==-1) {
  73. this.params.status = ''
  74. }else {
  75. this.params.status = this.currentNav
  76. }
  77. this.inintList()
  78. },
  79. // 实操预约
  80. async masterPageFn() {
  81. let obj = {}
  82. for(let k in this.params) {
  83. if(this.params[k]!=='') {
  84. obj[k] = this.params[k]
  85. }
  86. }
  87. const {data: res} = await masterPage(obj)
  88. this.params.pageNo ++
  89. this.list.push(...res.list)
  90. this.total = res.total
  91. if(this.list.length>=this.total) this.status = 'nomore'
  92. },
  93. // 搜索
  94. searchFn(val) {
  95. this.params.keyWord = val
  96. this.inintList()
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .searcBox {
  103. margin: 0 0 10rpx 0;
  104. }
  105. .card {
  106. padding: 0 24rpx;
  107. margin-bottom: 20rpx;
  108. }
  109. .tabs {
  110. display: flex;
  111. width: 100%;
  112. height: 72rpx;
  113. background: #FFFFFF;
  114. border-radius: 16rpx;
  115. margin-top: 20rpx;
  116. .tab {
  117. flex: 1;
  118. text-align: center;
  119. line-height: 72rpx;
  120. color: #ADADAD;
  121. &.active {
  122. background: rgba(25,137,250,0.1);
  123. border-radius: 16rpx;
  124. border: 2rpx solid #1989FA;
  125. color: $themC;
  126. font-weight: 600;
  127. }
  128. }
  129. }
  130. .navs {
  131. display: flex;
  132. justify-content: space-between;
  133. color: #fff;
  134. font-size: 28rpx;
  135. color: $themC;
  136. .nav {
  137. height: 80rpx;
  138. line-height: 80rpx;
  139. padding: 0 20rpx;
  140. &.active {
  141. font-weight: 500;
  142. position: relative;
  143. &::before {
  144. position: absolute;
  145. left: 50%;
  146. transform: translateX(-50%);
  147. bottom: 0;
  148. content: '';
  149. width: 56rpx;
  150. height: 6rpx;
  151. background: $themC;
  152. border-radius: 3rpx;
  153. }
  154. }
  155. }
  156. }
  157. .recordTotal {
  158. font-size: 24rpx;
  159. padding: 20rpx 0 20rpx 0;
  160. text-align: right;
  161. }
  162. .pad {
  163. padding-bottom: 40rpx;
  164. }
  165. </style>