diff --git a/pages/teacher/ManageList.vue b/pages/teacher/ManageList.vue
index 737151b..4a97bdd 100644
--- a/pages/teacher/ManageList.vue
+++ b/pages/teacher/ManageList.vue
@@ -33,7 +33,7 @@
手机号:
- {{item.phone || 0 }}
+ {{item.userName || 0 }}
{
- console.log("加载执行");
- }, 2000)
+ // 触底加载
+ if (this.courseList.length < this.param.total) {
+ this.param.pageNum++
+ if (this.optId == 1) {
+ this.findCourseList()
+ }
+ if (this.optId == 2) {
+ this.findCourseLists()
+ }
+ }
},
methods: {
@@ -93,7 +105,19 @@
method: 'get'
})
- this.courseList = res.data
+ 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'
+ })
+ }
},
async findCourseLists() {
let res = await request({
@@ -101,7 +125,19 @@
method: 'get'
})
- this.courseList = res.data
+ 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'
+ })
+ }
},
async reservationCourse(id) {
diff --git a/pages/teacher/StudentManagement.vue b/pages/teacher/StudentManagement.vue
index c80cea5..fd2113f 100644
--- a/pages/teacher/StudentManagement.vue
+++ b/pages/teacher/StudentManagement.vue
@@ -11,7 +11,7 @@
-
+
@@ -64,8 +64,13 @@
},
],
keyword: '',
-
- cadetList: []
+ cadetList: [],
+ param:{
+ pageNum:1,
+ pageSize:10,
+ total:0,
+ type:2
+ }
}
},
onShow() {
@@ -76,48 +81,48 @@
uni.stopPullDownRefresh()
},
onReachBottom() {
- // this.show = true
- setTimeout(() => {
- console.log("加载执行");
- }, 2000)
+ // 触底加载
+ if (this.orderList.length < this.param.total) {
+ this.param.pageNum++
+ this.findCadetList()
+ }
},
methods: {
async getindex(id) {
this.tabindex = id
- if (id == 2) {
- let res = await request({
- url: '/system/pay/stuListByCoachId?type=2',
- method: 'get',
- })
- this.cadetList = res
- }
- if (id == 3) {
- let res = await request({
- url: '/system/pay/stuListByCoachId?type=3',
- method: 'get',
- })
- this.cadetList = res
- }
+ this.param.type = id
+ this.findCadetList()
},
async changeInput() {
- if (this.keyword) {
- let res = await request({
- url: `/system/pay/stuList?name=${this.keyword}`,
- method: 'get'
- })
- this.cadetList = res
- } else {
- this.findCadetList()
- }
+ this.param.pageNum = 1
+ this.param.pageSize = 10
+ this.param.pageNum = 1
+ this.param.name = this.keyword
+ this.cadetList= []
+ this.findCadetList()
},
async findCadetList() {
let res = await request({
url: '/system/pay/stuListByCoachId',
- method: 'get'
+ method: 'get',
+ params:this.param
})
- this.cadetList = res
+ if (res.code == 0) {
+ if (this.param.pageNum != 1) {
+ this.cadetList = this.cadetList.concat(res.data.records)
+ } else {
+ this.cadetList = res.data.records
+ }
+ this.param.total = res.data.total
+ } else {
+ uni.showToast({
+ title: "网络不佳请稍后再试",
+ icon: 'error'
+ })
+ }
+
},
goDetails(userId) {
uni.navigateTo({
diff --git a/pages/teacher/index.vue b/pages/teacher/index.vue
index 74c3ab7..27afc46 100644
--- a/pages/teacher/index.vue
+++ b/pages/teacher/index.vue
@@ -100,7 +100,7 @@
-
+
{{item.createTime}}
@@ -121,7 +121,7 @@
手机号:
- {{item.phone}}
+ {{item.userName}}
@@ -220,7 +220,7 @@
url: `/drivingSchool/system/reservationCourse/applet/getAppReservationCourseListByUserId`,
method: 'get'
})
- this.courseList = res.data
+ this.courseList = res.data.records
},
getUserInfo() {
request({