From b015747510b77123e62301c34fd398831c549cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com> Date: Sat, 1 Apr 2023 13:15:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=88=86=E7=B1=BB=E3=80=81?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=88=97=E8=A1=A8=E7=9A=84=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 6 ++---- src/pages/service/cate.vue | 25 +++++++++---------------- src/pages/service/list.vue | 11 ++--------- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/src/pages.json b/src/pages.json index b407129..f6ac0de 100644 --- a/src/pages.json +++ b/src/pages.json @@ -22,15 +22,13 @@ { "path": "pages/service/cate", "style": { - "navigationBarTitleText": "分类", - "enablePullDownRefresh": true + "navigationBarTitleText": "分类" } }, { "path": "pages/service/list", "style": { - "navigationBarTitleText": "服务列表", - "enablePullDownRefresh": true + "navigationBarTitleText": "服务列表" } }, { diff --git a/src/pages/service/cate.vue b/src/pages/service/cate.vue index 815ea49..e03d6cd 100644 --- a/src/pages/service/cate.vue +++ b/src/pages/service/cate.vue @@ -80,7 +80,14 @@ export default { x: x - this.$utils.rpx2px(20), y: y - this.$utils.rpx2px(40), }; - this.initPage(); + // 加载分类 + this.data.push({ + id: 0, + name: "热门推荐", + cover: "", + child: await this.hotCate(), + }); + this.loadCate(); }, onShow() { this.newId = this.currentId = this.currentCateId; @@ -91,22 +98,8 @@ export default { this.$store.commit("system/currentCateId", this.newId); }, onReachBottom() {}, - onPullDownRefresh() { - this.initPage(); - uni.stopPullDownRefresh(); - }, + onPullDownRefresh() {}, methods: { - async initPage() { - this.data = []; - // 加载分类 - this.data.push({ - id: 0, - name: "热门推荐", - cover: "", - child: await this.hotCate(), - }); - this.loadCate(); - }, /** * 推荐 */ diff --git a/src/pages/service/list.vue b/src/pages/service/list.vue index afdee26..0410b36 100644 --- a/src/pages/service/list.vue +++ b/src/pages/service/list.vue @@ -65,20 +65,13 @@ export default { return; } this.currentId = e.id; - this.initPage(); + this.loadList(this.currentId); }, onShow() {}, onReady() {}, onReachBottom() {}, - onPullDownRefresh() { - this.initPage(); - uni.stopPullDownRefresh(); - }, + onPullDownRefresh() {}, methods: { - initPage() { - this.data = []; - this.loadList(this.currentId); - }, /** * 加载列表 */