修复安卓显示和成长积分接口
This commit is contained in:
+14
-6
@@ -7,8 +7,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import UniIcons from '../../uni_modules/uni-icons-x/components/uni-icons/uni-icons.uvue'
|
||||
import { apiGetStudentGrowth, apiGetStudentHomeProfile, apiGetStudentPointRecords, type StudentGrowth } from '../../api/student'
|
||||
import { homeStudentProfile, selectedStudentChangeVersion, setHomeStudentProfile } from '../../store/home'
|
||||
import { apiGetBoundStudents, apiGetStudentGrowth, apiGetStudentPointRecords, type StudentGrowth } from '../../api/student'
|
||||
import { applyBoundStudent, getSavedSelectedStudent, homeStudentProfile, saveSelectedStudent, selectedStudentChangeVersion } from '../../store/home'
|
||||
|
||||
const growth = ref<StudentGrowth>({ studentId: '', studentName: '', studentGrade: '', studentClass: '', pointsBalance: 0, level: 0, rank: 0, streakDays: 0, totalPoints: 0, records: [] })
|
||||
const isLoading = ref(true)
|
||||
@@ -33,10 +33,18 @@
|
||||
isLoading.value = true
|
||||
let studentId = homeStudentProfile.value?.id ?? ''
|
||||
if (!studentId) {
|
||||
const profileRes = await apiGetStudentHomeProfile(undefined, false)
|
||||
if (profileRes && profileRes.data) {
|
||||
setHomeStudentProfile(profileRes.data)
|
||||
studentId = profileRes.data.id
|
||||
const savedStudent = getSavedSelectedStudent()
|
||||
if (savedStudent) {
|
||||
applyBoundStudent(savedStudent)
|
||||
studentId = savedStudent.id
|
||||
} else {
|
||||
const res = await apiGetBoundStudents()
|
||||
const firstStudent = res?.data?.students[0]
|
||||
if (firstStudent) {
|
||||
saveSelectedStudent(firstStudent)
|
||||
applyBoundStudent(firstStudent)
|
||||
studentId = firstStudent.id
|
||||
}
|
||||
}
|
||||
}
|
||||
if (studentId) {
|
||||
|
||||
@@ -338,7 +338,8 @@
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding: 15px 20px 17px;
|
||||
background: linear-gradient(135deg, #5d3de8 0%, #8236e9 100%);
|
||||
background-color: #5d3de8;
|
||||
background-image: linear-gradient(to bottom right, #5d3de8, #8236e9);
|
||||
border-radius: 0 0 0 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user