新增下拉刷新

This commit is contained in:
Zy
2026-08-20 09:29:12 +08:00
parent 42387c476d
commit ab868f8180
9 changed files with 97 additions and 445 deletions

View File

@@ -54,7 +54,7 @@
<script setup lang="ts">
import { ref, computed } from 'vue'
import TabsComponents from '@/components/tabs/tabs.vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { onShow, onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
import { InspectionListType, getInspectionList } from '@/api/insepction.js'
import { parseTime } from '@/utils/time.js'
@@ -129,6 +129,10 @@ function getlist() {
})
})
.finally(() => {
if (isRefresh) {
uni.stopPullDownRefresh()
isRefresh = false
}
isLoading.value = false
})
}
@@ -155,6 +159,13 @@ onLoad(options => {
activeValue.value = Number(options.type)
})
// 是否正在下拉刷新
let isRefresh = false
onPullDownRefresh(() => {
isRefresh = true
init()
})
onShow(() => {
handleTabs(activeValue.value)
})