bookingMenuPage.tsx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. import { View, Text, StyleSheet, Image, ScrollView } from 'react-native';
  2. import TabViewComponent, { TabItem } from '../global/tabView';
  3. import NormalButton from '../global/normal_button';
  4. interface BookingMenuPageProps {}
  5. const dummyTabItems: TabItem[] = [
  6. {
  7. imgURL: require('../../assets/dummyStationPicture.png'),
  8. date: '今天',
  9. time: '16:30',
  10. chargeStationName: '上環街市充電站',
  11. chargeStationAddress: '香港上環皇后大道中345號',
  12. distance: '400米'
  13. },
  14. {
  15. imgURL: require('../../assets/dummyStationPicture2.png'),
  16. date: '3月15',
  17. time: '17:45',
  18. chargeStationName: '中環IFC充電站',
  19. chargeStationAddress: '香港中環皇后大道中999號',
  20. distance: '680米'
  21. },
  22. {
  23. imgURL: require('../../assets/dummyStationPicture2.png'),
  24. date: '4月20',
  25. time: '12:30',
  26. chargeStationName: '中環IFC充電站',
  27. chargeStationAddress: '香港中環皇后大道中999號',
  28. distance: '680米'
  29. }
  30. ];
  31. const BookingMenuPage: React.FC<BookingMenuPageProps> = () => {
  32. return (
  33. <View style={styles.container}>
  34. <View style={styles.topContainer}>
  35. <Text style={{ fontSize: 45 }}>預約</Text>
  36. <NormalButton
  37. title={
  38. <Text
  39. style={{
  40. color: 'white',
  41. fontSize: 16,
  42. fontWeight: '800'
  43. }}
  44. >
  45. + 新增預約
  46. </Text>
  47. }
  48. onPress={() => console.log('abc')}
  49. />
  50. <View style={styles.recentBookingMainContainer}>
  51. <Text
  52. style={{
  53. fontWeight: 400,
  54. fontSize: 16,
  55. color: '#222222',
  56. marginBottom: '5%'
  57. }}
  58. >
  59. 近期預約過
  60. </Text>
  61. <ScrollView>
  62. <View style={styles.recentBookingRowContainer}>
  63. <Image
  64. source={require('../../assets/bookingLogo.png')}
  65. style={{ height: 40, width: 40 }}
  66. />
  67. <View
  68. style={{
  69. flexDirection: 'row',
  70. justifyContent: 'space-between',
  71. flex: 1,
  72. borderBottomWidth: 0.5,
  73. paddingVertical: 15,
  74. borderColor: '#ccc',
  75. borderRadius: 8
  76. }}
  77. >
  78. <View
  79. style={{
  80. marginLeft: 15,
  81. gap: 3
  82. }}
  83. >
  84. <Text
  85. style={{
  86. fontSize: 16,
  87. color: '#222222'
  88. }}
  89. >
  90. 充電站#1
  91. </Text>
  92. <Text
  93. style={{
  94. fontSize: 16,
  95. color: '#888888'
  96. }}
  97. >
  98. 充電站地址#1
  99. </Text>
  100. </View>
  101. <NormalButton
  102. title={
  103. <Text style={{ color: '#061E25' }}>
  104. 重新預約
  105. </Text>
  106. }
  107. onPress={() => console.log('abc')}
  108. buttonPressedStyle={{
  109. backgroundColor: '#CFDEE4'
  110. }}
  111. extendedStyle={{
  112. backgroundColor: '#E3F2F8',
  113. paddingHorizontal: 25,
  114. paddingVertical: 1,
  115. borderRadius: 8
  116. }}
  117. />
  118. </View>
  119. </View>
  120. <View style={styles.recentBookingRowContainer}>
  121. <Image
  122. source={require('../../assets/bookingLogo.png')}
  123. style={{ height: 40, width: 40 }}
  124. />
  125. <View
  126. style={{
  127. flexDirection: 'row',
  128. justifyContent: 'space-between',
  129. flex: 1,
  130. borderBottomWidth: 0.5,
  131. paddingVertical: 15,
  132. borderColor: '#ccc',
  133. borderRadius: 8
  134. }}
  135. >
  136. <View
  137. style={{
  138. marginLeft: 15,
  139. gap: 3
  140. }}
  141. >
  142. <Text
  143. style={{
  144. fontSize: 16,
  145. color: '#222222'
  146. }}
  147. >
  148. 充電站#2
  149. </Text>
  150. <Text
  151. style={{
  152. fontSize: 16,
  153. color: '#888888'
  154. }}
  155. >
  156. 充電站地址#2
  157. </Text>
  158. </View>
  159. <NormalButton
  160. title={
  161. <Text style={{ color: '#061E25' }}>
  162. 重新預約
  163. </Text>
  164. }
  165. onPress={() => console.log('abc')}
  166. buttonPressedStyle={{
  167. backgroundColor: '#CFDEE4'
  168. }}
  169. extendedStyle={{
  170. backgroundColor: '#E3F2F8',
  171. paddingHorizontal: 25,
  172. paddingVertical: 1,
  173. borderRadius: 8
  174. }}
  175. />
  176. </View>
  177. </View>
  178. <View style={styles.recentBookingRowContainer}>
  179. <Image
  180. source={require('../../assets/bookingLogo.png')}
  181. style={{ height: 40, width: 40 }}
  182. />
  183. <View
  184. style={{
  185. flexDirection: 'row',
  186. justifyContent: 'space-between',
  187. flex: 1,
  188. borderBottomWidth: 0.5,
  189. paddingVertical: 15,
  190. borderColor: '#ccc',
  191. borderRadius: 8
  192. }}
  193. >
  194. <View
  195. style={{
  196. marginLeft: 15,
  197. gap: 3
  198. }}
  199. >
  200. <Text
  201. style={{
  202. fontSize: 16,
  203. color: '#222222'
  204. }}
  205. >
  206. 充電站#3
  207. </Text>
  208. <Text
  209. style={{
  210. fontSize: 16,
  211. color: '#888888'
  212. }}
  213. >
  214. 充電站地址#3
  215. </Text>
  216. </View>
  217. <NormalButton
  218. title={
  219. <Text style={{ color: '#061E25' }}>
  220. 重新預約
  221. </Text>
  222. }
  223. onPress={() => console.log('abc')}
  224. buttonPressedStyle={{
  225. backgroundColor: '#CFDEE4'
  226. }}
  227. extendedStyle={{
  228. backgroundColor: '#E3F2F8',
  229. paddingHorizontal: 25,
  230. paddingVertical: 1,
  231. borderRadius: 8
  232. }}
  233. />
  234. </View>
  235. </View>
  236. <View style={styles.recentBookingRowContainer}>
  237. <Image
  238. source={require('../../assets/bookingLogo.png')}
  239. style={{ height: 40, width: 40 }}
  240. />
  241. <View
  242. style={{
  243. flexDirection: 'row',
  244. justifyContent: 'space-between',
  245. flex: 1,
  246. borderBottomWidth: 0.5,
  247. paddingVertical: 15,
  248. borderColor: '#ccc',
  249. borderRadius: 8
  250. }}
  251. >
  252. <View
  253. style={{
  254. marginLeft: 15,
  255. gap: 3
  256. }}
  257. >
  258. <Text
  259. style={{
  260. fontSize: 16,
  261. color: '#222222'
  262. }}
  263. >
  264. 充電站#4
  265. </Text>
  266. <Text
  267. style={{
  268. fontSize: 16,
  269. color: '#888888'
  270. }}
  271. >
  272. 充電站地址#4
  273. </Text>
  274. </View>
  275. <NormalButton
  276. title={
  277. <Text style={{ color: '#061E25' }}>
  278. 重新預約
  279. </Text>
  280. }
  281. onPress={() => console.log('abc')}
  282. buttonPressedStyle={{
  283. backgroundColor: '#CFDEE4'
  284. }}
  285. extendedStyle={{
  286. backgroundColor: '#E3F2F8',
  287. paddingHorizontal: 25,
  288. paddingVertical: 1,
  289. borderRadius: 8
  290. }}
  291. />
  292. </View>
  293. </View>
  294. </ScrollView>
  295. </View>
  296. </View>
  297. <View style={styles.tabViewContainer}>
  298. <TabViewComponent
  299. titles={['已預約', '已完成']}
  300. tabItems={dummyTabItems}
  301. />
  302. </View>
  303. </View>
  304. );
  305. };
  306. const styles = StyleSheet.create({
  307. container: { flex: 1, backgroundColor: 'white' },
  308. topContainer: {
  309. flex: 1,
  310. gap: 20,
  311. marginTop: 25,
  312. marginHorizontal: '5%'
  313. },
  314. recentBookingMainContainer: { flex: 1 },
  315. recentBookingRowContainer: {
  316. flexDirection: 'row',
  317. alignItems: 'center'
  318. },
  319. tabViewContainer: { flex: 1 }
  320. });
  321. export default BookingMenuPage;