2026-10-15 21:56:45 +08:00
|
|
|
import { Button, Image, Text, View } from '@tarojs/components'
|
2026-10-17 22:44:09 +08:00
|
|
|
import { MainTab, switchMainTab } from '../services/tabNavigation'
|
2026-10-15 21:56:45 +08:00
|
|
|
import spirit from '../assets/home/spirit.png'
|
|
|
|
|
import './AppTabBar.scss'
|
|
|
|
|
|
2026-10-17 22:44:09 +08:00
|
|
|
export function AppTabBar({ active }: { active: MainTab }) {
|
|
|
|
|
const navigate = (page: MainTab) => switchMainTab(page, active)
|
2026-10-15 21:56:45 +08:00
|
|
|
return <View className='app-tabbar'>
|
|
|
|
|
<Button className={`app-tabbar-item ${active === 'home' ? 'active' : ''}`} onClick={() => navigate('home')}>
|
|
|
|
|
<View className='app-home-symbol'><View className='app-home-roof' /><View className='app-home-body'><View /></View></View>
|
|
|
|
|
<Text className='app-tabbar-label'>首页</Text>
|
|
|
|
|
</Button>
|
2026-10-17 22:44:09 +08:00
|
|
|
<Button className={`app-tabbar-realm ${active === 'fortune' ? 'active' : ''}`} onClick={() => navigate('fortune')}>
|
2026-10-15 21:56:45 +08:00
|
|
|
<View className='app-realm-symbol'><View className='app-spirit-frame'><Image className='app-spirit-image' src={spirit} mode='aspectFit' /></View></View>
|
|
|
|
|
<Text className='app-tabbar-label'>天宫</Text>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button className={`app-tabbar-item ${active === 'my' ? 'active' : ''}`} onClick={() => navigate('my')}>
|
|
|
|
|
<View className='app-person-symbol'><View className='app-person-head' /><View className='app-person-body' /></View>
|
|
|
|
|
<Text className='app-tabbar-label'>我的</Text>
|
|
|
|
|
</Button>
|
|
|
|
|
</View>
|
|
|
|
|
}
|