From 1ccae92d0fb24441a094ba66b8a0df0d6112e24e Mon Sep 17 00:00:00 2001 From: oneao Date: Tue, 20 Jan 2026 22:13:59 +0800 Subject: [PATCH] u --- code/allapp/allapp-rn/app.json | 8 +- code/allapp/allapp-rn/package.json | 4 +- code/allapp/allapp-rn/pnpm-lock.yaml | 18 ++- .../allapp-rn/src/app/(tabs)/money/index.tsx | 2 +- code/allapp/allapp-rn/src/app/auth/index.tsx | 6 + .../record/editor/components/CategoryGrid.tsx | 108 +++++++++++------- .../src/components/custom/Tabbar.tsx | 1 - code/allapp/allapp-rn/src/request/index.ts | 4 +- 8 files changed, 96 insertions(+), 55 deletions(-) diff --git a/code/allapp/allapp-rn/app.json b/code/allapp/allapp-rn/app.json index 3b251446..0516d357 100644 --- a/code/allapp/allapp-rn/app.json +++ b/code/allapp/allapp-rn/app.json @@ -1,13 +1,13 @@ { "expo": { - "name": "base-app", - "slug": "base-app", + "name": "allapp", + "slug": "allapp", "version": "1.0.0", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", "newArchEnabled": true, - "scheme": "oneao", + "scheme": "allapp", "splash": { "image": "./assets/splash-icon.png", "resizeMode": "contain", @@ -23,7 +23,7 @@ }, "edgeToEdgeEnabled": true, "predictiveBackGestureEnabled": false, - "package": "com.oneao.baseapp" + "package": "cn.oneao.allapp" }, "web": { "favicon": "./assets/favicon.png" diff --git a/code/allapp/allapp-rn/package.json b/code/allapp/allapp-rn/package.json index 214efb1b..4d9f94bb 100644 --- a/code/allapp/allapp-rn/package.json +++ b/code/allapp/allapp-rn/package.json @@ -1,5 +1,5 @@ { - "name": "base-app", + "name": "allapp", "version": "1.0.0", "private": true, "main": "expo-router/entry", @@ -47,6 +47,7 @@ "react-native-keyboard-controller": "1.18.5", "react-native-pager-view": "6.9.1", "react-native-popup-menu": "^0.18.0", + "react-native-qq-lib": "git+https://github.com/haxibiao/react-native-qq-lib.git", "react-native-qrcode-svg": "^6.3.20", "react-native-reanimated": "~4.1.1", "react-native-safe-area-context": "~5.6.1", @@ -54,7 +55,6 @@ "react-native-sortables": "^1.9.3", "react-native-svg": "15.12.1", "react-native-web": "^0.21.0", - "react-native-worklets": "0.5.1", "tailwind-merge": "^3.4.0", "zustand": "^5.0.8" }, diff --git a/code/allapp/allapp-rn/pnpm-lock.yaml b/code/allapp/allapp-rn/pnpm-lock.yaml index 52547133..50e09a4b 100644 --- a/code/allapp/allapp-rn/pnpm-lock.yaml +++ b/code/allapp/allapp-rn/pnpm-lock.yaml @@ -119,6 +119,9 @@ importers: react-native-popup-menu: specifier: ^0.18.0 version: 0.18.0 + react-native-qq-lib: + specifier: git+https://github.com/haxibiao/react-native-qq-lib.git + version: git+https://github.com/haxibiao/react-native-qq-lib.git#da1a25d40a31a18b85ce35c55737a5d7af40a2c9(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0) react-native-qrcode-svg: specifier: ^6.3.20 version: 6.3.20(react-native-svg@15.12.1(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0) @@ -140,9 +143,6 @@ importers: react-native-web: specifier: ^0.21.0 version: 0.21.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - react-native-worklets: - specifier: 0.5.1 - version: 0.5.1(@babel/core@7.28.5)(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0) tailwind-merge: specifier: ^3.4.0 version: 3.4.0 @@ -4947,6 +4947,13 @@ packages: react-native-popup-menu@0.18.0: resolution: {integrity: sha512-XD3gyp/hwL5YWw2J034DerfvbJ6S2YHqAzvqAFRU+UGnFD4JyTqggfm4UyynBD26O1PDoRb45Loil+NZCGfCnA==} + react-native-qq-lib@git+https://github.com/haxibiao/react-native-qq-lib.git#da1a25d40a31a18b85ce35c55737a5d7af40a2c9: + resolution: {commit: da1a25d40a31a18b85ce35c55737a5d7af40a2c9, repo: https://github.com/haxibiao/react-native-qq-lib.git, type: git} + version: 3.1.0 + peerDependencies: + react: ^16.8.1 + react-native: '>=0.60.0-rc.0 <1.0.x' + react-native-qrcode-svg@6.3.20: resolution: {integrity: sha512-GDP7T3DDEHUo53xmDyWWXXm3MhWRp0YayqVMum98JYfm0DW2rEbz1GIj+XLaA0QX443G0nURyzPnuQJeHjuvjA==} peerDependencies: @@ -11994,6 +12001,11 @@ snapshots: react-native-popup-menu@0.18.0: {} + react-native-qq-lib@git+https://github.com/haxibiao/react-native-qq-lib.git#da1a25d40a31a18b85ce35c55737a5d7af40a2c9(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0): + dependencies: + react: 19.1.0 + react-native: 0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0) + react-native-qrcode-svg@6.3.20(react-native-svg@15.12.1(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0): dependencies: prop-types: 15.8.1 diff --git a/code/allapp/allapp-rn/src/app/(tabs)/money/index.tsx b/code/allapp/allapp-rn/src/app/(tabs)/money/index.tsx index cc7949d5..c0ff5a37 100644 --- a/code/allapp/allapp-rn/src/app/(tabs)/money/index.tsx +++ b/code/allapp/allapp-rn/src/app/(tabs)/money/index.tsx @@ -35,7 +35,7 @@ export default function Money() { }).then((res) => { if (res.isSuccess) { console.log(res.data.records) - moneyRecordStore.setRecords(res.data.records, searchParams.record_time) + moneyRecordStore.setRecords(res.data.records || [], searchParams.record_time) } else { toast.show({ diff --git a/code/allapp/allapp-rn/src/app/auth/index.tsx b/code/allapp/allapp-rn/src/app/auth/index.tsx index 8ab1d909..a6e99cef 100644 --- a/code/allapp/allapp-rn/src/app/auth/index.tsx +++ b/code/allapp/allapp-rn/src/app/auth/index.tsx @@ -1,5 +1,7 @@ import { useRouter } from 'expo-router' +import { useEffect } from 'react' import { Image, Text, View } from 'react-native' +import * as QQAPI from 'react-native-qq-lib' import CustomHeader from '@/components/custom/Header' import { Button, ButtonText } from '@/components/ui/button' @@ -10,6 +12,10 @@ export default function AuthIndex() { router.push(url) } + useEffect(() => { + QQAPI.login() + }, []) + return ( void + + className?: string + style?: ViewStyle } export default function CategoryGrid({ data, selectedCategory, onSelectCategory, + className, + style, }: CategoryGridProps) { const flatListRef = useRef>(null) + // 每行 4 个,补齐空项 + const memoItems = useMemo(() => { + const items = [...data] + const remainder = items.length % 4 + if (remainder > 0) { + const emptyCount = 4 - remainder + for (let i = 0; i < emptyCount; i++) { + items.push({ id: `empty-${i}` } as any) + } + } + return items + }, [data]) + // 自动滚动到选中行 useEffect(() => { if (!selectedCategory || !flatListRef.current) @@ -41,43 +57,51 @@ export default function CategoryGrid({ }, [selectedCategory]) return ( - - - {data.map((item) => { - const isSelected = selectedCategory?.id === item.id - return ( - item.id.toString()} + showsVerticalScrollIndicator={false} + className={`${className}`} + style={[style]} + getItemLayout={(data, index) => { + return { length: 80, offset: 80 * index, index } + }} + renderItem={({ item }) => { + if (!('name' in item)) + return + + const isSelected = selectedCategory?.id === item.id + + return ( + onSelectCategory?.(item)} + > + - onSelectCategory?.(item)} - > - - - - - {item.name} - - - - ) - })} - - + + + + {item.name} + + + ) + }} + /> ) } diff --git a/code/allapp/allapp-rn/src/components/custom/Tabbar.tsx b/code/allapp/allapp-rn/src/components/custom/Tabbar.tsx index d55828d3..9adf75e6 100644 --- a/code/allapp/allapp-rn/src/components/custom/Tabbar.tsx +++ b/code/allapp/allapp-rn/src/components/custom/Tabbar.tsx @@ -6,7 +6,6 @@ import { useEffect, useState } from 'react' import { Pressable, View } from 'react-native' import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler' import Animated, { useAnimatedStyle, useSharedValue, withSequence, withTiming } from 'react-native-reanimated' -import { scheduleOnRN } from 'react-native-worklets' interface AppTabbarProps { data: TabbarItem[] diff --git a/code/allapp/allapp-rn/src/request/index.ts b/code/allapp/allapp-rn/src/request/index.ts index 476eb11d..de7e4c95 100644 --- a/code/allapp/allapp-rn/src/request/index.ts +++ b/code/allapp/allapp-rn/src/request/index.ts @@ -32,8 +32,8 @@ function isWhiteListed(url: string) { } const alovaInstance = createAlova({ - // baseURL: 'http://192.168.5.6:8086/app', - baseURL: 'http://192.168.1.137:8086/app', + baseURL: 'http://192.168.5.6:8086/app', + // baseURL: 'http://192.168.1.137:8086/app', requestAdapter: axiosRequestAdapter(), timeout: 5000, cacheFor: null,