u
This commit is contained in:
1 parent
cf9b01e633
commit
4dcac7b5a0
16 files changed
+139
-69
No files matched your search
@@ -74,7 +74,7 @@ export default function RootLayout() {
|
||||
|
||||
// 隐藏 splash
|
||||
SplashScreen.hideAsync()
|
||||
}, [fontsLoaded, userStore, moneyCategoryStore, router])
|
||||
}, [fontsLoaded])
|
||||
|
||||
return (
|
||||
<MenuProvider>
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ export default function SpaceInviteAndMembers() {
|
||||
return (
|
||||
<>
|
||||
<AccordionTitleText className="font-semibold text-lg">
|
||||
我的邀请码
|
||||
邀请码
|
||||
</AccordionTitleText>
|
||||
{isExpanded
|
||||
? (
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useEffect, useState } from 'react'
|
||||
import { View } from 'react-native'
|
||||
import CustomHeader from '@/components/custom/Header'
|
||||
|
||||
import { useSpaceStore } from '@/store/space'
|
||||
import JoinSpace from './components/JoinSpace'
|
||||
import SpaceHome from './components/SpaceHome'
|
||||
import SpaceInviteAndMembers from './components/SpaceInviteAndMembers'
|
||||
@@ -10,12 +9,11 @@ import SpaceInviteAndMembers from './components/SpaceInviteAndMembers'
|
||||
import StepFade from './components/StepFade'
|
||||
|
||||
export default function PagerWithTab() {
|
||||
const spaceStore = useSpaceStore()
|
||||
const [step, setStep] = useState<'join' | 'invite' | 'home'>('home')
|
||||
|
||||
useEffect(() => {
|
||||
spaceStore.init()
|
||||
}, [])
|
||||
function createSpace() {
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<View className="flex-1">
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ViewStyle } from 'react-native'
|
||||
import { Stack, useRouter } from 'expo-router'
|
||||
import React from 'react'
|
||||
import { Image, Text, TouchableOpacity, View } from 'react-native'
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||
import { LucideIcon } from '../common/ao'
|
||||
|
||||
export type StackScreenProps = React.ComponentProps<typeof Stack.Screen>
|
||||
@@ -63,41 +63,48 @@ export default function CustomHeader(props: CustomHeaderProps) {
|
||||
...screenProps?.options,
|
||||
headerShown: true,
|
||||
header: () => (
|
||||
<View
|
||||
className={`flex-row items-center h-24 px-2 ${className} `}
|
||||
<SafeAreaView
|
||||
className={`${className}`}
|
||||
style={[
|
||||
{ paddingTop: safeArea ? insets.top : 0 },
|
||||
style,
|
||||
]}
|
||||
>
|
||||
{
|
||||
left || (
|
||||
<View className="w-10 h-full justify-center">
|
||||
<TouchableOpacity onPress={() => router.back()}>
|
||||
<LucideIcon icon="ArrowLeft" size={24} clickable={false} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
{/* 左侧 */}
|
||||
<View
|
||||
className="flex-row items-center px-2"
|
||||
style={[
|
||||
{ height: 48 },
|
||||
]}
|
||||
>
|
||||
{
|
||||
left || (
|
||||
<View className="w-10 h-full justify-center">
|
||||
<TouchableOpacity onPress={() => router.back()}>
|
||||
<LucideIcon icon="ChevronLeft" size={28} clickable={false} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
{/* 左侧 */}
|
||||
|
||||
{/* 标题 */}
|
||||
<View className="flex-1 items-center justify-center">
|
||||
{typeof title === 'string'
|
||||
? <Text className="text-xl">{title}</Text>
|
||||
: title}
|
||||
</View>
|
||||
|
||||
{right || (
|
||||
<View className="w-10 h-full items-center justify-center">
|
||||
<Image
|
||||
source={require('@/static/images/logo.png')}
|
||||
style={{ width: 22, height: 22 }}
|
||||
/>
|
||||
{/* 标题 */}
|
||||
<View className="flex-1 items-center justify-center">
|
||||
{typeof title === 'string'
|
||||
? <Text className="text-xl">{title}</Text>
|
||||
: title}
|
||||
</View>
|
||||
)}
|
||||
|
||||
</View>
|
||||
{right || (
|
||||
<View className="w-10 h-full items-center justify-center">
|
||||
<Image
|
||||
source={require('@/static/images/logo.png')}
|
||||
style={{ width: 22, height: 22 }}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -31,8 +31,8 @@ function isWhiteListed(url: string) {
|
||||
}
|
||||
|
||||
const alovaInstance = createAlova({
|
||||
// baseURL: 'http://192.168.5.6:8086/app',
|
||||
baseURL: 'http://192.168.1.136:8086/app',
|
||||
baseURL: 'http://192.168.5.6:8086/app',
|
||||
// baseURL: 'http://192.168.1.136:8086/app',
|
||||
requestAdapter: axiosRequestAdapter(),
|
||||
timeout: 5000,
|
||||
cacheFor: null,
|
||||
|
||||
@@ -35,6 +35,7 @@ export const useMoneyCategoryStore = create<MoneyCategoryStore>()(
|
||||
set({ categories: get().categories.filter(c => c.id !== id) }),
|
||||
|
||||
init: async () => {
|
||||
|
||||
try {
|
||||
await queryMoneyCategoryApi().then((res) => {
|
||||
if (res.isSuccess) {
|
||||
|
||||
+3
-2
@@ -21,8 +21,9 @@ declare global {
|
||||
}
|
||||
|
||||
interface UserSpace {
|
||||
id: number
|
||||
name: string
|
||||
space_id: number
|
||||
space_name: string
|
||||
invite_code: string
|
||||
role: number
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ export interface GetUserSpaceParams {
|
||||
|
||||
}
|
||||
export interface GetUserSpaceResult {
|
||||
id: number
|
||||
name: string
|
||||
space_id: number
|
||||
space_name: string
|
||||
role: number
|
||||
invite_code: string
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user