makingBookingPageComponent.tsx 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. import { View, Text, ScrollView, Pressable, StyleSheet } from 'react-native';
  2. import { SafeAreaView } from 'react-native-safe-area-context';
  3. import { router } from 'expo-router';
  4. import NormalButton from '../global/normal_button';
  5. import {
  6. CheckMarkLogoSvg,
  7. DirectionLogoSvg,
  8. PreviousPageBlackSvg
  9. } from '../global/SVG';
  10. import { ChargingStationTabView } from '../global/chargingStationTabView';
  11. import ChooseCarForChargingRow from '../global/chooseCarForChargingRow';
  12. const dummyDataChooseCarForCharging = [
  13. {
  14. imageUrl: require('../../assets/car1.png'),
  15. VehicleName: 'TESLA - Model 3',
  16. isDefault: true
  17. },
  18. { VehicleName: 'TESLA - Model Y', isDefault: false },
  19. {
  20. imageUrl: require('../../assets/car1.png'),
  21. VehicleName: 'TESLA - Model X',
  22. isDefault: false
  23. },
  24. { VehicleName: 'TESLA - Model 3', isDefault: false }
  25. ];
  26. const MakingBookingPageComponent = () => (
  27. <SafeAreaView
  28. style={{
  29. flex: 1,
  30. backgroundColor: 'white'
  31. }}
  32. edges={['right', 'top', 'left']}
  33. >
  34. <ScrollView className="flex-1 bg-white ">
  35. <View className="pb-4">
  36. <View className="pl-8 pt-8">
  37. <Pressable
  38. style={{ alignSelf: 'flex-start' }}
  39. onPress={() => {
  40. if (router.canGoBack()) {
  41. router.back();
  42. } else {
  43. router.replace('./');
  44. }
  45. }}
  46. >
  47. <PreviousPageBlackSvg />
  48. </Pressable>
  49. <Text className="text-3xl mt-8">上環街市充電站</Text>
  50. <View className="flex-column">
  51. <View className="flex-row justify-between items-center mr-[5%]">
  52. <Text
  53. className="text-base"
  54. style={styles.grayColor}
  55. >
  56. 香港上環皇后大道中345號
  57. </Text>
  58. <NormalButton
  59. title={
  60. <View className="flex-row items-center justify-center text-center space-x-1">
  61. <DirectionLogoSvg />
  62. <Text className="text-base">路線</Text>
  63. </View>
  64. }
  65. onPress={() => console.log('路線')}
  66. extendedStyle={{
  67. backgroundColor: '#E3F2F8',
  68. borderRadius: 61,
  69. paddingHorizontal: 20,
  70. paddingVertical: 8
  71. }}
  72. />
  73. </View>
  74. <View className="flex-row space-x-2 items-center">
  75. <CheckMarkLogoSvg />
  76. <Text>Walk-In</Text>
  77. <Text>400米</Text>
  78. </View>
  79. </View>
  80. </View>
  81. </View>
  82. <View className=" bg-[#FAFAFA]">
  83. <View className=" bg-[#e7f5f8]">
  84. <View className="mx-[5%] ">
  85. <Text className="text-xl pt-4">選擇充電車輛</Text>
  86. <ScrollView
  87. horizontal={true}
  88. contentContainerStyle={{
  89. alignItems: 'center',
  90. flexDirection: 'row',
  91. marginVertical: 8
  92. }}
  93. className="space-x-2"
  94. >
  95. {dummyDataChooseCarForCharging.map((car, index) => (
  96. <ChooseCarForChargingRow
  97. navigationLink="/bookingConfirmationPage"
  98. imageUrl={car.imageUrl}
  99. key={`${car.VehicleName}+${index}`}
  100. VehicleName={car.VehicleName}
  101. isDefault={car.isDefault}
  102. />
  103. ))}
  104. </ScrollView>
  105. </View>
  106. </View>
  107. <View className="mx-[5%] ">
  108. <View className="justify-center p-4 pl-0">
  109. <Pressable
  110. style={{ alignSelf: 'flex-start' }}
  111. onPress={() => console.log('選擇充電方案')}
  112. >
  113. <Text className="text-lg" style={styles.grayColor}>
  114. 選擇充電方案
  115. </Text>
  116. </Pressable>
  117. </View>
  118. <View className="justify-center p-4 pl-0 ">
  119. <Pressable
  120. style={{ alignSelf: 'flex-start' }}
  121. onPress={() => console.log('選擇日期時間')}
  122. >
  123. <Text className="text-lg" style={styles.grayColor}>
  124. 選擇日期時間
  125. </Text>
  126. </Pressable>
  127. </View>
  128. <View className=" justify-center p-4 pl-0">
  129. <Pressable
  130. style={{ alignSelf: 'flex-start' }}
  131. onPress={() => console.log('選擇充電座')}
  132. >
  133. <Text className="text-lg" style={styles.grayColor}>
  134. 選擇充電座
  135. </Text>
  136. </Pressable>
  137. </View>
  138. </View>
  139. </View>
  140. <View className="mx-[5%] flex-1">
  141. <View
  142. className="flex-row border-slate-300 mt-3 mb-6 rounded-2xl flex-1"
  143. style={{ borderWidth: 1 }}
  144. >
  145. <View className="flex-1 m-4">
  146. <View className="flex-1 flex-row ">
  147. <View className=" flex-1 flex-column justify-between">
  148. <Text className="text-xl " style={styles.text}>
  149. 收費
  150. </Text>
  151. <View className="flex-row items-center space-x-2">
  152. <Text className="text-3xl text-[#02677D]">
  153. $20
  154. </Text>
  155. <Text style={styles.text}>每15分鐘</Text>
  156. </View>
  157. </View>
  158. <View className="items-center justify-center">
  159. <View className="w-[1px] h-[60%] bg-[#CCCCCC]" />
  160. </View>
  161. <View className="flex-1 flex-column ">
  162. <View className="flex-1"></View>
  163. <View className="flex-row items-center ml-4 space-x-2 ">
  164. <Text className="text-3xl text-[#02677D]">
  165. $3.5
  166. </Text>
  167. <Text style={styles.text}>每度電</Text>
  168. </View>
  169. </View>
  170. </View>
  171. </View>
  172. </View>
  173. <Text className="text-xl pb-2 mx-[5%]" style={styles.text}>
  174. 充電站資訊
  175. </Text>
  176. <View className="h-[250px]">
  177. <ChargingStationTabView titles={['充電插頭', '其他']} />
  178. </View>
  179. </View>
  180. </ScrollView>
  181. </SafeAreaView>
  182. );
  183. export default MakingBookingPageComponent;
  184. const styles = StyleSheet.create({
  185. grayColor: {
  186. color: '#888888'
  187. },
  188. topLeftTriangle: {
  189. width: 0,
  190. height: 0,
  191. borderLeftWidth: 50,
  192. borderBottomWidth: 50,
  193. borderLeftColor: '#02677D',
  194. borderBottomColor: 'transparent',
  195. position: 'absolute',
  196. top: 0,
  197. left: 0
  198. },
  199. text: {
  200. fontWeight: 300,
  201. color: '#000000'
  202. }
  203. });