fix: remove hardcoded defaults and sampleEvents from RecordView
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="profile-info">
|
<view class="profile-info">
|
||||||
<view class="name-row">
|
<view class="name-row">
|
||||||
<text class="profile-name">{{ profile.nickname || 'Zoey' }}</text>
|
<text class="profile-name">{{ profile.nickname || '未设置' }}</text>
|
||||||
<text class="star">✦</text>
|
<text class="star">✦</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="profile-subtitle">正在成为更清晰的自己</text>
|
<text class="profile-subtitle">正在成为更清晰的自己</text>
|
||||||
@@ -28,21 +28,21 @@
|
|||||||
<text class="meta-icon">♋</text>
|
<text class="meta-icon">♋</text>
|
||||||
<view>
|
<view>
|
||||||
<text class="meta-label">星座</text>
|
<text class="meta-label">星座</text>
|
||||||
<text class="meta-value">{{ profile.zodiac || '巨蟹座' }}</text>
|
<text class="meta-value">{{ profile.zodiac || '未设置' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="meta-item">
|
<view class="meta-item">
|
||||||
<view class="person-icon"></view>
|
<view class="person-icon"></view>
|
||||||
<view>
|
<view>
|
||||||
<text class="meta-label">MBTI</text>
|
<text class="meta-label">MBTI</text>
|
||||||
<text class="meta-value">{{ profile.mbti || 'ENTJ' }}</text>
|
<text class="meta-value">{{ profile.mbti || '未设置' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="meta-item no-border">
|
<view class="meta-item no-border">
|
||||||
<view class="job-icon"></view>
|
<view class="job-icon"></view>
|
||||||
<view>
|
<view>
|
||||||
<text class="meta-label">职业</text>
|
<text class="meta-label">职业</text>
|
||||||
<text class="meta-value">{{ profile.profession || '产品经理' }}</text>
|
<text class="meta-value">{{ profile.profession || '未设置' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<text class="heart">♡</text>
|
<text class="heart">♡</text>
|
||||||
<view>
|
<view>
|
||||||
<text class="meta-label">爱好</text>
|
<text class="meta-label">爱好</text>
|
||||||
<text class="hobby-text">{{ heroTags.join(' · ') }}</text>
|
<text class="hobby-text">{{ heroTags.length ? heroTags.join(' · ') : '未设置' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -140,54 +140,16 @@ const baseFilters = [
|
|||||||
]
|
]
|
||||||
const filters = computed(() => [...baseFilters, ...customFilters.value])
|
const filters = computed(() => [...baseFilters, ...customFilters.value])
|
||||||
|
|
||||||
const sampleEvents = [
|
|
||||||
{
|
|
||||||
id: 'sample-1',
|
|
||||||
title: '决定全职做自己热爱的AI产品',
|
|
||||||
time: '2025-05-20',
|
|
||||||
content: '辞去稳定的工作,孤注一掷地投入到AI产品的创业中,每天都充满挑战...',
|
|
||||||
eventType: 'highlight',
|
|
||||||
tags: ['高光']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'sample-2',
|
|
||||||
title: '一段关系的结束',
|
|
||||||
time: '2024-11-12',
|
|
||||||
content: '这段关系让我成长了很多,虽然很痛,但也让我更清楚自己想要什么...',
|
|
||||||
eventType: 'valley',
|
|
||||||
tags: ['低谷']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'sample-3',
|
|
||||||
title: '第一次独自旅行',
|
|
||||||
time: '2024-06-08',
|
|
||||||
content: '去了大理,遇见了很多有趣的人和事。那段时间真正感受到了自由和快乐...',
|
|
||||||
eventType: 'daily_log',
|
|
||||||
tags: ['美好的瞬间']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'sample-4',
|
|
||||||
title: '考上理想的高中',
|
|
||||||
time: '2016-09-01',
|
|
||||||
content: '那天拿到录取通知书,爸妈为我开心地庆祝,我暗下决心要更加努力...',
|
|
||||||
eventType: 'childhood',
|
|
||||||
tags: ['童年']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const profile = computed(() => store.userProfile || store.registrationData || {})
|
const profile = computed(() => store.userProfile || store.registrationData || {})
|
||||||
const events = computed(() => {
|
const events = computed(() => store.events || [])
|
||||||
const list = store.events || []
|
|
||||||
return list.length ? list : sampleEvents
|
|
||||||
})
|
|
||||||
const heroTags = computed(() => {
|
const heroTags = computed(() => {
|
||||||
const hobbies = profile.value.hobbies
|
const hobbies = profile.value.hobbies
|
||||||
if (Array.isArray(hobbies) && hobbies.length) return hobbies.slice(0, 4)
|
if (Array.isArray(hobbies) && hobbies.length) return hobbies.slice(0, 4)
|
||||||
return ['阅读', '旅行', '音乐', '创作']
|
return []
|
||||||
})
|
})
|
||||||
|
|
||||||
const avatar = computed(() => {
|
const avatar = computed(() => {
|
||||||
const nickname = profile.value.nickname || 'Zoey'
|
const nickname = profile.value.nickname || 'User'
|
||||||
return `https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(nickname)}&backgroundColor=b982ff`
|
return `https://api.dicebear.com/7.x/avataaars/svg?seed=${encodeURIComponent(nickname)}&backgroundColor=b982ff`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user