makingBookingPageComponent.tsx 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. imageUrl={car.imageUrl}
  98. key={`${car.VehicleName}+${index}`}
  99. VehicleName={car.VehicleName}
  100. isDefault={car.isDefault}
  101. />
  102. ))}
  103. </ScrollView>
  104. </View>
  105. </View>
  106. <View className="mx-[5%] ">
  107. <View className="justify-center p-4 pl-0">
  108. <Pressable
  109. style={{ alignSelf: 'flex-start' }}
  110. onPress={() => console.log('選擇充電方案')}
  111. >
  112. <Text className="text-lg" style={styles.grayColor}>
  113. 選擇充電方案
  114. </Text>
  115. </Pressable>
  116. </View>
  117. <View className="justify-center p-4 pl-0 ">
  118. <Pressable
  119. style={{ alignSelf: 'flex-start' }}
  120. onPress={() => console.log('選擇日期時間')}
  121. >
  122. <Text className="text-lg" style={styles.grayColor}>
  123. 選擇日期時間
  124. </Text>
  125. </Pressable>
  126. </View>
  127. <View className=" justify-center p-4 pl-0">
  128. <Pressable
  129. style={{ alignSelf: 'flex-start' }}
  130. onPress={() => console.log('選擇充電座')}
  131. >
  132. <Text className="text-lg" style={styles.grayColor}>
  133. 選擇充電座
  134. </Text>
  135. </Pressable>
  136. </View>
  137. </View>
  138. </View>
  139. <View className="mx-[5%] flex-1">
  140. <View
  141. className="flex-row border-slate-300 mt-3 mb-6 rounded-2xl flex-1"
  142. style={{ borderWidth: 1 }}
  143. >
  144. <View className="flex-1 m-4">
  145. <View className="flex-1 flex-row ">
  146. <View className=" flex-1 flex-column justify-between">
  147. <Text className="text-xl " style={styles.text}>
  148. 收費
  149. </Text>
  150. <View className="flex-row items-center space-x-2">
  151. <Text className="text-3xl text-[#02677D]">
  152. $20
  153. </Text>
  154. <Text style={styles.text}>每15分鐘</Text>
  155. </View>
  156. </View>
  157. <View className="items-center justify-center">
  158. <View className="w-[1px] h-[60%] bg-[#CCCCCC]" />
  159. </View>
  160. <View className="flex-1 flex-column ">
  161. <View className="flex-1"></View>
  162. <View className="flex-row items-center ml-4 space-x-2 ">
  163. <Text className="text-3xl text-[#02677D]">
  164. $3.5
  165. </Text>
  166. <Text style={styles.text}>每度電</Text>
  167. </View>
  168. </View>
  169. </View>
  170. </View>
  171. </View>
  172. <Text className="text-xl pb-2 mx-[5%]" style={styles.text}>
  173. 充電站資訊
  174. </Text>
  175. <View className="h-[250px]">
  176. <ChargingStationTabView titles={['充電插頭', '其他']} />
  177. </View>
  178. </View>
  179. </ScrollView>
  180. </SafeAreaView>
  181. );
  182. export default MakingBookingPageComponent;
  183. const styles = StyleSheet.create({
  184. grayColor: {
  185. color: '#888888'
  186. },
  187. topLeftTriangle: {
  188. width: 0,
  189. height: 0,
  190. borderLeftWidth: 50,
  191. borderBottomWidth: 50,
  192. borderLeftColor: '#02677D',
  193. borderBottomColor: 'transparent',
  194. position: 'absolute',
  195. top: 0,
  196. left: 0
  197. },
  198. text: {
  199. fontWeight: 300,
  200. color: '#000000'
  201. }
  202. });