From 465f3e436670c91895c7524de4124e48eb8492af Mon Sep 17 00:00:00 2001 From: km2025 Date: Wed, 31 Dec 2025 11:53:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0HotUpdate=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=B7=E5=BC=8F=EF=BC=9B=E6=B7=BB=E5=8A=A0=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/hot-update.tsx | 8 ++++---- utils/index.ts | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/components/hot-update.tsx b/components/hot-update.tsx index de61b22..a19c3ec 100644 --- a/components/hot-update.tsx +++ b/components/hot-update.tsx @@ -81,13 +81,13 @@ export const HotUpdate = () => { if (!showUpdate) return null return ( - + - - + + {isDownloading ? '更新中' : downloadProgress >= 100 ? '更新成功' : '更新失败'} - {downloadProgress}% + {downloadProgress}% ) diff --git a/utils/index.ts b/utils/index.ts index 5c0e69d..6ccbd94 100644 --- a/utils/index.ts +++ b/utils/index.ts @@ -1,4 +1,25 @@ +import { router } from 'expo-router' import { Dimensions } from 'react-native' export const screenWidth = Dimensions.get('window').width export const screenHeight = Dimensions.get('window').height + +export const push = (path: string, params?: Record) => { + const params2 = params || {} + router.push({ + pathname: path as any, + params: params2, + }) +} + +export const replace = (path: string, params?: Record) => { + const params2 = params || {} + router.replace({ + pathname: path as any, + params: params2, + }) +} + +export const goBack = () => { + router.back() +}