import { StackScreenProps } from '@react-navigation/stack'; import * as React from 'react'; import { Div, Button, Image, Text, Avatar, Input, Icon, Radio, } from 'react-native-magnus'; import { TextInputMask } from 'react-native-masked-text'; import { ScrollView } from 'react-native-gesture-handler'; import { useTranslation } from 'react-i18next'; import { useCreation } from 'ahooks'; import useModel from 'flooks'; import Login from './model'; import { MainStackParamList } from '../types'; import { connect } from '../utils/SystemUtils'; import Navigation from '../navigation/LoginStackNavigator'; import SmsInput from '../components/SmsInput'; export default function RegisterScreen({ navigation, }: StackScreenProps) { navigation.setOptions({ headerLeft: (props) => ( ), }); const { loginByRegister } = useModel(Login, []); const { t } = useTranslation(); const [phone, setPhone] = React.useState(''); const [code, setCode] = React.useState(''); const [password, setpassword] = React.useState(''); const [password2, setpassword2] = React.useState(''); const [sure, setSure] = React.useState(false); const canSubmit = useCreation(() => { if (phone && code && password && password === password2 && sure) { return true; } else { return false; } }, [phone, code, password, password2, sure]); return (
{t('guide1')}! {t('guide2')}
{t('shou-ji-hao')}:
{ setPhone(text); }} style={{ flex: 1, fontSize: 14 }} placeholder={t('shu-ru-shou-ji-hao')} /> {__DEV__ && ( { setPhone(text); }} /> )}
{/*
{t('yan-zheng-ma')}:
{ setCode(text); }} style={{ flex: 1, fontSize: 14 }} placeholder={t('shu-ru-yan-zheng-ma')} />
*/}
{t('mi-ma')}: { setpassword(text); }} style={{ flex: 1 }} placeholder={t('shu-ru-mi-ma')} />
{t('que-ren-mi-ma')}: { setpassword2(text); }} style={{ flex: 1 }} placeholder={t('zai-ci-shu-ru-que-ren-mi-ma')} />
{t('he')}
); }