2025-10-24
我的页面添加刷新
This commit is contained in:
@@ -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>
|
||||||
@@ -156,6 +162,12 @@
|
|||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
|
|
||||||
const user = ref()
|
const user = ref()
|
||||||
|
|
||||||
|
const isRefresher = ref(false)
|
||||||
|
const reflash = () => {
|
||||||
|
isRefresher.value = true
|
||||||
|
loadData()
|
||||||
|
}
|
||||||
|
|
||||||
const handleShippingAddress = () => {
|
const handleShippingAddress = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user