paymentFinishPageComponent.tsx 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. import { View, Text, ScrollView, StyleSheet, Pressable } from 'react-native';
  2. import React from 'react';
  3. import { SafeAreaView } from 'react-native-safe-area-context';
  4. import NormalButton from '../global/normal_button';
  5. import { router } from 'expo-router';
  6. import {
  7. BatteryIconSvg,
  8. BatteryLogoSvg,
  9. DownArrowSvg,
  10. LightingLogoSvg,
  11. TemperatureIconSvg,
  12. TickLogoSvg,
  13. TimeClockLogoSvg,
  14. UpArrowSvg
  15. } from '../global/SVG';
  16. import useBookingStore from '../../providers/booking_store';
  17. import userStore from '../../providers/user_store';
  18. const PaymentFinishPageComponent = () => {
  19. const {
  20. bookTime,
  21. carID,
  22. date,
  23. chargingWatt,
  24. connectorID,
  25. price,
  26. stationID,
  27. user,
  28. paymentFee,
  29. carCapacitance
  30. } = useBookingStore();
  31. // const [isMoreInfoButtonPressed, setIsMoreInfoButtonPressed] =
  32. // React.useState<boolean>(false);
  33. return (
  34. <SafeAreaView className="flex-1 bg-white">
  35. <ScrollView
  36. className="flex-1 mx-[5%]"
  37. showsVerticalScrollIndicator={false}
  38. >
  39. <View style={{ marginTop: 25, flex: 1 }}>
  40. <View className="flex-row items-center">
  41. <TickLogoSvg />
  42. <Text className="text-3xl pl-2">成功付款</Text>
  43. </View>
  44. {/* <View className="items-center pt-4 justify-center">
  45. <SlideInImage source={require('../../assets/car.png')} />
  46. <Text className="text-2xl font-light pb-4">
  47. TESLA Model 3
  48. </Text>
  49. </View>
  50. <View
  51. style={{ borderWidth: 1 }}
  52. className="border-[#EEEEEE] rounded-2xl"
  53. >
  54. <View className="mx-[5%] flex-column p-4 ">
  55. <View className="flex-row justify-evenly gap-6">
  56. <View className="flex-row items-center space-x-4">
  57. <BatteryLogoSvg />
  58. <View className="flex-column ">
  59. <Text
  60. className="text-sm"
  61. style={styles.grayColor}
  62. >
  63. 已充電
  64. </Text>
  65. <Text
  66. style={styles.greenColor}
  67. className="text-4xl font-light"
  68. >
  69. 95%
  70. </Text>
  71. </View>
  72. </View>
  73. <View className="flex-row items-center space-x-4">
  74. <TimeClockLogoSvg />
  75. <View className="flex-column">
  76. <Text
  77. className="text-sm"
  78. style={styles.grayColor}
  79. >
  80. 充電歷時
  81. </Text>
  82. <View className="flex-row items-end">
  83. <Text
  84. style={styles.greenColor}
  85. className="text-4xl font-light"
  86. >
  87. 39
  88. </Text>
  89. <Text
  90. style={styles.greenColor}
  91. className="text-sm font-light"
  92. >
  93. mins
  94. </Text>
  95. </View>
  96. </View>
  97. </View>
  98. </View>
  99. <View className="h-0.5 w-full my-4 bg-[#EEEEEE]" />
  100. {isMoreInfoButtonPressed ? (
  101. <>
  102. <View className="h-[100px] flex-row items-center">
  103. <View className="flex-1 flex-column items-center space-y-2">
  104. <LightingLogoSvg />
  105. <Text
  106. style={styles.grayColor}
  107. className="text-base"
  108. >
  109. 充電功率
  110. </Text>
  111. <Text
  112. style={styles.greenColor}
  113. className="font-bold text-base"
  114. >
  115. 22.1kW
  116. </Text>
  117. </View>
  118. <View className="flex-1 flex-column items-center space-y-2">
  119. <BatteryIconSvg />
  120. <Text
  121. style={styles.grayColor}
  122. className="text-base"
  123. >
  124. 實際功率
  125. </Text>
  126. <Text
  127. style={styles.greenColor}
  128. className="font-bold text-base"
  129. >
  130. 30.0kW
  131. </Text>
  132. </View>
  133. <View className="flex-1 flex-column items-center space-y-2">
  134. <TemperatureIconSvg />
  135. <Text
  136. style={styles.grayColor}
  137. className="text-base"
  138. >
  139. 溫度
  140. </Text>
  141. <Text
  142. style={styles.greenColor}
  143. className="font-bold text-base"
  144. >
  145. 36°c
  146. </Text>
  147. </View>
  148. </View>
  149. <Pressable
  150. onPress={() => {
  151. setIsMoreInfoButtonPressed(
  152. !isMoreInfoButtonPressed
  153. );
  154. }}
  155. style={{ padding: 2 }}
  156. >
  157. <View className="flex-row pt-4 items-center justify-center">
  158. <Text className="text-sm">
  159. 收起{' '}
  160. </Text>
  161. <UpArrowSvg />
  162. </View>
  163. </Pressable>
  164. </>
  165. ) : (
  166. <Pressable
  167. onPress={() => {
  168. setIsMoreInfoButtonPressed(
  169. !isMoreInfoButtonPressed
  170. );
  171. }}
  172. style={{ padding: 2 }}
  173. >
  174. <View className="flex-row items-center justify-center">
  175. <Text className="text-sm">
  176. 更多資訊{' '}
  177. </Text>
  178. <DownArrowSvg />
  179. </View>
  180. </Pressable>
  181. )}
  182. </View>
  183. </View> */}
  184. {/*
  185. <View
  186. className="my-4"
  187. style={{
  188. borderWidth: 1,
  189. borderColor: '#EEEEEE',
  190. borderRadius: 12
  191. }}
  192. >
  193. <View className="space-y-3 py-4 mx-[5%]">
  194. <View className="flex-1 flex-row items-center ">
  195. <View className="flex-1 flex-column">
  196. <Text
  197. style={styles.grayColor}
  198. className="text-xs "
  199. >
  200. 時間日期
  201. </Text>
  202. <Text
  203. style={styles.greenColor}
  204. className="text-4xl pt-2 "
  205. >
  206. 3月14 · 16:15
  207. </Text>
  208. </View>
  209. </View>
  210. <View className="flex-1 flex-column justify-center">
  211. <Text
  212. style={styles.grayColor}
  213. className="text-xs"
  214. >
  215. 充電地點
  216. </Text>
  217. <Text
  218. style={styles.greenColor}
  219. className="text-xl"
  220. >
  221. 上環街市充電站
  222. </Text>
  223. <Text
  224. style={styles.grayColor}
  225. className="text-base"
  226. >
  227. 香港上環皇后大道中345號
  228. </Text>
  229. </View>
  230. <View className="flex-1 flex-row items-center ">
  231. <View className="flex-column flex-1">
  232. <Text
  233. style={styles.grayColor}
  234. className="text-xs"
  235. >
  236. 方案
  237. </Text>
  238. <Text
  239. style={styles.greenColor}
  240. className="text-lg"
  241. >
  242. 按每度電結算
  243. </Text>
  244. <Text
  245. style={styles.grayColor}
  246. className="text-sm"
  247. >
  248. 度數: 50kWh
  249. </Text>
  250. </View>
  251. <View className="flex-column flex-1">
  252. <Text
  253. style={styles.grayColor}
  254. className="text-xs"
  255. >
  256. 車輛
  257. </Text>
  258. <Text
  259. style={styles.greenColor}
  260. className="text-lg"
  261. >
  262. TESLA Model 3
  263. </Text>
  264. </View>
  265. </View>
  266. </View>
  267. </View> */}
  268. <View>
  269. <Text className="text-xl py-4">收費概要</Text>
  270. <View className="flex-row justify-between">
  271. <Text className="text-base">充電費用</Text>
  272. <Text className="text-base">HK$ {paymentFee}</Text>
  273. </View>
  274. {chargingWatt === '' ? (
  275. <Text
  276. style={styles.grayColor}
  277. className="text-base"
  278. >
  279. 充滿停機預估費用
  280. </Text>
  281. ) : (
  282. <Text
  283. style={styles.grayColor}
  284. className="text-base"
  285. >
  286. 按每度電結算: {chargingWatt.split('~')[0]}
  287. </Text>
  288. )}
  289. <View className="h-0.5 my-3 bg-[#f4f4f4]" />
  290. <View className="flex-row justify-between ">
  291. <Text className="text-xl">總計</Text>
  292. <Text className="text-xl">HK$ {paymentFee}</Text>
  293. </View>
  294. <View className="mt-4"></View>
  295. </View>
  296. <View className="w-full h-1 bg-[#DBE4E8]" />
  297. <View className="space-y-4 my-4">
  298. <Text className="text-xl ">付款資訊</Text>
  299. <View>
  300. <Text
  301. className="text-base"
  302. style={styles.grayColor}
  303. >
  304. 訂單編號
  305. </Text>
  306. <Text className="text-base">CXZ-16336958</Text>
  307. </View>
  308. <View>
  309. <Text
  310. className="text-base"
  311. style={styles.grayColor}
  312. >
  313. 付款方式
  314. </Text>
  315. <Text className="text-base">預付銀包</Text>
  316. </View>
  317. {/* <View>
  318. <Text
  319. className="text-base"
  320. style={styles.grayColor}
  321. >
  322. 電郵地址
  323. </Text>
  324. <Text className="text-base">
  325. mikechan123@.com
  326. </Text>
  327. </View> */}
  328. </View>
  329. <NormalButton
  330. title={
  331. <Text style={{ color: '#fff', fontSize: 18 }}>
  332. 下一頁
  333. </Text>
  334. }
  335. onPress={() => {
  336. router.replace('bookingSuccessPage');
  337. }}
  338. />
  339. </View>
  340. </ScrollView>
  341. </SafeAreaView>
  342. );
  343. };
  344. export default PaymentFinishPageComponent;
  345. const styles = StyleSheet.create({
  346. grayColor: {
  347. color: '#888888'
  348. },
  349. greenColor: {
  350. color: '#02677D'
  351. }
  352. });