From 6aa98dae44158e6d069dcc3fd02055d8f284fe18 Mon Sep 17 00:00:00 2001 From: jinyaqiu Date: Mon, 21 Jul 2025 20:35:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=9A=90=E7=A7=81=E5=8D=8F=E8=AE=AE=20?= =?UTF-8?q?(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.fairclip.cn/FairClip/memowake-front/pulls/10 --- app/(tabs)/_layout.tsx | 12 ++- app/(tabs)/privacy-policy.tsx | 159 ++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 app/(tabs)/privacy-policy.tsx diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index eb6d47a..a4ec795 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -3,12 +3,12 @@ import { TabBarIcon } from '@/components/navigation/TabBarIcon'; import TabBarBackground from '@/components/ui/TabBarBackground'; import { Colors } from '@/constants/Colors'; import { useColorScheme } from '@/hooks/useColorScheme'; -import { useTranslation } from 'react-i18next'; import { fetchApi } from '@/lib/server-api-util'; import * as Notifications from 'expo-notifications'; import { Tabs } from 'expo-router'; import * as SecureStore from 'expo-secure-store'; import React, { useCallback, useEffect, useRef, useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { Platform } from 'react-native'; interface PollingData { @@ -282,6 +282,16 @@ export default function TabLayout() { tabBarStyle: { display: 'none' } // 确保在标签栏中不显示 }} /> + {/* 隐私协议 */} + null, // 隐藏底部标签栏 + headerShown: false, // 隐藏导航栏 + tabBarStyle: { display: 'none' } // 确保在标签栏中不显示 + }} + /> {/* Support Screen */} { + const [article, setArticle] = useState({} as Policy); + useEffect(() => { + const loadArticle = async () => { + fetchApi(`/system-config/policy/privacy_policy`).then((res: any) => { + setArticle(res) + }).catch((error: any) => { + console.log(error) + }) + } + loadArticle(); + }, []); + + if (!article) { + return ( + + 加载中... + + ); + } + + return ( + + + + Settings + {'Privacy Policy'} + + × + + + + + + + + + ); +}; + +export default PrivacyPolicy; + +const styles = StyleSheet.create({ + centeredView: { + flex: 1, + justifyContent: 'flex-end', + backgroundColor: 'rgba(0,0,0,0.5)', + }, + container: { + flex: 1, + }, + modalView: { + width: '100%', + height: '100%', + backgroundColor: 'white', + paddingHorizontal: 16, + }, + modalHeader: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + marginBottom: 20, + }, + modalTitle: { + fontSize: 20, + fontWeight: 'bold', + color: '#4C320C', + }, + closeButton: { + fontSize: 28, + color: '#4C320C', + padding: 10, + }, + modalContent: { + flex: 1, + }, + modalText: { + fontSize: 16, + color: '#4C320C', + }, + premium: { + backgroundColor: "#FAF9F6", + padding: 16, + borderRadius: 24, + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + }, + content: { + flex: 1, + flexDirection: 'column', + gap: 4, + backgroundColor: '#FAF9F6', + borderRadius: 24, + paddingVertical: 8 + }, + item: { + paddingHorizontal: 16, + paddingVertical: 8, + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + }, + itemText: { + fontSize: 14, + fontWeight: '600', + color: '#4C320C', + }, + upgradeButton: { + backgroundColor: '#E2793F', + borderRadius: 20, + paddingHorizontal: 16, + paddingVertical: 8, + }, + upgradeButtonText: { + color: '#fff', + fontSize: 14, + fontWeight: "600" + }, + switchContainer: { + width: 50, + height: 30, + borderRadius: 15, + justifyContent: 'center', + paddingHorizontal: 2, + }, + switchOn: { + backgroundColor: '#E2793F', + alignItems: 'flex-end', + }, + switchOff: { + backgroundColor: '#E5E5E5', + alignItems: 'flex-start', + }, + switchCircle: { + width: 26, + height: 26, + borderRadius: 13, + }, + switchCircleOn: { + backgroundColor: 'white', + }, + switchCircleOff: { + backgroundColor: '#A5A5A5', + }, +}); \ No newline at end of file