From a5f7f64459c4634163f1d2f4a5f315a5645c0a05 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Wed, 27 Aug 2025 11:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/personalCenter/index.js | 78 ++++++++++++++----------- pages/personalCenter/personalCenter.vue | 26 +++++---- 2 files changed, 57 insertions(+), 47 deletions(-) diff --git a/api/personalCenter/index.js b/api/personalCenter/index.js index 38516a1..402bfb3 100644 --- a/api/personalCenter/index.js +++ b/api/personalCenter/index.js @@ -1,5 +1,5 @@ // 个人中心相关API -import { get, request } from '@/utils/request' +import { get, request } from "@/utils/request"; /** * 获取预约列表 @@ -10,10 +10,10 @@ import { get, request } from '@/utils/request' * @returns {Promise} 返回预约列表数据 */ export function getAppointmentList(params) { - return get('/app/subscribe/list', params, { - timeout: 10000, + return get("/app/subscribe/list", params, { + timeout: 6000, showLoading: false, - }) + }); } /** @@ -23,12 +23,12 @@ export function getAppointmentList(params) { */ export function cancelAppointment(subscribeId) { return request({ - url: '/app/subscribe/cancelSub', - method: 'PUT', + url: "/app/subscribe/cancelSub", + method: "PUT", params: { - subscribeId: subscribeId - } - }) + subscribeId: subscribeId, + }, + }); } /** @@ -37,12 +37,16 @@ export function cancelAppointment(subscribeId) { * @returns {Promise} 返回核销结果 */ export function verifyAppointmentCode(subscribeId) { - return get('/app/subscribe/verifiedCode', { - subscribeId: subscribeId - }, { - timeout: 10000, - showLoading: true, - }) + return get( + "/app/subscribe/verifiedCode", + { + subscribeId: subscribeId, + }, + { + timeout: 6000, + showLoading: true, + }, + ); } /** @@ -50,10 +54,14 @@ export function verifyAppointmentCode(subscribeId) { * @returns {Promise} 返回用户信息 */ export function getUserInfo() { - return get('/app/user/info', {}, { - timeout: 10000, - showLoading: false, - }) + return get( + "/app/user/getUser", + {}, + { + timeout: 6000, + showLoading: false, + }, + ); } /** @@ -63,10 +71,10 @@ export function getUserInfo() { */ export function updateUserInfo(data) { return request({ - url: '/app/user/info', - method: 'PUT', + url: "/app/user/info", + method: "PUT", data, - }) + }); } /** @@ -77,10 +85,10 @@ export function updateUserInfo(data) { * @returns {Promise} 返回收藏列表数据 */ export function getMyCollection(params) { - return get('/app/collection/list', params, { - timeout: 10000, + return get("/app/collection/list", params, { + timeout: 6000, showLoading: false, - }) + }); } /** @@ -91,10 +99,10 @@ export function getMyCollection(params) { * @returns {Promise} 返回捐赠历史数据 */ export function getDonationHistory(params) { - return get('/app/donation/history', params, { - timeout: 10000, + return get("/app/donation/history", params, { + timeout: 6000, showLoading: false, - }) + }); } /** @@ -105,10 +113,10 @@ export function getDonationHistory(params) { * @returns {Promise} 返回祈福记录数据 */ export function getPrayerRecords(params) { - return get('/app/prayer/records', params, { - timeout: 10000, + return get("/app/prayer/records", params, { + timeout: 6000, showLoading: false, - }) + }); } /** @@ -119,8 +127,8 @@ export function getPrayerRecords(params) { * @returns {Promise} 返回寺庙活动数据 */ export function getTempleActivities(params) { - return get('/app/temple/activities', params, { - timeout: 10000, + return get("/app/temple/activities", params, { + timeout: 6000, showLoading: false, - }) -} \ No newline at end of file + }); +} diff --git a/pages/personalCenter/personalCenter.vue b/pages/personalCenter/personalCenter.vue index 4ee2e52..50441a0 100644 --- a/pages/personalCenter/personalCenter.vue +++ b/pages/personalCenter/personalCenter.vue @@ -5,16 +5,12 @@ - + {{ userInfo.phone }} - {{ userInfo.verificationStatus }} + {{ realNameStatus }} @@ -57,8 +53,9 @@ export default { loading: false, // 用户信息 userInfo: { - phone: "138****8912", - verificationStatus: "未实名", + phone: "666****6666", + verificationStatus: "false", + avatar: "", }, // 菜单项数据 menuItems: [ @@ -97,15 +94,15 @@ export default { methods: { // 加载用户信息 async loadUserInfo() { - this.loading = true; try { const response = await getUserInfo(); - + if (response.code === 200) { // 更新用户信息 this.userInfo = { - phone: response.data.phone || "138****8912", - verificationStatus: response.data.verificationStatus || "未实名", + phone: response.data.phonenumber || "666****6666", + isRealName: response.data.isReal || "false", + avatar: response.data.avatar, }; } else { console.warn("获取用户信息失败:", response.msg); @@ -138,6 +135,11 @@ export default { } }, }, + computed: { + realNameStatus() { + return this.isRealName ? "实名" : "未实名"; + }, + }, };