diff --git a/app.config.js b/app.config.js index 937c07d..cd46dbd 100644 --- a/app.config.js +++ b/app.config.js @@ -53,6 +53,7 @@ export default ({ config }) => { }, edgeToEdgeEnabled: true, predictiveBackGestureEnabled: false, + forceDarkAllowed: false, // 已去重的权限 permissions: [ diff --git a/app.constants.js b/app.constants.js index c9e4399..3e02dd8 100644 --- a/app.constants.js +++ b/app.constants.js @@ -8,6 +8,6 @@ export const ANDROID_ID = 'com.duomi.duooomi' export const IOS_ID = ANDROID_ID export const IOS_UNIVERSAL_LINK = 'duooomi.bowong.cn' export const OWNER_ID = 'x3xbTCWf7dbtWu4gGU2TeI054L77xtkt' -export const APP_VERSION = 'dev202512261854' +export const APP_VERSION = 'dev202512311111' export const ALIPAY_SCHEMA = 'alipay2021006119657394' export const ALIPAY_SCHEMA_SANDBOX = '9021000158673972' diff --git a/app/(tabs)/explore.tsx b/app/(tabs)/explore.tsx index b57d80a..d54c06a 100644 --- a/app/(tabs)/explore.tsx +++ b/app/(tabs)/explore.tsx @@ -134,7 +134,7 @@ export default function TabTwoScreen() { try { const assetList = (await imgPicker({ maxImages: 1, - type: ImagePicker.MediaTypeOptions.Images, + type: ImagePicker.MediaTypeOptions.All, resultType: 'asset', })) as unknown as ImagePicker.ImagePickerAsset[] diff --git a/app/_layout.tsx b/app/_layout.tsx index 988d106..f8640ce 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -11,9 +11,7 @@ import { KeyboardProvider } from 'react-native-keyboard-controller' import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context' import { ModalPortal } from '@/@share/components' -import { AuthLoadingScreen } from '@/components/auth-loading-screen' import { HotUpdate } from '@/components/hot-update' -import { useRouteGuard } from '@/hooks/core/use-route-guard' import { useColorScheme } from '@/hooks/use-color-scheme' import { setupGlobalFetchLogger } from '@/lib/fetch-logger' @@ -87,15 +85,15 @@ function RootLayout() { function Providers({ children }: { children: React.ReactNode }) { const colorScheme = useColorScheme() - const { isLoading } = useRouteGuard() + // const { isLoading } = useRouteGuard() - if (isLoading) { - return ( - - - - ) - } + // if (isLoading) { + // return ( + // + // + // + // ) + // } return ( diff --git a/ble/protocol/Constants.ts b/ble/protocol/Constants.ts index bf20fcd..b613ce2 100644 --- a/ble/protocol/Constants.ts +++ b/ble/protocol/Constants.ts @@ -11,8 +11,8 @@ export const BLE_UUIDS = { export const FRAME_CONSTANTS = { HEAD_DEVICE_TO_APP: 0xb0, - // HEAD_APP_TO_DEVICE: 0xc7, - HEAD_APP_TO_DEVICE: 0xb1, + HEAD_APP_TO_DEVICE: 0xc7, + // HEAD_APP_TO_DEVICE: 0xb1, MAX_DATA_SIZE: 496, HEADER_SIZE: 8, diff --git a/components/auth-loading-screen.tsx b/components/auth-loading-screen.tsx index 63e0484..d6ee72b 100644 --- a/components/auth-loading-screen.tsx +++ b/components/auth-loading-screen.tsx @@ -1,12 +1,12 @@ -import React from 'react' -import { Block, Text } from '@share/components' import { Ionicons } from '@expo/vector-icons' +import { Block, Text } from '@share/components' +import React from 'react' export function AuthLoadingScreen() { return ( - - + + 加载中... diff --git a/components/hot-update.tsx b/components/hot-update.tsx index 21b980b..de61b22 100644 --- a/components/hot-update.tsx +++ b/components/hot-update.tsx @@ -1,12 +1,12 @@ +import * as Sentry from '@sentry/react-native' import * as Updates from 'expo-updates' import { useUpdates } from 'expo-updates' import { useCallback, useEffect, useState } from 'react' -import { Text, Block } from '@/@share/components' +import { Block, Text } from '@/@share/components' import { useUpdateChecker } from '@/hooks/use-update-checker' import { ProgressLine } from './progress' -import * as Sentry from '@sentry/react-native' export const HotUpdate = () => { const { hasUpdate = true } = useUpdateChecker() @@ -84,7 +84,9 @@ export const HotUpdate = () => { - {isDownloading ? '更新中' : downloadProgress >= 100 ? '更新成功' : '更新失败'} + + {isDownloading ? '更新中' : downloadProgress >= 100 ? '更新成功' : '更新失败'} + {downloadProgress}% diff --git a/components/progress.tsx b/components/progress.tsx index a1bff2c..56716f5 100644 --- a/components/progress.tsx +++ b/components/progress.tsx @@ -1,6 +1,6 @@ import Svg, { Circle } from 'react-native-svg' -import { Text, Block } from '@/@share/components' +import { Block, Text } from '@/@share/components' import { cn } from '@/utils/cn' type ProgressProps = { progress: number @@ -11,7 +11,10 @@ type ProgressProps = { export function ProgressLine({ progress, className, progressClassName }: ProgressProps) { return ( - 100 ? 100 : progress}%` }} /> + 100 ? 100 : progress}%` }} + /> ) } @@ -23,7 +26,14 @@ type ProgressRingProps = { progress: number minWidth?: number } -export function ProgressRing({ radius, strokeColor, strokeWidth, textColor, progress, minWidth = 66 }: ProgressRingProps) { +export function ProgressRing({ + radius, + strokeColor, + strokeWidth, + textColor, + progress, + minWidth = 66, +}: ProgressRingProps) { // Calculate the progress for the circular indicator const circumference = 2 * Math.PI * radius const strokeDashoffset = circumference - (progress / 100) * circumference diff --git a/hooks/core/use-route-guard.ts b/hooks/core/use-route-guard.ts index 09270e2..3598830 100644 --- a/hooks/core/use-route-guard.ts +++ b/hooks/core/use-route-guard.ts @@ -1,5 +1,6 @@ -import { useEffect } from 'react' import { useRouter, useSegments } from 'expo-router' +import { useEffect } from 'react' + import { useAuth } from './use-auth' const PUBLIC_ROUTES = [ @@ -8,6 +9,7 @@ const PUBLIC_ROUTES = [ 'index', // 首页(探索页) 'auth', // 登录注册页 'pointList', // 积分列表页 + 'explore', ] function isPublicRoute(segments: string[]): boolean { @@ -29,6 +31,8 @@ export function useRouteGuard() { const segments = useSegments() const router = useRouter() + console.log('useAuth-----------------', { isAuthenticated, isLoading, segments }) + useEffect(() => { if (isLoading) return