paymentFinishPageComponent.tsx 17 KB

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