import Buttons from "@/components/basic/Buttons"; import { delSession } from "@/services/common"; import { clear, logout } from "@/services/user"; import { View, Text, Image } from "@tarojs/components"; import Taro, { useDidShow } from "@tarojs/taro"; import { useDispatch, useSelector } from "react-redux"; import './Profile.scss' import Box from "@/components/layout/Box"; import { BoxType, NaviBarTitleShowType, TemplateType } from "@/utils/types"; import Layout from "@/components/layout/layout"; import { useTranslation } from "react-i18next"; export default function Page() { const dispatch = useDispatch(); const { t } = useTranslation() const user = useSelector((state: any) => state.user); function tapLogin() { Taro.navigateTo({ url: '/pages/account/ChooseAuth' }) } useDidShow(() => { global.updateTab(3) }) function reset() { Taro.showModal({ title: '重置session', content: '确认重置session吗?', success: res => { if (res.confirm) { delSession({ type: 'WX_MP' }) } } }) } function tapProfile(e) { e.stopPropagation() if (user.isLogin) { Taro.navigateTo({ url: '/pages/account/ProfileSetting' }) } else { Taro.navigateTo({ url: '/pages/account/ChooseAuth' }) } } function tapBalance(e) { if (user.isLogin) { } else { Taro.navigateTo({ url: '/pages/account/ChooseAuth' }) e.stopPropagation() } } function goSetting(e) { Taro.navigateTo({ url: '/pages/account/Setting' }) e.stopPropagation() } function detail() { return { user.isLogin ? : } {user.isLogin ? user.nickname : '未登录'} {user.isLogin ? '用户名未设置' : ''} 逆龄石 {'会员体系升级中,期间指标记录限时免逆龄石记录\n敬请期待'} {user.isLogin && 设置 } { user.isLogin && user.test_user && 用户名:{user.nickname} } { user.isLogin && user.test_user && id:{user.id} } { user.isLogin && user.test_user && } } return { detail() } ; }