diff --git a/code/base-project/base-app/src/app/(tabs)/_layout.tsx b/code/base-project/base-app/src/app/(tabs)/_layout.tsx index 972cf8d6..ecc7d722 100644 --- a/code/base-project/base-app/src/app/(tabs)/_layout.tsx +++ b/code/base-project/base-app/src/app/(tabs)/_layout.tsx @@ -14,9 +14,9 @@ export default function TabsLayout() { icon: 'CircleDollarSign', }, { - name: 'user', - href: '/user', - icon: 'CircleCheckBig', + name: 'love', + href: '/love', + icon: 'Heart', }, { name: 'app', @@ -35,9 +35,9 @@ export default function TabsLayout() { icon: 'MessageCircle', }, { - name: 'love', - href: '/love', - icon: 'Heart', + name: 'user', + href: '/user', + icon: 'CircleUserRound', }, ] diff --git a/code/base-project/base-app/src/app/(tabs)/components/LocaleSelector.tsx b/code/base-project/base-app/src/app/(tabs)/components/LocaleSelector.tsx deleted file mode 100644 index d3e51d1e..00000000 --- a/code/base-project/base-app/src/app/(tabs)/components/LocaleSelector.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { Pressable, StyleSheet, Text, View } from 'react-native' - -const Locales = ['zh-cn', 'en', 'de', 'es'] - -interface Props { - locale: string - setLocale: (locale: string) => void - mainColor?: string - activeTextColor?: string -} - -export default function LocaleSelector({ - locale, - setLocale, - mainColor, - activeTextColor, -}: Props) { - return ( - - Locale: - {Locales.map((item, index) => ( - setLocale(item)} - accessibilityRole="button" - accessibilityLabel={item.toUpperCase()} - > - - {item.split('-')[0]?.toUpperCase()} - - - ))} - - ) -} - -const styles = StyleSheet.create({ - localeContainer: { - flexDirection: 'row', - alignItems: 'center', - marginBottom: 20, - }, - localeButton: { - alignItems: 'center', - justifyContent: 'center', - width: 36, - height: 36, - borderRadius: 36, - margin: 2, - }, - localeButtonText: { - fontSize: 15, - }, -}) diff --git a/code/base-project/base-app/src/app/(tabs)/components/ThemeSelector.tsx b/code/base-project/base-app/src/app/(tabs)/components/ThemeSelector.tsx deleted file mode 100644 index 30fe6c9a..00000000 --- a/code/base-project/base-app/src/app/(tabs)/components/ThemeSelector.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Pressable, StyleSheet, View } from 'react-native' - -export interface ITheme { - mainColor: string - activeTextColor: string -} - -interface Props { - themes: ITheme[] - setTheme: (theme: ITheme) => void -} - -export default function ThemeSelector({ themes = [], setTheme }: Props) { - return ( - - {themes.map((item, index) => ( - setTheme(item)} - accessibilityRole="button" - accessibilityLabel="Set Active Theme" - /> - ))} - - ) -} - -const styles = StyleSheet.create({ - themeContainer: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-around', - marginBottom: 10, - width: 330, - }, - themeButton: { - borderWidth: 4, - width: 32, - height: 32, - borderRadius: 32, - margin: 5, - shadowRadius: 20, - shadowColor: '#000', - shadowOpacity: 0.1, - shadowOffset: { width: 0, height: 0 }, - }, -}) diff --git a/code/base-project/base-app/src/app/(tabs)/money/components/TransactionsList.tsx b/code/base-project/base-app/src/app/(tabs)/money/components/TransactionsList.tsx index 6c30fcc3..eeb42561 100644 --- a/code/base-project/base-app/src/app/(tabs)/money/components/TransactionsList.tsx +++ b/code/base-project/base-app/src/app/(tabs)/money/components/TransactionsList.tsx @@ -1,6 +1,6 @@ import type { MoneyRecordGroup, MoneyRecordItem } from '@/types/money/record' -import React, { useCallback, useState } from 'react' -import { Pressable, SectionList, Text, View } from 'react-native' +import React, { useState } from 'react' +import { SectionList, Text, TouchableHighlight, View } from 'react-native' import { Menu, MenuOption, @@ -50,7 +50,7 @@ export default function StaticTransactions({ stickySectionHeadersEnabled={true} showsVerticalScrollIndicator={false} renderSectionHeader={({ section }) => ( - + {section.title} @@ -80,7 +80,7 @@ export default function StaticTransactions({ )} - renderItem={({ item }) => { + renderItem={({ item, index }) => { return ( setSelectedId(null)} + onBackdropPress={() => setSelectedId(null)} + onOpen={() => setSelectedId(item.id)} + onClose={() => setSelectedId(null)} > - + - - + + - {item.category_name} - {item.remark && {item.remark}} + + {item.remark ? item.remark : item.category_name} + + { + index === 1 && ( + + 操作人:张三 + + ) + } + - - + + {item.category_type === 1 ? '+' : '-'} {' '} {item.amount} - - 宝贝 - - { + onUpdate?.(item) + }} > 更新 - alert(`Clicked Option B fo`)}> + { + onDelete?.(item.id) + }} + > - 删除 + 删除 diff --git a/code/base-project/base-app/src/app/(tabs)/money/index.tsx b/code/base-project/base-app/src/app/(tabs)/money/index.tsx index 3c26f524..bb7b83d5 100644 --- a/code/base-project/base-app/src/app/(tabs)/money/index.tsx +++ b/code/base-project/base-app/src/app/(tabs)/money/index.tsx @@ -1,6 +1,6 @@ import type { MoneyRecordGroup, MoneyRecordItem, QueryMoneyRecordsResult } from '@/types/money/record' import React, { useEffect, useState } from 'react' -import { Text, TouchableOpacity, View } from 'react-native' +import { Text, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { ADatePicker, LucideIcon } from '@/components/common/ao' import { Fab, FabIcon } from '@/components/ui/fab' @@ -277,13 +277,17 @@ export default function Money() { } return ( + - + setShowDatePicker(true)} @@ -300,45 +304,51 @@ export default function Money() { - - - - - 余额 - {/* ↓20% */} + + + + + 余额 + + 0.00 - 22,313.00 - - - - 收入 - {/* ↑20% */} - - {moneyRecords.total_income} - + + 收入 + + 0.00 + + - - - 支出 - {/* ↑20% */} - - {moneyRecords.total_expense} - - {/* - - - 结余 - ↑20% - - 11.0 - */} + + 支出 + + 0.00 + + + + + 结余 + + 0.00 + diff --git a/code/base-project/base-app/src/app/(tabs)/user.tsx b/code/base-project/base-app/src/app/(tabs)/user.tsx deleted file mode 100644 index 09a32a23..00000000 --- a/code/base-project/base-app/src/app/(tabs)/user.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { router } from 'expo-router' -import { StyleSheet, Text, View } from 'react-native' -import { AButton, AInput } from '@/components/common/ao' -import { LucideIcon } from '@/components/common/ao/index' -import { useUserStore } from '@/store/user' - -export default function User() { - const userInfo = useUserStore(state => state.userInfo) - - if (!userInfo) { - return ( - - 未登录 - - ) - } - - const genderText = userInfo.gender === 1 ? '男' : userInfo.gender === 2 ? '女' : '未设置' - - return ( - - 个人信息 - - - 账号: - {userInfo.account} - - - 用户名: - {userInfo.username} - - - ID: - {userInfo.id} - - - 序号: - {userInfo.seqNo} - - - 性别: - {genderText} - - {userInfo.rememberMe && 已开启记住我功能} - - - { - router.replace('/auth') - }} - > - 跳转到登陆页面 - - - - - - - ) -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: '#fff', - padding: 20, - }, - title: { - fontSize: 20, - fontWeight: 'bold', - marginBottom: 16, - }, - infoBox: { - backgroundColor: '#f8f8f8', - borderRadius: 12, - padding: 16, - }, - item: { - fontSize: 16, - marginBottom: 8, - color: '#333', - }, - empty: { - textAlign: 'center', - marginTop: 100, - fontSize: 18, - color: '#888', - }, -}) diff --git a/code/base-project/base-app/src/app/(tabs)/user/components/ListItem.tsx b/code/base-project/base-app/src/app/(tabs)/user/components/ListItem.tsx new file mode 100644 index 00000000..1c11f6de --- /dev/null +++ b/code/base-project/base-app/src/app/(tabs)/user/components/ListItem.tsx @@ -0,0 +1,45 @@ +import type { icons } from 'lucide-react-native' +import { useRouter } from 'expo-router' +import { Text, TouchableOpacity } from 'react-native' +import { LucideIcon } from '@/components/common/ao/index' + +export interface ListItemProps { + icon: keyof typeof icons + text: string + href?: string + onPress?: () => void +} + +export default function ListItem({ icon, text, href, onPress }: ListItemProps) { + const router = useRouter() + + const handlePress = () => { + if (onPress) { + onPress() + return + } + + if (href) { + router.navigate(href) + } + } + + return ( + + + + {text} + + + + ) +} diff --git a/code/base-project/base-app/src/app/(tabs)/user/index.tsx b/code/base-project/base-app/src/app/(tabs)/user/index.tsx new file mode 100644 index 00000000..a1397a49 --- /dev/null +++ b/code/base-project/base-app/src/app/(tabs)/user/index.tsx @@ -0,0 +1,30 @@ +import { Text, TouchableOpacity, View } from 'react-native' +import { SafeAreaView } from 'react-native-safe-area-context' +import { LucideIcon } from '@/components/common/ao/index' +import { + Avatar, + AvatarImage, +} from '@/components/ui/avatar' +import ListItem from './components/ListItem' + +export default function User() { + return ( + + + + + + 张三 + + + + + + + + + ) +} diff --git a/code/base-project/base-app/src/app/system/settings/index.tsx b/code/base-project/base-app/src/app/system/settings/index.tsx new file mode 100644 index 00000000..ee07b7d2 --- /dev/null +++ b/code/base-project/base-app/src/app/system/settings/index.tsx @@ -0,0 +1,9 @@ +import { Text, View } from 'react-native' + +export default function Settings() { + return ( + + Settings + + ) +} diff --git a/code/base-project/base-app/src/app/system/share/index.tsx b/code/base-project/base-app/src/app/system/share/index.tsx new file mode 100644 index 00000000..e2909c7b --- /dev/null +++ b/code/base-project/base-app/src/app/system/share/index.tsx @@ -0,0 +1,17 @@ +import { Stack } from 'expo-router' +import { Text, View } from 'react-native' + +export default function Share() { + return ( + <> + + + Share + + + + ) +} diff --git a/code/base-project/base-app/src/components/custom/Header.tsx b/code/base-project/base-app/src/components/custom/Header.tsx new file mode 100644 index 00000000..5d599bfb --- /dev/null +++ b/code/base-project/base-app/src/components/custom/Header.tsx @@ -0,0 +1,17 @@ +import { Stack } from 'expo-router' +import { SafeAreaView } from 'react-native-safe-area-context' + +export default function CustomHeader() { + return ( + <> + + + + + + + ) +} diff --git a/code/base-project/base-app/src/components/custom/StepLayout.tsx b/code/base-project/base-app/src/components/custom/StepLayout.tsx index 763e0565..30a991c9 100644 --- a/code/base-project/base-app/src/components/custom/StepLayout.tsx +++ b/code/base-project/base-app/src/components/custom/StepLayout.tsx @@ -1,4 +1,3 @@ -import { Ionicons } from '@expo/vector-icons' import { usePathname, useRouter } from 'expo-router' import { useRef } from 'react' import { Image, Pressable, Text, View } from 'react-native' @@ -55,7 +54,7 @@ export default function StepLayout({ steps, children, showHearder = true }: Step onPress={canGoBack ? (currentStep.onBack ?? (() => router.back())) : undefined} style={{ opacity: canGoBack ? 1 : 0 }} > - + {/* */} diff --git a/code/base-project/base-app/src/components/ui/avatar/index.tsx b/code/base-project/base-app/src/components/ui/avatar/index.tsx new file mode 100644 index 00000000..20acba7d --- /dev/null +++ b/code/base-project/base-app/src/components/ui/avatar/index.tsx @@ -0,0 +1,185 @@ +'use client'; +import React from 'react'; +import { createAvatar } from '@gluestack-ui/core/avatar/creator'; + +import { View, Text, Image, Platform } from 'react-native'; + +import { tva } from '@gluestack-ui/utils/nativewind-utils'; +import { + withStyleContext, + useStyleContext, +} from '@gluestack-ui/utils/nativewind-utils'; +const SCOPE = 'AVATAR'; +import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils'; + +const UIAvatar = createAvatar({ + Root: withStyleContext(View, SCOPE), + Badge: View, + Group: View, + Image: Image, + FallbackText: Text, +}); + +const avatarStyle = tva({ + base: 'rounded-full justify-center items-center relative bg-primary-600 group-[.avatar-group]/avatar-group:-ml-2.5', + variants: { + size: { + 'xs': 'w-6 h-6', + 'sm': 'w-8 h-8', + 'md': 'w-12 h-12', + 'lg': 'w-16 h-16', + 'xl': 'w-24 h-24', + '2xl': 'w-32 h-32', + }, + }, +}); + +const avatarFallbackTextStyle = tva({ + base: 'text-typography-0 font-semibold overflow-hidden text-transform:uppercase web:cursor-default', + + parentVariants: { + size: { + 'xs': 'text-2xs', + 'sm': 'text-xs', + 'md': 'text-base', + 'lg': 'text-xl', + 'xl': 'text-3xl', + '2xl': 'text-5xl', + }, + }, +}); + +const avatarGroupStyle = tva({ + base: 'group/avatar-group flex-row-reverse relative avatar-group', +}); + +const avatarBadgeStyle = tva({ + base: 'w-5 h-5 bg-success-500 rounded-full absolute right-0 bottom-0 border-background-0 border-2', + parentVariants: { + size: { + 'xs': 'w-2 h-2', + 'sm': 'w-2 h-2', + 'md': 'w-3 h-3', + 'lg': 'w-4 h-4', + 'xl': 'w-6 h-6', + '2xl': 'w-8 h-8', + }, + }, +}); + +const avatarImageStyle = tva({ + base: 'h-full w-full rounded-full absolute', +}); + +type IAvatarProps = Omit< + React.ComponentPropsWithoutRef, + 'context' +> & + VariantProps; + +const Avatar = React.forwardRef< + React.ComponentRef, + IAvatarProps +>(function Avatar({ className, size = 'md', ...props }, ref) { + return ( + + ); +}); + +type IAvatarBadgeProps = React.ComponentPropsWithoutRef & + VariantProps; + +const AvatarBadge = React.forwardRef< + React.ComponentRef, + IAvatarBadgeProps +>(function AvatarBadge({ className, size, ...props }, ref) { + const { size: parentSize } = useStyleContext(SCOPE); + + return ( + + ); +}); + +type IAvatarFallbackTextProps = React.ComponentPropsWithoutRef< + typeof UIAvatar.FallbackText +> & + VariantProps; +const AvatarFallbackText = React.forwardRef< + React.ComponentRef, + IAvatarFallbackTextProps +>(function AvatarFallbackText({ className, size, ...props }, ref) { + const { size: parentSize } = useStyleContext(SCOPE); + + return ( + + ); +}); + +type IAvatarImageProps = React.ComponentPropsWithoutRef & + VariantProps; + +const AvatarImage = React.forwardRef< + React.ComponentRef, + IAvatarImageProps +>(function AvatarImage({ className, ...props }, ref) { + return ( + + ); +}); + +type IAvatarGroupProps = React.ComponentPropsWithoutRef & + VariantProps; + +const AvatarGroup = React.forwardRef< + React.ComponentRef, + IAvatarGroupProps +>(function AvatarGroup({ className, ...props }, ref) { + return ( + + ); +}); + +export { Avatar, AvatarBadge, AvatarFallbackText, AvatarImage, AvatarGroup }; diff --git a/code/base-project/base-app/src/request/index.ts b/code/base-project/base-app/src/request/index.ts index 4085918d..6c068bd8 100644 --- a/code/base-project/base-app/src/request/index.ts +++ b/code/base-project/base-app/src/request/index.ts @@ -30,8 +30,8 @@ function isWhiteListed(url: string) { } const alovaInstance = createAlova({ - baseURL: 'http://192.168.5.6:8085/app', - // baseURL: 'http://192.168.1.136:8085/app', + // baseURL: 'http://192.168.5.6:8085/app', + baseURL: 'http://192.168.1.136:8085/app', requestAdapter: axiosRequestAdapter(), timeout: 5000, cacheFor: null, diff --git a/code/base-project/base-app/src/static/images/404.png b/code/base-project/base-app/src/static/images/404.png deleted file mode 100644 index 32395243..00000000 Binary files a/code/base-project/base-app/src/static/images/404.png and /dev/null differ diff --git a/code/base-project/base-app/src/static/images/server-down.png b/code/base-project/base-app/src/static/images/server-down.png deleted file mode 100644 index c7b97868..00000000 Binary files a/code/base-project/base-app/src/static/images/server-down.png and /dev/null differ diff --git a/code/base-project/base-app/src/static/images/server-error.png b/code/base-project/base-app/src/static/images/server-error.png deleted file mode 100644 index e97f655c..00000000 Binary files a/code/base-project/base-app/src/static/images/server-error.png and /dev/null differ diff --git a/code/base-project/base-app/src/static/images/server-lost.svg b/code/base-project/base-app/src/static/images/server-lost.svg deleted file mode 100644 index 5cfc3275..00000000 --- a/code/base-project/base-app/src/static/images/server-lost.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/code/base-project/base-app/test2.html b/code/base-project/base-app/test2.html index 932e1fe7..6e5c1b85 100644 --- a/code/base-project/base-app/test2.html +++ b/code/base-project/base-app/test2.html @@ -1,143 +1,232 @@ - + - - -家庭记账列表 - + .qr-box { + width: 180px; + height: 180px; + background: #eee; + margin: 16px auto; + display: flex; + align-items: center; + justify-content: center; + border-radius: 10px; + font-size: 12px; + color: #666; + } + -
-
-
🛒
-
-
购物
-
买菜和日用品
-
-
-
-50.00
-
爸
-
+
+

共享空间(预览)

+ +
+ +
-
-
🍔
-
-
午餐
-
外卖订单
-
-
-
-30.00
-
妈
-
+ +
+

你尚未加入共享空间,你可以创建自己的空间或加入他人的。

+ +
生成邀请码
+
扫码加入
+ +
输入邀请码加入
+ + +
-
-
💰
-
-
工资
-
11月工资到账
-
-
-
+5000.00
-
我
-
+ +
+ + + + + + + +