feat: ask hello页面
This commit is contained in:
parent
7c4d1529d4
commit
142c8e44b6
@ -255,7 +255,7 @@ export default function AskScreen() {
|
|||||||
<GestureDetector gesture={gesture}>
|
<GestureDetector gesture={gesture}>
|
||||||
<View style={[styles.container, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
|
<View style={[styles.container, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
|
||||||
{/* 导航栏 */}
|
{/* 导航栏 */}
|
||||||
<View style={[styles.navbar, isHello && styles.hiddenNavbar]}>
|
<View style={[styles.navbar, { borderBottomWidth: isHello ? 0 : 1 }]}>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.backButton}
|
style={styles.backButton}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
@ -273,11 +273,11 @@ export default function AskScreen() {
|
|||||||
>
|
>
|
||||||
<ReturnArrow />
|
<ReturnArrow />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<ThemedText style={styles.title} onPress={() => { router.push('/owner') }}>MemoWake</ThemedText>
|
<ThemedText style={[styles.title, { opacity: isHello ? 0 : 1 }]} onPress={() => { router.push('/owner') }}>MemoWake</ThemedText>
|
||||||
<View style={styles.placeholder} />
|
<View style={styles.placeholder} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.contentContainer}>
|
<View style={[styles.contentContainer, { marginTop: isHello ? -24 : 0 }]}>
|
||||||
{/* 欢迎页面 */}
|
{/* 欢迎页面 */}
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[
|
style={[
|
||||||
@ -346,7 +346,7 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
paddingVertical: 16,
|
paddingVertical: 8,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: 'rgba(0,0,0,0.1)',
|
borderBottomColor: 'rgba(0,0,0,0.1)',
|
||||||
@ -355,11 +355,7 @@ const styles = StyleSheet.create({
|
|||||||
shadowOffset: { width: 0, height: 1 },
|
shadowOffset: { width: 0, height: 1 },
|
||||||
shadowOpacity: 0.1,
|
shadowOpacity: 0.1,
|
||||||
shadowRadius: 1,
|
shadowRadius: 1,
|
||||||
},
|
zIndex: 10
|
||||||
hiddenNavbar: {
|
|
||||||
shadowOpacity: 0,
|
|
||||||
elevation: 0,
|
|
||||||
opacity: 0
|
|
||||||
},
|
},
|
||||||
backButton: {
|
backButton: {
|
||||||
padding: 8,
|
padding: 8,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5" />
|
<circle cx="18" cy="18" r="18" fill="#FFB645"/>
|
||||||
|
<path d="M15.6281 20.1601L20.4742 15.314M25.4316 12.3564L21.341 25.651C20.9744 26.8425 20.7909 27.4385 20.4748 27.636C20.2005 27.8074 19.8609 27.836 19.5623 27.7121C19.2178 27.5692 18.9383 27.0111 18.3807 25.8958L15.7897 20.7139C15.7012 20.5369 15.6569 20.4488 15.5978 20.3721C15.5453 20.304 15.4848 20.2427 15.4168 20.1903C15.3418 20.1325 15.2552 20.0892 15.0861 20.0046L9.89224 17.4077C8.77693 16.8501 8.21923 16.571 8.07632 16.2266C7.95238 15.9279 7.98064 15.588 8.152 15.3137C8.34959 14.9975 8.94555 14.8138 10.1374 14.4471L23.4319 10.3564C24.3689 10.0682 24.8376 9.92412 25.154 10.0403C25.4297 10.1415 25.647 10.3586 25.7482 10.6343C25.8644 10.9506 25.7202 11.419 25.4322 12.3551L25.4316 12.3564Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 935 B |
@ -1,10 +1,9 @@
|
|||||||
import IP from "@/assets/icons/svg/ip.svg";
|
|
||||||
import { ThemedText } from "@/components/ThemedText";
|
import { ThemedText } from "@/components/ThemedText";
|
||||||
import { webSocketManager } from "@/lib/websocket-util";
|
import { webSocketManager } from "@/lib/websocket-util";
|
||||||
import { Message } from "@/types/ask";
|
import { Message } from "@/types/ask";
|
||||||
import { Dispatch, SetStateAction } from "react";
|
import { Dispatch, SetStateAction } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { ScrollView, StyleSheet, TouchableOpacity, View } from 'react-native';
|
import { Dimensions, Image, ScrollView, StyleSheet, TouchableOpacity, View } from 'react-native';
|
||||||
import { createNewConversation } from "./utils";
|
import { createNewConversation } from "./utils";
|
||||||
|
|
||||||
interface AskHelloProps {
|
interface AskHelloProps {
|
||||||
@ -14,6 +13,8 @@ interface AskHelloProps {
|
|||||||
}
|
}
|
||||||
export default function AskHello({ setUserMessages, setConversationId, setIsHello }: AskHelloProps) {
|
export default function AskHello({ setUserMessages, setConversationId, setIsHello }: AskHelloProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const width = Dimensions.get('window').width;
|
||||||
|
const height = Dimensions.get('window').height;
|
||||||
|
|
||||||
const handleCase = async (text: string) => {
|
const handleCase = async (text: string) => {
|
||||||
setIsHello(false);
|
setIsHello(false);
|
||||||
@ -50,7 +51,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
|
|||||||
<ScrollView
|
<ScrollView
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 8,
|
||||||
paddingBottom: 20
|
paddingBottom: 20
|
||||||
}}
|
}}
|
||||||
keyboardDismissMode="interactive"
|
keyboardDismissMode="interactive"
|
||||||
@ -62,10 +63,10 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
|
|||||||
{"\n"}
|
{"\n"}
|
||||||
{t('ask.iAmMemo', { ns: 'ask' })}
|
{t('ask.iAmMemo', { ns: 'ask' })}
|
||||||
</ThemedText>
|
</ThemedText>
|
||||||
<View className="-mt-10">
|
<View>
|
||||||
<IP />
|
<Image source={require('@/assets/images/png/icon/ip.png')} style={{ width: width * 0.5, height: height * 0.3 }} />
|
||||||
</View>
|
</View>
|
||||||
<ThemedText className="!text-textPrimary text-center -mt-20">
|
<ThemedText className="!text-textPrimary text-center -mt-10" style={{ fontSize: 16 }}>
|
||||||
{t('ask.ready', { ns: 'ask' })}
|
{t('ask.ready', { ns: 'ask' })}
|
||||||
{"\n"}
|
{"\n"}
|
||||||
{t('ask.justAsk', { ns: 'ask' })}
|
{t('ask.justAsk', { ns: 'ask' })}
|
||||||
@ -110,10 +111,12 @@ const styles = StyleSheet.create({
|
|||||||
marginTop: 16
|
marginTop: 16
|
||||||
},
|
},
|
||||||
case: {
|
case: {
|
||||||
borderWidth: 2,
|
borderWidth: 1,
|
||||||
borderColor: "#FFB645",
|
borderColor: "#AC7E35",
|
||||||
borderRadius: 24,
|
borderRadius: 10,
|
||||||
paddingHorizontal: 8,
|
paddingHorizontal: 8,
|
||||||
width: 'auto'
|
width: 'auto',
|
||||||
|
fontSize: 14,
|
||||||
|
color: "#4C320C"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -265,13 +265,14 @@ export default function SendMessage(props: Props) {
|
|||||||
returnKeyType="send"
|
returnKeyType="send"
|
||||||
/>
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[styles.voiceButton, { bottom: -10 }]}
|
|
||||||
onPress={handleSubmit}
|
onPress={handleSubmit}
|
||||||
className="absolute right-2"
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
right: 6,
|
||||||
|
bottom: 6
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<View>
|
<SendSvg />
|
||||||
<SendSvg color={'white'} width={24} height={24} />
|
|
||||||
</View>
|
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@ -288,15 +289,18 @@ const styles = StyleSheet.create({
|
|||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: 5
|
gap: 5,
|
||||||
|
// backgroundColor: '#F8F8F8'
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
backgroundColor: '#transparent',
|
backgroundColor: '#transparent',
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
borderColor: '#FF9500',
|
// borderColor: '#d9d9d9',
|
||||||
|
borderColor: '#AC7E35',
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
|
// borderRadius: 18,
|
||||||
borderRadius: 25,
|
borderRadius: 25,
|
||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingVertical: 13,
|
paddingVertical: 13,
|
||||||
|
|||||||
@ -14,9 +14,9 @@
|
|||||||
"refresh": "Refresh",
|
"refresh": "Refresh",
|
||||||
"error": "have some error",
|
"error": "have some error",
|
||||||
"issue": "have some issue",
|
"issue": "have some issue",
|
||||||
"case1": "Find last year's baby/pet material",
|
"case1": "Find last year’s baby moments",
|
||||||
"case2": "Find last year's food",
|
"case2": "Pet moments",
|
||||||
"case3": "Find recent travel material",
|
"case3": "Show me my food memories in France with family",
|
||||||
"mediaAuth": "need album permission",
|
"mediaAuth": "need album permission",
|
||||||
"mediaAuthDesc": "allow app to access album to save media files",
|
"mediaAuthDesc": "allow app to access album to save media files",
|
||||||
"saveSuccess": "save success",
|
"saveSuccess": "save success",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user