Skip to content

Commit 1a7c855

Browse files
committed
新增移动端 VRM PoC 并修复类型检查基线
1 parent 7a4b4ee commit 1a7c855

19 files changed

Lines changed: 1423 additions & 41 deletions

File tree

app/(tabs)/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ const MainUIScreen: React.FC<MainUIScreenProps> = () => {
435435

436436
// 根据消息类型,通过 MainManager 触发相应的行为
437437
if (result?.type === 'gemini_response') {
438-
mainManager.onGeminiResponse(result.isNewMessage);
438+
mainManager.onGeminiResponse(!!result.isNewMessage);
439439
} else if (result?.type === 'user_activity') {
440440
mainManager.onUserSpeechDetected();
441441
} else if (result?.type === 'turn_end') {

app/_layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default function RootLayout() {
4949
<Stack.Screen name="audio-debug" options={{ title: '🎤 音频诊断' }} />
5050
<Stack.Screen name="qr-scanner" options={{ title: '扫码(Dev)' }} />
5151
<Stack.Screen name="request-lab" options={{ title: 'Request/组件实验室' }} />
52+
<Stack.Screen name="vrm-poc" options={{ title: 'VRM R3F PoC' }} />
5253
<Stack.Screen name="webapp" options={{ title: 'WebApp(对齐 frontend/src/web/App.tsx)' }} />
5354
</Stack>
5455
<StatusBar style="auto" />

app/explore.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ export default function ExploreScreen() {
2323
const [isPlaying, setIsPlaying] = useState<boolean>(false);
2424
const [focusModeState, setFocusModeState] = useState<boolean>(false);
2525

26+
const getErrorMessage = (error: unknown): string => {
27+
if (error instanceof Error && error.message) {
28+
return error.message;
29+
}
30+
return String(error);
31+
};
32+
2633
// 扫码回填(只在参数变化时处理一次,避免重复应用)
2734
useEffect(() => {
2835
const qrParam = typeof params.qr === 'string' ? params.qr : undefined;
@@ -59,7 +66,7 @@ export default function ExploreScreen() {
5966
characterName: connectionConfig.characterName,
6067
onError: (error) => {
6168
console.error('AudioService错误:', error);
62-
Alert.alert('音频服务错误', error.message || '未知错误');
69+
Alert.alert('音频服务错误', getErrorMessage(error));
6370
},
6471
onConnectionChange: (connected) => {
6572
setIsConnected(connected);
@@ -78,7 +85,7 @@ export default function ExploreScreen() {
7885
// 初始化 AudioService
7986
audioServiceRef.current.init().catch((error) => {
8087
console.error('AudioService 初始化失败:', error);
81-
Alert.alert('初始化失败', error.message || '未知错误');
88+
Alert.alert('初始化失败', getErrorMessage(error));
8289
});
8390

8491
return () => {
@@ -370,4 +377,4 @@ const styles = StyleSheet.create({
370377
color: '#444',
371378
lineHeight: 18,
372379
},
373-
});
380+
});

app/settings.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,63 @@ const styles = StyleSheet.create({
611611
backgroundColor: '#fff',
612612
marginBottom: 12,
613613
},
614+
qrDesc: {
615+
fontSize: 14,
616+
lineHeight: 22,
617+
marginBottom: 12,
618+
},
619+
qrSteps: {
620+
borderWidth: 1,
621+
borderRadius: 12,
622+
padding: 12,
623+
marginBottom: 16,
624+
gap: 10,
625+
},
626+
qrStepRow: {
627+
flexDirection: 'row',
628+
alignItems: 'flex-start',
629+
},
630+
qrStepNum: {
631+
width: 22,
632+
height: 22,
633+
borderRadius: 11,
634+
alignItems: 'center',
635+
justifyContent: 'center',
636+
marginRight: 10,
637+
marginTop: 1,
638+
},
639+
qrStepNumText: {
640+
fontSize: 12,
641+
fontWeight: '700',
642+
color: '#fff',
643+
},
644+
qrStepText: {
645+
flex: 1,
646+
fontSize: 14,
647+
lineHeight: 20,
648+
},
649+
qrInfoBlock: {
650+
borderWidth: 1,
651+
borderRadius: 12,
652+
overflow: 'hidden',
653+
},
654+
qrInfoRow: {
655+
flexDirection: 'row',
656+
justifyContent: 'space-between',
657+
alignItems: 'center',
658+
paddingHorizontal: 12,
659+
paddingVertical: 10,
660+
borderBottomWidth: 1,
661+
},
662+
qrInfoLabel: {
663+
fontSize: 13,
664+
},
665+
qrInfoValue: {
666+
flex: 1,
667+
fontSize: 13,
668+
textAlign: 'right',
669+
marginLeft: 12,
670+
},
614671
qrHint: {
615672
fontSize: 14,
616673
textAlign: 'center',

0 commit comments

Comments
 (0)