2025-10-24

我的页面添加刷新
This commit is contained in:
2025-10-24 16:02:33 +08:00
parent 5769349d08
commit b4ece2d3d5

View File

@@ -1,6 +1,7 @@
<template>
<view class="my-container">
<scroll-view scroll-y="true" style="height: 100%;">
<scroll-view scroll-y="true" style="height: 100%;" :refresher-threshold="50" :refresher-triggered="isRefresher" refresher-background="transparent"
refresher-enabled="true" @refresherrefresh="reflash">
<view v-if="user!=null">
<view class="header">
<view class="header-user">
@@ -138,6 +139,11 @@
</view>
<u-button class="u-m-t-20" @click="loginOut">退出登录</u-button>
<view class="box-div">
</view>
</view>
</scroll-view>
</view>
@@ -156,6 +162,12 @@
} from '@dcloudio/uni-app'
const user = ref()
const isRefresher = ref(false)
const reflash = () => {
isRefresher.value = true
loadData()
}
const handleShippingAddress = () => {
uni.navigateTo({
@@ -172,6 +184,8 @@
const loadData = () => {
authAPI.me().then(res => {
user.value = res.user
}).finally(() => {
isRefresher.value = false
})
}
@@ -362,5 +376,11 @@
}
}
}
.box-div {
padding: 60rpx 0rpx;
}
}
</style>