|
|
@@ -65,7 +65,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, watch } from 'vue'
|
|
|
+import { ref, computed, watch } from 'vue'
|
|
|
import { lang } from '@/main'
|
|
|
import type { PageMode, ExerciseType } from '@/types/englishSpeaking'
|
|
|
import { useSpeakingStore } from '@/store/speaking'
|
|
|
@@ -76,10 +76,16 @@ import TopicDiscussionConfig from './configs/TopicDiscussionConfig.vue'
|
|
|
/** 当前页面层级:layer1(首页) → layer2(口语列表) → config(配置页) */
|
|
|
const pageMode = ref<PageMode>('layer1')
|
|
|
|
|
|
+const speakingStore = useSpeakingStore()
|
|
|
+
|
|
|
// 课本筛选条件的默认值(上海英语·五年级上·Unit2),供开发/演示用
|
|
|
const selectedTextbook = ref('shep')
|
|
|
-const selectedGrade = ref('grade5-1')
|
|
|
const selectedUnit = ref('SHEP-5-上-Unit2')
|
|
|
+// selectedGrade 持久化到 store(用于发送到后端 createSession 渲染 system_prompt)
|
|
|
+const selectedGrade = computed({
|
|
|
+ get: () => speakingStore.config.grade,
|
|
|
+ set: (val: string) => speakingStore.updateGrade(val),
|
|
|
+})
|
|
|
|
|
|
/** Layer1 选择练习类型后的回调,目前仅 speaking 类型会触发页面跳转 */
|
|
|
const handleSelectExerciseType = (type: ExerciseType) => {
|
|
|
@@ -103,7 +109,6 @@ const goLayer2 = () => {
|
|
|
}
|
|
|
|
|
|
// 点击画布上的 77 型 frame 会递增 openConfigSignal → 强制切到配置页
|
|
|
-const speakingStore = useSpeakingStore()
|
|
|
watch(() => speakingStore.openConfigSignal, (val, old) => {
|
|
|
if (val !== old) pageMode.value = 'config'
|
|
|
})
|