feat: 优化进入小班的加载速度

- 在多个班级信息页面中,将学员列表的获取逻辑替换为调用新的 API 接口 `getClassUserCourseFlag`,以获取带买课标识的学员信息。
- 为学员列表区域增加加载状态提示(`studentsLoading`),提升用户体验。
- 在考试周和结班状态下,调用 `userScoreList` 接口获取学员成绩信息,并为其设置超时时间为 60 秒。
- 更新应用版本号至 2.0.37,并将网络请求超时配置调整为 0。
This commit is contained in:
2026-02-05 17:40:38 +08:00
parent 0a37b21824
commit bb640778c0
5 changed files with 168 additions and 19 deletions

View File

@@ -3,7 +3,7 @@
"appid" : "__UNI__C7475A8",
"description" : "吴门医述",
"networkTimeout" : {
"request" : 15000
"request" : 0
},
"transformPx" : false,
"icons" : [
@@ -12,8 +12,8 @@
"src" : "图片路径"
}
],
"versionName" : "2.0.36",
"versionCode" : 2036,
"versionName" : "2.0.37",
"versionCode" : 2037,
"sassImplementationName" : "node-sass",
"app-plus" : {
"nvueCompiler" : "uni-app",

View File

@@ -220,7 +220,10 @@
<!-- 班内同学 -->
<template v-if="tabId == '2'">
<template v-if="students.length> 0">
<view v-if="studentsLoading" style="text-align: center;">
数据加载中
</view>
<template v-else-if="students.length> 0">
<view class="" style=" overflow: hidden; margin:20rpx 0">
<text style="font-size: 26rpx; color: #666;"> {{students.length}} 名学员</text>
</view>
@@ -570,6 +573,7 @@
showSubmitInfoBlank: false,
thisClass: {},
students: [],
studentsLoading: true,
tabId: undefined,
curTagIndex: 0,
scrollable: false,
@@ -776,6 +780,14 @@
this.submitInfo.photo = userObj.photo
}
}
if (this.thisClass.state == '3' || this.thisClass.state == '2') {
// 考试周 结班状态下的
this.students = await this.getStudentScoreList()
console.log('students考试周 结班状态下的', this.students);
} else {
this.students = await this.getStudentsList()
}
this.studentsLoading = false
},
components: {
sutdentScoreList,
@@ -1088,9 +1100,41 @@
})
});
},
// 未开班和进行中状态下,学员的信息,带买课标识
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
},
// 考试周和结班状态下,学员的信息
async getStudentScoreList() {
console.log('进来了码?');
var list = undefined
await $http.request({
url: "common/class/userScoreList",
@@ -1101,6 +1145,7 @@
header: {
'Content-Type': 'application/json'
},
timeout: '60000'
})
.then(res => {
if (res.code == 0) {
@@ -1916,13 +1961,6 @@ uni.navigateTo({
this.classModel = res.result.classModel
this.courses = res.result.courses
if (this.thisClass.state == '3' || this.thisClass.state == '2') {
// 考试周 结班状态下的
this.students = await this.getStudentScoreList()
console.log('students考试周 结班状态下的', this.students);
} else {
this.students = res.result.students
}
this.refresh = true
var ss = this.getTijiaoTitleList
if (this.thisClass.state != 0 && this.tabId != '3') {

View File

@@ -228,7 +228,10 @@
</view>
<!-- 学员列表 -->
<view class="" v-if="tabId == '2'">
<template v-if="students.length > 0">
<view v-if="studentsLoading" style="text-align: center;">
数据加载中
</view>
<template v-else-if="students.length > 0">
<view class="" style="overflow: hidden; margin: 20rpx 0">
<text style="font-size: 26rpx; color: #666"
>共 {{ students.length }} 名学员</text
@@ -639,6 +642,7 @@ export default {
showOverBtn: false,
},
students: [],
studentsLoading: true,
tabId: "2",
curTagIndex: 0,
scrollable: false,
@@ -1121,6 +1125,39 @@ export default {
that.opClass(statusCode);
}, 300);
},
// 未开班和进行中状态下,学员的信息,带买课标识
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
},
// 考试周和结班状态下,学员的信息
async getStudentScoreList() {
var list = undefined;
@@ -1135,6 +1172,7 @@ export default {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
timeout: '60000'
})
.then((res) => {
console.log("班状态下,学员的信息", this.classId, res);
@@ -1431,8 +1469,9 @@ export default {
this.students = await this.getStudentScoreList();
// console.log('students', this.students);
} else {
this.students = res.result.students;
this.students = await this.getStudentsList();
}
this.studentsLoading = false;
this.refresh = true;
if (this.thisClass.state == 0) {

View File

@@ -32,8 +32,11 @@
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"></u-tabs>
</view>
<!-- 学员列表 -->
<view class="" v-if="tabId == '2'">
<template v-if="students.length> 0 ">
<view class="" v-if="tabId == '2'">
<view v-if="studentsLoading" style="text-align: center;">
数据加载中
</view>
<template v-else-if="students.length> 0 ">
<view class="" style=" overflow: hidden; margin: 20rpx 0;">
<text style="font-size: 26rpx; color: #666;"> {{students.length}} 名学员</text>
<!-- <uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">
@@ -352,6 +355,7 @@
thisClass: {},
students: [],
studentsLoading: true,
tabId: '2',
curTagIndex: 0,
scrollable: false,
@@ -754,6 +758,39 @@
url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
})
},
// 未开班和进行中状态下,学员的信息,带买课标识
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
},
// 考试周和结班状态下,学员的信息
async getStudentScoreList() {
var list = undefined
@@ -766,6 +803,7 @@
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
timeout: '60000'
})
.then(res => {
console.log('考试周状态下,学员的信息',this.classId, res);
@@ -863,8 +901,9 @@
this.students = await this.getStudentScoreList()
// console.log('students', this.students);
} else {
this.students = res.result.students
this.students = await this.getStudentsList()
}
this.studentsLoading = false
this.refresh = true
}

View File

@@ -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
}
}
}