diff --git a/App.tsx b/App.tsx index 24207aa..b165b62 100644 --- a/App.tsx +++ b/App.tsx @@ -8,6 +8,9 @@ import InfoScreen from "./src/InfoScreen"; import DfuScreen from "./src/DfuScreen"; import PrivacyScreen from "./src/PrivacyScreen"; import SplashScreen from "./src/SplashScreen"; // ✅ 新增启动页 +import pxToDp from "./src/helper/pxToDp"; +import SettingScreen from "./src/SettingScreen"; +import './src/i18n' export type RootStackParamList = { Splash: undefined; @@ -16,6 +19,7 @@ export type RootStackParamList = { Info: { peripheral: any }; Dfu: { deviceId: string; name: string; firmware: string }; Privacy: undefined; + Setting: undefined; }; const Stack = createNativeStackNavigator(); @@ -25,13 +29,9 @@ export default function App() { + animation : 'slide_from_right' + }}> {/* 启动页(无标题) */} {/* 其他页面默认显示标题栏 */} + diff --git a/android/app/build.gradle b/android/app/build.gradle index c26acfb..11fda38 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -82,8 +82,8 @@ android { applicationId "com.zhixingpai.powerfundfuapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0.0" + versionCode 2 + versionName "1.0.1" } signingConfigs { debug { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fb78f39..8527a8d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -17,7 +17,8 @@ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" - android:exported="true"> + android:exported="true" + android:screenOrientation="portrait"> diff --git a/android/app/src/main/res/values-zh/strings.xml b/android/app/src/main/res/values-zh/strings.xml new file mode 100644 index 0000000..40d980c --- /dev/null +++ b/android/app/src/main/res/values-zh/strings.xml @@ -0,0 +1,3 @@ + + POWERFUN设置 + diff --git a/android/app/src/main/res/values-zh/styles.xml b/android/app/src/main/res/values-zh/styles.xml new file mode 100644 index 0000000..7ba83a2 --- /dev/null +++ b/android/app/src/main/res/values-zh/styles.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 40d980c..e3d0857 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - POWERFUN设置 + POWERFUN Settings diff --git a/ios/Podfile b/ios/Podfile index f79d687..4e817c4 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -20,6 +20,8 @@ end target 'dfuapp' do config = use_native_modules! + pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' + use_react_native!( :path => config[:reactNativePath], # An absolute path to your application root. diff --git a/ios/dfuapp/Info.plist b/ios/dfuapp/Info.plist index 21ebf9b..a943636 100644 --- a/ios/dfuapp/Info.plist +++ b/ios/dfuapp/Info.plist @@ -48,10 +48,10 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance + ITSAppUsesNonExemptEncryption + diff --git a/ios/dfuapp/en.lproj/InfoPlist.strings b/ios/dfuapp/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..77f60b2 --- /dev/null +++ b/ios/dfuapp/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +CFBundleDisplayName = "POWERFUN Settings"; +CFBundleName = "POWERFUN Settings"; \ No newline at end of file diff --git a/ios/dfuapp/zh-Hans.lproj/InfoPlist.strings b/ios/dfuapp/zh-Hans.lproj/InfoPlist.strings new file mode 100644 index 0000000..9bc44c0 --- /dev/null +++ b/ios/dfuapp/zh-Hans.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +CFBundleDisplayName = "POWERFUN设置"; +CFBundleName = "POWERFUN设置"; \ No newline at end of file diff --git a/package.json b/package.json index 8667c78..56895fa 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "scripts": { "android": "react-native run-android", + "clean-a": "cd android && gradlew clean", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", @@ -11,18 +12,25 @@ "build-a": "set NODE_OPTIONS=--openssl-legacy-provider && cd android&&gradlew assembleRelease" }, "dependencies": { + "@react-native-async-storage/async-storage": "^2.2.0", "@react-native/codegen": "0.81.4", "@react-native/new-app-screen": "0.81.4", "@react-navigation/native": "^7.1.17", "@react-navigation/native-stack": "^7.3.26", "@systemic-games/react-native-bluetooth-le": "^1.3.0", "@systemic-games/react-native-nordic-nrf5-dfu": "^1.3.0", + "@types/lodash": "^4.17.21", "base-64": "^1.0.0", + "i18next": "^25.7.3", "react": "19.1.0", + "react-i18next": "^16.5.0", "react-native": "0.81.4", + "react-native-device-info": "^15.0.1", "react-native-fs": "^2.20.0", "react-native-safe-area-context": "^5.6.1", "react-native-screens": "^4.16.0", + "react-native-status-bar-height": "^2.6.0", + "react-native-toast-message": "^2.3.3", "react-native-vector-icons": "^10.3.0" }, "devDependencies": { diff --git a/src/DfuScreen.tsx b/src/DfuScreen.tsx index a59913c..25b8c6a 100644 --- a/src/DfuScreen.tsx +++ b/src/DfuScreen.tsx @@ -4,6 +4,9 @@ import { NativeStackScreenProps } from "@react-navigation/native-stack"; import { RootStackParamList } from "../App"; import RNFS from "react-native-fs"; import { startDfu, DfuProgressEvent, DfuStateEvent } from "@systemic-games/react-native-nordic-nrf5-dfu"; +import { useTranslation } from 'react-i18next'; +import MyStatusbar from "./component/MyStatusbar"; +import MyHeader from "./component/MyHeader"; type Props = NativeStackScreenProps; @@ -14,33 +17,34 @@ interface DeviceInfo { } export default function DfuScreen({ route, navigation }: Props) { + const { t } = useTranslation(); const { deviceId, name, firmware: deviceFirmware } = route.params; const [progress, setProgress] = useState(0); - const [state, setState] = useState("准备中..."); + const [state, setState] = useState(t('dfu.preparing')); const [error, setError] = useState(); - const [latestVersion, setLatestVersion] = useState("读取中..."); + const [latestVersion, setLatestVersion] = useState(t('dfu.reading')); const [isDfuRunning, setIsDfuRunning] = useState(false); const mapDfuStateToChinese = (state: string): string => { switch (state) { - case "connecting": return "连接中…"; - case "starting": return "初始化中…"; - case "enablingDfuMode": return "启用 DFU 模式…"; - case "uploading": return "上传固件中…"; - case "validating": return "校验固件…"; - case "disconnecting": return "断开连接…"; - case "completed": return "升级完成"; - case "aborted": return "已取消"; + case "connecting": return t('dfu.stateConnecting'); + case "starting": return t('dfu.stateStarting'); + case "enablingDfuMode": return t('dfu.stateEnablingDfuMode'); + case "uploading": return t('dfu.stateUploading'); + case "validating": return t('dfu.stateValidating'); + case "disconnecting": return t('dfu.stateDisconnecting'); + case "completed": return t('dfu.stateCompleted'); + case "aborted": return t('dfu.stateAborted'); case "failed": - case "dfu_failed": return "升级失败"; - case "initializing": return "启动中…"; - case "errored": return "升级出错!"; + case "dfu_failed": return t('dfu.stateFailed'); + case "initializing": return t('dfu.stateInitializing'); + case "errored": return t('dfu.stateErrored'); default: return state; } }; - + // ✅ 拦截所有导航返回(iOS + Android) useEffect(() => { const unsubscribe = navigation.addListener("beforeRemove", (e) => { @@ -48,13 +52,13 @@ export default function DfuScreen({ route, navigation }: Props) { // 阻止返回 e.preventDefault(); - Alert.alert("请稍候", "正在升级,请勿返回或关闭应用!"); + Alert.alert(t('dfu.pleaseWait'), t('dfu.doNotReturn')); }); return unsubscribe; }, [navigation, isDfuRunning]); - + useEffect(() => { @@ -76,8 +80,8 @@ export default function DfuScreen({ route, navigation }: Props) { const deviceInfo = manifest.devices.find(d => d.hardware === deviceHW); if (!deviceInfo) { setIsDfuRunning(false); - Alert.alert("无法升级", `未找到硬件版本 ${deviceHW} 的固件`, [ - { text: "确认", onPress: () => navigation.goBack() }, + Alert.alert(t('dfu.cannotUpgrade'), t('dfu.hardwareNotFound', { hardware: deviceHW }), [ + { text: t('dfu.confirm'), onPress: () => navigation.goBack() }, ]); return; } @@ -89,8 +93,8 @@ export default function DfuScreen({ route, navigation }: Props) { if (latestFW <= deviceFW) { setIsDfuRunning(false); - Alert.alert("无需升级", "已是最新固件,无需升级", [ - { text: "确认", onPress: () => navigation.goBack() }, + Alert.alert(t('dfu.noNeedUpgrade'), t('dfu.alreadyLatest'), [ + { text: t('dfu.confirm'), onPress: () => navigation.goBack() }, ]); return; } @@ -104,14 +108,14 @@ export default function DfuScreen({ route, navigation }: Props) { }); setIsDfuRunning(false); - Alert.alert("升级成功", "升级成功,请重连设备", [ - { text: "确认", onPress: () => navigation.navigate("Home") }, + Alert.alert(t('dfu.upgradeSuccess'), t('dfu.upgradeSuccessMessage'), [ + { text: t('dfu.confirm'), onPress: () => navigation.navigate("Home") }, ]); } catch (err: any) { setIsDfuRunning(false); - setError(err.message || "DFU失败"); - Alert.alert("升级失败", err.message || "DFU失败", [ - { text: "确认", onPress: () => navigation.goBack() }, + setError(err.message || t('dfu.dfuFailed')); + Alert.alert(t('dfu.upgradeFailed'), err.message || t('dfu.dfuFailed'), [ + { text: t('dfu.confirm'), onPress: () => navigation.goBack() }, ]); } }; @@ -120,27 +124,40 @@ export default function DfuScreen({ route, navigation }: Props) { }, [deviceId, deviceFirmware, navigation]); return ( - - - 蓝牙名称: {name} - - - 最新版本: {latestVersion} - - - 当前版本: {deviceFirmware} - - - 升级状态: {mapDfuStateToChinese(state)} - + + + + - {/* 横向进度条 */} - - - {progress}% - + + + {t('dfu.bluetoothName')}: {name} + + + + + {t('dfu.latestVersion')}: {latestVersion} + + + + + {t('dfu.currentVersion')}: {deviceFirmware} + + + + + {t('dfu.upgradeStatus')}: {mapDfuStateToChinese(state)} + + - {error && {error}} + {/* 横向进度条 */} + + + {progress}% + + + {error && {error}} + ); } diff --git a/src/HomeScreen.tsx b/src/HomeScreen.tsx index 628f11e..2b35f3a 100644 --- a/src/HomeScreen.tsx +++ b/src/HomeScreen.tsx @@ -1,33 +1,36 @@ import React from "react"; -import { View, Text, TouchableOpacity, StyleSheet, StatusBar } from "react-native"; -import { NativeStackScreenProps } from "@react-navigation/native-stack"; +import { View, Text, TouchableOpacity, StyleSheet, StatusBar, Image } from "react-native"; +import { NativeStackScreenProps,NativeStackNavigationProp } from "@react-navigation/native-stack"; import { RootStackParamList } from "../App"; +import MyStatusbar from "./component/MyStatusbar"; +import MyHeader from "./component/MyHeader"; +import pxToDp from "./helper/pxToDp"; +import DeviceInfo from "react-native-device-info"; +import { useTranslation } from 'react-i18next'; -type Props = NativeStackScreenProps; +type Props = NativeStackScreenProps; export default function HomeScreen({ navigation }: Props) { + const { t } = useTranslation(); return ( {/* 设置状态栏颜色 */} - - + + navigation.navigate("Setting")}> + + }> {/* 中间按钮 */} + navigation.navigate("Scan")} > - 搜索设备 + {t('home.scan')} - - {/* 底部区域 */} - - navigation.navigate("Privacy")}> - 隐私协议 - - 版本号 v0.0.1 - ); } @@ -39,18 +42,22 @@ const styles = StyleSheet.create({ }, centerBox: { flex: 1, - justifyContent: "center", + // justifyContent: "center", alignItems: "center", + backgroundColor:'#fff', + paddingTop:pxToDp(250) }, button: { - backgroundColor: "#E7141E", // 红色按钮 - paddingVertical: 15, - paddingHorizontal: 40, - borderRadius: 10, + backgroundColor: "#E7141E", + borderRadius: pxToDp(24), + width:pxToDp(300), + height:pxToDp(96), + alignItems:'center', + justifyContent:'center' }, buttonText: { color: "#fff", - fontSize: 18, + fontSize: pxToDp(32), fontWeight: "bold", }, bottomBox: { diff --git a/src/InfoScreen.tsx b/src/InfoScreen.tsx index fead836..42352b8 100644 --- a/src/InfoScreen.tsx +++ b/src/InfoScreen.tsx @@ -19,7 +19,9 @@ import { ConnectionStatus, } from "@systemic-games/react-native-bluetooth-le"; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; - +import { useTranslation } from 'react-i18next'; +import MyStatusbar from "./component/MyStatusbar"; +import MyHeader from "./component/MyHeader"; type Props = NativeStackScreenProps; @@ -34,10 +36,9 @@ const fullUUID = (uuid: string) => : uuid; const Text = ({ children, style, ...props }: any) => { - const isDark = useColorScheme() === "dark"; return ( {children} @@ -46,6 +47,7 @@ const Text = ({ children, style, ...props }: any) => { }; export default function InfoScreen({ route, navigation }: Props) { + const { t } = useTranslation(); const { peripheral } = route.params; const deviceKey = peripheral.address || peripheral.systemId; @@ -56,11 +58,11 @@ export default function InfoScreen({ route, navigation }: Props) { const [isConnected, setIsConnected] = useState(false); const [isLoading, setIsLoading] = useState(true); - const [serial, setSerial] = useState("读取中..."); - const [firmware, setFirmware] = useState("读取中..."); - const [hardware, setHardware] = useState("读取中..."); - const [battery, setBattery] = useState("读取中..."); - const [powerTrim, setPowerTrim] = useState("读取中"); + const [serial, setSerial] = useState(t('info.reading')); + const [firmware, setFirmware] = useState(t('info.reading')); + const [hardware, setHardware] = useState(t('info.reading')); + const [battery, setBattery] = useState(t('info.reading')); + const [powerTrim, setPowerTrim] = useState(t('info.reading')); const [inputTrim, setInputTrim] = useState(""); const [readSuccessToast, setReadSuccessToast] = useState(false); // ✅ 读取成功提示 @@ -74,7 +76,7 @@ export default function InfoScreen({ route, navigation }: Props) { const prevConnectedRef = useRef(isConnected); const isActiveRef = useRef(true); - //增加校准按钮相关状态 + //增加校准按钮相关状态 const [calibrating, setCalibrating] = useState(false); const [calibrationSuccess, setCalibrationSuccess] = useState(false); const [calibrationValue, setCalibrationValue] = useState(""); @@ -82,56 +84,56 @@ export default function InfoScreen({ route, navigation }: Props) { const isCalibratingRef = useRef(false); useFocusEffect( - React.useCallback(() => { - // 页面获得焦点 - isActiveRef.current = true; - return () => { - // 页面失去焦点 - isActiveRef.current = false; - }; - }, []) -); + React.useCallback(() => { + // 页面获得焦点 + isActiveRef.current = true; + return () => { + // 页面失去焦点 + isActiveRef.current = false; + }; + }, []) + ); // ========== 监听连接状态变化,断开时提示重新连接 ========== useEffect(() => { - if (prevConnectedRef.current && !isConnected && isActiveRef.current) { - Alert.alert("提示", "设备已断开,请重新连接设备", [ - { text: "确定", onPress: () => navigation.goBack() }, - ]); - } - prevConnectedRef.current = isConnected; -}, [isConnected]); + if (prevConnectedRef.current && !isConnected && isActiveRef.current) { + Alert.alert(t('info.disconnectTitle'), t('info.disconnectMessage'), [ + { text: t('info.confirm'), onPress: () => navigation.goBack() }, + ]); + } + prevConnectedRef.current = isConnected; + }, [isConnected]); // ========== 页面即将返回时,强制断开蓝牙 ========== useEffect(() => { - const unsubscribe = navigation.addListener("beforeRemove", async (e) => { - if (disconnectingRef.current) return; - disconnectingRef.current = true; + const unsubscribe = navigation.addListener("beforeRemove", async (e) => { + if (disconnectingRef.current) return; + disconnectingRef.current = true; - const next = e.data.action?.type; - const action = e.data.action as any; + const next = e.data.action?.type; + const action = e.data.action as any; - // ✅ 判断是否跳转到 Dfu 页面 - if (next === "NAVIGATE" && action?.payload?.name === "Dfu") { - console.log("➡️ 跳转到 DFU,不断开蓝牙"); - disconnectingRef.current = false; - return; - } + // ✅ 判断是否跳转到 Dfu 页面 + if (next === "NAVIGATE" && action?.payload?.name === "Dfu") { + console.log("➡️ 跳转到 DFU,不断开蓝牙"); + disconnectingRef.current = false; + return; + } - // 🔌 其他页面离开则断开蓝牙 - console.log("📴 页面关闭,断开蓝牙..."); - try { - await Central.disconnectPeripheral(peripheral); - console.log("✅ 已断开蓝牙"); - } catch (err) { - console.warn("❌ 断开失败:", err); - } finally { - disconnectingRef.current = false; - } - }); - return unsubscribe; -}, [navigation, peripheral]); + // 🔌 其他页面离开则断开蓝牙 + console.log("📴 页面关闭,断开蓝牙..."); + try { + await Central.disconnectPeripheral(peripheral); + console.log("✅ 已断开蓝牙"); + } catch (err) { + console.warn("❌ 断开失败:", err); + } finally { + disconnectingRef.current = false; + } + }); + return unsubscribe; + }, [navigation, peripheral]); // ========== BLE notify 订阅FFF3 ========== useEffect(() => { @@ -154,7 +156,7 @@ export default function InfoScreen({ route, navigation }: Props) { peripheral, fullUUID(powerServiceUuid), fullUUID(powerNotifyUuid) - ).catch(() => {}); + ).catch(() => { }); await Central.subscribeCharacteristic( peripheral, fullUUID(powerServiceUuid), @@ -163,18 +165,18 @@ export default function InfoScreen({ route, navigation }: Props) { try { const raw = (notifyEv as any).value; if (!raw) return; - const byteArray = raw instanceof Uint8Array - ? raw - : new Uint8Array(raw); + const byteArray = raw instanceof Uint8Array + ? raw + : new Uint8Array(raw); if (byteArray[0] === 0x02 && byteArray.length >= 2) { - // 功率微调数据 - setPowerTrim(byteArray[1].toString()); - //setInputTrim(byteArray[1].toString()); - } - else if (byteArray[0] === 0x05 && byteArray.length >= 3) { - // 校准响应数据 (05XXXX格式) - handleFFF3Response(byteArray); - } + // 功率微调数据 + setPowerTrim(byteArray[1].toString()); + //setInputTrim(byteArray[1].toString()); + } + else if (byteArray[0] === 0x05 && byteArray.length >= 3) { + // 校准响应数据 (05XXXX格式) + handleFFF3Response(byteArray); + } } catch (err) { console.warn("notify parse error", err); } @@ -235,24 +237,24 @@ export default function InfoScreen({ route, navigation }: Props) { console.log("✅ info 读取完成"); - + try { - await Central.writeCharacteristic( - peripheral, - fullUUID(powerServiceUuid), - fullUUID(powerWriteUuid), - new Uint8Array([0x04]).buffer, - { withoutResponse: false } - ); - console.log("✅ 已发送 0x04,等待 notify 更新功率微调"); + await Central.writeCharacteristic( + peripheral, + fullUUID(powerServiceUuid), + fullUUID(powerWriteUuid), + new Uint8Array([0x04]).buffer, + { withoutResponse: false } + ); + console.log("✅ 已发送 0x04,等待 notify 更新功率微调"); - // notify 回调里已经订阅了,所以这里不用再重复订阅 - // 可以稍等 300ms,确保 notify 回来后 UI 会更新 - await new Promise(resolve => setTimeout(() => resolve(), 300)); - } catch (err) { - console.warn("❌ 首次读取功率微调失败", err); - } + // notify 回调里已经订阅了,所以这里不用再重复订阅 + // 可以稍等 300ms,确保 notify 回来后 UI 会更新 + await new Promise(resolve => setTimeout(() => resolve(), 300)); + } catch (err) { + console.warn("❌ 首次读取功率微调失败", err); + } } catch (e) { console.warn("❌ 读取失败", e); @@ -268,103 +270,103 @@ export default function InfoScreen({ route, navigation }: Props) { }, [peripheral]); - -// ========== 订阅 1818 服务的 2A63 特性 (通知) ========== -useEffect(() => { - const subscribeToPowerData = async () => { - try { - // 确保设备已经连接 - if (!isConnected) return; - console.log("✅ 订阅 2A63 特性通知..."); - - // 先取消之前的订阅(防止重复订阅) - await Central.unsubscribeCharacteristic( - peripheral, - fullUUID("1818"), - fullUUID("2a63") - ).catch(() => {}); + // ========== 订阅 1818 服务的 2A63 特性 (通知) ========== + useEffect(() => { + const subscribeToPowerData = async () => { + try { + // 确保设备已经连接 + if (!isConnected) return; - // 订阅 2A63 特性通知 - await Central.subscribeCharacteristic( - peripheral, - fullUUID("1818"), - fullUUID("2a63"), - (notifyEv) => { - try { - const raw = notifyEv.value; - if (raw) { - // 将 ArrayBuffer 转换为字节数组 - const byteArray = new Uint8Array(raw); - - // 解析数据 - parseData(byteArray); + console.log("✅ 订阅 2A63 特性通知..."); + + // 先取消之前的订阅(防止重复订阅) + await Central.unsubscribeCharacteristic( + peripheral, + fullUUID("1818"), + fullUUID("2a63") + ).catch(() => { }); + + // 订阅 2A63 特性通知 + await Central.subscribeCharacteristic( + peripheral, + fullUUID("1818"), + fullUUID("2a63"), + (notifyEv) => { + try { + const raw = notifyEv.value; + if (raw) { + // 将 ArrayBuffer 转换为字节数组 + const byteArray = new Uint8Array(raw); + + // 解析数据 + parseData(byteArray); + } + } catch (err) { + console.warn("❌ 处理通知数据失败", err); } - } catch (err) { - console.warn("❌ 处理通知数据失败", err); } - } - ); - - console.log("✅ 已订阅 2A63 特性通知"); - } catch (err) { - console.warn("❌ 订阅 2A63 特性失败", err); - } - }; + ); - // 只在设备已连接时进行订阅 - if (peripheral && isConnected) { - subscribeToPowerData(); - } + console.log("✅ 已订阅 2A63 特性通知"); + } catch (err) { + console.warn("❌ 订阅 2A63 特性失败", err); + } + }; - // 清理订阅(当组件卸载或者连接状态变化时) - return () => { + // 只在设备已连接时进行订阅 if (peripheral && isConnected) { - Central.unsubscribeCharacteristic(peripheral, fullUUID("1818"), fullUUID("2a63")).catch(() => {}); + subscribeToPowerData(); } - }; -}, [peripheral, isConnected]); -const cadenceStateRef = useRef({ + // 清理订阅(当组件卸载或者连接状态变化时) + return () => { + if (peripheral && isConnected) { + Central.unsubscribeCharacteristic(peripheral, fullUUID("1818"), fullUUID("2a63")).catch(() => { }); + } + }; + }, [peripheral, isConnected]); + + const cadenceStateRef = useRef({ lastCadenceCount: 0, // 上一次的踏频翻转次数,用于计算差值 lastCadenceTimestamp: 0, // 上一次的踏频时间戳(设备时间),用于计算差值 lastCadenceChangedTime: 0, // 最后一次踏频变化的时间(本地时间),用于检测超时 }); -const parseData = (byteArray: Uint8Array) => { - // 当前时间(用于超时检测) + const parseData = (byteArray: Uint8Array) => { + // 当前时间(用于超时检测) const currentTime = Date.now(); - // ========== 1. 解析功率 ========== + // ========== 1. 解析功率 ========== // 字节2-3:功率值(小端序) - const powerValue = (byteArray[3] << 8) | byteArray[2]; + const powerValue = (byteArray[3] << 8) | byteArray[2]; setPower(powerValue); // ========== 3. 解析踏频 ========== // 字节5-6:踏频翻转次数(小端序) const cadenceCount = (byteArray[6] << 8) | byteArray[5]; - + // 字节7-8:踏频时间戳(小端序) const timestamp = (byteArray[8] << 8) | byteArray[7]; - + // 获取上一次的状态 const lastState = cadenceStateRef.current; // 检测踏频翻转次数是否有变化 const hasCadenceChanged = cadenceCount !== lastState.lastCadenceCount; - + if (hasCadenceChanged) { // 踏频有变化,更新变化时间戳 cadenceStateRef.current.lastCadenceChangedTime = currentTime; } - + // 检查是否超时(3秒无变化) - if (lastState.lastCadenceChangedTime > 0 && - currentTime - lastState.lastCadenceChangedTime > 3000) { + if (lastState.lastCadenceChangedTime > 0 && + currentTime - lastState.lastCadenceChangedTime > 3000) { //setPower("0 W"); setCadence(0); setLeftBalance(0); - setRightBalance(0); + setRightBalance(0); cadenceStateRef.current = { lastCadenceCount: 0, lastCadenceTimestamp: 0, @@ -372,7 +374,7 @@ const parseData = (byteArray: Uint8Array) => { }; return; // 超时后直接返回,不再计算踏频 } - + // 如果是第一次收到踏频数据,只记录不计算 if (lastState.lastCadenceTimestamp === 0) { cadenceStateRef.current = { @@ -402,10 +404,10 @@ const parseData = (byteArray: Uint8Array) => { if (timeDiff > 0 && revDiff > 0) { // 假设时间单位是1/1024秒(蓝牙设备常用) const timeInSeconds = timeDiff / 1024.0; - + // RPM = (圈数 / 时间(秒)) * 60 const cadenceRPM = (revDiff / timeInSeconds) * 60; - + // 限制合理范围 if (cadenceRPM > 10 && cadenceRPM < 250) { setCadence(Math.round(cadenceRPM)); @@ -417,12 +419,12 @@ const parseData = (byteArray: Uint8Array) => { setCadence(0); } - // ========== 解析左平衡 ========== - // 字节4:左平衡值,单位0.5% + // ========== 解析左平衡 ========== + // 字节4:左平衡值,单位0.5% const leftBalanceValue = byteArray[4]; const leftBalancePercent = Math.round(leftBalanceValue * 0.5 * 10) / 10; setLeftBalance(leftBalancePercent); - // 计算右平衡:100% - 左平衡百分比 + // 计算右平衡:100% - 左平衡百分比 const rightBalancePercent = Math.round((100 - leftBalancePercent) * 10) / 10; setRightBalance(rightBalancePercent); @@ -442,7 +444,7 @@ const parseData = (byteArray: Uint8Array) => { const updatePowerTrim = async () => { const val = parseInt(inputTrim); if (isNaN(val) || val < 50 || val > 200) { - Alert.alert("提示", "功率微调可调整功率计的高低偏差,默认值100%。可调整的范围是50%-200%。请输入50至200的纯数字,不需要包含%符号。输入后点击下方按钮更新进功率计设备。"); + Alert.alert(t('info.disconnectTitle'), t('info.trimRangeAlert')); return; } if (val === Number(powerTrim)) { @@ -450,7 +452,7 @@ const parseData = (byteArray: Uint8Array) => { return; } if (!isConnected) { - Alert.alert("提示", "设备未连接"); + Alert.alert(t('info.disconnectTitle'), t('info.deviceNotConnected')); return; } @@ -480,281 +482,285 @@ const parseData = (byteArray: Uint8Array) => { } catch (err) { console.warn("❌ 写入失败", err); - Alert.alert("写入失败"); + Alert.alert(t('info.writeFailed')); } }; -// ========== 校准按钮逻辑 ========== -const handleCalibration = async () => { - if (!isConnected) { - Alert.alert("提示", "设备未连接"); - return; - } - - if (calibrating) { - return; // 正在校准中,不重复点击 - } - - try { - setCalibrating(true); - isCalibratingRef.current = true; - setCalibrationSuccess(false); - setCalibrationValue(""); - - console.log("🔧 开始校准,向FFF2写入05"); - - // 向FFF2写入05 - await Central.writeCharacteristic( - peripheral, - fullUUID("FFF1"), // 服务UUID - fullUUID("FFF2"), // 写入特征UUID - new Uint8Array([0x05]).buffer, - { withoutResponse: false } - ); - - console.log("✅ 已发送校准命令,等待响应..."); - - // 设置5秒超时 - calibrationTimeoutRef.current = setTimeout(() => { - if (isCalibratingRef.current) { - console.log("❌ 校准超时,未收到响应"); - Alert.alert("校准错误", "设备未响应,请重试"); - setCalibrating(false); - isCalibratingRef.current = false; - } - }, 5000); - - } catch (err) { - console.warn("❌ 发送校准命令失败", err); - Alert.alert("错误", "发送校准命令失败"); - setCalibrating(false); - isCalibratingRef.current = false; - - if (calibrationTimeoutRef.current) { - clearTimeout(calibrationTimeoutRef.current); + // ========== 校准按钮逻辑 ========== + const handleCalibration = async () => { + if (!isConnected) { + Alert.alert(t('info.disconnectTitle'), t('info.deviceNotConnected')); + return; } - } -}; -const handleFFF3Response = (byteArray: Uint8Array) => { - // 如果不是正在校准中,不处理 - if (!isCalibratingRef.current) return; - - // 清除超时定时器 - if (calibrationTimeoutRef.current) { - clearTimeout(calibrationTimeoutRef.current); - calibrationTimeoutRef.current = null; - } - - // 检查响应数据格式:05XXXX (05开头,后面至少2个字节) - // 假设响应是05 + 2字节的小端序数值 - if (byteArray[0] === 0x05 && byteArray.length >= 3) { - // 解析XXXX(小端序):低位在前,高位在后 - // byteArray[1] 是低位字节,byteArray[2] 是高位字节 - const value = Math.round (((byteArray[2] << 8) | byteArray[1])/10 ) ; //除以10发送出来 不然数据容易乱跳 和码表端处理保持一致 - console.log(`✅ 收到校准响应,值: ${value}`); - - // 更新状态 - setCalibrationValue(value.toString()); - setCalibrationSuccess(true); - - // 显示成功弹框 - Alert.alert( - "校准成功", - `校准值: ${value}`, - [ - { - text: "确定", - onPress: () => { - setCalibrating(false); - isCalibratingRef.current = false; - setCalibrationSuccess(false); - } + if (calibrating) { + return; // 正在校准中,不重复点击 + } + + try { + setCalibrating(true); + isCalibratingRef.current = true; + setCalibrationSuccess(false); + setCalibrationValue(""); + + console.log("🔧 开始校准,向FFF2写入05"); + + // 向FFF2写入05 + await Central.writeCharacteristic( + peripheral, + fullUUID("FFF1"), // 服务UUID + fullUUID("FFF2"), // 写入特征UUID + new Uint8Array([0x05]).buffer, + { withoutResponse: false } + ); + + console.log("✅ 已发送校准命令,等待响应..."); + + // 设置5秒超时 + calibrationTimeoutRef.current = setTimeout(() => { + if (isCalibratingRef.current) { + console.log("❌ 校准超时,未收到响应"); + Alert.alert(t('info.calibrationError'), t('info.calibrationTimeout')); + setCalibrating(false); + isCalibratingRef.current = false; } - ] - ); - } else { - console.warn("❌ 校准响应格式错误", byteArray); - Alert.alert("校准错误", "设备返回数据格式错误"); - setCalibrating(false); - isCalibratingRef.current = false; - } -}; + }, 5000); -useEffect(() => { - return () => { - // 清理校准超时定时器 + } catch (err) { + console.warn("❌ 发送校准命令失败", err); + Alert.alert(t('info.error'), t('info.calibrationSendError')); + setCalibrating(false); + isCalibratingRef.current = false; + + if (calibrationTimeoutRef.current) { + clearTimeout(calibrationTimeoutRef.current); + } + } + }; + + const handleFFF3Response = (byteArray: Uint8Array) => { + // 如果不是正在校准中,不处理 + if (!isCalibratingRef.current) return; + + // 清除超时定时器 if (calibrationTimeoutRef.current) { clearTimeout(calibrationTimeoutRef.current); calibrationTimeoutRef.current = null; } - }; -}, []); - + // 检查响应数据格式:05XXXX (05开头,后面至少2个字节) + // 假设响应是05 + 2字节的小端序数值 + if (byteArray[0] === 0x05 && byteArray.length >= 3) { + // 解析XXXX(小端序):低位在前,高位在后 + // byteArray[1] 是低位字节,byteArray[2] 是高位字节 + const value = Math.round(((byteArray[2] << 8) | byteArray[1]) / 10); //除以10发送出来 不然数据容易乱跳 和码表端处理保持一致 + console.log(`✅ 收到校准响应,值: ${value}`); + + // 更新状态 + setCalibrationValue(value.toString()); + setCalibrationSuccess(true); + + // 显示成功弹框 + Alert.alert( + t('info.calibrationSuccess'), + `${t('info.calibrationValue') + ": "} ${value}`, + [ + { + text: t('info.confirm'), + onPress: () => { + setCalibrating(false); + isCalibratingRef.current = false; + setCalibrationSuccess(false); + } + } + ] + ); + } else { + console.warn("❌ 校准响应格式错误", byteArray); + Alert.alert(t('info.calibrationError'), t('info.calibrationFormatError')); + setCalibrating(false); + isCalibratingRef.current = false; + } + }; + + useEffect(() => { + return () => { + // 清理校准超时定时器 + if (calibrationTimeoutRef.current) { + clearTimeout(calibrationTimeoutRef.current); + calibrationTimeoutRef.current = null; + } + }; + }, []); + + // ========== UI ========== return ( - + + + + - - 蓝牙名称: {peripheral.name} - + + {t('info.bluetoothName') + ": "} {peripheral.name} + - - ID号: {serial} - + + {t('info.idNumber') + ": "} {serial} + - - 固件版本: {firmware} - + + {t('info.firmwareVersion') + ": "} {firmware} + - - 电量: {battery} - + + {t('info.battery') + ": "} {battery} + - - 连接状态: {isConnected ? "已连接" : "未连接"} - - -{/* ====== 实时数据三卡片 ====== */} - - {/* 功率 */} - - - 功率/W - {power} - + + {t('info.connectionStatus') + ": "} {isConnected ? t('info.connected') : t('info.disconnected')} + - {/* 踏频 */} - - - 踏频/RPM - {cadence} - + {/* ====== 实时数据三卡片 ====== */} + + {/* 功率 */} + + + {t('info.power')} + {power} + - {/* 左右平衡 */} - - L / R - 左右平衡/% - - {leftbalance}/{rightbalance} - - - + {/* 踏频 */} + + + {t('info.cadence')} + {cadence} + + + {/* 左右平衡 */} + + L / R + {t('info.balance')} + + {leftbalance}/{rightbalance} + + + - {/* ========== 功率微调卡片部分 ========== */} - - - 功率微调设置 - - - - 当前微调: {powerTrim}% - - - - - 更新数值 - - + {/* ========== 功率微调卡片部分 ========== */} + + + {t('info.powerTrimTitle')} + - {/* ========== 新增校准按钮 ========== */} - - - - {calibrating ? "校准中...等待设备反应" : "校准归零"} - - + + {t('info.currentTrim') + ": "} {powerTrim}% + + + + + {t('info.updateValue')} + + + + {/* ========== 新增校准按钮 ========== */} + + + + {calibrating ? t('info.calibrating') : t('info.calibrateButton')} + + + + + + + + { + if (!isConnected) { + Alert.alert(t('info.disconnectTitle'), t('info.reconnectMessage'), [ + { + text: t('info.confirm'), + onPress: () => { + // 返回 ScanScreen + navigation.goBack(); + }, + }, + ]); + return; + } + // 蓝牙已连接,正常跳转 DFU + navigation.navigate("Dfu", { + deviceId: deviceKey, + name: peripheral.name, + firmware, + }); + }} + style={styles.pressable} + disabled={isLoading || powerTrimLoading} // ❌ 禁用点击 + > + {t('info.firmwareUpgrade')} + + + + + + {isLoading && ( + + + {t('info.readingInfo')} + + )} + + {/* ✅ 读取成功提示,固定在页面底部 */} + {readSuccessToast && ( + + + {t('info.readSuccess')} + + )} + + {/* 正在写入功率微调 */} + {powerTrimLoading && ( + + + {t('info.writingTrim')} + + )} + + {/* 功率微调写入成功 */} + {powerTrimSuccessToast && ( + + + {t('info.trimUpdateSuccess')} + + )} + + - - - - - { - if (!isConnected) { - Alert.alert("提示", "请重新连接设备", [ - { - text: "确定", - onPress: () => { - // 返回 ScanScreen - navigation.goBack(); - }, - }, - ]); - return; - } - // 蓝牙已连接,正常跳转 DFU - navigation.navigate("Dfu", { - deviceId: deviceKey, - name: peripheral.name, - firmware, - }); - }} - style={styles.pressable} - disabled={isLoading || powerTrimLoading} // ❌ 禁用点击 -> - 固件升级 - - - - - - {isLoading && ( - - - 正在读取信息... - - )} - - {/* ✅ 读取成功提示,固定在页面底部 */} - {readSuccessToast && ( - - - 读取成功! - - )} - - {/* 正在写入功率微调 */} - {powerTrimLoading && ( - - - 正在写入功率微调... - - )} - - {/* 功率微调写入成功 */} - {powerTrimSuccessToast && ( - - - 功率微调更新成功! - - )} - - ); } @@ -810,47 +816,47 @@ const styles = StyleSheet.create({ }, realtimeContainer: { - flexDirection: "row", - justifyContent: "space-between", - marginVertical: 10, -}, + flexDirection: "row", + justifyContent: "space-between", + marginVertical: 10, + }, -realtimeCard: { - flex: 1, - marginHorizontal: 4, - paddingVertical: 12, - borderRadius: 10, - backgroundColor: "#fff", - alignItems: "center", + realtimeCard: { + flex: 1, + marginHorizontal: 4, + paddingVertical: 12, + borderRadius: 10, + backgroundColor: "#fff", + alignItems: "center", - borderWidth: 1, - borderColor: "#E7141E", + borderWidth: 1, + borderColor: "#E7141E", - shadowColor: "#000", - shadowOffset: { width: 0, height: 1 }, - shadowOpacity: 0.1, - shadowRadius: 2, - elevation: 2, -}, + shadowColor: "#000", + shadowOffset: { width: 0, height: 1 }, + shadowOpacity: 0.1, + shadowRadius: 2, + elevation: 2, + }, -realtimeLabel: { - marginTop: 6, - fontSize: 14, - color: "#666", -}, + realtimeLabel: { + marginTop: 6, + fontSize: 14, + color: "#666", + }, -realtimeValue: { - marginTop: 4, - fontSize: 20, - fontWeight: "bold", - color: "#000", -}, + realtimeValue: { + marginTop: 4, + fontSize: 20, + fontWeight: "bold", + color: "#000", + }, -balanceHeader: { - fontSize: 16, - fontWeight: "bold", - color: "#E7141E", -}, + balanceHeader: { + fontSize: 16, + fontWeight: "bold", + color: "#E7141E", + }, diff --git a/src/PrivacyScreen.tsx b/src/PrivacyScreen.tsx index 14e90b8..8127891 100644 --- a/src/PrivacyScreen.tsx +++ b/src/PrivacyScreen.tsx @@ -1,80 +1,32 @@ import React from "react"; import { View, Text, ScrollView, StyleSheet } from "react-native"; +import MyStatusbar from "./component/MyStatusbar"; +import MyHeader from "./component/MyHeader"; +import { NativeStackScreenProps,NativeStackNavigationProp } from "@react-navigation/native-stack"; +import { RootStackParamList } from "../App"; +import { useTranslation } from 'react-i18next'; -export default function PrivacyScreen() { +type Props = NativeStackScreenProps; + +export default function PrivacyScreen({navigation}:Props) { + const { t } = useTranslation(); return ( - - 隐私协议 - - 本应用尊重并保护所有使用服务用户的个人隐私权。本隐私政策仅适用于无锡执行派体育文化发展有限公司的 POWERFUN 设置 APP 产品或服务。请在使用我们的产品或服务前,仔细阅读并了解本隐私政策。 - - {"\n\n"} - 一、我们如何收集和使用您的信息 - {"\n\n"} - 1. POWERFUN 设置 APP 不需要注册和登录,也不会收集任何关于个人的信息。 - {"\n\n"} - 2. 在您使用我司产品或服务过程中,我们可能会使用以下权限和信息: - {"\n"} - - Android ID:用于第三方或我们分析错误信息。 - {"\n"} - - 存储权限:用于管理本地缓存。 - {"\n"} - - 位置权限:用于设备产品与 APP 蓝牙连接。 - {"\n"} - - 蓝牙权限:用于设备产品与 APP 蓝牙连接。 - {"\n\n"} - 3. 关于第三方 SDK 使用说明: - {"\n\n"} - (1)第三方 SDK 名称:腾讯 Bugly - {"\n"} - 提供方:深圳市腾讯计算机系统有限公司 - {"\n"} - 收集类型:系统版本、设备 ID、手机型号、网络状态、系统设置、网络与 WiFi 信息、手机状态、系统日志等。 - {"\n"} - 使用目的:用于监控应用性能与稳定性,收集崩溃报告和使用数据以帮助我们识别并修复问题。 - {"\n\n"} - (2)第三方 SDK 名称:Aliyun OSS - {"\n"} - 提供方:阿里云计算有限公司 - {"\n"} - 使用目的:用于存储应用运行必要的配置和固件升级文件,确保数据可靠存储。 - - {"\n\n"} - 二、本政策如何更新 - {"\n\n"} - 我们的隐私政策可能会根据需求进行变更。未经您明确同意,我们不会削减您依据隐私政策应享有的权利。任何变更我们将在本页面公布。对于重大变更,我们会提供更为显著的通知。 - {"\n\n"} - 重大变更包括但不限于: - {"\n"} - - 服务模式发生重大变化(如用户信息处理目的、类型、方式等)。 - {"\n"} - - 在所有权或组织架构方面发生变更(如业务调整、破产并购等)。 - {"\n"} - - 用户信息安全影响评估报告显示存在高风险。 - - {"\n\n"} - 三、如何联系我们 - {"\n\n"} - 如果您对本隐私政策有任何疑问、意见或建议,可通过以下方式与我们联系: - {"\n"} - 电子邮件:bike99@qq.com - {"\n"} - 一般情况下,我们将在三十天内回复。 - - {"\n\n"} - 无锡执行派体育文化发展有限公司 - {"\n"} - 本政策自 2019 年 7 月 1 日起生效 - - + + + + + {t("privacy.title")} + {t("privacy.content")} + + ); } const styles = StyleSheet.create({ container: { flex: 1, - padding: 20, - backgroundColor: "#fff", + // padding: 20, + backgroundColor: "#f2f3f7", }, title: { fontSize: 22, @@ -85,5 +37,6 @@ const styles = StyleSheet.create({ fontSize: 16, lineHeight: 24, color: "#333", + marginBottom: 50 }, }); diff --git a/src/ScanScreen.tsx b/src/ScanScreen.tsx index 3597b78..782f7e5 100644 --- a/src/ScanScreen.tsx +++ b/src/ScanScreen.tsx @@ -17,8 +17,11 @@ import { NativeStackScreenProps } from "@react-navigation/native-stack"; import { RootStackParamList } from "../App"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; // 信号图标集 -type Props = NativeStackScreenProps; +type Props = NativeStackScreenProps; type DeviceWithTimestamp = ScannedPeripheral & { lastSeen: number }; +import { useTranslation } from 'react-i18next'; +import MyStatusbar from "./component/MyStatusbar"; +import MyHeader from "./component/MyHeader"; export default function ScanScreen({ navigation }: Props) { const [devices, setDevices] = useState([]); @@ -26,7 +29,7 @@ export default function ScanScreen({ navigation }: Props) { const [refreshing, setRefreshing] = useState(false); const handlerRef = useRef<((payload: CentralEventMap["scannedPeripheral"]) => void) | null>(null); - + const { t } = useTranslation(); // 将 RSSI 转换为信号格数(0-4) const getSignalLevel = (rssi?: number): number => { if (rssi === undefined) return 0; @@ -154,6 +157,13 @@ export default function ScanScreen({ navigation }: Props) { return ( + + item.systemId} @@ -163,7 +173,7 @@ export default function ScanScreen({ navigation }: Props) { style={styles.deviceRow} > - {item.name || "[no name]"} + {item.name || t("scan.noName")} {renderSignalIcon(item.advertisementData?.rssi)} @@ -177,13 +187,13 @@ export default function ScanScreen({ navigation }: Props) { {scanning ? ( <> - 搜索中... - (请确保设备有电且被唤醒) + {t("scan.scanning")} + {t("scan.tipScanning")} ) : ( <> - 暂无设备 - (请在设置中打开蓝牙) + {t("scan.noDevice")} + {t("scan.tipBluetooth")} )} diff --git a/src/SettingScreen.tsx b/src/SettingScreen.tsx new file mode 100644 index 0000000..b4c3ca3 --- /dev/null +++ b/src/SettingScreen.tsx @@ -0,0 +1,143 @@ +import React, { useState } from "react"; +import { View, Text, ScrollView, StyleSheet, TouchableOpacity, Image } from "react-native"; +import { useTranslation } from 'react-i18next'; +import MyStatusbar from "./component/MyStatusbar"; +import MyHeader from "./component/MyHeader"; +import LanguageModal from "./component/LanguageModal.tsx"; +import { NativeStackScreenProps } from "@react-navigation/native-stack"; +import { RootStackParamList } from "../App"; +import pxToDp from "./helper/pxToDp"; +import DeviceInfo from "react-native-device-info"; +import { LANGUAGES } from "./i18n"; + +type Props = NativeStackScreenProps; + +export default function SettingScreen({ navigation }: Props) { + const { t, i18n } = useTranslation(); + const [languageModalVisible, setLanguageModalVisible] = useState(false); + + // 获取当前语言显示名称 + const getCurrentLanguageLabel = (): string => { + const currentLang = i18n.language; + const language = LANGUAGES.find(lang => lang.key === currentLang); + return language?.label || '中文'; + }; + + return ( + + + + + + {/* 软件语言 */} + setLanguageModalVisible(true)} + > + + + {t('settings.language')} + + + {getCurrentLanguageLabel()} + + + + + {/* 隐私协议 */} + navigation.navigate("Privacy")} + > + + + {t('settings.privacy')} + + + + + + + {/* 版本号 */} + + + + {t('settings.version')} + + + {DeviceInfo.getVersion()} + + + + + {/* 语言切换弹窗 */} + setLanguageModalVisible(false)} + /> + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: "#f2f3f7", + }, + settingItem: { + width: pxToDp(670), + height: pxToDp(108), + borderRadius: pxToDp(24), + backgroundColor: '#fff', + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + paddingHorizontal: pxToDp(32), + }, + settingItemLeft: { + flexDirection: 'row', + alignItems: 'center', + }, + settingItemRight: { + flexDirection: 'row', + alignItems: 'center', + }, + icon: { + width: pxToDp(40), + height: pxToDp(40), + marginRight: pxToDp(12), + }, + settingLabel: { + fontSize: pxToDp(30), + color: '#333', + }, + settingValue: { + fontSize: pxToDp(30), + color: "#999", + marginRight: pxToDp(14), + }, + arrow: { + width: pxToDp(14), + height: pxToDp(24), + }, +}); \ No newline at end of file diff --git a/src/SplashScreen.tsx b/src/SplashScreen.tsx index fe798a9..ddadcea 100644 --- a/src/SplashScreen.tsx +++ b/src/SplashScreen.tsx @@ -2,8 +2,9 @@ import React, { useEffect } from "react"; import { View, Image, StyleSheet } from "react-native"; import { NativeStackScreenProps } from "@react-navigation/native-stack"; import { RootStackParamList } from "../App"; +import MyStatusbar from "./component/MyStatusbar"; -type Props = NativeStackScreenProps; +type Props = NativeStackScreenProps; export default function SplashScreen({ navigation }: Props) { useEffect(() => { @@ -16,6 +17,7 @@ export default function SplashScreen({ navigation }: Props) { return ( + void; +} + +const LanguageModal: React.FC = ({ visible, onClose }) => { + const { t, i18n } = useTranslation(); + const currentLanguage = i18n.language; + + const handleLanguageSelect = async (languageKey: string) => { + await saveLanguage(languageKey); + i18n.changeLanguage(languageKey); + onClose(); + }; + + return ( + + + e.stopPropagation()} + > + {/* 标题栏 */} + + {t('languageModal.title')} + + + + + + {/* 语言列表 */} + + {LANGUAGES.map((language) => ( + handleLanguageSelect(language.key)} + activeOpacity={0.7} + > + {language.label} + {currentLanguage === language.key && ( + + )} + + ))} + + + + + ); +}; + +const styles = StyleSheet.create({ + overlay: { + flex: 1, + backgroundColor: 'rgba(0, 0, 0, 0.5)', + justifyContent: 'center', + alignItems: 'center', + }, + modalContainer: { + width: pxToDp(630), + backgroundColor: '#fff', + borderRadius: pxToDp(24), + overflow: 'hidden', + }, + header: { + flexDirection: 'row', + justifyContent: 'center', + alignItems: 'center', + paddingVertical: pxToDp(32), + borderBottomWidth: pxToDp(1), + borderBottomColor: '#f0f0f0', + position: 'relative', + }, + title: { + fontSize: pxToDp(32), + fontWeight: '600', + color: '#333', + }, + closeButton: { + position: 'absolute', + right: pxToDp(32), + padding: pxToDp(8), + }, + closeIcon: { + fontSize: pxToDp(40), + color: '#666', + fontWeight: '300', + }, + languageList: { + paddingVertical: pxToDp(16), + }, + languageItem: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + paddingHorizontal: pxToDp(40), + paddingVertical: pxToDp(32), + backgroundColor: '#fff', + }, + languageText: { + fontSize: pxToDp(30), + color: '#333', + }, + checkmark: { + fontSize: pxToDp(40), + color: '#FF6B35', + fontWeight: 'bold', + }, +}); + +export default LanguageModal; \ No newline at end of file diff --git a/src/component/MyHeader.tsx b/src/component/MyHeader.tsx new file mode 100644 index 0000000..b1f1a01 --- /dev/null +++ b/src/component/MyHeader.tsx @@ -0,0 +1,67 @@ +// components/Hello.tsx +import React, {ReactNode, useState} from 'react'; +import {StyleProp, Text, TouchableOpacity, View, ViewStyle, Image} from 'react-native'; +import pxToDp from '../helper/pxToDp'; +import {RootNavigationProp} from '../types/RootNavigationProp' + +export interface Props { + backgroundColor: string; + title: string; + textColor: string; + navigation: RootNavigationProp; + hideBack?: boolean; + customBackFunction?: () => void; + backIconType?: number; + rightView?: ReactNode; +} + +const MyHeader: React.FC = props => { + const containerStyle: StyleProp = { + backgroundColor: props.backgroundColor, + height: pxToDp(88), + width: '100%', + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + paddingHorizontal: pxToDp(24), + }; + let backImage = + + return ( + + {props.hideBack ? ( + + ) : ( + { + if (props.customBackFunction) { + props.customBackFunction(); + } else { + props.navigation.goBack(); + } + }}> + {backImage} + + )} + + {props.title} + + + {props.rightView} + + + ); +}; + +export default MyHeader; diff --git a/src/component/MyStatusbar.tsx b/src/component/MyStatusbar.tsx new file mode 100644 index 0000000..78c2d06 --- /dev/null +++ b/src/component/MyStatusbar.tsx @@ -0,0 +1,41 @@ +// components/Hello.tsx +import React, {useState} from 'react'; +import {Button, StyleSheet, Text, View} from 'react-native'; +import {StatusBar, Platform, StatusBarProps} from 'react-native'; +import {useIsFocused} from '@react-navigation/native'; +import helper from '../helper/helper'; +export interface Props { + backgroundColor: string; + dark: Boolean; +} + +const FocusAwareStatusBar = (props: StatusBarProps) => { + const isFocused = useIsFocused(); + return isFocused ? : null; +}; +const MyStatusbar: React.FC = props => { + const height = helper.statusBarHeight; + const data: StatusBarProps = { + backgroundColor: props.backgroundColor + ? props.backgroundColor + : 'rgba(0,0,0,0)', + barStyle: props.dark ? 'dark-content' : 'light-content', + translucent: true, + }; + console.log('height', height); + return ( + + + + ); +}; + +// styles +const styles = StyleSheet.create({}); + +export default MyStatusbar; diff --git a/src/helper/helper.js b/src/helper/helper.js new file mode 100644 index 0000000..b1a6c6a --- /dev/null +++ b/src/helper/helper.js @@ -0,0 +1,106 @@ +import { Dimensions, StatusBar, Platform, Linking } from 'react-native'; +import pxToDp from './pxToDp'; +import { getStatusBarHeight } from 'react-native-status-bar-height'; +import * as _ from 'lodash'; +import myToast, { Toast } from './myToast'; +export default { + width: Dimensions.get('window').width, + height: + Platform.OS === 'ios' + ? Dimensions.get('window').height + : Dimensions.get('window').height / Dimensions.get('window').width > 1.8 + ? Dimensions.get('window').height + getStatusBarHeight() + : Dimensions.get('window').height, + statusBarHeight: getStatusBarHeight(), + bottomTabHeight: (Platform.OS === 'ios' && Dimensions.get('window').height / Dimensions.get('window').width > 1.8?34:0) + pxToDp(98), + isIOS: Platform.OS == 'ios', + isNullOrEmpty(strings) { + return !strings || String(strings).replace(/(^s*)|(s*$)/g, '').length == 0; + }, + stringToNumberStr(s) { + console.log(16, String(Number(s.replace(/[^0-9]/g, '')))); + return String(Number(s.replace(/[^0-9]/g, ''))); + }, + isIOSFullScreen() { + const dimen = Dimensions.get('window'); + return ( + Platform.OS === 'ios' && + !Platform.isPad && + !Platform.isTVOS && + (dimen.height === 780 || + dimen.width === 780 || + dimen.height === 812 || + dimen.width === 812 || + dimen.height === 844 || + dimen.width === 844 || + dimen.height === 896 || + dimen.width === 896 || + dimen.height === 926 || + dimen.width === 926) + ); + }, + //写一个方法,传入一个数组,判断数量是否是n的倍数,如果不是,补null + getNewArr(arr, n) { + let count = n - arr.length % n; + for (let i = 0; i < count; i++) { + arr.push(null); + } + return arr; + }, + //获取随机颜色 + getRandomColor() { + return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6); + }, + goPage(navigation, type, page, params) { + console.log(44, type, page, params); + if(page === '#') { + myToast.show('敬请期待','error'); + return; + } + if (type === 2) { + console.log(57, '外链') + Linking.openURL(page); + } else { + console.log(60, '内链') + const json = this.toJSON(_.replace(params, /"/g, '"')); + navigation.navigate(page, { ...json }); + } + }, + toJSON(str) { + try { + const a = JSON.parse(str); + return a; + } catch (error) { + return {}; + } + }, + getIntegerAndDecimal(num, type = 1) { + //type 1:去掉小数点前面的0 2:去掉0.,整数部分加小数点 + let integer = Math.floor(num).toFixed(0) + let decimal = (num - integer).toFixed(1) + if (decimal === '0.0') { + return { integer, decimal: '' } + } + if (type === 1) { + decimal = decimal.replace('0', '') + } else if (type === 2) { + decimal = decimal.replace('0.', '') + integer += '.' + } + return { integer, decimal } + }, + getHideString(str){ + //写一个方法,判断如果是手机号,隐藏中间四位,如果是邮箱,隐藏@前面的,如果是汉字,隐藏后面的 + if(!str) return ''; + if(str.indexOf('@') > -1){ + let arr = str.split('@'); + return arr[0].substr(0,1) + '****' + arr[0].substr(arr[0].length-1) + '@' + arr[1]; + } + if(str.length === 11){ + return str.substr(0,3) + '****' + str.substr(7); + } + if(str.length > 1){ + return str.substr(0,1) + '**'; + } + }, +}; diff --git a/src/helper/myToast.tsx b/src/helper/myToast.tsx new file mode 100644 index 0000000..4ce6b49 --- /dev/null +++ b/src/helper/myToast.tsx @@ -0,0 +1,37 @@ +type ToastType = 'success' | 'error'; +import React from 'react'; +import _Toast from 'react-native-toast-message'; +export default { + show( + text: string, + type: ToastType = 'success', + duration: number = 3500, + hide: () => void | undefined = () => {}, + ) { + // _Toast.hide(); + _Toast.show({ + text1: '提示', + text2: text, + type, + visibilityTime: duration, + onHide: hide, + }); + }, + useBlur( + navigation: any, + customFunc: (() => void) | null = null, + ) { + React.useEffect(() => { + const unsubscribe = navigation.addListener('blur', () => { + // do something + _Toast.hide(); + if (customFunc != null) { + customFunc(); + } + }); + return unsubscribe; + }, [navigation]); + }, +}; + +export const Toast = _Toast; diff --git a/src/helper/pxToDp.js b/src/helper/pxToDp.js new file mode 100644 index 0000000..561f299 --- /dev/null +++ b/src/helper/pxToDp.js @@ -0,0 +1,14 @@ +import { + Dimensions, + PixelRatio +} from 'react-native'; +//视屏的宽度和设置像素转换 +const deviceWidthDp = Dimensions.get('window').width; + +const uiWidthPx = 750; + +function pxToDp(uiElementPx,isConvert = true) { + if(!isConvert) return uiElementPx; + return Number((uiElementPx * deviceWidthDp / uiWidthPx)); +} +export default pxToDp \ No newline at end of file diff --git a/src/i18n/en-US.ts b/src/i18n/en-US.ts deleted file mode 100644 index 0bedb68..0000000 --- a/src/i18n/en-US.ts +++ /dev/null @@ -1,100 +0,0 @@ -const enUS = { - nav: { - scan: "Scan", - info: "Device Info", - dfu: "Firmware Update", - privacy: "Privacy Policy", - }, - - home: { - scan: "Scan Devices", - privacy: "Privacy Policy", - version: "Version v0.0.1", - }, - - scan: { - scanning: "Scanning...", - noDevice: "No Devices Found", - tipScanning: "(Make sure the device is powered on and awake)", - tipBluetooth: "(Please enable Bluetooth in settings)", - noName: "[No Name]", - rssiUnit: "dBm", - }, - - dfu: { - preparing: "Preparing...", - reading: "Reading...", - wait: "Please wait", - upgrading: "Updating firmware. Do not exit the app.", - - bluetoothName: "Bluetooth Name", - latestVersion: "Latest Version", - currentVersion: "Current Version", - upgradeStatus: "Update Status", - - successTitle: "Update Successful", - successMsg: "Firmware updated successfully. Please reconnect the device.", - - failTitle: "Update Failed", - noNeedTitle: "No Update Required", - noNeedMsg: "The firmware is already up to date.", - - notFoundTitle: "Update Unavailable", - notFoundMsg: "Firmware for hardware version {{hw}} not found", - - confirm: "OK", - }, - - dfuState: { - connecting: "Connecting...", - starting: "Initializing...", - enablingDfuMode: "Enabling DFU Mode...", - uploading: "Uploading firmware...", - validating: "Validating firmware...", - disconnecting: "Disconnecting...", - completed: "Completed", - aborted: "Aborted", - failed: "Update Failed", - dfu_failed: "Update Failed", - initializing: "Starting...", - errored: "Update Error!", - }, - - privacy: { - title: "Privacy Policy", - content: `This application respects and protects the personal privacy of all users. This Privacy Policy applies only to the POWERFUN Settings App products or services provided by Wuxi Zhixingpai Sports Culture Development Co., Ltd. Please read and fully understand this policy before using our products or services. - -1. How We Collect and Use Your Information - -1. The POWERFUN Settings App does not require registration or login and does not collect any personal information. - -2. During your use of our products or services, we may use the following permissions: -- Android ID -- Storage -- Location -- Bluetooth - -3. Third-party SDK usage: - -(1) Tencent Bugly -Provider: Tencent Computer Systems Company Limited -Purpose: crash reporting and performance monitoring. - -(2) Aliyun OSS -Provider: Alibaba Cloud Computing Co., Ltd. -Purpose: storage of configuration and firmware update files. - -2. Updates to This Policy - -We may update this policy from time to time. Changes will be published on this page. - -3. Contact Us - -Email: bike99@qq.com - -Wuxi Zhixingpai Sports Culture Development Co., Ltd. -Effective date: July 1, 2019`, - }, -}; - -export default enUS; diff --git a/src/i18n/index.ts b/src/i18n/index.ts new file mode 100644 index 0000000..58edb90 --- /dev/null +++ b/src/i18n/index.ts @@ -0,0 +1,71 @@ +import i18n from 'i18next'; +import { initReactI18next } from 'react-i18next'; +import AsyncStorage from '@react-native-async-storage/async-storage'; + +import zh from './locales/zh.json'; +import en from './locales/en.json'; + +const LANGUAGE_KEY = '@app_language'; + +// 语言配置类型 +export interface LanguageOption { + key: string; + label: string; + value: string; +} + +// 语言选项 +export const LANGUAGES: LanguageOption[] = [ + { + key: 'zh', + label: '中文', + value: 'zh', + }, + { + key: 'en', + label: 'English', + value: 'en', + }, +]; + +// 获取存储的语言 +export const getStoredLanguage = async (): Promise => { + try { + const language = await AsyncStorage.getItem(LANGUAGE_KEY); + return language || 'zh'; + } catch (error) { + return 'zh'; + } +}; + +// 保存语言选择 +export const saveLanguage = async (language: string): Promise => { + try { + await AsyncStorage.setItem(LANGUAGE_KEY, language); + } catch (error) { + console.error('保存语言失败:', error); + } +}; + +// 初始化 i18n +i18n + .use(initReactI18next) + .init({ + compatibilityJSON: 'v3', + resources: { + zh: { translation: zh }, + en: { translation: en }, + }, + lng: 'zh', + fallbackLng: 'zh', + interpolation: { + escapeValue: false, + }, + }); + +// 从存储中加载语言设置 +getStoredLanguage().then((language) => { + i18n.changeLanguage(language); +}); + +export default i18n; \ No newline at end of file diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json new file mode 100644 index 0000000..078bb35 --- /dev/null +++ b/src/i18n/locales/en.json @@ -0,0 +1,120 @@ +{ + "nav": { + "scan": "Scan", + "info": "Device Info", + "dfu": "Firmware Update", + "privacy": "Privacy Policy" + }, + "home": { + "title": "POWERFUN Settings", + "scan": "Scan Devices", + "privacy": "Privacy Policy", + "version": "Version v0.0.1" + }, + "scan": { + "title": "Scan Devices", + "scanning": "Scanning...", + "noDevice": "No Devices Found", + "tipScanning": "(Make sure the device is powered on and awake)", + "tipBluetooth": "(Please enable Bluetooth in settings)", + "noName": "[No Name]", + "rssiUnit": "dBm" + }, + "dfu": { + "title": "Firmware Update", + "preparing": "Preparing...", + "reading": "Reading...", + + "bluetoothName": "Bluetooth Name", + "latestVersion": "Latest Version", + "currentVersion": "Current Version", + "upgradeStatus": "Update Status", + + "stateConnecting": "Connecting…", + "stateStarting": "Initializing…", + "stateEnablingDfuMode": "Enabling DFU Mode…", + "stateUploading": "Uploading Firmware…", + "stateValidating": "Validating Firmware…", + "stateDisconnecting": "Disconnecting…", + "stateCompleted": "Update Completed", + "stateAborted": "Aborted", + "stateFailed": "Update Failed", + "stateInitializing": "Starting…", + "stateErrored": "Update Error!", + + "pleaseWait": "Please Wait", + "doNotReturn": "Updating in progress, do not go back or close the app!", + + "cannotUpgrade": "Cannot Update", + "hardwareNotFound": "Firmware not found for hardware version {hardware}", + "noNeedUpgrade": "No Update Needed", + "alreadyLatest": "Already the latest firmware, no update needed", + + "upgradeSuccess": "Update Successful", + "upgradeSuccessMessage": "Update successful, please reconnect the device", + "upgradeFailed": "Update Failed", + "dfuFailed": "DFU Failed", + + "confirm": "OK" + }, + "privacy": { + "title": "Privacy Policy", + "content": "This application respects and protects the personal privacy of all users. This Privacy Policy applies only to the POWERFUN Settings App products or services provided by Wuxi Zhixingpai Sports Culture Development Co., Ltd. Please read and fully understand this policy before using our products or services.\n\n1. How We Collect and Use Your Information\n\n1. The POWERFUN Settings App does not require registration or login and does not collect any personal information.\n\n2. During your use of our products or services, we may use the following permissions:\n- Android ID\n- Storage\n- Location\n- Bluetooth\n\n3. Third-party SDK usage:\n\n(1) Tencent Bugly \nProvider: Tencent Computer Systems Company Limited \nPurpose: crash reporting and performance monitoring.\n\n(2) Aliyun OSS \nProvider: Alibaba Cloud Computing Co., Ltd. \nPurpose: storage of configuration and firmware update files.\n\n2. Updates to This Policy\n\nWe may update this policy from time to time. Changes will be published on this page.\n\n3. Contact Us\n\nEmail: bike99@qq.com\n\nWuxi Zhixingpai Sports Culture Development Co., Ltd. \nEffective date: July 1, 2019" + }, + "settings": { + "title": "Settings", + "language": "Language", + "privacy": "Privacy Policy", + "version": "Version" + }, + "languageModal": { + "title": "Language" + }, + "info": { + "title": "Device Info", + "bluetoothName": "Bluetooth Name", + "idNumber": "ID Number", + "firmwareVersion": "Firmware Version", + "battery": "Battery", + "connectionStatus": "Connection Status", + "connected": "Connected", + "disconnected": "Disconnected", + "reading": "Reading...", + + "power": "Power/W", + "cadence": "Cadence/RPM", + "balance": "L/R Balance/%", + "balanceHeader": "L / R", + + "powerTrimTitle": "Power Trim Settings", + "currentTrim": "Current Trim", + "trimPlaceholder": "Enter 50-200", + "updateValue": "Update Value", + + "calibrateButton": "Calibrate Zero", + "calibrating": "Calibrating... Waiting for device", + "firmwareUpgrade": "Firmware Update", + + "readingInfo": "Reading information...", + "readSuccess": "Read successfully!", + "writingTrim": "Writing power trim...", + "trimUpdateSuccess": "Power trim updated successfully!", + + "disconnectTitle": "Notice", + "disconnectMessage": "Device disconnected, please reconnect", + "reconnectMessage": "Please reconnect the device", + "confirm": "OK", + + "trimRangeAlert": "Power trim adjusts the power meter's high and low deviation. Default value is 100%. Adjustable range is 50%-200%. Please enter a number between 50 and 200 without the % symbol. Click the button below to update the power meter after entering.", + "deviceNotConnected": "Device not connected", + "writeFailed": "Write failed", + + "calibrationSuccess": "Calibration Successful", + "calibrationValue": "Calibration Value", + "calibrationError": "Calibration Error", + "calibrationTimeout": "Device not responding, please try again", + "calibrationFormatError": "Invalid response format from device", + "calibrationSendError": "Failed to send calibration command", + "error": "Error" + } + } \ No newline at end of file diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json new file mode 100644 index 0000000..a71d9cd --- /dev/null +++ b/src/i18n/locales/zh.json @@ -0,0 +1,120 @@ +{ + "nav": { + "scan": "搜索", + "info": "设备信息", + "dfu": "固件升级", + "privacy": "隐私协议" + }, + "home": { + "title": "POWERFUN设置", + "scan": "搜索设备", + "privacy": "隐私协议", + "version": "版本号 v0.0.1" + }, + "scan": { + "title": "搜索设备", + "scanning": "搜索中...", + "noDevice": "暂无设备", + "tipScanning": "(请确保设备有电且被唤醒)", + "tipBluetooth": "(请在设置中打开蓝牙)", + "noName": "[无名称]", + "rssiUnit": "dBm" + }, + "dfu": { + "title": "固件升级", + "preparing": "准备中...", + "reading": "读取中...", + + "bluetoothName": "蓝牙名称", + "latestVersion": "最新版本", + "currentVersion": "当前版本", + "upgradeStatus": "升级状态", + + "stateConnecting": "连接中…", + "stateStarting": "初始化中…", + "stateEnablingDfuMode": "启用 DFU 模式…", + "stateUploading": "上传固件中…", + "stateValidating": "校验固件…", + "stateDisconnecting": "断开连接…", + "stateCompleted": "升级完成", + "stateAborted": "已取消", + "stateFailed": "升级失败", + "stateInitializing": "启动中…", + "stateErrored": "升级出错!", + + "pleaseWait": "请稍候", + "doNotReturn": "正在升级,请勿返回或关闭应用!", + + "cannotUpgrade": "无法升级", + "hardwareNotFound": "未找到硬件版本 {hardware} 的固件", + "noNeedUpgrade": "无需升级", + "alreadyLatest": "已是最新固件,无需升级", + + "upgradeSuccess": "升级成功", + "upgradeSuccessMessage": "升级成功,请重连设备", + "upgradeFailed": "升级失败", + "dfuFailed": "DFU失败", + + "confirm": "确认" + }, + "privacy": { + "title": "隐私协议", + "content": "本应用尊重并保护所有使用服务用户的个人隐私权。本隐私政策仅适用于无锡执行派体育文化发展有限公司的 POWERFUN 设置 APP 产品或服务。请在使用我们的产品或服务前,仔细阅读并了解本隐私政策。\n\n一、我们如何收集和使用您的信息\n\n1. POWERFUN 设置 APP 不需要注册和登录,也不会收集任何关于个人的信息。\n\n2. 在您使用我司产品或服务过程中,我们可能会使用以下权限和信息:\n- Android ID:用于第三方或我们分析错误信息。\n- 存储权限:用于管理本地缓存。\n- 位置权限:用于设备产品与 APP 蓝牙连接。\n- 蓝牙权限:用于设备产品与 APP 蓝牙连接。\n\n3. 关于第三方 SDK 使用说明:\n\n(1)第三方 SDK 名称:腾讯 Bugly \n提供方:深圳市腾讯计算机系统有限公司 \n收集类型:系统版本、设备 ID、手机型号、网络状态、系统设置、网络与 WiFi 信息、手机状态、系统日志等。 \n使用目的:用于监控应用性能与稳定性,收集崩溃报告和使用数据以帮助我们识别并修复问题。\n\n(2)第三方 SDK 名称:Aliyun OSS \n提供方:阿里云计算有限公司 \n使用目的:用于存储应用运行必要的配置和固件升级文件,确保数据可靠存储。\n\n二、本政策如何更新\n\n我们的隐私政策可能会根据需求进行变更。未经您明确同意,我们不会削减您依据隐私政策应享有的权利。任何变更我们将在本页面公布。对于重大变更,我们会提供更为显著的通知。\n\n重大变更包括但不限于:\n- 服务模式发生重大变化(如用户信息处理目的、类型、方式等)。\n- 在所有权或组织架构方面发生变更(如业务调整、破产并购等)。\n- 用户信息安全影响评估报告显示存在高风险。\n\n三、如何联系我们\n\n如果您对本隐私政策有任何疑问、意见或建议,可通过以下方式与我们联系:\n电子邮件:bike99@qq.com\n\n一般情况下,我们将在三十天内回复。\n\n无锡执行派体育文化发展有限公司 \n本政策自 2019 年 7 月 1 日起生效" + }, + "settings": { + "title": "设置", + "language": "软件语言", + "privacy": "隐私协议", + "version": "版本号" + }, + "languageModal": { + "title": "软件语言" + }, + "info": { + "title": "设备信息", + "bluetoothName": "蓝牙名称", + "idNumber": "ID号", + "firmwareVersion": "固件版本", + "battery": "电量", + "connectionStatus": "连接状态", + "connected": "已连接", + "disconnected": "未连接", + "reading": "读取中...", + + "power": "功率/W", + "cadence": "踏频/RPM", + "balance": "左右平衡/%", + "balanceHeader": "L / R", + + "powerTrimTitle": "功率微调设置", + "currentTrim": "当前微调", + "trimPlaceholder": "输入50-200", + "updateValue": "更新数值", + + "calibrateButton": "校准归零", + "calibrating": "校准中...等待设备反应", + "firmwareUpgrade": "固件升级", + + "readingInfo": "正在读取信息...", + "readSuccess": "读取成功!", + "writingTrim": "正在写入功率微调...", + "trimUpdateSuccess": "功率微调更新成功!", + + "disconnectTitle": "提示", + "disconnectMessage": "设备已断开,请重新连接设备", + "reconnectMessage": "请重新连接设备", + "confirm": "确定", + + "trimRangeAlert": "功率微调可调整功率计的高低偏差,默认值100%。可调整的范围是50%-200%。请输入50至200的纯数字,不需要包含%符号。输入后点击下方按钮更新进功率计设备。", + "deviceNotConnected": "设备未连接", + "writeFailed": "写入失败", + + "calibrationSuccess": "校准成功", + "calibrationValue": "校准值", + "calibrationError": "校准错误", + "calibrationTimeout": "设备未响应,请重试", + "calibrationFormatError": "设备返回数据格式错误", + "calibrationSendError": "发送校准命令失败", + "error": "错误" + } + } \ No newline at end of file diff --git a/src/i18n/zh-CN.ts b/src/i18n/zh-CN.ts deleted file mode 100644 index bd5c2e9..0000000 --- a/src/i18n/zh-CN.ts +++ /dev/null @@ -1,109 +0,0 @@ -const zhCN = { - nav: { - scan: "搜索", - info: "设备信息", - dfu: "固件升级", - privacy: "隐私协议", - }, - - home: { - scan: "搜索设备", - privacy: "隐私协议", - version: "版本号 v0.0.1", - }, - - scan: { - scanning: "搜索中...", - noDevice: "暂无设备", - tipScanning: "(请确保设备有电且被唤醒)", - tipBluetooth: "(请在设置中打开蓝牙)", - noName: "[无名称]", - rssiUnit: "dBm", - }, - - dfu: { - preparing: "准备中...", - reading: "读取中...", - wait: "请稍候", - upgrading: "正在升级,请勿返回或关闭应用!", - - bluetoothName: "蓝牙名称", - latestVersion: "最新版本", - currentVersion: "当前版本", - upgradeStatus: "升级状态", - - successTitle: "升级成功", - successMsg: "升级成功,请重连设备", - - failTitle: "升级失败", - noNeedTitle: "无需升级", - noNeedMsg: "已是最新固件,无需升级", - - notFoundTitle: "无法升级", - notFoundMsg: "未找到硬件版本 {{hw}} 的固件", - - confirm: "确认", - }, - - dfuState: { - connecting: "连接中…", - starting: "初始化中…", - enablingDfuMode: "启用 DFU 模式…", - uploading: "上传固件中…", - validating: "校验固件…", - disconnecting: "断开连接…", - completed: "升级完成", - aborted: "已取消", - failed: "升级失败", - dfu_failed: "升级失败", - initializing: "启动中…", - errored: "升级出错!", - }, - - privacy: { - title: "隐私协议", - content: `本应用尊重并保护所有使用服务用户的个人隐私权。本隐私政策仅适用于无锡执行派体育文化发展有限公司的 POWERFUN 设置 APP 产品或服务。请在使用我们的产品或服务前,仔细阅读并了解本隐私政策。 - -一、我们如何收集和使用您的信息 - -1. POWERFUN 设置 APP 不需要注册和登录,也不会收集任何关于个人的信息。 - -2. 在您使用我司产品或服务过程中,我们可能会使用以下权限和信息: -- Android ID:用于第三方或我们分析错误信息。 -- 存储权限:用于管理本地缓存。 -- 位置权限:用于设备产品与 APP 蓝牙连接。 -- 蓝牙权限:用于设备产品与 APP 蓝牙连接。 - -3. 关于第三方 SDK 使用说明: - -(1)第三方 SDK 名称:腾讯 Bugly -提供方:深圳市腾讯计算机系统有限公司 -收集类型:系统版本、设备 ID、手机型号、网络状态、系统设置、网络与 WiFi 信息、手机状态、系统日志等。 -使用目的:用于监控应用性能与稳定性,收集崩溃报告和使用数据以帮助我们识别并修复问题。 - -(2)第三方 SDK 名称:Aliyun OSS -提供方:阿里云计算有限公司 -使用目的:用于存储应用运行必要的配置和固件升级文件,确保数据可靠存储。 - -二、本政策如何更新 - -我们的隐私政策可能会根据需求进行变更。未经您明确同意,我们不会削减您依据隐私政策应享有的权利。任何变更我们将在本页面公布。对于重大变更,我们会提供更为显著的通知。 - -重大变更包括但不限于: -- 服务模式发生重大变化(如用户信息处理目的、类型、方式等)。 -- 在所有权或组织架构方面发生变更(如业务调整、破产并购等)。 -- 用户信息安全影响评估报告显示存在高风险。 - -三、如何联系我们 - -如果您对本隐私政策有任何疑问、意见或建议,可通过以下方式与我们联系: -电子邮件:bike99@qq.com - -一般情况下,我们将在三十天内回复。 - -无锡执行派体育文化发展有限公司 -本政策自 2019 年 7 月 1 日起生效`, - }, -}; - -export default zhCN; diff --git a/src/img/Return.png b/src/img/Return.png new file mode 100644 index 0000000..33501c4 Binary files /dev/null and b/src/img/Return.png differ diff --git a/src/img/Return2.png b/src/img/Return2.png new file mode 100644 index 0000000..383bcac Binary files /dev/null and b/src/img/Return2.png differ diff --git a/src/img/Search.png b/src/img/Search.png new file mode 100644 index 0000000..ac2c605 Binary files /dev/null and b/src/img/Search.png differ diff --git a/src/img/Settings.png b/src/img/Settings.png new file mode 100644 index 0000000..3e2127a Binary files /dev/null and b/src/img/Settings.png differ diff --git a/src/img/_PrivacyAgreement.png b/src/img/_PrivacyAgreement.png new file mode 100644 index 0000000..7a7834d Binary files /dev/null and b/src/img/_PrivacyAgreement.png differ diff --git a/src/img/_SoftwareLanguage.png b/src/img/_SoftwareLanguage.png new file mode 100644 index 0000000..d2e80a0 Binary files /dev/null and b/src/img/_SoftwareLanguage.png differ diff --git a/src/types/RootNavigationProp.tsx b/src/types/RootNavigationProp.tsx new file mode 100644 index 0000000..aba66c8 --- /dev/null +++ b/src/types/RootNavigationProp.tsx @@ -0,0 +1,4 @@ +import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; +import { RootStackParamList } from "../../App"; + +export type RootNavigationProp = NativeStackNavigationProp; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index ad0d219..bbd935a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,7 +16,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.4.tgz" integrity sha512-YsmSKC29MJwf0gF8Rjjrg5LQCmyh+j/nD8/eP7f+BeoQTKYqs9RoWbjGOdy0+1Ekr68RJZMUOPVQaQisnIo4Rw== -"@babel/core@^7.0.0", "@babel/core@^7.0.0 || ^8.0.0-0", "@babel/core@^7.0.0-0", "@babel/core@^7.0.0-0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.11.0", "@babel/core@^7.11.6", "@babel/core@^7.12.0", "@babel/core@^7.12.3", "@babel/core@^7.13.0", "@babel/core@^7.23.9", "@babel/core@^7.25.2", "@babel/core@^7.4.0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.8.0": +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9", "@babel/core@^7.25.2": version "7.28.4" resolved "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz" integrity sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA== @@ -37,7 +37,7 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/eslint-parser@^7.12.0", "@babel/eslint-parser@^7.25.1": +"@babel/eslint-parser@^7.25.1": version "7.28.4" resolved "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.28.4.tgz" integrity sha512-Aa+yDiH87980jR6zvRfFuCR1+dLb00vBydhTL+zI992Rz/wQhSvuxjmOOuJOgO3XmakO6RykRGD2S1mq1AtgHA== @@ -966,7 +966,7 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/runtime@^7.25.0": +"@babel/runtime@^7.25.0", "@babel/runtime@^7.27.6", "@babel/runtime@^7.28.4": version "7.28.4" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz" integrity sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ== @@ -1359,7 +1359,7 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== @@ -1372,6 +1372,13 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@react-native-async-storage/async-storage@^2.2.0": + version "2.2.0" + resolved "https://repo.huaweicloud.com/repository/npm/@react-native-async-storage/async-storage/-/async-storage-2.2.0.tgz#a3aa565253e46286655560172f4e366e8969f5ad" + integrity sha512-gvRvjR5JAaUZF8tv2Kcq/Gbt3JHwbKFYfmb445rhOj6NUMx3qPLixmDx5pZAyb9at1bYvJ4/eTUipU5aki45xw== + dependencies: + merge-options "^3.0.4" + "@react-native-community/cli-clean@20.0.0": version "20.0.0" resolved "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-20.0.0.tgz" @@ -1503,7 +1510,7 @@ dependencies: joi "^17.2.1" -"@react-native-community/cli@*", "@react-native-community/cli@20.0.0": +"@react-native-community/cli@20.0.0": version "20.0.0" resolved "https://registry.npmjs.org/@react-native-community/cli/-/cli-20.0.0.tgz" integrity sha512-/cMnGl5V1rqnbElY1Fvga1vfw0d3bnqiJLx2+2oh7l9ulnXfVRWb5tU2kgBqiMxuDOKA+DQoifC9q/tvkj5K2w== @@ -1679,7 +1686,7 @@ hermes-parser "0.29.1" nullthrows "^1.1.1" -"@react-native/metro-config@*", "@react-native/metro-config@0.81.4": +"@react-native/metro-config@0.81.4": version "0.81.4" resolved "https://registry.npmjs.org/@react-native/metro-config/-/metro-config-0.81.4.tgz" integrity sha512-aEXhRMsz6yN5X63Zk+cdKByQ0j3dsKv+ETRP9lLARdZ82fBOCMuK6IfmZMwK3A/3bI7gSvt2MFPn3QHy3WnByw== @@ -1893,6 +1900,11 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== +"@types/lodash@^4.17.21": + version "4.17.21" + resolved "https://repo.huaweicloud.com/repository/npm/@types/lodash/-/lodash-4.17.21.tgz#b806831543d696b14f8112db600ea9d3a1df6ea4" + integrity sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ== + "@types/node@*": version "24.5.2" resolved "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz" @@ -1936,7 +1948,7 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.0.0 || ^6.0.0 || ^7.0.0", "@typescript-eslint/eslint-plugin@^7.1.1": +"@typescript-eslint/eslint-plugin@^7.1.1": version "7.18.0" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz" integrity sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw== @@ -1951,7 +1963,7 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@^7.0.0", "@typescript-eslint/parser@^7.1.1": +"@typescript-eslint/parser@^7.1.1": version "7.18.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz" integrity sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg== @@ -2025,6 +2037,16 @@ semver "^7.6.0" ts-api-utils "^1.3.0" +"@typescript-eslint/utils@7.18.0": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz" + integrity sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "7.18.0" + "@typescript-eslint/types" "7.18.0" + "@typescript-eslint/typescript-estree" "7.18.0" + "@typescript-eslint/utils@^5.10.0": version "5.62.0" resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz" @@ -2039,16 +2061,6 @@ eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/utils@7.18.0": - version "7.18.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz" - integrity sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "7.18.0" - "@typescript-eslint/types" "7.18.0" - "@typescript-eslint/typescript-estree" "7.18.0" - "@typescript-eslint/visitor-keys@5.62.0": version "5.62.0" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz" @@ -2095,7 +2107,7 @@ acorn-jsx@^5.3.2: resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.15.0, acorn@^8.9.0: +acorn@^8.15.0, acorn@^8.9.0: version "8.15.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz" integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== @@ -2475,7 +2487,7 @@ braces@^3.0.3: dependencies: fill-range "^7.1.1" -browserslist@^4.24.0, browserslist@^4.25.3, "browserslist@>= 4.21.0": +browserslist@^4.24.0, browserslist@^4.25.3: version "4.26.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.26.2.tgz" integrity sha512-ECFzp6uFOSB+dcZ5BK/IBaGWssbSYBHvuMeMt3MMFyhI0Z8SqGgEkBLARgpRH3hutIgPVsALcMwbDrJqPxQ65A== @@ -2675,16 +2687,16 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@^1.0.0, color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - color-name@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== +color-name@^1.0.0, color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + color-string@^1.9.0: version "1.9.1" resolved "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz" @@ -2847,27 +2859,20 @@ dayjs@^1.8.15: resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.18.tgz" integrity sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA== -debug@^2.6.9: +debug@2.6.9, debug@^2.6.9: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.4.0, debug@^4.4.1, debug@4: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.4.0, debug@^4.4.1: version "4.4.3" resolved "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz" integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== dependencies: ms "^2.1.3" -debug@2.6.9: - version "2.6.9" - resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - decamelize@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" @@ -3249,7 +3254,7 @@ eslint-plugin-react@^7.30.1: string.prototype.matchall "^4.0.12" string.prototype.repeat "^1.0.0" -eslint-scope@^5.1.1, eslint-scope@5.1.1: +eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -3270,22 +3275,12 @@ eslint-visitor-keys@^2.1.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint-visitor-keys@^3.4.1: - version "3.4.3" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -eslint-visitor-keys@^3.4.3: - version "3.4.3" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -"eslint@^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7", "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0", "eslint@^3.17.0 || ^4 || ^5 || ^6 || ^7 || ^8", "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^7.0.0 || ^8.0.0", "eslint@^7.5.0 || ^8.0.0 || ^9.0.0", eslint@^8.1.0, eslint@^8.19.0, eslint@^8.56.0, eslint@>=4.19.1, eslint@>=7.0.0, eslint@>=8: +eslint@^8.19.0: version "8.57.1" resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz" integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== @@ -3502,15 +3497,7 @@ finalhandler@1.1.2: statuses "~1.5.0" unpipe "~1.0.0" -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@^4.1.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3791,6 +3778,13 @@ html-escaper@^2.0.0: resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== +html-parse-stringify@^3.0.1: + version "3.0.1" + resolved "https://repo.huaweicloud.com/repository/npm/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz#dfc1017347ce9f77c8141a507f233040c59c55d2" + integrity sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg== + dependencies: + void-elements "3.1.0" + http-errors@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz" @@ -3815,6 +3809,13 @@ human-signals@^2.1.0: resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +i18next@^25.7.3: + version "25.7.3" + resolved "https://repo.huaweicloud.com/repository/npm/i18next/-/i18next-25.7.3.tgz#88bf15b414012a53ca87b9d408108aa81cb627cc" + integrity sha512-2XaT+HpYGuc2uTExq9TVRhLsso+Dxym6PWaKpn36wfBmTI779OQ7iP/XaZHzrnGyzU4SHpFrTYLKfVyBfAhVNA== + dependencies: + "@babel/runtime" "^7.28.4" + iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" @@ -3868,7 +3869,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@2, inherits@2.0.4: +inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4045,6 +4046,11 @@ is-path-inside@^3.0.3: resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://repo.huaweicloud.com/repository/npm/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + is-regex@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz" @@ -4126,14 +4132,7 @@ is-wsl@^1.1.0: resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz" integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw== -is-wsl@^2.1.1: - version "2.2.0" - resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -4419,7 +4418,7 @@ jest-resolve-dependencies@^29.7.0: jest-regex-util "^29.6.3" jest-snapshot "^29.7.0" -jest-resolve@*, jest-resolve@^29.7.0: +jest-resolve@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== @@ -4563,7 +4562,7 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@*, jest@^29.6.3: +jest@^29.6.3: version "29.7.0" resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== @@ -4806,6 +4805,13 @@ memoize-one@^5.0.0: resolved "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz" integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== +merge-options@^3.0.4: + version "3.0.4" + resolved "https://repo.huaweicloud.com/repository/npm/merge-options/-/merge-options-3.0.4.tgz#84709c2aa2a4b24c1981f66c179fe5565cc6dbb7" + integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ== + dependencies: + is-plain-obj "^2.1.0" + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" @@ -4843,7 +4849,7 @@ metro-cache@0.83.2: https-proxy-agent "^7.0.5" metro-core "0.83.2" -metro-config@^0.83.1, metro-config@0.83.2: +metro-config@0.83.2, metro-config@^0.83.1: version "0.83.2" resolved "https://registry.npmjs.org/metro-config/-/metro-config-0.83.2.tgz" integrity sha512-1FjCcdBe3e3D08gSSiU9u3Vtxd7alGH3x/DNFqWDFf5NouX4kLgbVloDDClr1UrLz62c0fHh2Vfr9ecmrOZp+g== @@ -4857,7 +4863,7 @@ metro-config@^0.83.1, metro-config@0.83.2: metro-runtime "0.83.2" yaml "^2.6.1" -metro-core@^0.83.1, metro-core@0.83.2: +metro-core@0.83.2, metro-core@^0.83.1: version "0.83.2" resolved "https://registry.npmjs.org/metro-core/-/metro-core-0.83.2.tgz" integrity sha512-8DRb0O82Br0IW77cNgKMLYWUkx48lWxUkvNUxVISyMkcNwE/9ywf1MYQUE88HaKwSrqne6kFgCSA/UWZoUT0Iw== @@ -4896,7 +4902,7 @@ metro-resolver@0.83.2: dependencies: flow-enums-runtime "^0.0.6" -metro-runtime@^0.83.1, metro-runtime@0.83.2: +metro-runtime@0.83.2, metro-runtime@^0.83.1: version "0.83.2" resolved "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.83.2.tgz" integrity sha512-nnsPtgRvFbNKwemqs0FuyFDzXLl+ezuFsUXDbX8o0SXOfsOPijqiQrf3kuafO1Zx1aUWf4NOrKJMAQP5EEHg9A== @@ -4904,7 +4910,7 @@ metro-runtime@^0.83.1, metro-runtime@0.83.2: "@babel/runtime" "^7.25.0" flow-enums-runtime "^0.0.6" -metro-source-map@^0.83.1, metro-source-map@0.83.2: +metro-source-map@0.83.2, metro-source-map@^0.83.1: version "0.83.2" resolved "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.83.2.tgz" integrity sha512-5FL/6BSQvshIKjXOennt9upFngq2lFvDakZn5LfauIVq8+L4sxXewIlSTcxAtzbtjAIaXeOSVMtCJ5DdfCt9AA== @@ -4963,7 +4969,7 @@ metro-transform-worker@0.83.2: metro-transform-plugins "0.83.2" nullthrows "^1.1.1" -metro@^0.83.1, metro@0.83.2: +metro@0.83.2, metro@^0.83.1: version "0.83.2" resolved "https://registry.npmjs.org/metro/-/metro-0.83.2.tgz" integrity sha512-HQgs9H1FyVbRptNSMy/ImchTTE5vS2MSqLoOo7hbDoBq6hPPZokwJvBMwrYSxdjQZmLXz2JFZtdvS+ZfgTc9yw== @@ -5017,16 +5023,16 @@ micromatch@^4.0.4, micromatch@^4.0.8: braces "^3.0.3" picomatch "^2.3.1" -"mime-db@>= 1.43.0 < 2": - version "1.54.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz" - integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ== - mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== +"mime-db@>= 1.43.0 < 2": + version "1.54.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz" + integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ== + mime-types@^2.1.27, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" @@ -5034,43 +5040,22 @@ mime-types@^2.1.27, mime-types@~2.1.24, mime-types@~2.1.34: dependencies: mime-db "1.52.0" -mime@^2.4.1: - version "2.6.0" - resolved "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz" - integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== - mime@1.6.0: version "1.6.0" resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mime@^2.4.1: + version "2.6.0" + resolved "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^3.0.5: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -5089,16 +5074,16 @@ mkdirp@^1.0.4: resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -ms@^2.1.3, ms@2.1.3: - version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== +ms@2.1.3, ms@^2.1.3: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + nanoid@^3.3.11: version "3.3.11" resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz" @@ -5109,16 +5094,16 @@ natural-compare@^1.4.0: resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -negotiator@~0.6.4: - version "0.6.4" - resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz" - integrity sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w== - negotiator@0.6.3: version "0.6.3" resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== +negotiator@~0.6.4: + version "0.6.4" + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz" + integrity sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w== + nocache@^3.0.1: version "3.0.4" resolved "https://registry.npmjs.org/nocache/-/nocache-3.0.4.tgz" @@ -5220,13 +5205,6 @@ object.values@^1.1.6, object.values@^1.2.1: define-properties "^1.2.1" es-object-atoms "^1.0.0" -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" - integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww== - dependencies: - ee-first "1.1.1" - on-finished@2.4.1: version "2.4.1" resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz" @@ -5234,6 +5212,13 @@ on-finished@2.4.1: dependencies: ee-first "1.1.1" +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" + integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww== + dependencies: + ee-first "1.1.1" + on-headers@~1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz" @@ -5416,7 +5401,7 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@>=2, prettier@2.8.8: +prettier@2.8.8: version "2.8.8" resolved "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== @@ -5521,6 +5506,15 @@ react-freeze@^1.0.0: resolved "https://registry.npmjs.org/react-freeze/-/react-freeze-1.0.4.tgz" integrity sha512-r4F0Sec0BLxWicc7HEyo2x3/2icUTrRmDjaaRyzzn+7aDyFZliszMDOgLVwSnQnYENOlL1o569Ze2HZefk8clA== +react-i18next@^16.5.0: + version "16.5.0" + resolved "https://repo.huaweicloud.com/repository/npm/react-i18next/-/react-i18next-16.5.0.tgz#107e4323742344a2f8792feb905cea551da6fd2c" + integrity sha512-IMpPTyCTKxEj8klCrLKUTIUa8uYTd851+jcu2fJuUB9Agkk9Qq8asw4omyeHVnOXHrLgQJGTm5zTvn8HpaPiqw== + dependencies: + "@babel/runtime" "^7.27.6" + html-parse-stringify "^3.0.1" + use-sync-external-store "^1.6.0" + react-is@^16.13.1: version "16.13.1" resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz" @@ -5536,6 +5530,11 @@ react-is@^19.1.0: resolved "https://registry.npmjs.org/react-is/-/react-is-19.1.1.tgz" integrity sha512-tr41fA15Vn8p4X9ntI+yCyeGSf1TlYaY5vlTZfQmeLBrFo3psOPX6HhTDnFNL9uj3EhP0KAQ80cugCl4b4BERA== +react-native-device-info@^15.0.1: + version "15.0.1" + resolved "https://repo.huaweicloud.com/repository/npm/react-native-device-info/-/react-native-device-info-15.0.1.tgz#8a2716861bb8e491e0627f326bcc007c77d2e8f6" + integrity sha512-U5waZRXtT3l1SgZpZMlIvMKPTkFZPH8W7Ks6GrJhdH723aUIPxjVer7cRSij1mvQdOAAYFJV/9BDzlC8apG89A== + react-native-fs@^2.20.0: version "2.20.0" resolved "https://registry.npmjs.org/react-native-fs/-/react-native-fs-2.20.0.tgz" @@ -5549,12 +5548,12 @@ react-native-is-edge-to-edge@^1.2.1: resolved "https://registry.npmjs.org/react-native-is-edge-to-edge/-/react-native-is-edge-to-edge-1.2.1.tgz" integrity sha512-FLbPWl/MyYQWz+KwqOZsSyj2JmLKglHatd3xLZWskXOpRaio4LfEDEz8E/A6uD8QoTHW6Aobw1jbEwK7KMgR7Q== -react-native-safe-area-context@^5.6.1, "react-native-safe-area-context@>= 4.0.0": +react-native-safe-area-context@^5.6.1: version "5.6.1" resolved "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.6.1.tgz" integrity sha512-/wJE58HLEAkATzhhX1xSr+fostLsK8Q97EfpfMDKo8jlOc1QKESSX/FQrhk7HhQH/2uSaox4Y86sNaI02kteiA== -react-native-screens@^4.16.0, "react-native-screens@>= 4.0.0": +react-native-screens@^4.16.0: version "4.16.0" resolved "https://registry.npmjs.org/react-native-screens/-/react-native-screens-4.16.0.tgz" integrity sha512-yIAyh7F/9uWkOzCi1/2FqvNvK6Wb9Y1+Kzn16SuGfN9YFJDTbwlzGRvePCNTOX0recpLQF3kc2FmvMUhyTCH1Q== @@ -5563,6 +5562,16 @@ react-native-screens@^4.16.0, "react-native-screens@>= 4.0.0": react-native-is-edge-to-edge "^1.2.1" warn-once "^0.1.0" +react-native-status-bar-height@^2.6.0: + version "2.6.0" + resolved "https://repo.huaweicloud.com/repository/npm/react-native-status-bar-height/-/react-native-status-bar-height-2.6.0.tgz#b6afd25b6e3d533c43d0fcdcfd5cafd775592cea" + integrity sha512-z3SGLF0mHT+OlJDq7B7h/jXPjWcdBT3V14Le5L2PjntjjWM3+EJzq2BcXDwV+v67KFNJic5pgA26cCmseYek6w== + +react-native-toast-message@^2.3.3: + version "2.3.3" + resolved "https://repo.huaweicloud.com/repository/npm/react-native-toast-message/-/react-native-toast-message-2.3.3.tgz#e301508d386a9902ff6b4559ecc6674f8cfdf97a" + integrity sha512-4IIUHwUPvKHu4gjD0Vj2aGQzqPATiblL1ey8tOqsxOWRPGGu52iIbL8M/mCz4uyqecvPdIcMY38AfwRuUADfQQ== + react-native-vector-icons@^10.3.0: version "10.3.0" resolved "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-10.3.0.tgz" @@ -5571,7 +5580,7 @@ react-native-vector-icons@^10.3.0: prop-types "^15.7.2" yargs "^16.1.1" -react-native@*, react-native@0.81.4: +react-native@0.81.4: version "0.81.4" resolved "https://registry.npmjs.org/react-native/-/react-native-0.81.4.tgz" integrity sha512-bt5bz3A/+Cv46KcjV0VQa+fo7MKxs17RCcpzjftINlen4ZDUl0I6Ut+brQ2FToa5oD0IB0xvQHfmsg2EDqsZdQ== @@ -5624,7 +5633,7 @@ react-test-renderer@19.1.0: react-is "^19.1.0" scheduler "^0.26.0" -react@*, "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", react@^19.1.0, "react@>= 18.2.0", react@>=16.8, react@>=17.0.0, react@19.1.0: +react@19.1.0: version "19.1.0" resolved "https://registry.npmjs.org/react/-/react-19.1.0.tgz" integrity sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg== @@ -5798,7 +5807,7 @@ safe-array-concat@^1.1.3: has-symbols "^1.1.0" isarray "^2.0.5" -safe-buffer@~5.2.0, safe-buffer@5.2.1: +safe-buffer@5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -5825,7 +5834,7 @@ safe-regex-test@^1.1.0: resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -scheduler@^0.26.0, scheduler@0.26.0: +scheduler@0.26.0, scheduler@^0.26.0: version "0.26.0" resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz" integrity sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA== @@ -5835,32 +5844,7 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.1.3: - version "7.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz" - integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== - -semver@^7.3.7: - version "7.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz" - integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== - -semver@^7.5.2: - version "7.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz" - integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== - -semver@^7.5.3: - version "7.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz" - integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== - -semver@^7.5.4: - version "7.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz" - integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== - -semver@^7.6.0: +semver@^7.1.3, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: version "7.7.2" resolved "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz" integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== @@ -6028,14 +6012,6 @@ slice-ansi@^2.0.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" -source-map-support@~0.5.20: - version "0.5.21" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@0.5.13: version "0.5.13" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" @@ -6044,6 +6020,14 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map@^0.5.6: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" @@ -6083,16 +6067,16 @@ stacktrace-parser@^0.1.10: dependencies: type-fest "^0.7.1" -statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== - statuses@2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== +statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== + stop-iteration-iterator@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz" @@ -6106,13 +6090,6 @@ strict-uri-encode@^2.0.0: resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - string-length@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" @@ -6194,6 +6171,13 @@ string.prototype.trimstart@^1.0.8: define-properties "^1.2.1" es-object-atoms "^1.0.0" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + strip-ansi@^5.0.0: version "5.2.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz" @@ -6390,7 +6374,7 @@ typed-array-length@^1.0.7: possible-typed-array-names "^1.0.0" reflect.getprototypeof "^1.0.6" -typescript@^5.8.3, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", typescript@>=4.2.0, typescript@>=4.9.5: +typescript@^5.8.3: version "5.9.2" resolved "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz" integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A== @@ -6438,7 +6422,7 @@ universalify@^0.1.0: resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -unpipe@~1.0.0, unpipe@1.0.0: +unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== @@ -6468,6 +6452,11 @@ use-sync-external-store@^1.5.0: resolved "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz" integrity sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A== +use-sync-external-store@^1.6.0: + version "1.6.0" + resolved "https://repo.huaweicloud.com/repository/npm/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz#b174bfa65cb2b526732d9f2ac0a408027876f32d" + integrity sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w== + utf8@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz" @@ -6502,6 +6491,11 @@ vlq@^1.0.0: resolved "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz" integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w== +void-elements@3.1.0: + version "3.1.0" + resolved "https://repo.huaweicloud.com/repository/npm/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09" + integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w== + walker@^1.0.7, walker@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" @@ -6634,12 +6628,7 @@ ws@^6.2.3: dependencies: async-limiter "~1.0.0" -ws@^7: - version "7.5.10" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz" - integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== - -ws@^7.5.10: +ws@^7, ws@^7.5.10: version "7.5.10" resolved "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==