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> <template>
<view class="my-container"> <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 v-if="user!=null">
<view class="header"> <view class="header">
<view class="header-user"> <view class="header-user">
@@ -138,6 +139,11 @@
</view> </view>
<u-button class="u-m-t-20" @click="loginOut">退出登录</u-button> <u-button class="u-m-t-20" @click="loginOut">退出登录</u-button>
<view class="box-div">
</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@@ -157,6 +163,12 @@
const user = ref() const user = ref()
const isRefresher = ref(false)
const reflash = () => {
isRefresher.value = true
loadData()
}
const handleShippingAddress = () => { const handleShippingAddress = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/my/shippingAddress' url: '/pages/my/shippingAddress'
@@ -172,6 +184,8 @@
const loadData = () => { const loadData = () => {
authAPI.me().then(res => { authAPI.me().then(res => {
user.value = res.user user.value = res.user
}).finally(() => {
isRefresher.value = false
}) })
} }
@@ -362,5 +376,11 @@
} }
} }
} }
.box-div {
padding: 60rpx 0rpx;
}
} }
</style> </style>