feat(mobile): 新增解忧商行移动端首页、详情与个人中心

This commit is contained in:
yml2213
2026-10-30 12:26:31 +08:00
parent 97167fa482
commit ef01486e53
14 changed files with 1499 additions and 10 deletions
@@ -0,0 +1,50 @@
import { Button, List } from 'antd-mobile'
import { useNavigate } from 'react-router-dom'
import { BrandLogo } from '@/components/BrandLogo'
import { useSessionStore } from '@/stores/session'
export function MobileProfilePage() {
const navigate = useNavigate()
const user = useSessionStore(state => state.user)
const logout = useSessionStore(state => state.logout)
return (
<div className="mobile-profile">
<section className="mobile-profile__head">
<BrandLogo height={42} variant="seal" />
<div>
<h1>{user ? user.nickname || '我的商行' : '还没登录'}</h1>
<p>{user ? user.phone : '登录后查看订单、钱包与实名状态'}</p>
</div>
</section>
<List className="mobile-profile__list">
<List.Item extra={user ? '已登录' : '未登录'}>账号状态</List.Item>
<List.Item extra={user?.realname_status === 'verified' ? '已实名' : '未实名'}>
实名认证
</List.Item>
<List.Item onClick={() => navigate('/m/orders')}>我的订单</List.Item>
<List.Item onClick={() => navigate('/m/messages')}>消息中心</List.Item>
</List>
<div className="mobile-profile__actions">
{user ? (
<Button
block
onClick={async () => {
await logout()
navigate('/m')
}}
>
退出登录
</Button>
) : (
<Button block color="primary" onClick={() => navigate('/m/login')}>
登录 / 注册
</Button>
)}
</div>
</div>
)
}