diff --git a/@share/components/Img.tsx b/@share/components/Img.tsx index 07ad776..8fb5b19 100644 --- a/@share/components/Img.tsx +++ b/@share/components/Img.tsx @@ -77,7 +77,7 @@ const Img = forwardRef((props, ref) => { ref, // placeholder: blurhash, source: imageSource, - cachePolicy: 'memory-disk' as const, + cachePolicy: 'disk' as const, errorSource, ...reset, } diff --git a/@share/components/Video.tsx b/@share/components/Video.tsx index 94c28d2..310a337 100644 --- a/@share/components/Video.tsx +++ b/@share/components/Video.tsx @@ -46,7 +46,7 @@ const VideoBox = ({ url, needWeb = true, width = 256, style, ...videoProps }: Pr try { // 先尝试从缓存获取 const cachedUrl = await videoUrlCache.get(url!, width) - // console.log('getRedirectUrl cachedUrl-----------', url, cachedUrl) + // console.log('getRedirectUrl cachedUrl-----------', url, cachedUrl, width) if (cachedUrl) { setUrlFinal(cachedUrl) return diff --git a/app.config.js b/app.config.js index 3784b19..000fba4 100644 --- a/app.config.js +++ b/app.config.js @@ -12,7 +12,7 @@ export const IOS_UNIVERSAL_LINK = 'duooomi.bowong.cn' // 原生版本,原生代码变更时需要更新此版本号 export const VERSION = '1.1.0' // JavaScript版本,JS代码变更时需要更新此版本号 -export const APP_VERSION = 'dev202601151820' +export const APP_VERSION = 'dev202601151552' const ALIPAY_SCHEMA = 'alipay2021006119657394' const ALIPAY_SCHEMA_SANDBOX = 'alipay9021000158673972' diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index a6d8cee..983a03c 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -7,7 +7,6 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' import { Colors } from '@/constants/theme' import { userStore } from '@/stores' -import { configureWebBrowser } from '@/utils' interface BottomNavProps { currentRoute: string @@ -78,14 +77,14 @@ const CustomTabBar = observer(function CustomTabBar(props: any) { export default function Layout() { useEffect(() => { // 配置WebBrowser - const setupWebBrowser = async () => { - try { - await configureWebBrowser() - } catch (error) { - console.warn('Failed to configure WebBrowser:', error) - } - } - setupWebBrowser() + // const setupWebBrowser = async () => { + // try { + // await configureWebBrowser() + // } catch (error) { + // console.warn('Failed to configure WebBrowser:', error) + // } + // } + // setupWebBrowser() }, []) return }> diff --git a/app/(tabs)/generate.tsx b/app/(tabs)/generate.tsx index 73aef8f..a42cb11 100644 --- a/app/(tabs)/generate.tsx +++ b/app/(tabs)/generate.tsx @@ -251,6 +251,7 @@ const Generate = observer(function Generate() { handleSelectTemplate(item)} /> @@ -460,6 +461,7 @@ type TemplateItemProps = { const TemplateItem = memo(function TemplateItem({ item, itemWidth, isSelected, onSelect }) { return ( setSelectedItem(item)} /> ), @@ -399,7 +406,8 @@ const Index = observer(function Index() { } numColumns={3} onEndReached={handleLoadMore} - drawDistance={600} + removeClippedSubviews={true} + drawDistance={300} onEndReachedThreshold={0.3} refreshControl={} renderItem={renderItem} @@ -526,7 +534,12 @@ type HeroCircleProps = { const HeroCircle = observer(function HeroCircle({ selectedItem, onQuickGen, onOpenSearch }) { const isAuthenticated = userStore.isAuthenticated const { balance } = userBalanceStore + + const Width = 216 + const previewUrl = selectedItem?.webpHighPreviewUrl || selectedItem?.url || '' + const existItem = !!selectedItem?.url + return ( @@ -534,7 +547,7 @@ const HeroCircle = observer(function HeroCircle({ selectedItem, {existItem && ( - + )} @@ -626,8 +639,10 @@ const GridItem = memo( function GridItem({ item, isSelected, itemWidth, onSelect }) { // console.log('item-------------', item); + const previewUrl = item?.webpPreviewUrl || item?.url || '' + return ( - + ( width: itemWidth, }} > - + {isSelected && } diff --git a/app/(tabs)/sync.tsx b/app/(tabs)/sync.tsx index 65e3178..3dd2448 100644 --- a/app/(tabs)/sync.tsx +++ b/app/(tabs)/sync.tsx @@ -172,7 +172,7 @@ const Sync = observer(() => { }) .catch((e) => { Toast.hideLoading() - console.log('e--------', e) + console.log('transferMediaSingle e--------', e) Toast.show({ title: e || '同步失败' }) }) @@ -382,6 +382,7 @@ const Sync = observer(() => { itemWidth={itemWidth} post={post} onSelect={handleItemSelect} + key={post?.id} /> ) }, @@ -396,7 +397,8 @@ const Sync = observer(() => { 'row'} @@ -702,7 +704,7 @@ const GridItem = memo( } return ( - onSelect(post)}> + onSelect(post)}> { const url = selectedItem?.url || selectedItem?.imageUrl - // console.log('GalleryRenderer--------------', selectedItem) + console.log('GalleryRenderer--------------', selectedItem) if (!url) return null @@ -961,7 +963,7 @@ const GalleryRenderer = memo(({ selectedItem }: { selectedItem: any }) => { className="relative z-10 border-4 border-black" style={{ width: Width, height: Width, borderRadius: Width, overflow: 'hidden' }} > - + ) }) diff --git a/app/_layout.tsx b/app/_layout.tsx index f2f92de..43ecd73 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -93,7 +93,7 @@ function RootLayout() { - + ) diff --git a/eas.json b/eas.json index 388f1e8..227d31e 100644 --- a/eas.json +++ b/eas.json @@ -6,7 +6,7 @@ "build": { "production": { "channel": "production", - "distribution": "store", + "distribution": "internal", "bun": "1.3.3", "ios": { "image": "latest" @@ -17,6 +17,10 @@ }, "env": { "EXPO_PUBLIC_ENV": "production", + "EXPO_PUBLIC_OWNER_ID": "x3xbTCWf7dbtWu4gGU2TeI054L77xtkt", + "EXPO_PUBLIC_INDEX_GROUP_ID": "cmjto2jdq02egeqecpfehyggs", + "EXPO_PUBLIC_GENERATE_GROUP_ID": "cmk3qbw9p0008j2eb84etgxcb", + "FLIPPER_DISABLE": "1", "GRADLE_OPTS": "-Dorg.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m", "ORG_GRADLE_PROJECT_reactNativeArchitectures": "arm64-v8a,x86_64" @@ -37,6 +41,10 @@ }, "env": { "EXPO_PUBLIC_ENV": "development", + "EXPO_PUBLIC_OWNER_ID": "x3xbTCWf7dbtWu4gGU2TeI054L77xtkt", + "EXPO_PUBLIC_INDEX_GROUP_ID": "cmjto2jdq02egeqecpfehyggs", + "EXPO_PUBLIC_GENERATE_GROUP_ID": "cmk3qbw9p0008j2eb84etgxcb", + "GRADLE_OPTS": "-Dorg.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m", "ORG_GRADLE_PROJECT_reactNativeArchitectures": "arm64-v8a,x86_64" }, @@ -55,6 +63,10 @@ }, "env": { "EXPO_PUBLIC_ENV": "test", + "EXPO_PUBLIC_OWNER_ID": "x3xbTCWf7dbtWu4gGU2TeI054L77xtkt", + "EXPO_PUBLIC_INDEX_GROUP_ID": "cmjto2jdq02egeqecpfehyggs", + "EXPO_PUBLIC_GENERATE_GROUP_ID": "cmk3qbw9p0008j2eb84etgxcb", + "FLIPPER_DISABLE": "1", "GRADLE_OPTS": "-Dorg.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m", "ORG_GRADLE_PROJECT_reactNativeArchitectures": "arm64-v8a,x86_64" diff --git a/hooks/data/use-template-generations.ts b/hooks/data/use-template-generations.ts index a5aa1e9..1c8a135 100644 --- a/hooks/data/use-template-generations.ts +++ b/hooks/data/use-template-generations.ts @@ -18,6 +18,8 @@ export const useTemplateGenerations = () => { const currentPageRef = useRef(1) const hasMoreRef = useRef(true) + const pageSize = 10 + const load = useCallback(async (params?: ListTemplateGenerationsInput) => { setLoading(true) setError(null) @@ -29,7 +31,7 @@ export const useTemplateGenerations = () => { async () => await templateGeneration.list({ page: params?.page || 1, - limit: params?.limit || 20, + limit: params?.limit || pageSize, ...params, }), ) @@ -60,7 +62,7 @@ export const useTemplateGenerations = () => { async () => await templateGeneration.list({ page: nextPage, - limit: params?.limit || 20, + limit: params?.limit || pageSize, ...params, }), ) diff --git a/hooks/use-update-checker.ts b/hooks/use-update-checker.ts index 0827894..f941700 100644 --- a/hooks/use-update-checker.ts +++ b/hooks/use-update-checker.ts @@ -10,7 +10,7 @@ interface UseUpdateCheckerOptions { } export const useUpdateChecker = ({ - interval = 5 * 60 * 1000, // 5分钟 + interval = 1 * 60 * 1000, // 5分钟 // 关闭轮询 enablePeriodicCheck = false, }: UseUpdateCheckerOptions = {}) => { diff --git a/utils/storage.ts b/utils/storage.ts index 177c144..6d52f89 100644 --- a/utils/storage.ts +++ b/utils/storage.ts @@ -1,11 +1,13 @@ import AsyncStorage from '@react-native-async-storage/async-storage' +import { APP_VERSION } from '@/app.config' + interface StorageData { [key: string]: string } class Storage { - private readonly STORAGE_KEY = 'app_storage' + private readonly STORAGE_KEY = `app_storage_${APP_VERSION}` private cache: StorageData = {} private isInitialized = false @@ -28,23 +30,25 @@ class Storage { // 获取存储值 async get(key: string): Promise { - await this.init() + try { + await this.init() - const value = this.cache[key] - - // console.log('get-----------', value) - - return value ? (value as unknown as T) : null + const value = this.cache[key] + return value as unknown as T + // console.log('get-----------', value) + } catch (error) { + return null + } } // 设置存储 async set(key: string, value: any): Promise { - await this.init() - - this.cache[key] = value - - // 保存到本地存储 try { + await this.init() + + this.cache[key] = value + + // 保存到本地存储 await AsyncStorage.setItem(this.STORAGE_KEY, JSON.stringify(this.cache)) // console.log('💾 已存储:', key, '->', value) } catch (error) {