新增下拉刷新
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
|
||||
<script setup>
|
||||
import { nextTick, ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import TabsComponents from '@/components/tabs/tabs.vue'
|
||||
import { getComplainList } from '@/api/complain.js'
|
||||
|
||||
@@ -133,6 +133,10 @@ function init() {
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
if (isRefresh) {
|
||||
uni.stopPullDownRefresh()
|
||||
isRefresh = false
|
||||
}
|
||||
isLoading.value = false
|
||||
})
|
||||
}
|
||||
@@ -156,6 +160,13 @@ function handleComplaint(id) {
|
||||
})
|
||||
}
|
||||
|
||||
// 是否正在下拉刷新
|
||||
let isRefresh = false
|
||||
onPullDownRefresh(() => {
|
||||
isRefresh = true
|
||||
resetList()
|
||||
})
|
||||
|
||||
function scrolltolower() {
|
||||
if (isLoading.value || !hasMore.value) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user