feat: 优化进入小班的加载速度
- 在多个班级信息页面中,将学员列表的获取逻辑替换为调用新的 API 接口 `getClassUserCourseFlag`,以获取带买课标识的学员信息。 - 为学员列表区域增加加载状态提示(`studentsLoading`),提升用户体验。 - 在考试周和结班状态下,调用 `userScoreList` 接口获取学员成绩信息,并为其设置超时时间为 60 秒。 - 更新应用版本号至 2.0.37,并将网络请求超时配置调整为 0。
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"appid" : "__UNI__C7475A8",
|
"appid" : "__UNI__C7475A8",
|
||||||
"description" : "吴门医述",
|
"description" : "吴门医述",
|
||||||
"networkTimeout" : {
|
"networkTimeout" : {
|
||||||
"request" : 15000
|
"request" : 0
|
||||||
},
|
},
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"icons" : [
|
"icons" : [
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
"src" : "图片路径"
|
"src" : "图片路径"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"versionName" : "2.0.36",
|
"versionName" : "2.0.37",
|
||||||
"versionCode" : 2036,
|
"versionCode" : 2037,
|
||||||
"sassImplementationName" : "node-sass",
|
"sassImplementationName" : "node-sass",
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"nvueCompiler" : "uni-app",
|
"nvueCompiler" : "uni-app",
|
||||||
|
|||||||
@@ -220,7 +220,10 @@
|
|||||||
|
|
||||||
<!-- 班内同学 -->
|
<!-- 班内同学 -->
|
||||||
<template v-if="tabId == '2'">
|
<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">
|
<view class="" style=" overflow: hidden; margin:20rpx 0">
|
||||||
<text style="font-size: 26rpx; color: #666;">共 {{students.length}} 名学员</text>
|
<text style="font-size: 26rpx; color: #666;">共 {{students.length}} 名学员</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -570,6 +573,7 @@
|
|||||||
showSubmitInfoBlank: false,
|
showSubmitInfoBlank: false,
|
||||||
thisClass: {},
|
thisClass: {},
|
||||||
students: [],
|
students: [],
|
||||||
|
studentsLoading: true,
|
||||||
tabId: undefined,
|
tabId: undefined,
|
||||||
curTagIndex: 0,
|
curTagIndex: 0,
|
||||||
scrollable: false,
|
scrollable: false,
|
||||||
@@ -776,6 +780,14 @@
|
|||||||
this.submitInfo.photo = userObj.photo
|
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: {
|
components: {
|
||||||
sutdentScoreList,
|
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() {
|
async getStudentScoreList() {
|
||||||
console.log('进来了码?');
|
|
||||||
var list = undefined
|
var list = undefined
|
||||||
await $http.request({
|
await $http.request({
|
||||||
url: "common/class/userScoreList",
|
url: "common/class/userScoreList",
|
||||||
@@ -1101,6 +1145,7 @@
|
|||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
|
timeout: '60000'
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -1916,13 +1961,6 @@ uni.navigateTo({
|
|||||||
this.classModel = res.result.classModel
|
this.classModel = res.result.classModel
|
||||||
this.courses = res.result.courses
|
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
|
this.refresh = true
|
||||||
var ss = this.getTijiaoTitleList
|
var ss = this.getTijiaoTitleList
|
||||||
if (this.thisClass.state != 0 && this.tabId != '3') {
|
if (this.thisClass.state != 0 && this.tabId != '3') {
|
||||||
|
|||||||
@@ -228,7 +228,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 学员列表 -->
|
<!-- 学员列表 -->
|
||||||
<view class="" v-if="tabId == '2'">
|
<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">
|
<view class="" style="overflow: hidden; margin: 20rpx 0">
|
||||||
<text style="font-size: 26rpx; color: #666"
|
<text style="font-size: 26rpx; color: #666"
|
||||||
>共 {{ students.length }} 名学员</text
|
>共 {{ students.length }} 名学员</text
|
||||||
@@ -639,6 +642,7 @@ export default {
|
|||||||
showOverBtn: false,
|
showOverBtn: false,
|
||||||
},
|
},
|
||||||
students: [],
|
students: [],
|
||||||
|
studentsLoading: true,
|
||||||
tabId: "2",
|
tabId: "2",
|
||||||
curTagIndex: 0,
|
curTagIndex: 0,
|
||||||
scrollable: false,
|
scrollable: false,
|
||||||
@@ -1121,6 +1125,39 @@ export default {
|
|||||||
that.opClass(statusCode);
|
that.opClass(statusCode);
|
||||||
}, 300);
|
}, 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() {
|
async getStudentScoreList() {
|
||||||
var list = undefined;
|
var list = undefined;
|
||||||
@@ -1135,6 +1172,7 @@ export default {
|
|||||||
//默认 无 说明:请求头
|
//默认 无 说明:请求头
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
|
timeout: '60000'
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("班状态下,学员的信息", this.classId, res);
|
console.log("班状态下,学员的信息", this.classId, res);
|
||||||
@@ -1431,8 +1469,9 @@ export default {
|
|||||||
this.students = await this.getStudentScoreList();
|
this.students = await this.getStudentScoreList();
|
||||||
// console.log('students', this.students);
|
// console.log('students', this.students);
|
||||||
} else {
|
} else {
|
||||||
this.students = res.result.students;
|
this.students = await this.getStudentsList();
|
||||||
}
|
}
|
||||||
|
this.studentsLoading = false;
|
||||||
|
|
||||||
this.refresh = true;
|
this.refresh = true;
|
||||||
if (this.thisClass.state == 0) {
|
if (this.thisClass.state == 0) {
|
||||||
|
|||||||
@@ -32,8 +32,11 @@
|
|||||||
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"></u-tabs>
|
itemStyle="padding-left:10rpx; background-color:#fff; padding-right: 10rpx; height: 50px; font-size:26rpx"></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<!-- 学员列表 -->
|
<!-- 学员列表 -->
|
||||||
<view class="" v-if="tabId == '2'">
|
<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;">
|
<view class="" style=" overflow: hidden; margin: 20rpx 0;">
|
||||||
<text style="font-size: 26rpx; color: #666;">共 {{students.length}} 名学员</text>
|
<text style="font-size: 26rpx; color: #666;">共 {{students.length}} 名学员</text>
|
||||||
<!-- <uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">共
|
<!-- <uni-section class="mb-10 nobg xueyuanTitle" title="班内学员" type="line" sub-title="">共
|
||||||
@@ -352,6 +355,7 @@
|
|||||||
|
|
||||||
thisClass: {},
|
thisClass: {},
|
||||||
students: [],
|
students: [],
|
||||||
|
studentsLoading: true,
|
||||||
tabId: '2',
|
tabId: '2',
|
||||||
curTagIndex: 0,
|
curTagIndex: 0,
|
||||||
scrollable: false,
|
scrollable: false,
|
||||||
@@ -754,6 +758,39 @@
|
|||||||
url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
|
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() {
|
async getStudentScoreList() {
|
||||||
var list = undefined
|
var list = undefined
|
||||||
@@ -766,6 +803,7 @@
|
|||||||
header: { //默认 无 说明:请求头
|
header: { //默认 无 说明:请求头
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
|
timeout: '60000'
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('考试周状态下,学员的信息',this.classId, res);
|
console.log('考试周状态下,学员的信息',this.classId, res);
|
||||||
@@ -863,8 +901,9 @@
|
|||||||
this.students = await this.getStudentScoreList()
|
this.students = await this.getStudentScoreList()
|
||||||
// console.log('students', this.students);
|
// console.log('students', this.students);
|
||||||
} else {
|
} else {
|
||||||
this.students = res.result.students
|
this.students = await this.getStudentsList()
|
||||||
}
|
}
|
||||||
|
this.studentsLoading = false
|
||||||
this.refresh = true
|
this.refresh = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,12 +279,12 @@
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(async res => {
|
||||||
this.refresh = false
|
this.refresh = false
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
|
||||||
this.thisClass = res.result.class
|
this.thisClass = res.result.class
|
||||||
this.students = res.result.students
|
this.students = await this.getStudentsList()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -298,6 +298,39 @@
|
|||||||
icon: 'none'
|
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