bookingConfirmationPage.tsx 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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 Svg, { Path } from 'react-native-svg';
  5. import NormalButton from '../global/normal_button';
  6. const PreviousPageSvg = () => (
  7. <Svg width="28" height="28" viewBox="0 0 28 28" fill="none">
  8. <Path
  9. d="M7.04167 15.6667L16.375 25L14 27.3334L0.666672 14L14 0.666687L16.375 3.00002L7.04167 12.3334H27.3333V15.6667H7.04167Z"
  10. fill="black"
  11. />
  12. </Svg>
  13. );
  14. const BookingConfirmationPage = () => {
  15. return (
  16. <SafeAreaView
  17. style={{ flex: 1, backgroundColor: 'white' }}
  18. edges={['top', 'left', 'right']}
  19. >
  20. <ScrollView className="flex-1" showsVerticalScrollIndicator={false}>
  21. <View className="flex-1">
  22. <View className="pl-8 pt-8">
  23. <Pressable
  24. style={{ alignSelf: 'flex-start' }}
  25. onPress={() => {
  26. if (router.canGoBack()) {
  27. router.back();
  28. } else {
  29. router.replace('./');
  30. }
  31. }}
  32. >
  33. <PreviousPageSvg />
  34. </Pressable>
  35. <Text className="text-3xl mt-8">確認您的預約</Text>
  36. </View>
  37. <View className="flex-1 mt-4 mx-[5%]">
  38. <View className="flex-1 flex-row items-center pb-3">
  39. <View className="flex-1 flex-column">
  40. <Text
  41. style={styles.grayColor}
  42. className="text-base"
  43. >
  44. 日期
  45. </Text>
  46. <Text
  47. style={styles.greenColor}
  48. className="text-6xl text-center pt-2"
  49. >
  50. 3月14
  51. </Text>
  52. </View>
  53. <View className="flex-1 flex-column">
  54. <Text
  55. style={styles.grayColor}
  56. className="text-base pl-7"
  57. >
  58. 時間
  59. </Text>
  60. <Text
  61. style={styles.greenColor}
  62. className="text-6xl text-center pt-2"
  63. >
  64. 15:15
  65. </Text>
  66. </View>
  67. </View>
  68. <View className="flex-1 flex-column justify-center space-y-1 pb-3">
  69. <Text
  70. style={styles.grayColor}
  71. className="text-base"
  72. >
  73. 充電地點
  74. </Text>
  75. <Text
  76. style={styles.greenColor}
  77. className="text-3xl "
  78. >
  79. 上環街市充電站
  80. </Text>
  81. <Text style={styles.grayColor} className="text-sm">
  82. 香港上環皇后大道中345號
  83. </Text>
  84. </View>
  85. <View className="flex-1 flex-row pb-3 ">
  86. <View className="flex-column flex-1">
  87. <Text
  88. style={styles.grayColor}
  89. className="text-base"
  90. >
  91. 方案
  92. </Text>
  93. <Text
  94. style={styles.greenColor}
  95. className="text-lg"
  96. >
  97. 按每度電結算
  98. </Text>
  99. <Text
  100. style={styles.grayColor}
  101. className="text-sm"
  102. >
  103. 度數: 50kWh
  104. </Text>
  105. </View>
  106. <View className="flex-column flex-1">
  107. <Text
  108. style={styles.grayColor}
  109. className="text-base"
  110. >
  111. 車輛
  112. </Text>
  113. <Text
  114. style={styles.greenColor}
  115. className="text-lg"
  116. >
  117. TESLA Model 3
  118. </Text>
  119. </View>
  120. </View>
  121. </View>
  122. </View>
  123. <View className="w-full h-1 bg-[#DBE4E8]" />
  124. <View className="flex-1 mx-[5%]">
  125. <Text className="text-xl py-4">收費概要</Text>
  126. <View className="flex-row justify-between">
  127. <Text className="text-base">充電費用</Text>
  128. <Text className="text-base">HK$ 175</Text>
  129. </View>
  130. <Text style={styles.grayColor} className="text-base">
  131. 按每度電結算: 50 kWh
  132. </Text>
  133. <View className="h-0.5 my-3 bg-[#f4f4f4]" />
  134. <View className="flex-row justify-between">
  135. <Text className="text-base" style={styles.grayColor}>
  136. 小計
  137. </Text>
  138. <Text className="text-base">HK$ 175</Text>
  139. </View>
  140. <View className="flex-row justify-between">
  141. <Text className="text-base" style={styles.grayColor}>
  142. 其他費用
  143. </Text>
  144. <Text className="text-base">HK$ 11</Text>
  145. </View>
  146. <View className="h-0.5 my-3 bg-[#f4f4f4]" />
  147. <View className="flex-row justify-between ">
  148. <Text className="text-xl">總計</Text>
  149. <Text className="text-xl">HK$ 186</Text>
  150. </View>
  151. <View className="mt-4">
  152. <NormalButton
  153. title={
  154. <Text
  155. style={{
  156. color: 'white',
  157. fontSize: 16,
  158. fontWeight: '800'
  159. }}
  160. >
  161. 下一步
  162. </Text>
  163. }
  164. onPress={() => console.log('abc')}
  165. extendedStyle={{ padding: 24 }}
  166. />
  167. </View>
  168. </View>
  169. </ScrollView>
  170. </SafeAreaView>
  171. );
  172. };
  173. export default BookingConfirmationPage;
  174. const styles = StyleSheet.create({
  175. grayColor: {
  176. color: '#888888'
  177. },
  178. greenColor: {
  179. color: '#02677D'
  180. }
  181. });