新增下拉刷新
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onReady, onShow, onLoad } from '@dcloudio/uni-app'
|
||||
import { onReady, onShow, onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import TabsComponents from '@/components/tabs/tabs.vue'
|
||||
import NavBar from '@/components/navbar/navbar.vue'
|
||||
import { getUserTicketlist } from '@/api/ticket.js'
|
||||
@@ -153,10 +153,14 @@ function getlist() {
|
||||
hasMore.value = reportRecords.value.length < total.value
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({ icon: 'error', title: '网络异常' })
|
||||
uni.showToast({ title: res.msg || '获取数据失败', icon: 'none' })
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
if (isRefresh) {
|
||||
uni.stopPullDownRefresh()
|
||||
isRefresh = false
|
||||
}
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
@@ -216,6 +220,14 @@ function handleComplted(row) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 是否正在下拉刷新
|
||||
let isRefresh = false
|
||||
onPullDownRefresh(() => {
|
||||
isRefresh = true
|
||||
resetList()
|
||||
})
|
||||
|
||||
/* 预览图片 */
|
||||
function handlePrivew(imgs) {
|
||||
// if (imgs.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user