Ian Fung 1 年之前
父節點
當前提交
154684e0f3

+ 2 - 0
app/(auth)/(tabs)/(charging)/chargingPage.tsx

@@ -151,6 +151,8 @@ const ChargingPage = () => {
                     return false;
                 });
                 if (finishedReservation) {
+                    console.log('now', now);
+                    console.log('Finished reservation found:', finishedReservation);
                     setCurrentStatus('finishReservation');
                     setData(finishedReservation);
                 } else {

+ 3 - 2
component/accountPages/addVehiclePageComponent.tsx

@@ -82,7 +82,7 @@ const AddVehiclePageComponent = () => {
                     <Pressable style={styles.button} onPress={() => router.push('setVehiclesOne')}>
                         <TextInput
                             style={styles.fakeTextInput}
-                            placeholder={vehicleBrand ? vehicleBrand : '車輛類型'}
+                            placeholder={vehicleBrand ? vehicleBrand : '車輛品牌'}
                             editable={false}
                             pointerEvents="none"
                         ></TextInput>
@@ -95,8 +95,9 @@ const AddVehiclePageComponent = () => {
                     </Pressable>
                     <TextInput
                         style={styles.fakeTextInput}
-                        onChangeText={(e) => setLicensePlate(e)}
+                        onChangeText={(e) => setLicensePlate(e.toUpperCase())}
                         placeholder="點擊輸入車輛牌照號碼"
+                        autoCapitalize="characters"
                     ></TextInput>
                 </View>
                 <View className="flex-row items-center">

+ 1 - 1
component/chargingPage/chargingFinishPageComponent.tsx

@@ -79,7 +79,7 @@ const TemperatureIconSvg = () => (
 
 const ChargingFinishPageComponent = ({ data }: { data: any }) => {
     const chargingData = Array.isArray(data) ? data[0] : data;
-    console.log('chargingData', chargingData);
+    // console.log('chargingData', chargingData);
     const [isMoreInfoButtonPressed, setIsMoreInfoButtonPressed] = React.useState<boolean>(false);
 
     function calculateDurationInMinutes(startTimeString: string, endTimeString: string): number {

+ 8 - 23
component/chooseCar/chooseCarPageComponent.tsx

@@ -21,11 +21,8 @@ import { chargeStationService } from '../../service/chargeStationService';
 
 const chooseCarPageComponent = () => {
     const [isChecked, setChecked] = useState(false);
-    const { height: deviceHeight, width: deviceWidth } =
-        Dimensions.get('window');
-    const [brandNameDropdownOptions, setBrandNameDropdownOptions] = useState(
-        []
-    );
+    const { height: deviceHeight, width: deviceWidth } = Dimensions.get('window');
+    const [brandNameDropdownOptions, setBrandNameDropdownOptions] = useState([]);
     const [isLoading, setIsLoading] = useState(false);
     const [licensePlate, setLicensePlate] = useState('');
     const [selectedBrandID, setSelectedBrandID] = useState('');
@@ -43,12 +40,7 @@ const chooseCarPageComponent = () => {
     const handleSubmit = async () => {
         setIsLoading(true);
         try {
-            const result = await chargeStationService.addCar(
-                licensePlate,
-                selectedBrandID,
-                selectedTypeID,
-                isChecked
-            );
+            const result = await chargeStationService.addCar(licensePlate, selectedBrandID, selectedTypeID, isChecked);
             if (result) {
                 router.push({
                     pathname: 'addVehicleSuccessfulPage',
@@ -92,9 +84,7 @@ const chooseCarPageComponent = () => {
 
     useEffect(() => {
         if (selectedBrandID) {
-            const selectedBrand = brandData.find(
-                (brand) => brand.id === selectedBrandID
-            );
+            const selectedBrand = brandData.find((brand) => brand.id === selectedBrandID);
 
             if (selectedBrand && selectedBrand.car_types) {
                 const typeOptions = selectedBrand.car_types.map((carType) => ({
@@ -111,14 +101,8 @@ const chooseCarPageComponent = () => {
     }, [selectedBrandID, brandData]);
 
     return (
-        <SafeAreaView
-            className="flex-1 bg-white"
-            edges={['top', 'right', 'left']}
-        >
-            <ScrollView
-                showsVerticalScrollIndicator={false}
-                className="flex-1 mx-[5%]"
-            >
+        <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
+            <ScrollView showsVerticalScrollIndicator={false} className="flex-1 mx-[5%]">
                 <View style={{ marginTop: 25 }}>
                     <Pressable
                         className="self-start"
@@ -180,12 +164,13 @@ const chooseCarPageComponent = () => {
                     <TextInput
                         style={styles.fakeTextInput}
                         onChangeText={(text) => {
-                            setLicensePlate(text);
+                            setLicensePlate(text.toUpperCase());
                             // console.log(licensePlate);
                         }}
                         value={licensePlate}
                         placeholder="車輛牌照號碼"
                         placeholderTextColor="#888"
+                        autoCapitalize="characters"
                     />
                 </View>
 

+ 1 - 1
component/registrationMultiStepForm/formComponent/form.tsx

@@ -17,7 +17,7 @@ import SetVehiclesTwo from '../../../app/(auth)/(tabs)/(home)/(vehicle)/setVehic
 
 type FormProps = {};
 const Form: React.FC<FormProps> = ({}) => {
-    const [screen, setScreen] = useState<number>(0);
+    const [screen, setScreen] = useState<number>(2);
     const FormTitle = ['', '註冊 - 電郵驗證', '註冊 - 基本資料', '註冊 - 車輛資料', '註冊 - 設立銀包'];
 
     const ScreenDisplay = () => {

+ 1 - 2
component/registrationMultiStepForm/formComponent/formPages/basicInformation.tsx

@@ -5,7 +5,6 @@ import DateModal from '../../../global/date_input';
 import NormalButton from '../../../global/normal_button';
 import useSignUpStore from '../../../../providers/signup_form_store';
 import DropdownSelect from '../../../global/dropdown_select';
-import TestingDropDownSelect from '../../../global/testingDropDownSelect';
 
 type basicInformationProps = {
     goToNextPage: () => void;
@@ -125,7 +124,7 @@ const BasicInformation: React.FC<basicInformationProps> = ({ goToNextPage }) =>
                                 });
                             }}
                             dropdownOptions={genderDropdownOptions}
-                            placeholder={'性別'}
+                            placeholder={`性別`}
                             extendedStyle={{ paddingLeft: 10, paddingVertical: 18 }}
                         />
                     </View>

+ 3 - 2
component/registrationMultiStepForm/formComponent/formPages/carInformation.tsx

@@ -357,7 +357,7 @@ const CarInformation: React.FC<CarInformationProps> = ({ goToNextPage, goToChoos
                         >
                             <TextInput
                                 style={styles.fakeTextInput}
-                                placeholder={vehicleBrand ? vehicleBrand : '車輛類型'}
+                                placeholder={vehicleBrand ? vehicleBrand : '車輛品牌'}
                                 editable={false}
                                 pointerEvents="none"
                             ></TextInput>
@@ -373,12 +373,13 @@ const CarInformation: React.FC<CarInformationProps> = ({ goToNextPage, goToChoos
                             style={styles.fakeTextInput}
                             onChangeText={(text) => {
                                 setSignUpFormData({
-                                    licensePlate: text
+                                    licensePlate: text.toUpperCase()
                                 });
                                 // console.log(licensePlate);
                             }}
                             // value={signUpFormData.licensePlate}
                             placeholder="車輛牌照號碼"
+                            autoCapitalize="characters"
                             placeholderTextColor="#888"
                         />
                     </View>