From 985897adbdac5cbb21479b9d51a0a1a467df571a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=7E=E6=B5=B7=7E=E7=88=B1=E6=B5=B7=E7=88=B1?= =?UTF-8?q?=E6=B5=B7=7E=E5=8F=B3?= <1828712314@qq.com> Date: Thu, 20 Feb 2025 11:44:57 +0800 Subject: [PATCH] =?UTF-8?q?request=20=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index.vue | 20 ++++++++++++++++++++ sub/enterprise/edit.vue | 7 +++++-- sub/task/enforce.vue | 1 + sub/task/locate.vue | 8 ++++---- utils/request.js | 21 +++++++++++++-------- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 05e6780..911ddcf 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -25,6 +25,10 @@ :scroll-y="true" :style="{ maxHeight: `${viewHeigth}px` }" class="view" + :refresher-enabled="true" + @refresherrefresh="refresherrefresh" + :refresher-triggered="refresherTriggered" + @refresherpulling="refresherpulling" > @@ -205,6 +209,7 @@ export default { type: 2 } ], + refresherTriggered: false, list: [], color: ['#1B84FF', '#7239EA', '#F6B100', '#F8285A', '#17C653'] } @@ -222,6 +227,9 @@ export default { this.getPageHeight() }) }, + onShow() { + this.init() + }, methods: { getPageHeight() { const query = uni.createSelectorQuery().in(this) @@ -362,6 +370,18 @@ export default { changeTab(type) { this.queryParams.type = type this.getList() + }, + refresherpulling() { + const that = this + if (!this.refresherTriggered) { + this.refresherTriggered = true + setTimeout(() => { + that.refresherTriggered = false + }, 1000) + } + }, + refresherrefresh() { + this.init() } } } diff --git a/sub/enterprise/edit.vue b/sub/enterprise/edit.vue index fec2917..43e6b3a 100644 --- a/sub/enterprise/edit.vue +++ b/sub/enterprise/edit.vue @@ -1,5 +1,5 @@