From c9cd20ba9edfd9f2a4853c3b76edd46c95c85bf1 Mon Sep 17 00:00:00 2001 From: zhuchunyun Date: Wed, 28 Aug 2024 18:40:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/CoachManage.vue | 8 +++--- pages/index/orderManage.vue | 56 ++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/pages/index/CoachManage.vue b/pages/index/CoachManage.vue index 76ceba7..b1c18fb 100644 --- a/pages/index/CoachManage.vue +++ b/pages/index/CoachManage.vue @@ -27,14 +27,14 @@ - {{item.experienceYear}}年 + {{item.experienceYear||0}}年 教龄 - {{item.student}}人 + {{item.student||0}}人 学员数量 @@ -95,8 +95,8 @@ method: 'get', params: this.queryParams }).then((res) => { - if (res.code == 200) { - this.dataList = res.rows + if (res.code == 0) { + this.dataList = res.data } }) }, diff --git a/pages/index/orderManage.vue b/pages/index/orderManage.vue index a185508..791a93f 100644 --- a/pages/index/orderManage.vue +++ b/pages/index/orderManage.vue @@ -114,25 +114,27 @@ listData: ["全部订单", "已报名", "已付款", "已面签"], listDataIndex: 0, orderList: [], - isState: false + isState: false, + param:{ + pageNum:1, + pageSize:10, + total:0 + } } }, - // open(){ - // this.$refs.popup.open('top') - // }, onShow() { - this.findOrderListByState(0) - + this.findOrderListByState(this.tabindex) }, onPullDownRefresh() { console.log("刷新"); uni.stopPullDownRefresh() }, onReachBottom() { - // this.show = true - setTimeout(() => { - console.log("加载执行"); - }, 2000) + // 触底加载 + if (this.orderList.length < this.param.total) { + this.param.pageNum++ + this.findOrderListByState(this.tabindex) + } }, methods: { @@ -142,31 +144,33 @@ let state = null let isSign = null if (index == 1) { - state = 3 + this.param.state = 3 } else if (index == 2) { - state = 3 + this.param.state = 3 } else if (index == 3) { - state = 3 - isSign = 1 + this.param.state = 3 + this.param.isSign = 1 } let res = await request({ url: `/system/pay/list`, method: 'get', - params: { - isSign: isSign, - state: state, - pageNum:1, - pageSize:10 - } + params: this.param }) - - this.orderList = res.data.records + if (res.code == 0) { + if (this.param.pageNum != 1) { + this.orderList = this.orderList.concat(res.data.records) + } else { + this.orderList = res.data.records + } + this.param.total = res.data.total + } else { + uni.showToast({ + title: "网络不佳请稍后再试", + icon: 'error' + }) + } }, - - // getindex(index) { - // this.tabindex = index - // }, goDetails(id) { uni.navigateTo({ url: `/pages/index/orderDetails?id=${id}`