|
|
@@ -1,4 +1,14 @@
|
|
|
-import { View, Text, Image, StyleSheet, Pressable, Alert, Dimensions, ActivityIndicator } from 'react-native';
|
|
|
+import {
|
|
|
+ View,
|
|
|
+ Text,
|
|
|
+ Image,
|
|
|
+ StyleSheet,
|
|
|
+ Pressable,
|
|
|
+ Alert,
|
|
|
+ Dimensions,
|
|
|
+ ActivityIndicator,
|
|
|
+ ScrollView
|
|
|
+} from 'react-native';
|
|
|
import { Ionicons } from '@expo/vector-icons';
|
|
|
import Logo from '../../../global/logo';
|
|
|
import NormalButton from '../../../global/normal_button';
|
|
|
@@ -122,117 +132,238 @@ const LoginPage: React.FC<LoginPageProps> = ({ goToNextPage, goToForgetPassWordP
|
|
|
};
|
|
|
|
|
|
const insets = useSafeAreaInsets();
|
|
|
-
|
|
|
+ console.log(screenHeight);
|
|
|
return (
|
|
|
- <View className={`flex-1 justify-center ${screenHeight < 750 ? 'h-screen' : 'h-[80vh] space-y-8'}`}>
|
|
|
- <View className="flex-3 items-center justify-end" style={{}}>
|
|
|
- <Image
|
|
|
- source={require('../../../../assets/ccLogo.png')}
|
|
|
- resizeMode="contain"
|
|
|
+ // <View className={`flex-1 justify-center ${screenHeight < 750 ? 'h-screen' : 'h-screen space-y-8'}`}>
|
|
|
+ // {/* // <View className={`flex-1 justify-center ${screenHeight < 750 ? 'h-screen' : 'h-[80vh] space-y-8'}`}> */}
|
|
|
+ // <View className="flex-3 items-center justify-end" style={{}}>
|
|
|
+ // <Image
|
|
|
+ // source={require('../../../../assets/ccLogo.png')}
|
|
|
+ // resizeMode="contain"
|
|
|
+ // style={{
|
|
|
+ // width: screenHeight > 750 ? 250 : 200,
|
|
|
+ // height: screenHeight > 750 ? 250 : 200
|
|
|
+ // }}
|
|
|
+ // />
|
|
|
+ // </View>
|
|
|
+ // <View
|
|
|
+ // style={{
|
|
|
+ // gap: 10
|
|
|
+ // // paddingBottom: Math.max(insets.bottom, 20)
|
|
|
+ // // marginTop: screenHeight > 750 ? 40 : 0
|
|
|
+ // }}
|
|
|
+ // className="mx-[5%] flex-2 "
|
|
|
+ // >
|
|
|
+ // <Text className="text-lg text-center text-[#888888] font-[600]">
|
|
|
+ // 提示: 舊用戶<Text className="font-bold">必須</Text>綁定手機號碼才能登入
|
|
|
+ // </Text>
|
|
|
+ // <Pressable onPress={goToBindingPhoneNumberPage}>
|
|
|
+ // <Text className="text-lg text-center text-[#888888] font-[600] underline">
|
|
|
+ // 立即按我前往綁定頁面
|
|
|
+ // </Text>
|
|
|
+ // </Pressable>
|
|
|
+
|
|
|
+ // <PhoneInput
|
|
|
+ // value={loginPhone}
|
|
|
+ // onChangeText={(phone) => setLoginPhone(phone)}
|
|
|
+ // placeholder="輸入電話號碼"
|
|
|
+ // extendedStyle={{ borderRadius: 12, padding: 20 }}
|
|
|
+ // textContentType="telephoneNumber"
|
|
|
+ // autoComplete="tel"
|
|
|
+ // keyboardType="phone-pad"
|
|
|
+ // autoCapitalize="none"
|
|
|
+ // />
|
|
|
+ // <View className="relative">
|
|
|
+ // <NormalInput
|
|
|
+ // value={loginPassword}
|
|
|
+ // placeholder="密碼"
|
|
|
+ // onChangeText={(password) => setLoginPassword(password)}
|
|
|
+ // secureTextEntry={!showPassword}
|
|
|
+ // extendedStyle={{ borderRadius: 12, padding: 20, paddingRight: 50 }}
|
|
|
+ // textContentType="password"
|
|
|
+ // autoComplete="password"
|
|
|
+ // />
|
|
|
+ // <Pressable
|
|
|
+ // className="absolute right-4 top-0 bottom-0 justify-center"
|
|
|
+ // onPress={() => setShowPassword(!showPassword)}
|
|
|
+ // >
|
|
|
+ // <Ionicons name={showPassword ? 'eye-outline' : 'eye-off-outline'} size={24} color="#02677D" />
|
|
|
+ // </Pressable>
|
|
|
+ // </View>
|
|
|
+
|
|
|
+ // <View className="flex flex-row items-center ">
|
|
|
+ // <Checkbox
|
|
|
+ // style={styles.checkbox}
|
|
|
+ // value={saveAccount}
|
|
|
+ // color={saveAccount ? '#02677D' : '#02677D'}
|
|
|
+ // onValueChange={(newValue) => {
|
|
|
+ // setSaveAccount(newValue);
|
|
|
+ // console.log(newValue);
|
|
|
+ // }}
|
|
|
+ // />
|
|
|
+
|
|
|
+ // <Text style={styles.text}>記住我的電話號碼</Text>
|
|
|
+ // </View>
|
|
|
+
|
|
|
+ // <NormalButton
|
|
|
+ // extendedStyle={{ padding: 20 }}
|
|
|
+ // onPress={() => _login(loginPhone, loginPassword)}
|
|
|
+ // title={
|
|
|
+ // isLoading ? (
|
|
|
+ // <Text
|
|
|
+ // style={{
|
|
|
+ // fontWeight: '700',
|
|
|
+ // fontSize: 20,
|
|
|
+ // color: '#fff'
|
|
|
+ // }}
|
|
|
+ // >
|
|
|
+ // <ActivityIndicator />
|
|
|
+ // </Text>
|
|
|
+ // ) : (
|
|
|
+ // <Text
|
|
|
+ // style={{
|
|
|
+ // fontWeight: '700',
|
|
|
+ // fontSize: 20,
|
|
|
+ // color: '#fff'
|
|
|
+ // }}
|
|
|
+ // >
|
|
|
+ // 登入
|
|
|
+ // </Text>
|
|
|
+ // )
|
|
|
+ // }
|
|
|
+ // />
|
|
|
+ // <View className="flex flex-row justify-between relative">
|
|
|
+ // <Pressable className="self-start" onPress={goToNextPage}>
|
|
|
+ // <Text style={styles.text}>註冊會員</Text>
|
|
|
+ // </Pressable>
|
|
|
+ // <Pressable className="self-start" onPress={() => goToForgetPassWordPage()}>
|
|
|
+ // <Text style={styles.text}>忘記密碼</Text>
|
|
|
+ // </Pressable>
|
|
|
+ // </View>
|
|
|
+ // </View>
|
|
|
+ // </View>
|
|
|
+
|
|
|
+ <ScrollView
|
|
|
+ contentContainerStyle={{ flexGrow: 1, justifyContent: 'center' }}
|
|
|
+ keyboardShouldPersistTaps="handled"
|
|
|
+ className={`flex-1 ${screenHeight < 750 ? '' : 'space-y-8'}`}
|
|
|
+ >
|
|
|
+ {/* // <View className={`flex-1 justify-center ${screenHeight < 750 ? 'h-screen' : 'h-[80vh] space-y-8'}`}> */}
|
|
|
+
|
|
|
+ <View className="flex-1 py-4">
|
|
|
+ <View className="items-center">
|
|
|
+ {/* <View className="flex-3 items-center justify-end" style={{}}> */}
|
|
|
+ <Image
|
|
|
+ source={require('../../../../assets/ccLogo.png')}
|
|
|
+ resizeMode="contain"
|
|
|
+ style={{
|
|
|
+ width: screenHeight > 750 ? 250 : 180,
|
|
|
+ height: screenHeight > 750 ? 250 : 180
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ <View
|
|
|
style={{
|
|
|
- width: screenHeight > 750 ? 250 : 200,
|
|
|
- height: screenHeight > 750 ? 250 : 200
|
|
|
+ gap: 10
|
|
|
+ // paddingBottom: Math.max(insets.bottom, 20)
|
|
|
+ // marginTop: screenHeight > 750 ? 40 : 0
|
|
|
}}
|
|
|
- />
|
|
|
- </View>
|
|
|
- <View
|
|
|
- style={{
|
|
|
- gap: 10
|
|
|
- // paddingBottom: Math.max(insets.bottom, 20)
|
|
|
- // marginTop: screenHeight > 750 ? 40 : 0
|
|
|
- }}
|
|
|
- className="mx-[5%] flex-2 "
|
|
|
- >
|
|
|
- <Text className="text-lg text-center text-[#888888] font-[600]">
|
|
|
- 提示: 舊用戶<Text className="font-bold">必須</Text>綁定手機號碼才能登入
|
|
|
- </Text>
|
|
|
- <Pressable onPress={goToBindingPhoneNumberPage}>
|
|
|
- <Text className="text-lg text-center text-[#888888] font-[600] underline">
|
|
|
- 立即按我前往綁定頁面
|
|
|
+ className="mx-[5%] mt-4 "
|
|
|
+ >
|
|
|
+ <Text className="text-lg text-center text-[#888888] font-[500]">
|
|
|
+ 提示: 舊用戶<Text className="font-bold">必須</Text>綁定手機號碼才能登入
|
|
|
</Text>
|
|
|
- </Pressable>
|
|
|
-
|
|
|
-
|
|
|
- <PhoneInput
|
|
|
- value={loginPhone}
|
|
|
- onChangeText={(phone) => setLoginPhone(phone)}
|
|
|
- placeholder="輸入電話號碼"
|
|
|
- extendedStyle={{ borderRadius: 12, padding: 20 }}
|
|
|
- textContentType="telephoneNumber"
|
|
|
- autoComplete="tel"
|
|
|
- keyboardType="phone-pad"
|
|
|
- autoCapitalize="none"
|
|
|
- />
|
|
|
- <View className="relative">
|
|
|
- <NormalInput
|
|
|
- value={loginPassword}
|
|
|
- placeholder="密碼"
|
|
|
- onChangeText={(password) => setLoginPassword(password)}
|
|
|
- secureTextEntry={!showPassword}
|
|
|
- extendedStyle={{ borderRadius: 12, padding: 20, paddingRight: 50 }}
|
|
|
- textContentType="password"
|
|
|
- autoComplete="password"
|
|
|
- />
|
|
|
- <Pressable
|
|
|
- className="absolute right-4 top-0 bottom-0 justify-center"
|
|
|
- onPress={() => setShowPassword(!showPassword)}
|
|
|
- >
|
|
|
- <Ionicons name={showPassword ? 'eye-outline' : 'eye-off-outline'} size={24} color="#02677D" />
|
|
|
+ <Pressable onPress={goToBindingPhoneNumberPage}>
|
|
|
+ <Text className="text-xl text-center text-[#02677D] font-[800] underline">
|
|
|
+ 立即按我前往綁定頁面
|
|
|
+ </Text>
|
|
|
</Pressable>
|
|
|
- </View>
|
|
|
|
|
|
- <View className="flex flex-row items-center ">
|
|
|
- <Checkbox
|
|
|
- style={styles.checkbox}
|
|
|
- value={saveAccount}
|
|
|
- color={saveAccount ? '#02677D' : '#02677D'}
|
|
|
- onValueChange={(newValue) => {
|
|
|
- setSaveAccount(newValue);
|
|
|
- console.log(newValue);
|
|
|
- }}
|
|
|
+ <PhoneInput
|
|
|
+ value={loginPhone}
|
|
|
+ onChangeText={(phone) => setLoginPhone(phone)}
|
|
|
+ placeholder="輸入電話號碼"
|
|
|
+ extendedStyle={{ borderRadius: 12, padding: 20 }}
|
|
|
+ textContentType="telephoneNumber"
|
|
|
+ autoComplete="tel"
|
|
|
+ keyboardType="phone-pad"
|
|
|
+ autoCapitalize="none"
|
|
|
/>
|
|
|
+ <View className="relative">
|
|
|
+ <NormalInput
|
|
|
+ value={loginPassword}
|
|
|
+ placeholder="密碼"
|
|
|
+ onChangeText={(password) => setLoginPassword(password)}
|
|
|
+ secureTextEntry={!showPassword}
|
|
|
+ extendedStyle={{ borderRadius: 12, padding: 20, paddingRight: 50 }}
|
|
|
+ textContentType="password"
|
|
|
+ autoComplete="password"
|
|
|
+ />
|
|
|
+ <Pressable
|
|
|
+ className="absolute right-4 top-0 bottom-0 justify-center"
|
|
|
+ onPress={() => setShowPassword(!showPassword)}
|
|
|
+ >
|
|
|
+ <Ionicons
|
|
|
+ name={showPassword ? 'eye-outline' : 'eye-off-outline'}
|
|
|
+ size={24}
|
|
|
+ color="#02677D"
|
|
|
+ />
|
|
|
+ </Pressable>
|
|
|
+ </View>
|
|
|
|
|
|
- <Text style={styles.text}>記住我的電話號碼</Text>
|
|
|
- </View>
|
|
|
+ <View className="flex flex-row items-center ">
|
|
|
+ <Checkbox
|
|
|
+ style={styles.checkbox}
|
|
|
+ value={saveAccount}
|
|
|
+ color={saveAccount ? '#02677D' : '#02677D'}
|
|
|
+ onValueChange={(newValue) => {
|
|
|
+ setSaveAccount(newValue);
|
|
|
+ console.log(newValue);
|
|
|
+ }}
|
|
|
+ />
|
|
|
|
|
|
- <NormalButton
|
|
|
- extendedStyle={{ padding: 20 }}
|
|
|
- onPress={() => _login(loginPhone, loginPassword)}
|
|
|
- title={
|
|
|
- isLoading ? (
|
|
|
- <Text
|
|
|
- style={{
|
|
|
- fontWeight: '700',
|
|
|
- fontSize: 20,
|
|
|
- color: '#fff'
|
|
|
- }}
|
|
|
- >
|
|
|
- <ActivityIndicator />
|
|
|
- </Text>
|
|
|
- ) : (
|
|
|
- <Text
|
|
|
- style={{
|
|
|
- fontWeight: '700',
|
|
|
- fontSize: 20,
|
|
|
- color: '#fff'
|
|
|
- }}
|
|
|
- >
|
|
|
- 登入
|
|
|
- </Text>
|
|
|
- )
|
|
|
- }
|
|
|
- />
|
|
|
- <View className="flex flex-row justify-between relative">
|
|
|
- <Pressable className="self-start" onPress={goToNextPage}>
|
|
|
- <Text style={styles.text}>註冊會員</Text>
|
|
|
- </Pressable>
|
|
|
- <Pressable className="self-start" onPress={() => goToForgetPassWordPage()}>
|
|
|
- <Text style={styles.text}>忘記密碼</Text>
|
|
|
- </Pressable>
|
|
|
-
|
|
|
+ <Text style={styles.text}>記住我的電話號碼</Text>
|
|
|
+ </View>
|
|
|
+
|
|
|
+ <NormalButton
|
|
|
+ extendedStyle={{ padding: 20 }}
|
|
|
+ onPress={() => _login(loginPhone, loginPassword)}
|
|
|
+ title={
|
|
|
+ isLoading ? (
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ fontWeight: '700',
|
|
|
+ fontSize: 20,
|
|
|
+ color: '#fff'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <ActivityIndicator />
|
|
|
+ </Text>
|
|
|
+ ) : (
|
|
|
+ <Text
|
|
|
+ style={{
|
|
|
+ fontWeight: '700',
|
|
|
+ fontSize: 20,
|
|
|
+ color: '#fff'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 登入
|
|
|
+ </Text>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ />
|
|
|
+ <View className="flex flex-row justify-between relative">
|
|
|
+ <Pressable className="self-start" onPress={goToNextPage}>
|
|
|
+ <Text style={styles.text}>註冊會員</Text>
|
|
|
+ </Pressable>
|
|
|
+ <Pressable className="self-start" onPress={() => goToForgetPassWordPage()}>
|
|
|
+ <Text style={styles.text}>忘記密碼</Text>
|
|
|
+ </Pressable>
|
|
|
+ </View>
|
|
|
</View>
|
|
|
+ <View className="pb-6" />
|
|
|
</View>
|
|
|
- </View>
|
|
|
+ </ScrollView>
|
|
|
);
|
|
|
};
|
|
|
|