From 0c879dcc0f29cb99db5e5d99aa992ef7a8a0ecce Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Sun, 22 Sep 2024 11:05:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/center.vue | 33 ++++++++++++++++++++++++++++++++- pages/index/index.vue | 20 ++++++++++---------- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/pages/index/center.vue b/pages/index/center.vue index 736e379..9acdba7 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -146,10 +146,32 @@ }, data() { return { + userList : [], + queryParams: { + pageNo: 1, + pageSize: 10, + title: '', + }, + total : 0, } }, onShow() { this.$store.commit('getUserInfo') + + // 水洗店获取我的用户 + if(this.userShop){ + this.getUserPage() + } + }, + //滚动到屏幕底部 + onReachBottom() { + if(this.queryParams.pageSize < this.productList.total){ + this.queryParams.pageSize += 10 + // 水洗店获取我的用户 + if(this.userShop){ + this.getUserPage() + } + } }, methods: { headBtn() { @@ -163,7 +185,16 @@ } }) }, - + // 获取客户数据 + getUserPage(){ + this.$api('getMyUserPage', this.queryParams, res => { + uni.stopPullDownRefresh() + if(res.code == 200){ + this.userList = res.result + console.log("===getUserPage=="); + } + }) + }, } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 18385eb..d672022 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -152,9 +152,9 @@ this.noticeList() this.banner() - if(!this.userShop.shop){ - // 查询我的客户 - this.getUserPage() + if(this.userShop){ + // 查询水洗店首页统计 + this.getLaundryStoreHomeData() }else{ //查询桌布商品 this.getGoodsPage() @@ -162,8 +162,8 @@ }, // 下拉刷新 onPullDownRefresh(){ - if(!this.userShop.shop){ - this.getUserPage() + if(this.userShop){ + this.getLaundryStoreHomeData() }else{ this.getGoodsPage() } @@ -174,8 +174,8 @@ onReachBottom() { if(this.queryParams.pageSize < this.productList.total){ this.queryParams.pageSize += 10 - if(!this.userShop.shop){ - this.getUserPage() + if(this.userShop){ + this.getLaundryStoreHomeData() }else{ this.getGoodsPage() } @@ -210,9 +210,9 @@ } }) }, - // 获取客户数据 - getUserPage(){ - this.$api('getMyUserPage', this.queryParams, res => { + // 查询水洗店首页统计 + getLaundryStoreHomeData(){ + this.$api('laundryStoreHomeData', this.queryParams, res => { uni.stopPullDownRefresh() if(res.code == 200){ this.userList = res.result