chargingPageComponent.tsx 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. import { View, Text, ScrollView, StyleSheet, Image } from 'react-native';
  2. import { SafeAreaView } from 'react-native-safe-area-context';
  3. import RippleEffectBatteryIcon from '../global/rippleEffectBatteryIcon';
  4. import LoadingDots from '../global/loadingDots';
  5. import NormalButton from '../global/normal_button';
  6. import { router } from 'expo-router';
  7. import { BatteryIconSvg, LightingLogoSvg, TemperatureIconSvg } from '../global/SVG';
  8. const ChargingPageComponent = () => {
  9. return (
  10. <SafeAreaView
  11. style={{ flex: 1, backgroundColor: 'white' }}
  12. edges={['top', 'left', 'right']}
  13. >
  14. <ScrollView className="flex-1">
  15. <View className="flex-1 mx-[5%] space-y-4">
  16. <View className="items-center">
  17. <View className="mt-6 mb-4">
  18. <Text className="text-lg ">現正充電中:</Text>
  19. </View>
  20. <Text className="text-4xl font-light">
  21. TESLA Model 3
  22. </Text>
  23. </View>
  24. <View className="items-center">
  25. <Text className="text-lg" style={styles.grayColor}>
  26. 充電中
  27. </Text>
  28. <View className="flex-row space-x-4 p-4 pr-8 items-center">
  29. <RippleEffectBatteryIcon />
  30. <Text
  31. style={{
  32. color: '#02677D',
  33. fontSize: 60,
  34. fontWeight: 300
  35. }}
  36. >
  37. 55%
  38. <LoadingDots />
  39. </Text>
  40. </View>
  41. <Text className="text-lg mb-6" style={styles.grayColor}>
  42. 尚餘時間 ~48 mins
  43. </Text>
  44. <View className="mb-[-10] items-center justify-center ">
  45. <Image
  46. source={require('../../assets/car.png')}
  47. style={{ width: 430, height: 200 }}
  48. resizeMode="contain"
  49. />
  50. </View>
  51. </View>
  52. <View
  53. className="h-[220px] min-h-[20px] border-slate-300 rounded-2xl flex-column"
  54. style={{ borderWidth: 1 }}
  55. >
  56. {/* Top */}
  57. <View className="h-[65%] flex-row justify-evenly items-center">
  58. <View className="flex-1 flex-column items-center space-y-2">
  59. <LightingLogoSvg />
  60. <Text
  61. style={styles.grayColor}
  62. className="text-base"
  63. >
  64. 充電功率
  65. </Text>
  66. <Text
  67. style={styles.greenColor}
  68. className="font-bold text-base"
  69. >
  70. 22.1kW
  71. </Text>
  72. </View>
  73. <View className="flex-1 flex-column items-center space-y-2">
  74. <BatteryIconSvg />
  75. <Text
  76. style={styles.grayColor}
  77. className="text-base"
  78. >
  79. 實際功率
  80. </Text>
  81. <Text
  82. style={styles.greenColor}
  83. className="font-bold text-base"
  84. >
  85. 30.0kW
  86. </Text>
  87. </View>
  88. <View className="flex-1 flex-column items-center space-y-2">
  89. <TemperatureIconSvg />
  90. <Text
  91. style={styles.grayColor}
  92. className="text-base"
  93. >
  94. 溫度
  95. </Text>
  96. <Text
  97. style={styles.greenColor}
  98. className="font-bold text-base"
  99. >
  100. 36°c
  101. </Text>
  102. </View>
  103. </View>
  104. <View className="mx-[5%]">
  105. <View className="h-[1px] w-[100%] bg-[#CCCCCC]" />
  106. </View>
  107. {/* bottom container */}
  108. <View className="h-[35%] mx-[5%] justify-center ">
  109. <Text
  110. style={styles.grayColor}
  111. className="text-base"
  112. >
  113. 充電歷時 ~12mins
  114. </Text>
  115. </View>
  116. </View>
  117. <View
  118. className="min-h-[20px] border-slate-300 rounded-2xl justify-center p-4"
  119. style={{ borderWidth: 1 }}
  120. >
  121. <View className="flex-row items-center justify-between ">
  122. <View>
  123. <Text className="text-lg">預計充電費用</Text>
  124. <Text
  125. className="text-base"
  126. style={styles.grayColor}
  127. >
  128. 按每度電結算: 50 kWh
  129. </Text>
  130. </View>
  131. <Text className="text-3xl">HK$ 175</Text>
  132. </View>
  133. </View>
  134. <View
  135. className="border-slate-300 rounded-2xl justify-center p-4"
  136. style={{ borderWidth: 1 }}
  137. >
  138. <Text className="text-lg pb-1 ">其他資訊</Text>
  139. <View className="flex-row">
  140. <View className="flex-1 flex-column">
  141. <Text
  142. className="text-base"
  143. style={styles.grayColor}
  144. >
  145. 開始時間
  146. </Text>
  147. <Text className="text-base">16:33:04</Text>
  148. </View>
  149. <View className="flex-1 flex-column">
  150. <Text
  151. className="text-base"
  152. style={styles.grayColor}
  153. >
  154. 充電座
  155. </Text>
  156. <Text className="text-base">A104</Text>
  157. </View>
  158. </View>
  159. </View>
  160. <View>
  161. <NormalButton
  162. onPress={() => {
  163. router.push('/paymentSummaryPage')
  164. }}
  165. title={
  166. <Text
  167. className="text-xl text-white"
  168. style={{ fontWeight: 900 }}
  169. >
  170. 完成充電
  171. </Text>
  172. }
  173. />
  174. </View>
  175. <View>
  176. <NormalButton
  177. onPress={() => {
  178. router.push('/chargingPenaltyPage')
  179. }}
  180. title={
  181. <Text
  182. className="text-xl text-white"
  183. style={{ fontWeight: 900 }}
  184. >
  185. OTHER PAGE DEMO
  186. </Text>
  187. }
  188. />
  189. </View>
  190. </View>
  191. </ScrollView>
  192. </SafeAreaView>
  193. );
  194. };
  195. export default ChargingPageComponent;
  196. const styles = StyleSheet.create({
  197. grayColor: {
  198. color: '#888888'
  199. },
  200. greenColor: {
  201. color: '#02677D'
  202. },
  203. text: {
  204. fontWeight: 300,
  205. color: '#000000'
  206. }
  207. });