SEC_Warehouse/src/pages/agreement/index.tsx

32 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { View, Text } from '@tarojs/components'
import { useRouter } from '@tarojs/taro'
import { Navbar } from '@/components/navbar'
import { AGREEMENT_TEXTS, type AgreementType } from './content'
import styles from './index.module.scss'
export default function AgreementPage() {
const router = useRouter()
const raw = router.params.type ?? 'user'
const type: AgreementType = raw === 'privacy' ? 'privacy' : 'user'
const doc = AGREEMENT_TEXTS[type]
return (
<View className={styles.page}>
<Navbar title={doc.title} />
<View className={styles.body}>
<Text className={styles.title}>{doc.title}</Text>
<Text className={styles.updated}>更新日期:{doc.updatedAt}</Text>
{doc.sections.map((s) => (
<View key={s.heading} className={styles.section}>
<Text className={styles.heading}>{s.heading}</Text>
{s.paragraphs.map((p, i) => (
<Text key={i} className={styles.paragraph}>{p}</Text>
))}
</View>
))}
</View>
</View>
)
}