paymentSummaryPage.tsx 5.5 KB

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