feat: refine tiangong flows and integrate profile avatars
This commit is contained in:
1 parent
4608dbd5cf
commit
5be2ca6b50
65 files changed
+2099
-532
No files matched your search
@@ -1,21 +1,16 @@
|
||||
import Taro from '@tarojs/taro'
|
||||
import { Button, Image, Text, View } from '@tarojs/components'
|
||||
import { MainTab, switchMainTab } from '../services/tabNavigation'
|
||||
import spirit from '../assets/home/spirit.png'
|
||||
import './AppTabBar.scss'
|
||||
|
||||
export function AppTabBar({ active }: { active: 'home' | 'my' }) {
|
||||
const navigate = (page: 'home' | 'my') => {
|
||||
if (page === active) return
|
||||
const url = `/pages/${page}/index`
|
||||
if (process.env.TARO_ENV === 'weapp') Taro.switchTab({ url })
|
||||
else Taro.redirectTo({ url })
|
||||
}
|
||||
export function AppTabBar({ active }: { active: MainTab }) {
|
||||
const navigate = (page: MainTab) => switchMainTab(page, active)
|
||||
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>
|
||||
<Button className='app-tabbar-realm' onClick={() => Taro.navigateTo({ url: '/pages/fortune/index' })}>
|
||||
<Button className={`app-tabbar-realm ${active === 'fortune' ? 'active' : ''}`} onClick={() => navigate('fortune')}>
|
||||
<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>
|
||||
|
||||
Reference in new issue
Block a user