From d1e223ad231f293c945496d7287229c935833375 Mon Sep 17 00:00:00 2001 From: Peanut Date: Mon, 15 Jun 2026 10:49:11 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9AMineView=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=A1=A3=E6=A1=88=E5=AD=97=E6=AE=B5=20comput?= =?UTF-8?q?ed=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mini-program/src/pages/main/MineView.vue | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mini-program/src/pages/main/MineView.vue b/mini-program/src/pages/main/MineView.vue index e622aff..7bed267 100644 --- a/mini-program/src/pages/main/MineView.vue +++ b/mini-program/src/pages/main/MineView.vue @@ -111,6 +111,29 @@ const harmonyPercent = computed(() => { return Math.round((filled / 7) * 100) + '%' }) +const genderText = computed(() => { + const map = { male: '男', female: '女', other: '其他' } + return map[profile.value.gender] || null +}) + +const age = computed(() => { + const birthday = profile.value.birthday + if (!birthday) return null + const birthYear = Number(String(birthday).slice(0, 4)) + if (!birthYear) return null + return new Date().getFullYear() - birthYear +}) + +const hobbyText = computed(() => { + const hobbies = profile.value.hobbies + if (Array.isArray(hobbies) && hobbies.length) return hobbies.slice(0, 4).join(' · ') + return null +}) + +const goEditProfile = () => { + uni.navigateTo({ url: '/pages/onboarding/index?edit=1' }) +} + const openProfileSettings = () => { uni.navigateTo({ url: '/pages/onboarding/index?edit=1' }) }