feat: 支持页面
All checks were successful
Prod Deploy / Explore-Gitea-Actions (push) Successful in 35s

This commit is contained in:
Junhui Chen 2025-07-21 17:18:01 +08:00
parent 2f8a3d2948
commit 9deeaa9a0c
5 changed files with 100 additions and 0 deletions

View File

@ -3,6 +3,7 @@ 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';
@ -17,6 +18,7 @@ interface PollingData {
extra: any;
}
export default function TabLayout() {
const { t } = useTranslation();
const colorScheme = useColorScheme();
const [pollingData, setPollingData] = useState<PollingData[]>([]);
const pollingInterval = useRef<NodeJS.Timeout | number>(null);
@ -281,6 +283,17 @@ export default function TabLayout() {
}}
/>
{/* Support Screen */}
<Tabs.Screen
name="support"
options={{
title: t('tabTitle', { ns: 'support' }),
tabBarButton: () => null, // 隐藏底部标签栏
headerShown: false, // 隐藏导航栏
tabBarStyle: { display: 'none' } // 确保在标签栏中不显示
}}
/>
{/* Debug Screen - only in development */}
{process.env.NODE_ENV === 'development' && (
<Tabs.Screen

67
app/(tabs)/support.tsx Normal file
View File

@ -0,0 +1,67 @@
import { Ionicons } from '@expo/vector-icons';
import { LinearGradient } from 'expo-linear-gradient';
import Head from 'expo-router/head';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Linking, Text, TouchableOpacity, View } from 'react-native';
const SupportScreen = () => {
const { t } = useTranslation('support');
const handleWeChatSupport = () => {
Linking.openURL('https://work.weixin.qq.com/kfid/kfca0ac87f4e05e8bfd');
};
const handleEmailSupport = () => {
Linking.openURL('mailto:memowake@fairclip.cn');
};
return (
<>
<Head>
<title>{t('pageTitle')}</title>
</Head>
<LinearGradient
colors={['#FFB645', '#E2793F']}
className="flex-1 items-center justify-center p-6"
>
<View className="items-center mb-12">
<Text className="text-white text-5xl font-extrabold tracking-tight">
MemoWake
</Text>
<Text className="text-white/90 text-2xl mt-4 text-center max-w-xs">
{t('title')}
</Text>
<Text className="text-white/90 text-lg mt-4 text-center max-w-xs">
{t('description')}
</Text>
</View>
<View className="w-full max-w-xs">
<TouchableOpacity
className="bg-white/90 rounded-xl px-6 py-4 flex-row items-center justify-center shadow-lg mb-5"
onPress={handleWeChatSupport}
activeOpacity={0.8}
>
<Ionicons name="chatbubbles-outline" size={24} color="black" />
<Text className="text-black font-bold text-lg ml-3">
{t('onlineSupport')}
</Text>
</TouchableOpacity>
<TouchableOpacity
className="bg-black/80 rounded-xl px-6 py-4 flex-row items-center justify-center shadow-lg"
onPress={handleEmailSupport}
activeOpacity={0.8}
>
<Ionicons name="mail-outline" size={24} color="white" />
<Text className="text-white font-bold text-lg ml-3">
{t('emailSupport')}
</Text>
</TouchableOpacity>
</View>
</LinearGradient>
</>
);
};
export default SupportScreen;

View File

@ -0,0 +1,8 @@
{
"title": "Support & Help",
"description": "If you encounter any issues or have any suggestions, please contact us through the following methods.",
"onlineSupport": "Online Support",
"emailSupport": "Email Support",
"pageTitle": "Support & Help - MemoWake",
"tabTitle": "Support"
}

View File

@ -0,0 +1,8 @@
{
"title": "支持与帮助",
"description": "如果您在使用中遇到任何问题,或有任何建议,请通过以下方式联系我们。",
"onlineSupport": "在线客服",
"emailSupport": "邮件联系",
"pageTitle": "支持与帮助 - MemoWake",
"tabTitle": "支持"
}

View File

@ -4,6 +4,7 @@ import enAdmin from './locales/en/admin.json';
import enAsk from './locales/en/ask.json';
import enCommon from './locales/en/common.json';
import enDownload from './locales/en/download.json';
import enSupport from './locales/en/support.json';
import enExample from './locales/en/example.json';
import enFairclip from './locales/en/fairclip.json';
import enLanding from './locales/en/landing.json';
@ -14,6 +15,7 @@ import zhAdmin from './locales/zh/admin.json';
import zhAsk from './locales/zh/ask.json';
import zhCommon from './locales/zh/common.json';
import zhDownload from './locales/zh/download.json';
import zhSupport from './locales/zh/support.json';
import zhExample from './locales/zh/example.json';
import zhFairclip from './locales/zh/fairclip.json';
import zhLanding from './locales/zh/landing.json';
@ -27,6 +29,7 @@ const translations = {
ask: enAsk,
common: enCommon,
download: enDownload,
support: enSupport,
example: enExample,
fairclip: enFairclip,
landing: enLanding,
@ -39,6 +42,7 @@ const translations = {
ask: zhAsk,
common: zhCommon,
download: zhDownload,
support: zhSupport,
example: zhExample,
fairclip: zhFairclip,
landing: zhLanding,