From b8aaa100b4a50d4415c7693707f7f0bd9bc8ee98 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Mon, 24 Jun 2024 16:57:04 +0800 Subject: [PATCH] add --- pages.json | 2 +- pages/my/my.vue | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pages.json b/pages.json index 2db36bc..513c6a4 100644 --- a/pages.json +++ b/pages.json @@ -52,7 +52,7 @@ "path": "pages/my/my", "style": { "navigationBarTitleText": "个人中心", - "enablePullDownRefresh": false, + "enablePullDownRefresh": true, "navigationStyle": "custom" } }, { diff --git a/pages/my/my.vue b/pages/my/my.vue index 5ff99f2..8242580 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -121,13 +121,17 @@ orderCountApi } from "@/api/order.js"; import { - onShow + onShow, + onPullDownRefresh } from "@dcloudio/uni-app" + import { + userInfoApi + } from "@/api/user.js" + + const userStore = useUserStore(); - const userInfo = ref({}); - const orderCount = ref({ no_pay: 0, receiving: 0, @@ -175,9 +179,18 @@ } onShow(() => { - userInfo.value = userStore.userInfo; + userInfoApi().then(res => { + userInfo.value = res.data; + }) getOrderCount(); }) + + onPullDownRefresh(() => { + userInfoApi().then(res => { + userInfo.value = res.data; + uni.stopPullDownRefresh() + }) + })