feat: download page
This commit is contained in:
parent
edf03a04ee
commit
04693b805e
@ -120,6 +120,16 @@ export default function TabLayout() {
|
||||
tabBarStyle: { display: 'none' } // 确保在标签栏中不显示
|
||||
}}
|
||||
/>
|
||||
{/* 下载 */}
|
||||
<Tabs.Screen
|
||||
name="download"
|
||||
options={{
|
||||
title: 'download',
|
||||
tabBarButton: () => null, // 隐藏底部标签栏
|
||||
headerShown: false, // 隐藏导航栏
|
||||
tabBarStyle: { display: 'none' } // 确保在标签栏中不显示
|
||||
}}
|
||||
/>
|
||||
</Tabs>
|
||||
);
|
||||
}
|
||||
|
||||
63
app/(tabs)/download.tsx
Normal file
63
app/(tabs)/download.tsx
Normal file
@ -0,0 +1,63 @@
|
||||
import AndroidLogo from '@/assets/icons/svg/android.svg';
|
||||
import AppleLogo from '@/assets/icons/svg/apple.svg';
|
||||
import MemoIP from '@/assets/icons/svg/memo-ip.svg';
|
||||
import { LinearGradient } from 'expo-linear-gradient';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Linking, Text, TouchableOpacity, View } from 'react-native';
|
||||
|
||||
const IOS_APP_STORE_URL = 'https://apps.apple.com/cn/app/id6748205761';
|
||||
const ANDROID_APK_URL = 'https://cdn.memorywake.com/apks/application-f086a38c-dac1-43f1-9d24-e4378c2ce121.apk';
|
||||
export default function DownloadScreen() {
|
||||
const handleIOSDownload = () => {
|
||||
Linking.openURL(IOS_APP_STORE_URL);
|
||||
};
|
||||
|
||||
const handleAndroidDownload = () => {
|
||||
Linking.openURL(ANDROID_APK_URL);
|
||||
};
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<LinearGradient
|
||||
colors={['#FFB645', '#E2793F']}
|
||||
className="flex-1 items-center justify-center p-6"
|
||||
>
|
||||
<View className="absolute top-0 left-0 w-full h-full">
|
||||
<MemoIP width="100%" height="100%" style={{ opacity: 0.1 }} />
|
||||
</View>
|
||||
<View className="items-center mb-12">
|
||||
<Text className="text-white text-5xl font-extrabold tracking-tight">
|
||||
MemoWake
|
||||
</Text>
|
||||
<Text className="text-white/90 text-lg mt-4 text-center max-w-xs">
|
||||
{t('desc', { ns: 'download' })}
|
||||
</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={handleIOSDownload}
|
||||
activeOpacity={0.8}
|
||||
>
|
||||
<AppleLogo width={24} height={24} fill="black" />
|
||||
<Text className="text-black font-bold text-lg ml-3">
|
||||
{t('ios', { ns: 'download' })}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
className="bg-black/80 rounded-xl px-6 py-4 flex-row items-center justify-center shadow-lg"
|
||||
onPress={handleAndroidDownload}
|
||||
activeOpacity={0.8}
|
||||
>
|
||||
<AndroidLogo width={24} height={24} fill="#3DDC84" />
|
||||
<Text className="text-white font-bold text-lg ml-3">
|
||||
{t('android', { ns: 'download' })}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</LinearGradient>
|
||||
);
|
||||
}
|
||||
1
assets/icons/svg/android.svg
Normal file
1
assets/icons/svg/android.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-android2" viewBox="0 0 16 16"> <path d="M11.358 1.342a.5.5 0 0 1 .478.67l-.632 1.9a.5.5 0 0 1-.952.142l.63-1.9a.5.5 0 0 1 .476-.312m-6.716 0a.5.5 0 0 1 .478.312l.63 1.9a.5.5 0 0 1-.952-.142l-.63-1.9a.5.5 0 0 1 .476-.67M7.48 10.152a.5.5 0 0 1 .96 0l.175.525a.5.5 0 0 1-.96.002zm-2.225 1.015a.5.5 0 1 1 .866-.5l.176.524a.5.5 0 1 1-.866.5l-.176-.524zm4.45 0a.5.5 0 1 1 .866.5l-.176-.524a.5.5 0 1 1-.866-.5l.176.524z"/> <path d="M14 4.478a1.5 1.5 0 0 0-1.5-1.5h-9A1.5 1.5 0 0 0 2 4.478V13.5a1.5 1.5 0 0 0 1.5 1.5h9a1.5 1.5 0 0 0 1.5-1.5zM3.5 13V6h9v7z"/> </svg>
|
||||
|
After Width: | Height: | Size: 653 B |
1
assets/icons/svg/apple.svg
Normal file
1
assets/icons/svg/apple.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-apple" viewBox="0 0 16 16"> <path d="M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516s1.52.087 2.475-1.258.762-2.391.728-2.43m3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422s1.675-2.789 1.698-2.854-.597-.79-1.254-1.157a3.7 3.7 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56s.625 1.924 1.273 2.796c.576.984 1.34 1.667 1.659 1.899s1.219.386 1.843.067c.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758q.52-1.185.473-1.282"/> <path d="M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516s1.52.087 2.475-1.258.762-2.391.728-2.43m3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422s1.675-2.789 1.698-2.854-.597-.79-1.254-1.157a3.7 3.7 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56s.625 1.924 1.273 2.796c.576.984 1.34 1.667 1.659 1.899s1.219.386 1.843.067c.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758q.52-1.185.473-1.282"/> </svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@ -17,7 +17,7 @@ i18n
|
||||
resources: translations,
|
||||
|
||||
// 支持命名空间
|
||||
ns: ['common', 'example'],
|
||||
ns: ['common', 'example', 'download'],
|
||||
defaultNS: 'common',
|
||||
|
||||
// 设置默认语言为中文
|
||||
|
||||
6
i18n/locales/en/download.json
Normal file
6
i18n/locales/en/download.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"title": "Download Our App",
|
||||
"desc": "Get the full experience by downloading our app on your favorite platform.",
|
||||
"ios": "Download for iOS",
|
||||
"android": "Download for Android"
|
||||
}
|
||||
6
i18n/locales/zh/download.json
Normal file
6
i18n/locales/zh/download.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"title": "下载我们的应用",
|
||||
"desc": "在您喜欢的平台上下载我们的应用,以获得完整的体验。",
|
||||
"ios": "下载 iOS 版",
|
||||
"android": "下载 Android 版"
|
||||
}
|
||||
@ -3,6 +3,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 enExample from './locales/en/example.json';
|
||||
import enFairclip from './locales/en/fairclip.json';
|
||||
import enLanding from './locales/en/landing.json';
|
||||
@ -12,6 +13,7 @@ import enUpload from './locales/en/upload.json';
|
||||
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 zhExample from './locales/zh/example.json';
|
||||
import zhFairclip from './locales/zh/fairclip.json';
|
||||
import zhLanding from './locales/zh/landing.json';
|
||||
@ -22,25 +24,27 @@ import zhUpload from './locales/zh/upload.json';
|
||||
const translations = {
|
||||
en: {
|
||||
admin: enAdmin,
|
||||
ask: enAsk,
|
||||
common: enCommon,
|
||||
download: enDownload,
|
||||
example: enExample,
|
||||
fairclip: enFairclip,
|
||||
landing: enLanding,
|
||||
login: enLogin,
|
||||
personal: enPersonal,
|
||||
upload: enUpload,
|
||||
ask: enAsk
|
||||
upload: enUpload
|
||||
},
|
||||
zh: {
|
||||
admin: zhAdmin,
|
||||
ask: zhAsk,
|
||||
common: zhCommon,
|
||||
download: zhDownload,
|
||||
example: zhExample,
|
||||
fairclip: zhFairclip,
|
||||
landing: zhLanding,
|
||||
login: zhLogin,
|
||||
personal: zhPersonal,
|
||||
upload: zhUpload,
|
||||
ask: zhAsk
|
||||
upload: zhUpload
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@ -26,6 +26,7 @@
|
||||
"expo-image": "~2.3.2",
|
||||
"expo-image-manipulator": "~13.1.7",
|
||||
"expo-image-picker": "~16.1.4",
|
||||
"expo-linear-gradient": "^14.1.5",
|
||||
"expo-linking": "~7.1.5",
|
||||
"expo-localization": "^16.1.5",
|
||||
"expo-location": "~18.1.5",
|
||||
@ -8033,6 +8034,17 @@
|
||||
"react": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-linear-gradient": {
|
||||
"version": "14.1.5",
|
||||
"resolved": "http://192.168.31.115:8081/repository/npm/expo-linear-gradient/-/expo-linear-gradient-14.1.5.tgz",
|
||||
"integrity": "sha512-BSN3MkSGLZoHMduEnAgfhoj3xqcDWaoICgIr4cIYEx1GcHfKMhzA/O4mpZJ/WC27BP1rnAqoKfbclk1eA70ndQ==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"expo": "*",
|
||||
"react": "*",
|
||||
"react-native": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/expo-linking": {
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/expo-linking/-/expo-linking-7.1.6.tgz",
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
"expo-image": "~2.3.2",
|
||||
"expo-image-manipulator": "~13.1.7",
|
||||
"expo-image-picker": "~16.1.4",
|
||||
"expo-linear-gradient": "^14.1.5",
|
||||
"expo-linking": "~7.1.5",
|
||||
"expo-localization": "^16.1.5",
|
||||
"expo-location": "~18.1.5",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user