feat: 联调对话功能

This commit is contained in:
王天骄
2026-06-09 17:00:23 +08:00
parent 3414d0662c
commit 2192b855a1
77 changed files with 1082 additions and 487 deletions
+21 -12
View File
@@ -2,10 +2,10 @@
<view class="teaching-page">
<view class="teaching-shell">
<view class="top-nav">
<button class="icon-button" aria-label="设置" @click="emit('open-settings')">
<button class="icon-button" aria-label="设置" @click="openSettings">
<view class="settings-icon"></view>
</button>
<button class="icon-button home-button" aria-label="首页" @click="emit('go-home')">
<button class="icon-button home-button" aria-label="首页" @click="goHome">
<view class="home-icon"></view>
</button>
<view class="nav-spacer"></view>
@@ -105,12 +105,12 @@
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
import type { ClinicalCase } from '../../api/cases'
import { createProfileOpener } from '../../api/navigation'
import { computed, onMounted, ref } from 'vue'
import { readStoredClinicalCase, type ClinicalCase } from '../../api/cases'
import { createHomeNavigator, createProfileOpener, createSettingsOpener } from '../../api/navigation'
const props = defineProps<{
caseItem: ClinicalCase | null
caseItem?: ClinicalCase | null
}>()
const emit = defineEmits<{
@@ -120,6 +120,8 @@ const emit = defineEmits<{
}>()
const openProfile = createProfileOpener(emit)
const openSettings = createSettingsOpener(emit)
const goHome = createHomeNavigator(emit)
type OptionKey = 'A' | 'B' | 'C' | 'D'
@@ -188,13 +190,16 @@ const questionIndex = ref(0)
const selectedOption = ref<OptionKey | ''>(questions[0].defaultSelected || '')
const showVideoView = ref(false)
const videoPlaying = ref(false)
const storedCase = ref<ClinicalCase | null>(null)
const activeCase = computed(() => props.caseItem || storedCase.value)
const patient = computed(() => ({
name: props.caseItem?.patientName || '陈先生',
gender: props.caseItem?.gender || '男',
age: props.caseItem?.age || 60,
department: props.caseItem?.department || '心血管内科',
chiefComplaint: props.caseItem?.title || '持续胸痛3小时'
name: activeCase.value?.patientName || '陈先生',
gender: activeCase.value?.gender || '男',
age: activeCase.value?.age || 60,
department: activeCase.value?.department || '心血管内科',
chiefComplaint: activeCase.value?.title || '持续胸痛3小时'
}))
const complaintShort = computed(() => {
@@ -225,7 +230,7 @@ function handleNextQuestion() {
showVideoView.value = false
videoPlaying.value = false
uni.setStorageSync('clinical-thinking-teaching-question', {
caseId: props.caseItem?.id || '',
caseId: activeCase.value?.id || '',
questionId: questions[nextIndex].id,
index: nextIndex
})
@@ -234,6 +239,10 @@ function handleNextQuestion() {
function toggleVideoPlay() {
videoPlaying.value = !videoPlaying.value
}
onMounted(() => {
storedCase.value = readStoredClinicalCase()
})
</script>
<style>