feat: 优化进入小班的加载速度
- 在多个班级信息页面中,将学员列表的获取逻辑替换为调用新的 API 接口 `getClassUserCourseFlag`,以获取带买课标识的学员信息。 - 为学员列表区域增加加载状态提示(`studentsLoading`),提升用户体验。 - 在考试周和结班状态下,调用 `userScoreList` 接口获取学员成绩信息,并为其设置超时时间为 60 秒。 - 更新应用版本号至 2.0.37,并将网络请求超时配置调整为 0。
This commit is contained in:
@@ -279,12 +279,12 @@
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
.then(async res => {
|
||||
this.refresh = false
|
||||
if (res.code == 0) {
|
||||
|
||||
this.thisClass = res.result.class
|
||||
this.students = res.result.students
|
||||
this.students = await this.getStudentsList()
|
||||
|
||||
|
||||
}
|
||||
@@ -298,6 +298,39 @@
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
},
|
||||
// 未开班和进行中状态下,学员的信息,带买课标识
|
||||
async getStudentsList() {
|
||||
var list = undefined
|
||||
await $http.request({
|
||||
url: "common/class/getClassUserCourseFlag",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": parseInt(this.classId)
|
||||
},
|
||||
header: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
list = res.result.students
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '获取学员信息失败',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
}).catch(e => {
|
||||
list = []
|
||||
uni.showToast({
|
||||
title: e.errMsg,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
})
|
||||
});
|
||||
return list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user