/* eslint-disable global-require */ /* eslint-disable react/style-prop-object */ import * as WebBrowser from 'expo-web-browser'; import * as React from 'react'; import { Div, Button, Image, Text, Avatar } from 'react-native-magnus'; import { List } from 'react-native-paper'; import { ScrollView } from 'react-native-gesture-handler'; import { StatusBar } from 'expo-status-bar'; import Constants from 'expo-constants'; import { useCreation } from '@umijs/hooks'; import { useTranslation } from 'react-i18next'; import useModel from 'flooks'; import User from '../../flooks/User'; // detail模块通用方法 import UserCoupon from '../userCoupon/SettingCom'; import { connectKefuOn } from '../../Utils/TotastUtils'; export default function UserScreen({ navigation }) { const { t } = useTranslation(); const { userInfo } = useModel(User, ['id']); const { avatar, nickname, username } = userInfo || { nickname: '未登录', }; const showNick = useCreation(() => { if (nickname) { return nickname; } else { return showUser; } }, [nickname]); const showUser = useCreation(() => { if (username) { const name = username.substring(4, 7); return username.replace(name, '****'); } else { return username; } }, [username]); return ( <>
{showNick} {t('ding-dong-wai-mai')} {showUser}
( )} right={(props) => } onPress={() => navigation.navigate('Collection')} />
( )} right={(props) => } onPress={connectKefuOn} />
( )} right={(props) => } onPress={() => navigation.navigate('Address')} />
( )} right={(props) => } onPress={() => navigation.navigate('Cooperation')} />
( )} right={(props) => } onPress={() => navigation.navigate('AppSetting')} />
( )} right={(props) => } onPress={() => navigation.navigate('Rule')} />
( )} right={(props) => } onPress={() => navigation.navigate('FeedBack')} />
); }