From d94835f6c58a0404233583de6735de8c9de0ff51 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Wed, 21 Jan 2026 18:06:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=8D=9F=E5=9B=9E=E6=BB=9A=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/repair/equipAssessment/index.vue | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/pages/repair/equipAssessment/index.vue b/src/pages/repair/equipAssessment/index.vue index 29d6929..585ff7f 100644 --- a/src/pages/repair/equipAssessment/index.vue +++ b/src/pages/repair/equipAssessment/index.vue @@ -43,7 +43,7 @@ - + @@ -152,6 +152,7 @@ const queryParams = ref({ pageNum: 1, pageSize: 10, }) +const scrollTop = ref(0) // 滚动位置 // 右滑按钮组 const options = ref([ @@ -233,6 +234,10 @@ const getTableList = async (isTap = false) => { }) console.log('queryParams.value查询参数', queryParams.value) const res = await getLossAssessmentListAPI(queryParams.value) + setTimeout(() => { + scrollTop.value = uni.getStorageSync('scrollTop') || 0 + console.log('🚀 ~ scrollTop.value:', scrollTop.value) + }, 400) total.value = res.data.total if (isTap) { tableList.value = res.data.rows @@ -272,6 +277,15 @@ onShow(() => { getTableList(true) }) +let timers = null +const onScroll = (e) => { + if (timers) clearTimeout(timers) + timers = setTimeout(() => { + uni.setStorageSync('scrollTop', e.detail.scrollTop) + uni.setStorageSync('queryParams', JSON.stringify(queryParams.value)) + }, 500) +} + // 滚动触底事件 const onScrollTolower = debounce(() => { console.log('触底事件') @@ -284,6 +298,10 @@ const onScrollTolower = debounce(() => { // tap 栏切换 const changeTab = (index) => { active.value = index + uni.setStorageSync('scrollTop', 0) + uni.setStorageSync('activeTab', index) + uni.removeStorageSync('queryParams') + uni.removeStorageSync('scrollTop') queryParams.value.pageNum = 1 tableList.value = [] if (index == 1) {