分页
This commit is contained in:
parent
480f53e0c6
commit
defbc14180
@ -30,7 +30,13 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
courseList: []
|
||||
courseList: [],
|
||||
|
||||
param:{
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
total:0
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
@ -41,10 +47,11 @@
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
// this.show = true
|
||||
setTimeout(() => {
|
||||
console.log("加载执行");
|
||||
}, 2000)
|
||||
// 触底加载
|
||||
if (this.courseList.length < this.param.total) {
|
||||
this.param.pageNum++
|
||||
this.findCourseList()
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -53,8 +60,20 @@
|
||||
url: `/drivingSchool/system/reservationCourse/applet/getReservationCourseList`,
|
||||
method: 'get'
|
||||
})
|
||||
this.courseList = res.data
|
||||
console.log(this.courseList);
|
||||
if (res.code == 0) {
|
||||
if (this.param.pageNum != 1) {
|
||||
this.courseList = this.courseList.concat(res.data.records)
|
||||
} else {
|
||||
this.courseList = res.data.records
|
||||
}
|
||||
this.param.total = res.data.total
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "网络不佳请稍后再试",
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
goDetails() {
|
||||
uni.navigateTo({
|
||||
|
@ -88,7 +88,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="con">
|
||||
<!-- <u-empty mode="list" v-if="courseList.length == 0"> -->
|
||||
<u-empty mode="list" v-if="!courseList||courseList.length == 0">
|
||||
</u-empty>
|
||||
<view class="f-box" v-for="(item,index) in courseList" :key="index">
|
||||
<view class="f-top">{{item.createTime}}</view>
|
||||
@ -201,14 +201,14 @@
|
||||
url: `/drivingSchool/system/reservationCourse/applet/getReservationCourseList`,
|
||||
method: 'get'
|
||||
})
|
||||
this.courseList = res.data
|
||||
this.courseList = res.data.records
|
||||
},
|
||||
getUserInfo() {
|
||||
request({
|
||||
url: '/jx/auth/getJxInfo',
|
||||
url: '/getJxInfo',
|
||||
method: 'get'
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
if (res.code == 200) {
|
||||
this.schoolInfo = res.data.schoolInfo
|
||||
uni.setStorageSync("roles", res.data.roles)
|
||||
uni.setStorageSync("deptId", res.data.schoolInfo.deptId)
|
||||
@ -220,7 +220,7 @@
|
||||
url: '/drivingSchool/system/reservationCourse/applet/getHomeData',
|
||||
method: 'get'
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
if (res.code == 200) {
|
||||
this.dataInfo = res.data
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user