feat: 登陆优化

This commit is contained in:
jinyaqiu 2025-08-05 15:40:25 +08:00
parent 40b6c89f27
commit 81be115dad
7 changed files with 23 additions and 14 deletions

View File

@ -1,6 +1,4 @@
import Handers from '@/assets/icons/svg/handers.svg'; 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 ForgetPwd from '@/components/login/forgetPwd';
import Login from '@/components/login/login'; import Login from '@/components/login/login';
import PhoneLogin from '@/components/login/phoneLogin'; import PhoneLogin from '@/components/login/phoneLogin';
@ -10,7 +8,7 @@ import { ThemedView } from '@/components/ThemedView';
import { useLocalSearchParams, useRouter } from 'expo-router'; import { useLocalSearchParams, useRouter } from 'expo-router';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next'; 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'; import { useSafeAreaInsets } from 'react-native-safe-area-context';
const LoginScreen = () => { const LoginScreen = () => {
@ -55,6 +53,7 @@ const LoginScreen = () => {
}; };
const updateUrlParam = (key: string, value: string) => { const updateUrlParam = (key: string, value: string) => {
setError('');
router.setParams({ [key]: value }); router.setParams({ [key]: value });
} }
@ -83,9 +82,9 @@ const LoginScreen = () => {
{ {
(showPassword || showSecondPassword) (showPassword || showSecondPassword)
? ?
<LoginIP2 /> <Image source={require('@/assets/images/png/icon/ipNoHandsEyes.png')} />
: :
<LoginIP1 /> <Image source={require('@/assets/images/png/icon/ipNoHands.png')} />
} }
</View> </View>
<View <View

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -4,7 +4,7 @@ import LookSvg from '@/assets/icons/svg/look.svg';
import { ThemedText } from '@/components/ThemedText'; import { ThemedText } from '@/components/ThemedText';
import { FileUploadItem } from '@/lib/background-uploader/types'; import { FileUploadItem } from '@/lib/background-uploader/types';
import { useTranslation } from 'react-i18next'; 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'; import FilesUploader from '../file-upload/files-uploader';
interface Props { interface Props {
@ -70,7 +70,13 @@ export default function Look(props: Props) {
<View className="w-full"> <View className="w-full">
<TouchableOpacity <TouchableOpacity
className={`w-full bg-white rounded-full p-4 items-center ${isLoading ? 'opacity-70' : ''}`} 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} disabled={isLoading}
> >
{isLoading ? ( {isLoading ? (

View File

@ -34,13 +34,15 @@ export default function UserName(props: Props) {
<View className="flex-1" /> <View className="flex-1" />
{/* Input container fixed at bottom */} {/* Input container fixed at bottom */}
<View className="w-full bg-white p-4 border-t border-gray-200 rounded-t-3xl"> <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="flex-col items-center justify-center w-full gap-[1rem]">
<View className='w-full flex flex-row items-center justify-between'> <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-textSecondary font-semibold">{t('auth.userMessage.title', { ns: 'login' })}</ThemedText>
<ThemedText className="text-[#E2793F] font-semibold">{error}</ThemedText>
</View> </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 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 <TextInput
className="bg-inputBackground rounded-2xl p-4 w-full" className="bg-inputBackground rounded-2xl p-4 w-full"
placeholder={t('auth.userMessage.usernamePlaceholder', { ns: 'login' })} placeholder={t('auth.userMessage.usernamePlaceholder', { ns: 'login' })}

View File

@ -20,7 +20,8 @@
"avatarText": "Choose an avatar to begin your journey", "avatarText": "Choose an avatar to begin your journey",
"avatorText2": "You can always change it later", "avatorText2": "You can always change it later",
"choosePhoto": "Choose Photo", "choosePhoto": "Choose Photo",
"allDone": "All Done!" "allDone": "All Done!",
"avatarRequired": "Please upload an avatar"
}, },
"telLogin": { "telLogin": {
"title": "Verify Your Identity", "title": "Verify Your Identity",

View File

@ -20,7 +20,8 @@
"avatarText": "选择一个头像开始您的旅程", "avatarText": "选择一个头像开始您的旅程",
"avatorText2": "您可以随时更改", "avatorText2": "您可以随时更改",
"choosePhoto": "选择照片", "choosePhoto": "选择照片",
"allDone": "完成!" "allDone": "完成!",
"avatarRequired": "请上传头像"
}, },
"telLogin": { "telLogin": {
"title": "请输入手机号", "title": "请输入手机号",