This commit is contained in:
zmj 2024-06-24 16:57:04 +08:00
parent ea9e6ae292
commit b8aaa100b4
2 changed files with 18 additions and 5 deletions

View File

@ -52,7 +52,7 @@
"path": "pages/my/my", "path": "pages/my/my",
"style": { "style": {
"navigationBarTitleText": "个人中心", "navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, { }, {

View File

@ -121,13 +121,17 @@
orderCountApi orderCountApi
} from "@/api/order.js"; } from "@/api/order.js";
import { import {
onShow onShow,
onPullDownRefresh
} from "@dcloudio/uni-app" } from "@dcloudio/uni-app"
import {
userInfoApi
} from "@/api/user.js"
const userStore = useUserStore(); const userStore = useUserStore();
const userInfo = ref({}); const userInfo = ref({});
const orderCount = ref({ const orderCount = ref({
no_pay: 0, no_pay: 0,
receiving: 0, receiving: 0,
@ -175,9 +179,18 @@
} }
onShow(() => { onShow(() => {
userInfo.value = userStore.userInfo; userInfoApi().then(res => {
userInfo.value = res.data;
})
getOrderCount(); getOrderCount();
}) })
onPullDownRefresh(() => {
userInfoApi().then(res => {
userInfo.value = res.data;
uni.stopPullDownRefresh()
})
})
</script> </script>
<style lang="scss"> <style lang="scss">