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