Compare commits
No commits in common. "546bca3472274bcb763c8c7bd8eff513731749e4" and "2f4fd12c6748b68691f5ff3250d7fd8043da0c6c" have entirely different histories.
546bca3472
...
2f4fd12c67
@ -20,8 +20,6 @@ import {
|
|||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
View
|
View
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
||||||
import { runOnJS } from 'react-native-reanimated';
|
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
|
||||||
export default function AskScreen() {
|
export default function AskScreen() {
|
||||||
@ -48,25 +46,6 @@ export default function AskScreen() {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const updateState = (value: string) => {
|
|
||||||
console.log('Received in JS:', value);
|
|
||||||
// 更新 React 状态或路由
|
|
||||||
router.replace(value);
|
|
||||||
};
|
|
||||||
// 右滑
|
|
||||||
const gesture = Gesture.Pan()
|
|
||||||
.onEnd((event) => {
|
|
||||||
const { translationX } = event;
|
|
||||||
const threshold = 100; // 滑动阈值
|
|
||||||
|
|
||||||
if (translationX > threshold) {
|
|
||||||
// 从左向右滑动,跳转页面
|
|
||||||
runOnJS(router.replace)("memo-list");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.minPointers(1)
|
|
||||||
.activeOffsetX([-10, 10]); // 在 X 方向触发的范围
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isHello && userMessages.length > 0) {
|
if (!isHello && userMessages.length > 0) {
|
||||||
scrollToEnd();
|
scrollToEnd();
|
||||||
@ -257,7 +236,6 @@ export default function AskScreen() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GestureDetector gesture={gesture}>
|
|
||||||
<View style={[styles.container, { paddingTop: insets.top }]}>
|
<View style={[styles.container, { paddingTop: insets.top }]}>
|
||||||
{/* 导航栏 */}
|
{/* 导航栏 */}
|
||||||
<View style={[styles.navbar, isHello && styles.hiddenNavbar]}>
|
<View style={[styles.navbar, isHello && styles.hiddenNavbar]}>
|
||||||
@ -338,7 +316,6 @@ export default function AskScreen() {
|
|||||||
</View>
|
</View>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
</View >
|
</View >
|
||||||
</GestureDetector>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { checkNotificationPermission, getLocationPermission, getPermissions, req
|
|||||||
import { ThemedText } from '@/components/ThemedText';
|
import { ThemedText } from '@/components/ThemedText';
|
||||||
import { useAuth } from '@/contexts/auth-context';
|
import { useAuth } from '@/contexts/auth-context';
|
||||||
import { fetchApi } from '@/lib/server-api-util';
|
import { fetchApi } from '@/lib/server-api-util';
|
||||||
import { Address, User, UserInfoDetails } from '@/types/user';
|
import { Address } from '@/types/user';
|
||||||
import * as Location from 'expo-location';
|
import * as Location from 'expo-location';
|
||||||
import { useFocusEffect, useRouter } from 'expo-router';
|
import { useFocusEffect, useRouter } from 'expo-router';
|
||||||
import * as SecureStore from 'expo-secure-store';
|
import * as SecureStore from 'expo-secure-store';
|
||||||
@ -20,14 +20,8 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { Linking, Platform, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
import { Linking, Platform, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
|
||||||
const Setting = (props: { userInfo: UserInfoDetails }) => {
|
const Setting = (props: { userInfo: any }) => {
|
||||||
const [userInfo, setUserInfo] = useState<User | null>(null);
|
const { userInfo } = props;
|
||||||
|
|
||||||
const getUserInfo = async () => {
|
|
||||||
const res = await fetchApi<User>("/iam/user-info");
|
|
||||||
setUserInfo(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
// 判断当前语言环境
|
// 判断当前语言环境
|
||||||
@ -206,7 +200,6 @@ const Setting = (props: { userInfo: UserInfoDetails }) => {
|
|||||||
// 获取语言环境
|
// 获取语言环境
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getLanguage();
|
getLanguage();
|
||||||
getUserInfo()
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -227,7 +220,7 @@ const Setting = (props: { userInfo: UserInfoDetails }) => {
|
|||||||
<ScrollView style={styles.modalContent} showsVerticalScrollIndicator={false}>
|
<ScrollView style={styles.modalContent} showsVerticalScrollIndicator={false}>
|
||||||
{/* 用户信息 */}
|
{/* 用户信息 */}
|
||||||
<UserInfo
|
<UserInfo
|
||||||
userInfo={userInfo || {} as User}
|
userInfo={userInfo}
|
||||||
setCurrentLocation={setCurrentLocation}
|
setCurrentLocation={setCurrentLocation}
|
||||||
getCurrentLocation={getCurrentLocation}
|
getCurrentLocation={getCurrentLocation}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
|
|||||||
@ -20,7 +20,6 @@ export default function Look(props: Props) {
|
|||||||
const { fileData, setFileData, isLoading, handleUser, avatar } = props;
|
const { fileData, setFileData, isLoading, handleUser, avatar } = props;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className="flex-1 bg-textPrimary justify-between p-[2rem]">
|
<View className="flex-1 bg-textPrimary justify-between p-[2rem]">
|
||||||
<View className="flex-1 justify-center items-center">
|
<View className="flex-1 justify-center items-center">
|
||||||
@ -33,11 +32,11 @@ export default function Look(props: Props) {
|
|||||||
{t('auth.userMessage.avatorText2', { ns: 'login' })}
|
{t('auth.userMessage.avatorText2', { ns: 'login' })}
|
||||||
</ThemedText>
|
</ThemedText>
|
||||||
{
|
{
|
||||||
fileData[0]?.preview || fileData[0]?.previewUrl
|
fileData[0]?.previewUrl
|
||||||
?
|
?
|
||||||
<Image
|
<Image
|
||||||
className='rounded-full w-[10rem] h-[10rem]'
|
className='rounded-full w-[10rem] h-[10rem]'
|
||||||
source={{ uri: fileData[0].preview || fileData[0].previewUrl }}
|
source={{ uri: fileData[0].previewUrl }}
|
||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
avatar
|
avatar
|
||||||
|
|||||||
@ -99,7 +99,6 @@ export interface FileUploadItem {
|
|||||||
status: 'pending' | 'uploading' | 'success' | 'error'; // 统一状态
|
status: 'pending' | 'uploading' | 'success' | 'error'; // 统一状态
|
||||||
error?: string | null;
|
error?: string | null;
|
||||||
previewUrl: string; // 预览URL
|
previewUrl: string; // 预览URL
|
||||||
preview: string; // 预览URL
|
|
||||||
file?: File;
|
file?: File;
|
||||||
type: 'image' | 'video';
|
type: 'image' | 'video';
|
||||||
thumbnail?: string; // 缩略图URL
|
thumbnail?: string; // 缩略图URL
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user