|
|
@ -3,7 +3,7 @@ |
|
|
|
<topNavbar title="我的预约"></topNavbar> |
|
|
|
<view class="pad"> |
|
|
|
<view class="searcBox"> |
|
|
|
<searchRow placeholder="搜索考场名称、车牌号"/> |
|
|
|
<searchRow placeholder="搜索考场名称、车牌号" @searchFn="searchFn" ref="searchRef"/> |
|
|
|
</view> |
|
|
|
<view class="tabs"> |
|
|
|
<view class="tab" v-for="(item,index) in tabList" :key="index" :class="{active: currentTab==item.id}" @click="changeTab(item)">{{ item.text }}</view> |
|
|
@ -14,7 +14,7 @@ |
|
|
|
<view class="recordTotal" v-if="total">{{total}}条记录</view> |
|
|
|
|
|
|
|
<view class="tabCon" v-show="currentTab==1"> |
|
|
|
<view class="card" v-for="(item,index) in examList" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail')"> |
|
|
|
<view class="card" v-for="(item,index) in list" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail?type=1&id='+item.id)"> |
|
|
|
<imitate :item="item"></imitate> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -26,11 +26,15 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="tabCon" v-if="currentTab==3"> |
|
|
|
<view class="card" v-for="(item,index) in examList" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail?type=3&id='+item.id)"> |
|
|
|
<view class="card" v-for="(item,index) in list" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail?type=3&id='+item.id)"> |
|
|
|
<examin :item="item"></examin> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view style="padding: 10rpx 0 20rpx 0;" v-if="list.length"> |
|
|
|
<u-loadmore :status="status" /> |
|
|
|
</view> |
|
|
|
<nodata v-if="!list.length&&status=='nomore'"></nodata> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
@ -60,20 +64,24 @@ |
|
|
|
// 0:未签到,1:已签到,2:已签退,3:旷课,9:已取消 |
|
|
|
currentTab: 3, |
|
|
|
currentNav: 0, |
|
|
|
examParams: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '0',studentId: ''}, |
|
|
|
examList: [], |
|
|
|
total: 20 |
|
|
|
params: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '0',studentId: '', keyWord: ''}, |
|
|
|
list: [], |
|
|
|
total: 20, |
|
|
|
status: 'loading' |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
if(options.currentTab) this.currentTab = options.currentTab |
|
|
|
this.examParams.studentId = this.userId |
|
|
|
this.params.studentId = this.vuex_userInfo.id |
|
|
|
this.inintList() |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
this.inintList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
inintList() { |
|
|
|
this.examParams.pageNo = 1 |
|
|
|
this.examList = [] |
|
|
|
this.params.pageNo = 1 |
|
|
|
this.list = [] |
|
|
|
if(this.currentTab==3) { |
|
|
|
this.examSimulationRecordFn() |
|
|
|
}else if(this.currentTab==1) { |
|
|
@ -81,33 +89,48 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
changeTab(item) { |
|
|
|
this.params.keyWord = '' |
|
|
|
this.currentTab = item.id |
|
|
|
this.$refs.searchRef.keyword = '' |
|
|
|
this.inintList() |
|
|
|
}, |
|
|
|
changeNav(item) { |
|
|
|
this.currentNav = item.id |
|
|
|
this.examList = [] |
|
|
|
this.examParams.pageNo = 1 |
|
|
|
this.list = [] |
|
|
|
this.params.pageNo = 1 |
|
|
|
if(item.id==-1) { |
|
|
|
this.examParams.status = '' |
|
|
|
this.params.status = '' |
|
|
|
}else { |
|
|
|
this.examParams.status = this.currentNav |
|
|
|
this.params.status = this.currentNav |
|
|
|
} |
|
|
|
this.examSimulationRecordFn() |
|
|
|
this.inintList() |
|
|
|
}, |
|
|
|
// 考场预约 |
|
|
|
async examSimulationRecordFn() { |
|
|
|
const {data: res} = await examSimulationRecord(this.examParams) |
|
|
|
this.examParams.pageNo ++ |
|
|
|
this.examList.push(...res.list) |
|
|
|
const {data: res} = await examSimulationRecord(this.params) |
|
|
|
this.params.pageNo ++ |
|
|
|
this.list.push(...res.list) |
|
|
|
this.total = res.total |
|
|
|
if(this.list.length>=this.total) this.status = 'nomore' |
|
|
|
}, |
|
|
|
// 模拟器预约记录 |
|
|
|
async simulationPageFn() { |
|
|
|
const {data: res} = await simulationPage(this.examParams) |
|
|
|
this.examParams.pageNo ++ |
|
|
|
this.examList.push(...res.list) |
|
|
|
let obj = {} |
|
|
|
for(let k in this.params) { |
|
|
|
if(this.params[k]!=='') { |
|
|
|
obj[k] = this.params[k] |
|
|
|
} |
|
|
|
} |
|
|
|
const {data: res} = await simulationPage(obj) |
|
|
|
this.params.pageNo ++ |
|
|
|
this.list.push(...res.list) |
|
|
|
this.total = res.total |
|
|
|
if(this.list.length>=this.total) this.status = 'nomore' |
|
|
|
}, |
|
|
|
// 搜索 |
|
|
|
searchFn(val) { |
|
|
|
this.params.keyWord = val |
|
|
|
this.inintList() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|