From e720969d2e57e0eb845861b5b9c2ac731bebe162 Mon Sep 17 00:00:00 2001 From: km2025 Date: Tue, 27 Jan 2026 16:17:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=94=AE=E7=9B=98?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E8=A7=86=E5=9B=BE=E6=94=AF=E6=8C=81=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A1=AE=E8=AE=A4=E6=A8=A1=E6=80=81=E6=A1=86?= =?UTF-8?q?=E5=B8=83=E5=B1=80=EF=BC=9B=E7=A7=BB=E9=99=A4=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=EF=BC=9B=E6=9B=B4=E6=96=B0=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- @share/components/ConfirmModal.tsx | 75 +++++++++++++------------- app/(tabs)/explore.tsx | 2 +- app/(tabs)/index.tsx | 5 -- app/(tabs)/sync.tsx | 24 ++++++--- hooks/data/use-template-generations.ts | 9 ++-- 5 files changed, 62 insertions(+), 53 deletions(-) diff --git a/@share/components/ConfirmModal.tsx b/@share/components/ConfirmModal.tsx index 9c04221..b4cf66e 100644 --- a/@share/components/ConfirmModal.tsx +++ b/@share/components/ConfirmModal.tsx @@ -1,5 +1,6 @@ import { Ionicons } from '@expo/vector-icons' import React, { type ReactNode } from 'react' +import { KeyboardAwareScrollView } from 'react-native-keyboard-controller' import Block from './Block' import Text from './Text' @@ -49,50 +50,50 @@ const ConfirmModal: React.FC = ({ } return ( - - - - {badge} - - - {title} - - - - {typeof content === 'string' ? ( - {content} - ) : ( - content - )} - - - - - {cancelText} + + + + + {badge} - - {confirmLoading ? ( - <> - - {confirmText} - + {title} + + + + {typeof content === 'string' ? ( + {content} ) : ( - <> - {confirmText} - {title==='确认支付?' && ( - - )} - + content )} + + + + {cancelText} + + + + {confirmLoading ? ( + <> + + {confirmText} + + ) : ( + <> + {confirmText} + {title === '确认支付?' && } + + )} + + - + ) } diff --git a/app/(tabs)/explore.tsx b/app/(tabs)/explore.tsx index d73aac5..dbf39c3 100644 --- a/app/(tabs)/explore.tsx +++ b/app/(tabs)/explore.tsx @@ -37,7 +37,7 @@ export default observer(function TabTwoScreen() { const isConnected = bleStore.state.isConnected - console.log('isConnected----------', isConnected) + // console.log('isConnected----------', isConnected) const { galleryList: contents } = bleStore diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 37c87bd..c6b099f 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -582,11 +582,6 @@ const GooActions = observer(function GooActions({ gooPoints, on {isDev && isPolling && } )} - {!!isLogin && ( - router.push('/settings')}> - - - )} { // 加载生成记录 useEffect(() => { if (isFocused) { - loadGenerations() + // loadGenerations() } }, [isFocused]) @@ -423,7 +423,7 @@ const Sync = observer(() => { } @@ -499,6 +499,9 @@ const DeviceItem = observer(({ device }: { device: any }) => { const canEdit = !!bindDevice && isConnected + // 绑定过的设备 + const hasBind = !!bleStore.bindDeviceList?.find((d) => d?.id === id) + const { id: userId } = userStore.user || {} const onConnectToggle = async (device: any) => { if (device.connected) { @@ -623,6 +626,16 @@ const DeviceItem = observer(({ device }: { device: any }) => { {isConnected ? '已连接' : '未连接'} + + {hasBind && ( + + + 绑定过 + + + )} @@ -856,13 +869,10 @@ const HeaderBanner = observer(({ connectedDevice, onPick }: { connectedDevice: a const handleLogout = () => { if (isLogin) { - signOut().then(() => { - Toast.show({ title: '已登出' }) - router.replace('/auth') - }) + router.push('/settings') } } - const loginText = isLogin ? '登出' : '登录' + const loginText = isLogin ? '设置' : '登录' return ( diff --git a/hooks/data/use-template-generations.ts b/hooks/data/use-template-generations.ts index 0ae8add..c903647 100644 --- a/hooks/data/use-template-generations.ts +++ b/hooks/data/use-template-generations.ts @@ -1,6 +1,6 @@ import { root } from '@repo/core' import { type ListTemplateGenerationsInput, type TemplateGeneration, TemplateGenerationController } from '@repo/sdk' -import { useCallback, useRef, useState } from 'react' +import { useCallback, useEffect, useRef, useState } from 'react' import { type ApiError } from '@/lib/types' @@ -19,14 +19,13 @@ export const useTemplateGenerations = () => { const load = useCallback(async (params?: ListTemplateGenerationsInput) => { setLoading(true) setError(null) - currentPageRef.current = 1 const templateGeneration = root.get(TemplateGenerationController) const { data, error } = await handleError( async () => await templateGeneration.list({ - page: currentPageRef.current, + page: 1, limit: params?.limit || pageSize, ...params, }), @@ -93,6 +92,10 @@ export const useTemplateGenerations = () => { [load], ) + useEffect(() => { + load() + }, []) + return { data, loading,