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'; import { verify } from '../utils/SmsUtil'; export default function ForgetPsdScreen({ navigation }: StackScreenProps) { const { changePsd } = 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 canSubmit = useCreation(() => { if (phone && code && password && password === password2) { return true; } else { return false; } }, [phone, code, password, password2]); function submit() { verify(phone, code).then((res) => { console.log(res); }); } return (
{t('shou-ji-hao')}:
{ setPhone(text); }} style={{ flex: 1, fontSize: 14 }} placeholder={t('shu-ru-shou-ji-hao')} /> {__DEV__ && ( { setPhone(text); }} /> )}
{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')} />
); }