|
|
|
@ -75,10 +75,20 @@ const navigateTo = (item: { label: string }) => { |
|
|
|
} else if (item.label === '捡垃圾') { |
|
|
|
router.push('/scrap') |
|
|
|
} else if (item.label === '角色') { |
|
|
|
showCharacterDetail.value = true |
|
|
|
openCharacterDetail() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const openCharacterDetail = async () => { |
|
|
|
await characterStore.fetchCharacters() |
|
|
|
const current = characterStore.characters.find(c => c.id === characterStore.currentCharacter?.id) |
|
|
|
if (current) { |
|
|
|
characterStore.currentCharacter = current |
|
|
|
localStorage.setItem('current_character', JSON.stringify(current)) |
|
|
|
} |
|
|
|
showCharacterDetail.value = true |
|
|
|
} |
|
|
|
|
|
|
|
const handleBreakthrough = async () => { |
|
|
|
const result = await characterStore.breakthrough() |
|
|
|
breakthroughMessage.value = result.message |
|
|
|
|