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' }) }