paymentSummaryPage.tsx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import { View, Text, ScrollView, StyleSheet, Pressable } from 'react-native';
  2. import { SafeAreaView } from 'react-native-safe-area-context';
  3. import Svg, { Path, Rect } from 'react-native-svg';
  4. import NormalButton from './global/normal_button';
  5. import SlideInImage from './global/slideInImage';
  6. const TickLogoSvg = () => (
  7. <Svg width="24" height="24" viewBox="0 0 24 24" fill="none">
  8. <Rect width="24" height="24" rx="12" fill="#02677D" />
  9. <Path
  10. d="M9.5501 18L3.8501 12.3L5.2751 10.875L9.5501 15.15L18.7251 5.97498L20.1501 7.39998L9.5501 18Z"
  11. fill="#CEE6F0"
  12. />
  13. </Svg>
  14. );
  15. const RightArrowSvg = () => (
  16. <Svg width="7" height="12" viewBox="0 0 7 12" fill="none">
  17. <Path
  18. d="M6.70762 5.99998L1.05383 11.6538L-4.60642e-08 10.6L4.6 5.99998L-4.48209e-07 1.39998L1.05382 0.346158L6.70762 5.99998Z"
  19. fill="#02677D"
  20. />
  21. </Svg>
  22. );
  23. // **This is 付款概要 page**
  24. const PaymentSummaryPage = () => {
  25. return (
  26. <SafeAreaView
  27. className="flex-1 bg-white"
  28. edges={['top', 'left', 'right']}
  29. >
  30. <ScrollView
  31. className="flex-1 mx-[5%]"
  32. showsVerticalScrollIndicator={false}
  33. >
  34. <View style={{ marginTop: 25 }}>
  35. <Text style={{ fontSize: 45 }}>付款概要</Text>
  36. <View className="flex-column">
  37. <View className="items-center pt-6 ">
  38. <SlideInImage
  39. source={require('../assets/car1.png')}
  40. />
  41. </View>
  42. <Pressable onPress={() => console.log('優惠券')}>
  43. <Text className="text-lg pb-4">優惠券</Text>
  44. <View className="bg-[#e9f2f7] rounded-xl h-[9vh] items-center flex-row pl-6 justify-between">
  45. <View className="flex-row ">
  46. <TickLogoSvg />
  47. <Text className="color-[#34667c] px-4 text-base">
  48. $20 迎新優惠券
  49. </Text>
  50. </View>
  51. <View className="pr-8">
  52. <RightArrowSvg />
  53. </View>
  54. </View>
  55. </Pressable>
  56. </View>
  57. <View>
  58. <Text className="text-xl py-4">收費概要</Text>
  59. <View className="flex-row justify-between">
  60. <Text className="text-base">充電費用</Text>
  61. <Text className="text-base">HK$ 175</Text>
  62. </View>
  63. <Text style={styles.grayColor} className="text-base">
  64. 按每度電結算: 50 kWh
  65. </Text>
  66. <View className="h-0.5 my-3 bg-[#f4f4f4]" />
  67. <View className="flex-row justify-between">
  68. <Text
  69. className="text-base"
  70. style={styles.grayColor}
  71. >
  72. 小計
  73. </Text>
  74. <Text className="text-base">HK$ 175</Text>
  75. </View>
  76. <View className="flex-row justify-between">
  77. <Text
  78. className="text-base"
  79. style={styles.grayColor}
  80. >
  81. 其他費用
  82. </Text>
  83. <Text className="text-base">HK$ 11</Text>
  84. </View>
  85. <View className="h-0.5 my-3 bg-[#f4f4f4]" />
  86. <View className="flex-row justify-between ">
  87. <Text className="text-xl">總計</Text>
  88. <Text className="text-3xl">HK$ 186</Text>
  89. </View>
  90. <View className="mt-4 ">
  91. <NormalButton
  92. title={
  93. <Text
  94. style={{
  95. color: 'white',
  96. fontSize: 16,
  97. fontWeight: '800'
  98. }}
  99. >
  100. 前往付款
  101. </Text>
  102. }
  103. onPress={() => console.log('前往付款')}
  104. extendedStyle={{ padding: 24 }}
  105. />
  106. </View>
  107. <View className="h-8" />
  108. </View>
  109. </View>
  110. </ScrollView>
  111. </SafeAreaView>
  112. );
  113. };
  114. export default PaymentSummaryPage;
  115. const styles = StyleSheet.create({
  116. grayColor: {
  117. color: '#888888'
  118. },
  119. greenColor: {
  120. color: '#02677D'
  121. }
  122. });