首页、学情、任务绑定接口
This commit is contained in:
@@ -8,14 +8,23 @@
|
||||
<script setup lang="ts">
|
||||
import UniIcons from '../../uni_modules/uni-icons-x/components/uni-icons/uni-icons.uvue'
|
||||
import { apiGetStudentHomeProfile, apiGetStudentVocabulary, type StudentVocabulary, type VocabularyBook } from '../../api/student'
|
||||
import { homeStudentProfile, setHomeStudentProfile } from '../../store/home'
|
||||
import { homeStudentProfile, selectedStudentChangeVersion, setHomeStudentProfile } from '../../store/home'
|
||||
|
||||
const vocabulary = ref<StudentVocabulary>({ studentId: '', studentName: '', studentGrade: '', studentClass: '', bookCount: 0, books: [] })
|
||||
const isLoading = ref(true)
|
||||
const observedStudentVersion = ref(selectedStudentChangeVersion.value)
|
||||
|
||||
onLoad(() => { loadVocabulary() })
|
||||
|
||||
onShow(() => {
|
||||
if (observedStudentVersion.value !== selectedStudentChangeVersion.value) {
|
||||
observedStudentVersion.value = selectedStudentChangeVersion.value
|
||||
loadVocabulary()
|
||||
}
|
||||
})
|
||||
|
||||
async function loadVocabulary() {
|
||||
isLoading.value = true
|
||||
let studentId = homeStudentProfile.value?.id ?? ''
|
||||
if (!studentId) {
|
||||
const profileRes = await apiGetStudentHomeProfile(undefined, false)
|
||||
|
||||
Reference in New Issue
Block a user