Browse Source

钱包修复

zbb 3 months ago
parent
commit
71683df3a2
3 changed files with 18 additions and 4 deletions
  1. 1 1
      app/_layout.tsx
  2. 16 3
      app/integral/index.tsx
  3. 1 0
      app/wallet/index.tsx

+ 1 - 1
app/_layout.tsx

@@ -19,7 +19,7 @@ export default function RootLayout() {
       <AuthProvider>
         <ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
           <Stack>
-            <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
+            <Stack.Screen name="(tabs)" options={{ headerShown: false, title: '' }} />
             <Stack.Screen name="login" options={{ headerShown: false }} />
             <Stack.Screen name="product/[id]" options={{ headerShown: false }} />
             <Stack.Screen name="address" options={{ headerShown: false }} />

+ 16 - 3
app/integral/index.tsx

@@ -202,9 +202,22 @@ export default function IntegralScreen() {
       if (res?.code === 0) {
         Alert.alert('提示', '签到成功');
         setIstodaySignIn(true);
-        const dateInfo = setDate();
-        getInfo();
-        getData(dateInfo);
+        
+        // Optimistic update for UI
+        const optimisticDateInfo = dataInfo.map(item => {
+             if (item.istoday) {
+                 return { ...item, isSignIn: true };
+             }
+             return item;
+        });
+        setDataInfo(optimisticDateInfo);
+
+        // Delay fetch to ensure backend data consistency
+        setTimeout(() => {
+            const dateInfo = setDate();
+            getInfo();
+            getData(dateInfo);
+        }, 500);
       } else {
         Alert.alert('提示', res?.msg || '签到失败');
       }

+ 1 - 0
app/wallet/index.tsx

@@ -104,6 +104,7 @@ export default function WalletScreen() {
         headerTransparent: true,
         headerTintColor: '#fff', 
         headerBackTitleVisible: false,
+        headerBackTitle: '',
       }} />
 
       <SafeAreaView style={{ flex: 1, marginTop: 100 }}>