This commit is contained in:
zhaofang
2022-09-25 12:40:59 +08:00
parent b0810123e0
commit e15c24b6d1
3 changed files with 74 additions and 38 deletions

View File

@@ -73,13 +73,12 @@
<div class="content"><img src="@/assets/images/icon/remark-iocn.png" alt="" srcset="">详细介绍<div class="content-text" v-html="courseInfo.summary"></div></div>
</div>
</el-tab-pane>
<el-tab-pane label="大纲" name="second">
<el-tab-pane label="大纲" name="second" v-if="courseInfo.type==20">
<div class="category" v-for="(item) in catalogTree" :key="item.id">
<div class="node">
<div class="title">{{item.section.name}}</div>
<div class="subnode" v-for="(it,itIdx) in item.contents" :key="it.id">
<div class="sub-title">
<!-- {{itIdx+1}}. -->
<div class="tip"><span class="tip-type">{{getType(it.contentType)}}</span>{{it.contentName}}</div>
</div>
</div>
@@ -87,6 +86,14 @@
</div>
<div style="height: 30px;"></div>
</el-tab-pane>
<el-tab-pane label="大纲" name="second" v-if="courseInfo.type==10">
<div class="category" v-for="(item) in contentList" :key="item.id">
<div class="node">
<div class="title">{{item.contentName}}</div>
</div>
</div>
<div style="height: 30px;"></div>
</el-tab-pane>
<el-tab-pane :label="'评论('+commentsTtoal+')'" name="third">
<comments v-if="courseInfo.id!=''" :readonly="!stuStusts || stuStusts==0" :showTop="false" @writeTotal="showCommentsTotal" @success="addCommentSuccess" @delSuccess="delCommentSuccess" :obj-type="1" :to-users="toUsers" :obj-id="courseInfo.id" :obj-title="courseInfo.name"></comments>
</el-tab-pane>
@@ -185,31 +192,38 @@ export default {
ctoUsers.push({aid:item.teacherId,name:item.teacherName,sex:item.sex});
})
this.toUsers=ctoUsers;
this.loadAuthorInfo(rs.result.teachers,userIds)
this.loadAuthorInfo(rs.result.teachers,userIds);
}
this.courseInfo=rs.result.course;
this.courseInfo.score = rs.result.course.score;
if(rs.result.course.tags!=''){
this.tagArray=rs.result.course.tags.split(',');
}
if(!rs.result.course.resOwner3){
this.courseInfo.resOwner = this.resOwnerName(rs.result.course.resOwner2);
} else{
this.courseInfo.resOwner = this.resOwnerName(rs.result.course.resOwner3);
}
this.teachers=rs.result.teachers;
this.contentList=rs.result.contents;
let treeList=[];
rs.result.sections.forEach(sec=>{
let treeNode={section:sec,contents:[]}
rs.result.contents.forEach(c=>{
if(c.csectionId==sec.id){
treeNode.contents.push(c);
}
});
treeList.push(treeNode);
})
this.catalogTree=treeList;
this.courseInfo=rs.result.course;
this.courseInfo.score = rs.result.course.score;
if(rs.result.course.tags!=''){
this.tagArray=rs.result.course.tags.split(',');
}
if(!rs.result.course.resOwner3){
this.courseInfo.resOwner = this.resOwnerName(rs.result.course.resOwner2);
} else{
this.courseInfo.resOwner = this.resOwnerName(rs.result.course.resOwner3);
}
this.teachers=rs.result.teachers;
if(this.courseInfo.type == 10) {
this.contentList=rs.result.contents;
} else {
let treeList=[];
rs.result.sections.forEach(sec=>{
let treeNode={section:sec,contents:[]}
rs.result.contents.forEach(c=>{
if(c.csectionId==sec.id){
treeNode.contents.push(c);
}
});
treeList.push(treeNode);
})
this.catalogTree=treeList;
}
this.showQrimage();
this.isSignUp();
}else{

View File

@@ -517,11 +517,11 @@ export default {
//此处使用window.open有问题
//window.open(`${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.type}`);
} else {
if (item.type == 10) {
return this.webBaseUrl + "/course/micro?id=" + item.id;
} else if (item.type == 20) {
// if (item.type == 10) {
// return this.webBaseUrl + "/course/micro?id=" + item.id;
// } else if (item.type == 20) {
return this.webBaseUrl + "/course/detail?id=" + item.id;
}
// }
}
return "";

View File

@@ -80,6 +80,15 @@
</div>
</div>
</div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="paegSize"
layout="total, sizes, prev, pager, next, jumper"
:total="count">
</el-pagination>
</div>
<el-dialog
width="860px"
@@ -137,6 +146,7 @@ export default {
components:{interactBar},
data(){
return{
count:0,
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
options: [{
value: '选项1',
@@ -149,7 +159,7 @@ export default {
num :null,
dialogVisible: false,
pageIndex:1,
paegSize:1,
paegSize:10,
orderType:true,
orderField:'',
courseId:'',
@@ -238,18 +248,30 @@ export default {
endTime:this.endTime,
}
apiNote.query(data).then(res=>{
this.datalist = res.result.list
this.datalist = res.result.list;
this.count = res.result.count;
})
},
// 根据秒数转换成对应的时分秒
getHMS(time) {
const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600)
const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60)
const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60)
// console.log(hour + ':' + min + ':' + sec)
return hour + ':' + min + ':' + sec
}
const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600)
const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60)
const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60)
// console.log(hour + ':' + min + ':' + sec)
return hour + ':' + min + ':' + sec
},
handleSizeChange(val) {
this.paegSize = val;
this.pageIndex = 1;
this.noteData(this.num);
console.log(`每页 ${val}`);
},
handleCurrentChange(val) {
this.pageIndex = val;
this.noteData(this.num);
console.log(`当前页: ${val}`);
}
}
}