暂存
This commit is contained in:
@@ -208,24 +208,11 @@
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.classEntityList.length > 0) {
|
||||
this.courseList = res.classEntityList
|
||||
// var list = res.classEntityList
|
||||
// this.courseList = this.courseList.concat(list)
|
||||
// if (res.courses.pages > this.page) {
|
||||
// this.status = 0
|
||||
// } else {
|
||||
// this.status = 2
|
||||
// }
|
||||
this.courseList = res.classEntityList
|
||||
|
||||
}else{
|
||||
this.courseList = []
|
||||
}
|
||||
// else if (this.page > 1) {
|
||||
// this.status = 2 // 加载完成
|
||||
|
||||
// } else {
|
||||
// this.status = 3 // 暂无数据
|
||||
// }
|
||||
// console.log('status', this.status)
|
||||
}
|
||||
this.flag = true
|
||||
}
|
||||
uni.hideLoading()
|
||||
@@ -241,13 +228,45 @@
|
||||
});
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url,id) {
|
||||
// console.log('进来了',url,id);
|
||||
async onPageJump(url,id) {
|
||||
var isStudent = await this.getRealRole(id)
|
||||
console.log('isStudent',isStudent);
|
||||
if(isStudent){
|
||||
uni.navigateTo({
|
||||
url:`/pages/miniClass/classInfo?id=${id}`
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}`
|
||||
});
|
||||
});}
|
||||
},
|
||||
|
||||
// 获取真实的身份信息
|
||||
async getRealRole(id) {
|
||||
// console.log('this.thisClass.id', this.thisClass.id);
|
||||
var _isStudent = undefined
|
||||
await $http.request({
|
||||
url: "common/class/getUserRole",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading()
|
||||
// 如果单纯是学员的身份
|
||||
if(res.result.length == 1 && res.result[0].role == 0){
|
||||
console.log('只是学员身份');
|
||||
_isStudent = true
|
||||
|
||||
}else{
|
||||
_isStudent = false
|
||||
}
|
||||
})
|
||||
return _isStudent
|
||||
},
|
||||
shuomingPage(url,id,pid){
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&pid=${pid}`
|
||||
|
||||
Reference in New Issue
Block a user