@@ -1,11 +1,11 @@
<!-- 页面编号 : M - 01 ; 用途 : 我的首页 。 -- >
< template >
< view class = "page-shell profile-page" >
< view class = "profile-hero" > < view class = "profile-seal" > { { profile . name ? profile . name . slice ( 0 , 1 ) : '谱' } } < / view > < view class = "profile-copy" > < text class = "profile-name" > { { profile . name || '家谱用户' } } < / text > < text class = "profile-meta" > { { profile . phone || '资料加载中' } } · { { profile . role || '家谱成员' } } < / text > < / view > < text class = "profile-edit" @click ="showSoon " > 资料 < / text > < / view >
< view class = "profile-hero" > < view class = "profile-seal" > { { profile . name ? profile . name . slice ( 0 , 1 ) : '谱' } } < / view > < view class = "profile-copy" > < text class = "profile-name" > { { profile . name || '家谱用户' } } < / text > < text class = "profile-meta" > { { profile . phone || '资料加载中' } } · { { profile . role || '家谱成员' } } < / text > < / view > < text class = "profile-edit" @click ="toProfile " > 资料 < / text > < / view >
< text v-if = "loadError" class="error-copy" > {{ loadError }} < / text >
< view class = "todo-card paper-card" @click ="toNotifications" > < view > < text class = "todo-title" > 待你处理 < / text > < text class = "todo-copy" > 家谱相关提醒与审核通知 < / text > < / view > < text class = "todo-count" > { { unreadCount } } < / text > < / view >
< view class = "menu-group paper-card" > < view v-for = "item in accountItems" :key="item" class="menu-row" @click="showSoon " > < text > { { item } } < / text > < text > 查看 < / text > < / view > < / view >
< view class = "menu-group paper-card" > < view v-for = "item in serviceItems" :key="item" class="menu-row" @click="showSoon " > < text > { { item } } < / text > < text > 查看 < / text > < / view > < / view >
< view class = "menu-group paper-card" > < view v-for = "item in accountItems" :key="item.label " class="menu-row" @click="openItem(item) " > < text > { { item . label } } < / text > < text > 查看 < / text > < / view > < / view >
< view class = "menu-group paper-card" > < view v-for = "item in serviceItems" :key="item.label " class="menu-row" @click="openItem(item) " > < text > { { item . label } } < / text > < text > 查看 < / text > < / view > < / view >
< AppTabbar active = "profile" / >
< / view >
< / template >
@@ -19,14 +19,23 @@ import { notifications } from '@/data/mock.js'
const profile = ref ( { } )
const loadError = ref ( '' )
const unreadCount = computed ( ( ) => notifications . filter ( ( item ) => item . unread ) . length )
const accountItems = [ '我的资料' , '我的加入申请' , '账号与安全' ]
const serviceItems = [ '帮助中心' , '意见反馈' , 'VIP 服务' ]
const accountItems = [
{ label : '我的资料' , path : '/pages/profile/m02-edit-profile' } ,
{ label : '我的加入申请' , path : '/pages/genealogy/g09-my-applications' } ,
{ label : '账号与安全' , path : '/pages/profile/m03-security-settings' }
]
const serviceItems = [
{ label : '帮助中心' , path : '/pages/profile/m06-help-center' } ,
{ label : '意见反馈' , path : '/pages/profile/m07-feedback' } ,
{ label : 'VIP 服务' , path : '/pages/profile/m09-vip-orders' }
]
onMounted ( async ( ) => {
try { profile . value = await appApi . getProfile ( ) } catch ( error ) { loadError . value = error . message || '个人资料加载失败。' }
} )
const toNotifications = ( ) => uni . navigateTo ( { url : '/pages/notification/n01-message-center' } )
const showSoon = ( ) => uni . showToast ( { title : '该服务将按计划逐步开放' , icon : 'non e' } )
const toProfile = ( ) => uni . navigateTo ( { url : '/pages/profile/m02-edit-profil e' } )
const openItem = ( item ) => uni . navigateTo ( { url : item . path } )
< / script >
< style scoped lang = "scss" >