feat: ask

This commit is contained in:
jinyaqiu 2025-08-05 15:53:32 +08:00
parent 81be115dad
commit 5fa25e225f
3 changed files with 13 additions and 5 deletions

View File

@ -253,7 +253,7 @@ export default function AskScreen() {
return (
<GestureDetector gesture={gesture}>
<View style={[styles.container, { paddingTop: insets.top }]}>
<View style={[styles.container, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
{/* 导航栏 */}
<View style={[styles.navbar, isHello && styles.hiddenNavbar]}>
<TouchableOpacity
@ -340,7 +340,7 @@ export default function AskScreen() {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f8f8f8',
backgroundColor: '#fff',
},
navbar: {
flexDirection: 'row',
@ -359,6 +359,7 @@ const styles = StyleSheet.create({
hiddenNavbar: {
shadowOpacity: 0,
elevation: 0,
opacity: 0
},
backButton: {
padding: 8,

View File

@ -1,5 +1,5 @@
import { Asset } from 'expo-asset';
import { useRouter } from 'expo-router';
import { useFocusEffect, useRouter } from 'expo-router';
import * as SplashScreen from 'expo-splash-screen';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { FlatList, InteractionManager, PixelRatio, Platform, RefreshControl, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
@ -135,6 +135,13 @@ const MemoList = () => {
};
}, [fetchHistoryList]);
// 每次进入页面就刷新
useFocusEffect(
useCallback(() => {
handleRefresh();
}, [])
);
// 渲染列表项
const renderItem = useCallback(({ item }: { item: Chat }) => (
<TouchableOpacity

View File

@ -1,10 +1,10 @@
import IP from "@/assets/icons/svg/ip.svg";
import { ThemedText } from "@/components/ThemedText";
import { webSocketManager } from "@/lib/websocket-util";
import { Message } from "@/types/ask";
import { Dispatch, SetStateAction } from "react";
import { useTranslation } from "react-i18next";
import { ScrollView, StyleSheet, TouchableOpacity, View } from 'react-native';
import { webSocketManager } from "@/lib/websocket-util";
import { createNewConversation } from "./utils";
interface AskHelloProps {
@ -57,7 +57,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
keyboardShouldPersistTaps="handled"
>
<View className="items-center">
<ThemedText className="text-3xl font-bold text-center">
<ThemedText style={{ fontSize: 32, fontWeight: 'bold', textAlign: 'center', lineHeight: 40, }}>
{t('ask.hi', { ns: 'ask' })}
{"\n"}
{t('ask.iAmMemo', { ns: 'ask' })}