feat: 联调登录+对话
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
v-if="showChatPage"
|
||||
:case-item="caseItem"
|
||||
@open-settings="emit('open-settings')"
|
||||
@open-profile="emit('open-profile')"
|
||||
@open-profile="openProfile"
|
||||
@go-home="emit('go-home')"
|
||||
/>
|
||||
<view v-else class="scenario-page">
|
||||
@@ -162,6 +162,7 @@ import {
|
||||
type ScenarioOptions,
|
||||
type ScenarioRecommendation
|
||||
} from '../../api/scenario'
|
||||
import { createProfileOpener } from '../../api/navigation'
|
||||
import ChatPage from '../chat/chat.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -174,6 +175,8 @@ const emit = defineEmits<{
|
||||
(event: 'go-home'): void
|
||||
}>()
|
||||
|
||||
const openProfile = createProfileOpener(emit)
|
||||
|
||||
type ScenarioFormKey = keyof ScenarioForm
|
||||
|
||||
const fallbackOptions: ScenarioOptions = {
|
||||
@@ -185,7 +188,7 @@ const fallbackOptions: ScenarioOptions = {
|
||||
|
||||
const form = reactive<ScenarioForm>({
|
||||
environment: 'outpatient',
|
||||
ageGroup: 'young',
|
||||
ageGroup: 'youth',
|
||||
education: 'higher',
|
||||
personality: 'calm'
|
||||
})
|
||||
@@ -233,6 +236,7 @@ function handleGenerate() {
|
||||
...form,
|
||||
caseId: props.caseItem.id,
|
||||
caseNo: props.caseItem.caseNo,
|
||||
mode: props.caseItem.mode === 'teaching' ? 'teaching' : 'practice',
|
||||
recommendationId: selectedRecommendationId.value || undefined
|
||||
}).then(result => {
|
||||
uni.setStorageSync('clinical-thinking-scenario', result)
|
||||
@@ -240,6 +244,8 @@ function handleGenerate() {
|
||||
setTimeout(() => {
|
||||
showChatPage.value = true
|
||||
}, 450)
|
||||
}).catch(error => {
|
||||
showToast(error instanceof Error ? error.message : '模拟场景生成失败')
|
||||
}).finally(() => {
|
||||
setTimeout(() => {
|
||||
generating.value = false
|
||||
|
||||
Reference in New Issue
Block a user