34 lines
2.3 KiB
TypeScript
34 lines
2.3 KiB
TypeScript
import { useEffect, useState } from 'react'
|
|||
|
|
import { Button, ScrollView, Text, View } from '@tarojs/components'
|
||
|
|
import { NavBar } from '../../components/NavBar'
|
||
|
|
import { api } from '../../services/request'
|
||
|
|
import './index.scss'
|
||
|
|
|
||
|
|
const sampleUser = '为使用小程序软件服务(以下简称“本服务”),您应当阅读并遵守《小程序软件注册协议》以及专项规则等。请您务必审慎阅读、充分理解各条款内容,特别是免除或限制责任的相应条款。'
|
||
|
|
const samplePrivacy = '欢迎使用那吉。本隐私政策旨在向您说明我们收集、使用、存储、披露个人信息的方式、范围及您享有的相关权利,确保您在充分知情的前提下自愿使用本应用。'
|
||
|
|
|
||
|
|
export default function AgreementPage() {
|
||
|
|
const [active, setActive] = useState<'user' | 'privacy'>('user')
|
||
|
|
const [body, setBody] = useState(sampleUser)
|
||
|
|
|
||
|
|
useEffect(() => {
|
||
|
|
api.agreement(active).then((res) => setBody(res.body)).catch(() => setBody(active === 'user' ? sampleUser : samplePrivacy))
|
||
|
|
}, [active])
|
||
|
|
|
||
|
|
return (
|
||
|
|
<View className='page agreement-page'>
|
||
|
|
<NavBar back title='协议' />
|
||
|
|
<View className='tabs'>
|
||
|
|
<Button className={active === 'user' ? 'tab current' : 'tab'} onClick={() => setActive('user')}>用户协议</Button>
|
||
|
|
<Button className={active === 'privacy' ? 'tab current' : 'tab'} onClick={() => setActive('privacy')}>隐私政策</Button>
|
||
|
|
</View>
|
||
|
|
<ScrollView className='article' scrollY>
|
||
|
|
<Text className='article-title'>{active === 'user' ? '用户协议' : '一、引言'}</Text>
|
||
|
|
<Text className='paragraph'>{body}</Text>
|
||
|
|
<Text className='paragraph'>一、协议的范围{'\n'}1.1 本协议是您与那吉之间关于使用那吉软件服务所订立的协议。所有规则均为本协议不可分割的一部分,与协议正文具有同等法律效力。</Text>
|
||
|
|
<Text className='paragraph'>二、适用范围{'\n'}本政策适用于您通过本应用进行的所有操作及我们因此收集的个人信息,涵盖注册、登录、使用功能、参与互动等场景。</Text>
|
||
|
|
<Text className='paragraph'>三、个人信息的收集与使用{'\n'}我们遵循合法、正当、必要原则,仅收集为实现服务功能所必需的信息。</Text>
|
||
|
|
</ScrollView>
|
||
|
|
</View>
|
||
|
|
)
|
||
|
|
}
|