userTermsPageComponent.tsx 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. import { View, Text, ScrollView, Pressable, Button, Alert, StyleSheet } from 'react-native';
  2. import React, { useContext } from 'react';
  3. import { SafeAreaView } from 'react-native-safe-area-context';
  4. import { router } from 'expo-router';
  5. import { CrossLogoSvg, RightArrowIconSvg } from '../global/SVG';
  6. import NormalButton from '../global/normal_button';
  7. type TermsSectionProps = {
  8. title: string| undefined;
  9. clauses: string[];
  10. };
  11. const TermsSection: React.FC<TermsSectionProps> = ({ title, clauses }) => (
  12. <View className="mb-3">
  13. {title && (
  14. <Text style={styles.sectionTitle}>{title}</Text>
  15. )}
  16. {clauses.map((clause, index) => (
  17. <Text key={index} style={styles.clause}>
  18. {clause}
  19. </Text>
  20. ))}
  21. </View>
  22. );
  23. const UserTermsPageComponent: React.FC<{ onAgree: () => void }> = ({ onAgree }) => {
  24. const sections = [
  25. {
  26. clauses: [
  27. '歡迎使用 Crazy Charge(以下簡稱「本公司」或「我們」)提供的電動車充電服務(以下簡稱「服務」)。請仔細閱讀以下條款及細則(以下簡稱「本條款」),使用 Crazy Charge 此應用程式即表示您同意遵守本條款的所有內容。'
  28. ]
  29. },
  30. {
  31. title: '1. 服務使用',
  32. clauses: [
  33. '1.1 賬戶與服務接入:用戶須透過本公司APP進行充值、付款及啓動充電服務。',
  34. '1.2 賬戶資料責任:用戶須確保所提供的資料真實、準確及完整,並對其帳戶的一切活動負責。',
  35. '1.3 服務變更權限:本公司保留隨時修改、暫停或終止服務的權利,而無須事先通知用戶。'
  36. ]
  37. },
  38. {
  39. title: '2. 充值及付款',
  40. clauses: [
  41. '2.1 充值與餘額:用戶可透過APP進行充值,充值金額將存入用戶帳戶。',
  42. '2.2 充值金額有效期:充值金額沒有使用期限。',
  43. '2.3 優惠政策:本公司可能不時提供優惠,相關優惠受特定條款約束。'
  44. ]
  45. },
  46. {
  47. title: '3. 退款政策',
  48. clauses: [
  49. '3.1 退款申請方式:如用戶要求退款,須透過WhatsApp提交申請。',
  50. '3.2 退款優惠扣除:退款金額將扣除該次充值所涉及的所有優惠。',
  51. '3.3 退款行政費用:每筆退款將收取港幣150元作為行政費用。',
  52. '3.4 退款建議:建議用戶將未使用的充值金額留作日後使用。',
  53. '3.5 退款處理時間:退款處理時間由本公司決定。'
  54. ]
  55. },
  56. {
  57. title: '4. 責任限制',
  58. clauses: [
  59. '4.1 服務穩定性承諾:本公司將盡力確保服務的穩定性及準確性。',
  60. '4.2 用戶損失責任:因使用本服務而導致的任何損失,本公司概不負責。',
  61. '4.3 不可抗力責任:如因不可抗力導致服務中斷,本公司不承擔責任。'
  62. ]
  63. }
  64. ];
  65. const handleAgree = () => {
  66. router.back()
  67. // onAgree();
  68. };
  69. return (
  70. <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
  71. <View style={styles.container}>
  72. <ScrollView contentContainerStyle={styles.scrollContainer}>
  73. <Text style={styles.header}>Crazy Charge 用戶條款及細則</Text>
  74. <View style={styles.section}>
  75. {sections.map((section, index) => (
  76. <TermsSection
  77. key={index}
  78. title={section.title}
  79. clauses={section.clauses}
  80. />
  81. ))}
  82. </View>
  83. </ScrollView>
  84. <NormalButton
  85. extendedStyle={styles.agreeButton}
  86. onPress={() => handleAgree()}
  87. title={<Text
  88. style={{
  89. fontWeight: '600',
  90. fontSize: 18,
  91. color: '#fff'
  92. }}
  93. >
  94. 同意並繼續
  95. </Text>}
  96. >
  97. </NormalButton>
  98. </View>
  99. </SafeAreaView>
  100. );
  101. };
  102. const styles = StyleSheet.create({
  103. container: {
  104. flex: 1,
  105. padding: 8,
  106. backgroundColor: '#f8f9fa'
  107. },
  108. scrollContainer: {
  109. paddingBottom: 70
  110. },
  111. header: {
  112. fontSize: 24,
  113. fontWeight: 'bold',
  114. marginBottom: 15,
  115. color: '#2c3e50',
  116. textAlign: 'center'
  117. },
  118. description: {
  119. fontSize: 14,
  120. color: '#2c3e50',
  121. paddingLeft: 20,
  122. paddingRight: 20,
  123. marginBottom: 10,
  124. },
  125. section: {
  126. marginBottom: 10,
  127. backgroundColor: 'white',
  128. borderRadius: 8,
  129. padding: 16,
  130. elevation: 2
  131. },
  132. sectionTitle: {
  133. fontSize: 18,
  134. fontWeight: '600',
  135. marginBottom: 12,
  136. color: '#025c72'
  137. },
  138. clause: {
  139. fontSize: 14,
  140. lineHeight: 20,
  141. marginBottom: 5,
  142. color: '#34495e'
  143. },
  144. agreeButton: {
  145. position: 'absolute',
  146. bottom: 10,
  147. left: 20,
  148. right: 20,
  149. padding: 16,
  150. alignItems: 'center'
  151. },
  152. });
  153. export default UserTermsPageComponent;