feat: 登陆优化
This commit is contained in:
parent
40b6c89f27
commit
81be115dad
@ -1,6 +1,4 @@
|
||||
import Handers from '@/assets/icons/svg/handers.svg';
|
||||
import LoginIP1 from '@/assets/icons/svg/loginIp1.svg';
|
||||
import LoginIP2 from '@/assets/icons/svg/loginIp2.svg';
|
||||
import ForgetPwd from '@/components/login/forgetPwd';
|
||||
import Login from '@/components/login/login';
|
||||
import PhoneLogin from '@/components/login/phoneLogin';
|
||||
@ -10,7 +8,7 @@ import { ThemedView } from '@/components/ThemedView';
|
||||
import { useLocalSearchParams, useRouter } from 'expo-router';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Keyboard, KeyboardAvoidingView, LayoutChangeEvent, Platform, ScrollView, StatusBar, TouchableOpacity, View, ViewStyle, useWindowDimensions } from 'react-native';
|
||||
import { Image, Keyboard, KeyboardAvoidingView, LayoutChangeEvent, Platform, ScrollView, StatusBar, TouchableOpacity, View, ViewStyle, useWindowDimensions } from 'react-native';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
|
||||
const LoginScreen = () => {
|
||||
@ -55,6 +53,7 @@ const LoginScreen = () => {
|
||||
};
|
||||
|
||||
const updateUrlParam = (key: string, value: string) => {
|
||||
setError('');
|
||||
router.setParams({ [key]: value });
|
||||
}
|
||||
|
||||
@ -83,9 +82,9 @@ const LoginScreen = () => {
|
||||
{
|
||||
(showPassword || showSecondPassword)
|
||||
?
|
||||
<LoginIP2 />
|
||||
<Image source={require('@/assets/images/png/icon/ipNoHandsEyes.png')} />
|
||||
:
|
||||
<LoginIP1 />
|
||||
<Image source={require('@/assets/images/png/icon/ipNoHands.png')} />
|
||||
}
|
||||
</View>
|
||||
<View
|
||||
|
||||
BIN
assets/images/png/icon/ipNoHands.png
Normal file
BIN
assets/images/png/icon/ipNoHands.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
BIN
assets/images/png/icon/ipNoHandsEyes.png
Normal file
BIN
assets/images/png/icon/ipNoHandsEyes.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@ -4,7 +4,7 @@ import LookSvg from '@/assets/icons/svg/look.svg';
|
||||
import { ThemedText } from '@/components/ThemedText';
|
||||
import { FileUploadItem } from '@/lib/background-uploader/types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ActivityIndicator, Image, TouchableOpacity, View } from 'react-native';
|
||||
import { ActivityIndicator, Alert, Image, TouchableOpacity, View } from 'react-native';
|
||||
import FilesUploader from '../file-upload/files-uploader';
|
||||
|
||||
interface Props {
|
||||
@ -70,7 +70,13 @@ export default function Look(props: Props) {
|
||||
<View className="w-full">
|
||||
<TouchableOpacity
|
||||
className={`w-full bg-white rounded-full p-4 items-center ${isLoading ? 'opacity-70' : ''}`}
|
||||
onPress={handleUser}
|
||||
onPress={() => {
|
||||
if (fileData[0]?.preview || fileData[0]?.previewUrl || avatar) {
|
||||
handleUser()
|
||||
} else {
|
||||
Alert.alert(t('auth.userMessage.avatarRequired', { ns: 'login' }))
|
||||
}
|
||||
}}
|
||||
disabled={isLoading}
|
||||
>
|
||||
{isLoading ? (
|
||||
|
||||
@ -34,13 +34,15 @@ export default function UserName(props: Props) {
|
||||
<View className="flex-1" />
|
||||
{/* Input container fixed at bottom */}
|
||||
<View className="w-full bg-white p-4 border-t border-gray-200 rounded-t-3xl">
|
||||
<View className="flex-col items-center justify-center w-full gap-[3rem]">
|
||||
<View className='w-full flex flex-row items-center justify-between'>
|
||||
<View className="flex-col items-center justify-center w-full gap-[1rem]">
|
||||
<View className='w-full flex flex-row items-center justify-center'>
|
||||
<ThemedText className="text-textSecondary font-semibold">{t('auth.userMessage.title', { ns: 'login' })}</ThemedText>
|
||||
<ThemedText className="text-[#E2793F] font-semibold">{error}</ThemedText>
|
||||
</View>
|
||||
<View className='w-full'>
|
||||
<View className='w-full mb-[1rem]'>
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 10 }}>
|
||||
<ThemedText className="!text-textPrimary ml-2 mb-2 font-semibold">{t('auth.userMessage.username', { ns: 'login' })}</ThemedText>
|
||||
<ThemedText style={{ color: "#E2793F", fontSize: 14 }}>{error}</ThemedText>
|
||||
</View>
|
||||
<TextInput
|
||||
className="bg-inputBackground rounded-2xl p-4 w-full"
|
||||
placeholder={t('auth.userMessage.usernamePlaceholder', { ns: 'login' })}
|
||||
|
||||
@ -20,7 +20,8 @@
|
||||
"avatarText": "Choose an avatar to begin your journey",
|
||||
"avatorText2": "You can always change it later",
|
||||
"choosePhoto": "Choose Photo",
|
||||
"allDone": "All Done!"
|
||||
"allDone": "All Done!",
|
||||
"avatarRequired": "Please upload an avatar"
|
||||
},
|
||||
"telLogin": {
|
||||
"title": "Verify Your Identity",
|
||||
|
||||
@ -20,7 +20,8 @@
|
||||
"avatarText": "选择一个头像开始您的旅程",
|
||||
"avatorText2": "您可以随时更改",
|
||||
"choosePhoto": "选择照片",
|
||||
"allDone": "完成!"
|
||||
"allDone": "完成!",
|
||||
"avatarRequired": "请上传头像"
|
||||
},
|
||||
"telLogin": {
|
||||
"title": "请输入手机号",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user