|
|
@@ -1,18 +1,18 @@
|
|
|
-import * as WebBrowser from 'expo-web-browser'
|
|
|
-import * as React from 'react'
|
|
|
-import { StyleSheet, View, StatusBar, Platform, Image } from 'react-native'
|
|
|
-import { Flex, WingBlank, InputItem } from '@ant-design/react-native'
|
|
|
-import { Card, Paragraph, Caption } from 'react-native-paper'
|
|
|
-import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs'
|
|
|
-import useModel from 'flooks'
|
|
|
-import Toast from '../../flooks/Toast'
|
|
|
-import user from '../../flooks/User'
|
|
|
-import Button from '../../components/Button'
|
|
|
+import * as WebBrowser from 'expo-web-browser';
|
|
|
+import * as React from 'react';
|
|
|
+import { StyleSheet, View, StatusBar, Platform, Image } from 'react-native';
|
|
|
+import { Flex, WingBlank, InputItem } from '@ant-design/react-native';
|
|
|
+import { Card, Paragraph, Caption } from 'react-native-paper';
|
|
|
+import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
|
|
|
+import useModel from 'flooks';
|
|
|
+import Toast from '../../flooks/Toast';
|
|
|
+import user from '../../flooks/User';
|
|
|
+import Button from '../../components/Button';
|
|
|
|
|
|
-const Tab = createMaterialTopTabNavigator()
|
|
|
+const Tab = createMaterialTopTabNavigator();
|
|
|
|
|
|
// const img = require('../../assets/images/loginImg.png')
|
|
|
-const img2 = require('../../assets/images/loginLogo.png')
|
|
|
+const img2 = require('../../assets/images/loginLogo.png');
|
|
|
|
|
|
export default function LoginScreen({ navigation }) {
|
|
|
const btnList = () => (
|
|
|
@@ -22,7 +22,7 @@ export default function LoginScreen({ navigation }) {
|
|
|
size="small"
|
|
|
type="info"
|
|
|
onPress={() => {
|
|
|
- navigation.navigate('BackPassword')
|
|
|
+ navigation.navigate('BackPassword');
|
|
|
}}
|
|
|
>
|
|
|
忘记密码
|
|
|
@@ -31,7 +31,7 @@ export default function LoginScreen({ navigation }) {
|
|
|
用户注册
|
|
|
</Button>
|
|
|
</View>
|
|
|
- )
|
|
|
+ );
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
@@ -90,27 +90,27 @@ export default function LoginScreen({ navigation }) {
|
|
|
</WingBlank>
|
|
|
</View>
|
|
|
</>
|
|
|
- )
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
const LoginPassword = ({ route }) => {
|
|
|
- const [phone, setphone] = React.useState()
|
|
|
- const [password, setPassword] = React.useState()
|
|
|
+ const [phone, setphone] = React.useState();
|
|
|
+ const [password, setPassword] = React.useState();
|
|
|
|
|
|
- const { warnning } = useModel(Toast, [])
|
|
|
- const { loginByPsd } = useModel(user, [])
|
|
|
- const { params } = route
|
|
|
- const { btnList } = params || {}
|
|
|
+ const { warnning } = useModel(Toast, []);
|
|
|
+ const { loginByPsd } = useModel(user, []);
|
|
|
+ const { params } = route;
|
|
|
+ const { btnList } = params || {};
|
|
|
|
|
|
const submit = () => {
|
|
|
if (!phone) {
|
|
|
- warnning('手机号不能为空')
|
|
|
+ warnning('手机号不能为空');
|
|
|
} else if (!password) {
|
|
|
- warnning('密码不能为空')
|
|
|
+ warnning('密码不能为空');
|
|
|
} else {
|
|
|
- loginByPsd(phone, password)
|
|
|
+ loginByPsd(phone, password);
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
return (
|
|
|
<View style={styles.list}>
|
|
|
@@ -141,25 +141,25 @@ const LoginPassword = ({ route }) => {
|
|
|
<Button onPress={submit}>登录</Button>
|
|
|
</View>
|
|
|
</View>
|
|
|
- )
|
|
|
-}
|
|
|
+ );
|
|
|
+};
|
|
|
|
|
|
const LoginCode = ({ route }) => {
|
|
|
- const [phone, setphone] = React.useState()
|
|
|
- const [code, setCode] = React.useState()
|
|
|
- const { warnning } = useModel(Toast, [])
|
|
|
- const { loginByPsd } = useModel(user, [])
|
|
|
- const { params } = route
|
|
|
- const { btnList } = params || {}
|
|
|
+ const [phone, setphone] = React.useState();
|
|
|
+ const [code, setCode] = React.useState();
|
|
|
+ const { warnning } = useModel(Toast, []);
|
|
|
+ const { loginByPsd } = useModel(user, []);
|
|
|
+ const { params } = route;
|
|
|
+ const { btnList } = params || {};
|
|
|
const submit = () => {
|
|
|
if (!phone) {
|
|
|
- warnning('手机号不能为空')
|
|
|
+ warnning('手机号不能为空');
|
|
|
} else if (!code) {
|
|
|
- warnning('验证码')
|
|
|
+ warnning('验证码');
|
|
|
} else {
|
|
|
- loginByPsd(phone, code)
|
|
|
+ loginByPsd(phone, code);
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
return (
|
|
|
<View style={styles.list}>
|
|
|
<InputItem
|
|
|
@@ -182,7 +182,7 @@ const LoginCode = ({ route }) => {
|
|
|
maxLength={6}
|
|
|
style={{ fontSize: 14 }}
|
|
|
onExtraClick={() => {
|
|
|
- console.log('发送验证码')
|
|
|
+ console.log('发送验证码');
|
|
|
}}
|
|
|
>
|
|
|
<Paragraph>验证码</Paragraph>
|
|
|
@@ -192,8 +192,8 @@ const LoginCode = ({ route }) => {
|
|
|
<Button onPress={submit}>登录</Button>
|
|
|
</View>
|
|
|
</View>
|
|
|
- )
|
|
|
-}
|
|
|
+ );
|
|
|
+};
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
container: { flex: 1, backgroundColor: '#FFF2C7' },
|
|
|
@@ -233,4 +233,4 @@ const styles = StyleSheet.create({
|
|
|
marginTop: 10,
|
|
|
marginLeft: 10,
|
|
|
},
|
|
|
-})
|
|
|
+});
|