mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
Merge branch 'dev'
This commit is contained in:
@@ -99,6 +99,15 @@ const queryComments=function(pageSize){
|
|||||||
const majorTypes=function (){
|
const majorTypes=function (){
|
||||||
return ajax.get('/xboe/m/boe/cases/majorTypes');
|
return ajax.get('/xboe/m/boe/cases/majorTypes');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 详情新*/
|
||||||
|
const details = function (id, addView) {
|
||||||
|
let pars = 'id=' + id;
|
||||||
|
if (addView) {
|
||||||
|
pars += '&addView=' + addView
|
||||||
|
}
|
||||||
|
return ajax.get('/xboe/m/boe/cases/details?' + pars);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
indexList,
|
indexList,
|
||||||
@@ -112,5 +121,6 @@ export default {
|
|||||||
usernameList,
|
usernameList,
|
||||||
queryPraises,
|
queryPraises,
|
||||||
queryComments,
|
queryComments,
|
||||||
majorTypes
|
majorTypes,
|
||||||
|
details
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ export default {
|
|||||||
apiArticle.detail(id,false).then(res => {
|
apiArticle.detail(id,false).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.addForm = res.result;
|
this.addForm = res.result;
|
||||||
|
// this.addForm.content = res.result.content.trim();
|
||||||
|
// console.log(this.addForm.content)
|
||||||
if(this.addForm.coverurl){
|
if(this.addForm.coverurl){
|
||||||
this.converImage = this.fileBaseUrl + this.addForm.coverurl;
|
this.converImage = this.fileBaseUrl + this.addForm.coverurl;
|
||||||
}
|
}
|
||||||
@@ -137,6 +139,16 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
this.addForm.status = 2;
|
this.addForm.status = 2;
|
||||||
|
let content= this.addForm.content.replace(/<.*?>/ig,"");
|
||||||
|
console.log(content)
|
||||||
|
if(content.trim() == ''){
|
||||||
|
this.$message('您输入的内容为空,无法发布')
|
||||||
|
type: 'warning'
|
||||||
|
this.loading=false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.addForm.content=content.trim()
|
||||||
|
console.log(this.addForm.content,'iguighui')
|
||||||
apiArticle.save(this.addForm).then(res => {
|
apiArticle.save(this.addForm).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
if(res.message=='服务处理成功'){
|
if(res.message=='服务处理成功'){
|
||||||
|
|||||||
@@ -54,7 +54,6 @@
|
|||||||
<span slot="title" class="textl">课件管理</span>
|
<span slot="title" class="textl">课件管理</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
|
|
||||||
<el-submenu index="exam" v-show="curIdentity == 3">
|
<el-submenu index="exam" v-show="curIdentity == 3">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<svg-icon icon-class="exam" style="font-size:14px"></svg-icon>
|
<svg-icon icon-class="exam" style="font-size:14px"></svg-icon>
|
||||||
@@ -345,6 +344,10 @@ export default {
|
|||||||
activeMenu() {
|
activeMenu() {
|
||||||
const route = this.$route;
|
const route = this.$route;
|
||||||
const { meta, path } = route;
|
const { meta, path } = route;
|
||||||
|
console.log(meta)
|
||||||
|
if(meta.title == '添加受众'){
|
||||||
|
meta.activeMenu = '/manage/ugroups'
|
||||||
|
}
|
||||||
if (meta.activeMenu) {
|
if (meta.activeMenu) {
|
||||||
return meta.activeMenu;
|
return meta.activeMenu;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="more"><router-link to="/case">更多 ></router-link></span>
|
<span class="more"><router-link to="/case">更多 ></router-link></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="modules-list xrow" style="height: 235px;overflow: hidden;">
|
<div class="modules-list xrow" style="height: 255px;overflow: hidden;">
|
||||||
<div class="index-course xrow-course" v-for="ca in caseList.list" :key="ca.id">
|
<div class="index-course xrow-course" v-for="ca in caseList.list" :key="ca.id">
|
||||||
<div class="casetwo" :body-style="{ padding: '0px' }">
|
<div class="casetwo" :body-style="{ padding: '0px' }">
|
||||||
<!-- <div class="case-top"></div> -->
|
<!-- <div class="case-top"></div> -->
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<div class="case-inter">
|
<div class="case-inter">
|
||||||
<interactBar :type="3" :readonly="true" :data="ca" :shares="false" :views="false"></interactBar>
|
<interactBar :type="3" :readonly="true" :data="ca" :shares="false" :views="false"></interactBar>
|
||||||
</div>
|
</div>
|
||||||
<div style="height:40px;margin-top:10px">
|
<div class="case-orginfo" style="margin-top:10px">
|
||||||
<authorInfo :avatar="ca.authorInfo.avatar" :info="ca.authorInfo.orgInfo" :name="ca.authorInfo.name" :sex="ca.authorInfo.sex"></authorInfo></div>
|
<authorInfo :avatar="ca.authorInfo.avatar" :info="ca.authorInfo.orgInfo" :name="ca.authorInfo.name" :sex="ca.authorInfo.sex"></authorInfo></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -649,6 +649,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.case-orginfo{
|
||||||
|
// line-height: 25px;
|
||||||
|
height: 45px;
|
||||||
|
}
|
||||||
.three-line-ellipsis {
|
.three-line-ellipsis {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@@ -661,7 +665,7 @@ export default {
|
|||||||
.casetwo{
|
.casetwo{
|
||||||
border: 1px solid #F0F0F0;
|
border: 1px solid #F0F0F0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 220px;
|
height: 245px;
|
||||||
margin-bottom:15px;
|
margin-bottom:15px;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -672,12 +676,9 @@ export default {
|
|||||||
.case-conent{
|
.case-conent{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
// box-shadow: 1px 1px 15px #ccc;
|
|
||||||
// position: absolute;
|
|
||||||
// top: 5%;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
// left: 4%;
|
// left: 4%;
|
||||||
padding: 16px;
|
padding: 15px;
|
||||||
.case-time{
|
.case-time{
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
@@ -688,14 +689,15 @@ export default {
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom:10px;
|
margin-bottom:8px;
|
||||||
}
|
}
|
||||||
.case-text{
|
.case-text{
|
||||||
height: 55px;
|
height: 60px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
overflow: hidden;
|
||||||
color: #888888;
|
color: #888888;
|
||||||
line-height: 18px;
|
// line-height: 18px;
|
||||||
margin-bottom:12px;
|
margin-bottom:10px;
|
||||||
}
|
}
|
||||||
::v-deep .case-inter{
|
::v-deep .case-inter{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -27,7 +27,8 @@
|
|||||||
<div class="btn-div clearfix" >
|
<div class="btn-div clearfix" >
|
||||||
<div style="color:#2974D6;font-weight: 450;" v-if="caseDetail.orgDomain" class="item">{{ orgDomainTranslate(caseDetail.orgDomain) }}</div>
|
<div style="color:#2974D6;font-weight: 450;" v-if="caseDetail.orgDomain" class="item">{{ orgDomainTranslate(caseDetail.orgDomain) }}</div>
|
||||||
<div style="color:#2974D6;font-weight: 450;" class="item" v-if="caseDetail.orgDomain == '' && caseDetail.orgDomainParent">{{ orgDomainTranslate(caseDetail.orgDomainParent) }}</div>
|
<div style="color:#2974D6;font-weight: 450;" class="item" v-if="caseDetail.orgDomain == '' && caseDetail.orgDomainParent">{{ orgDomainTranslate(caseDetail.orgDomainParent) }}</div>
|
||||||
<div style="color:#2974D6;font-weight: 450;" v-if="caseDetail.majorType" class="item">{{ majorTypeTranslate(caseDetail.majorType) }}</div>
|
<!-- <div style="color:#2974D6;font-weight: 450;" v-if="caseDetail.majorType" class="item">{{ majorTypeTranslate(caseDetail.majorType) }}</div> -->
|
||||||
|
<div class="item" style="color:#2974D6;font-weight: 450;" v-for="item,idx in caseDetail.majorType" :key="idx" >{{ majorTypeTranslate(item) }}</div>
|
||||||
<div v-if="caseDetail.keyword1" class="item">{{ caseDetail.keyword1 }}</div>
|
<div v-if="caseDetail.keyword1" class="item">{{ caseDetail.keyword1 }}</div>
|
||||||
<div v-if="caseDetail.keyword2" class="item">{{ caseDetail.keyword2 }}</div>
|
<div v-if="caseDetail.keyword2" class="item">{{ caseDetail.keyword2 }}</div>
|
||||||
<div v-if="caseDetail.keyword3" class="item">{{ caseDetail.keyword3 }}</div>
|
<div v-if="caseDetail.keyword3" class="item">{{ caseDetail.keyword3 }}</div>
|
||||||
@@ -313,6 +314,7 @@ export default {
|
|||||||
apiDict.items(key).then(res => {
|
apiDict.items(key).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.Profess = res.result;
|
this.Profess = res.result;
|
||||||
|
// this.Profess = this.Profess.split(",")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -448,10 +450,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCaseData() {
|
getCaseData() {
|
||||||
apiCase.detail(this.resolveId,true).then(res => {
|
apiCase.details(this.resolveId,true).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
if (JSON.stringify(res.result) != '{}') {
|
if (JSON.stringify(res.result) != '{}') {
|
||||||
this.caseDetail = res.result;
|
this.caseDetail = res.result.case;
|
||||||
|
this.caseDetail.majorType = this.caseDetail.majorType.split(",")
|
||||||
this.getCaseUserDetail();
|
this.getCaseUserDetail();
|
||||||
if(this.caseDetail.filePath){
|
if(this.caseDetail.filePath){
|
||||||
//this.pdfPath=this.basePath+this.caseDetail.filePath;
|
//this.pdfPath=this.basePath+this.caseDetail.filePath;
|
||||||
|
|||||||
@@ -95,7 +95,8 @@
|
|||||||
<div class="keyword-text clearfix">
|
<div class="keyword-text clearfix">
|
||||||
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain">{{ orgDomainTranslate(item.orgDomain) }}</div>
|
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain">{{ orgDomainTranslate(item.orgDomain) }}</div>
|
||||||
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.orgDomainParent) }}</div>
|
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.orgDomainParent) }}</div>
|
||||||
<div style="color:#2974D6;font-weight: 450;" v-if="item.majorType">{{ majorTypeTranslate(item.majorType) }}</div>
|
<div style="color:#2974D6;font-weight: 450;" v-for="item,idx in item.majorType" :key="idx" >{{ majorTypeTranslate(item) }}</div>
|
||||||
|
|
||||||
<div v-if="item.keyword1">{{ item.keyword1 }}</div>
|
<div v-if="item.keyword1">{{ item.keyword1 }}</div>
|
||||||
<div v-if="item.keyword2">{{ item.keyword2 }}</div>
|
<div v-if="item.keyword2">{{ item.keyword2 }}</div>
|
||||||
<div v-if="item.keyword3">{{ item.keyword3 }}</div>
|
<div v-if="item.keyword3">{{ item.keyword3 }}</div>
|
||||||
@@ -322,7 +323,6 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if(this.searchTags.length == 0){
|
if(this.searchTags.length == 0){
|
||||||
console.log('gyigyu')
|
|
||||||
this.queryCondition.majorType = null;
|
this.queryCondition.majorType = null;
|
||||||
this.queryCondition.orgDomain = null;
|
this.queryCondition.orgDomain = null;
|
||||||
};
|
};
|
||||||
@@ -581,7 +581,9 @@ export default {
|
|||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
if (res.result.list.length > 0) {
|
if (res.result.list.length > 0) {
|
||||||
this.isSeach = false;
|
this.isSeach = false;
|
||||||
|
console.log(res.result.list)
|
||||||
res.result.list.forEach(item => {
|
res.result.list.forEach(item => {
|
||||||
|
item.majorType = item.majorType.split(",");
|
||||||
item.isAll = false;
|
item.isAll = false;
|
||||||
item.authorInfo = {
|
item.authorInfo = {
|
||||||
aid: "",
|
aid: "",
|
||||||
|
|||||||
@@ -96,13 +96,10 @@
|
|||||||
<div v-if="homeworkInfo.info.submitMode==1 || homeworkInfo.info.submitMode==3">
|
<div v-if="homeworkInfo.info.submitMode==1 || homeworkInfo.info.submitMode==3">
|
||||||
<div class="homework-title">上传作业</div>
|
<div class="homework-title">上传作业</div>
|
||||||
<div class="homework-content">
|
<div class="homework-content">
|
||||||
<div v-if="homeworkInfo.filePath!=''">
|
|
||||||
<el-tag closable type="success" @close="removeHomeworkFile">作业附件</el-tag><span style="margin-left: 10px;">请点击下面的提交</span>
|
<!-- <div v-else >
|
||||||
</div>
|
|
||||||
<div v-else >
|
|
||||||
<el-button type="primary">选择文件并上传</el-button>
|
<el-button type="primary">选择文件并上传</el-button>
|
||||||
<!-- <file-upload dir="files" :isShowTip="false" @success="uploadHomeworkFile" @remove="removeHomeworkFile"></file-upload> -->
|
</div> -->
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="text-align: center;padding-bottom: 10px;">
|
<!-- <div style="text-align: center;padding-bottom: 10px;">
|
||||||
@@ -208,7 +205,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div style="text-align: center; margin-bottom: 15px" v-if="assessInfo.allowSubmit"><el-button type="primary" @click="assessSubmitFun">提交</el-button></div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div v-else style="text-align: center;padding-top: 20px;color: red;">此课程无评估</div> -->
|
<!-- <div v-else style="text-align: center;padding-top: 20px;color: red;">此课程无评估</div> -->
|
||||||
</div>
|
</div>
|
||||||
@@ -302,7 +298,7 @@
|
|||||||
<div v-else class="uavatar">
|
<div v-else class="uavatar">
|
||||||
<div v-if="item.sex == 1 "><img src="../../../../public/images/Avatarman.png" alt=""></div>
|
<div v-if="item.sex == 1 "><img src="../../../../public/images/Avatarman.png" alt=""></div>
|
||||||
<div v-else><img src="../../../../public/images/Avatarwoman.png" alt=""></div>
|
<div v-else><img src="../../../../public/images/Avatarwoman.png" alt=""></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="teacher-info">
|
<div class="teacher-info">
|
||||||
@@ -481,10 +477,11 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.showQrimage();
|
|
||||||
this.loadResOwners();
|
this.loadResOwners();
|
||||||
let id = this.$route.query.id;
|
let id = this.$route.query.id;
|
||||||
this.courseInfo.id = id;
|
this.courseInfo.id = id;
|
||||||
|
this.showQrimage();
|
||||||
let $this = this;
|
let $this = this;
|
||||||
//页面只支取一次,所以先直接写在这里面
|
//页面只支取一次,所以先直接写在这里面
|
||||||
apiCoursePortal.detail(id).then(rs => {
|
apiCoursePortal.detail(id).then(rs => {
|
||||||
@@ -550,8 +547,7 @@ export default {
|
|||||||
$this.loadAssessInfo();
|
$this.loadAssessInfo();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//study info
|
|
||||||
// this.loadStudyInfo();
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(rs.message);
|
this.$message.error(rs.message);
|
||||||
}
|
}
|
||||||
@@ -561,7 +557,7 @@ export default {
|
|||||||
showQrimage(row){
|
showQrimage(row){
|
||||||
this.qrcode = this.webBaseUrl+'/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
|
this.qrcode = this.webBaseUrl+'/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.crateQrcode();
|
//this.crateQrcode();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
crateQrcode(){
|
crateQrcode(){
|
||||||
@@ -605,21 +601,6 @@ export default {
|
|||||||
//console.log("当前播放11"+itme);
|
//console.log("当前播放11"+itme);
|
||||||
let intTime=parseInt(itme);
|
let intTime=parseInt(itme);
|
||||||
this.videoPlayingTime=intTime;
|
this.videoPlayingTime=intTime;
|
||||||
let saveTime=Math.floor(intTime%10);
|
|
||||||
if(intTime>10 && saveTime==0 && this.coursewareInfo.studyItemId!=''){
|
|
||||||
//记录播放时间
|
|
||||||
//console.log('记录播放时间:'+intTime);
|
|
||||||
let postData={
|
|
||||||
itemId:this.coursewareInfo.studyItemId,
|
|
||||||
videoTime:intTime
|
|
||||||
}
|
|
||||||
apicourseStudy.studyVideoTime(postData).then(rs=>{
|
|
||||||
if(rs.status!=200){
|
|
||||||
console.log('记录播放时间错误');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
audioPlaying(item){
|
audioPlaying(item){
|
||||||
//console.log("当前播放22"+item);
|
//console.log("当前播放22"+item);
|
||||||
@@ -651,11 +632,7 @@ export default {
|
|||||||
studyId: this.studyId,
|
studyId: this.studyId,
|
||||||
contentId: this.homeworkInfo.content.id
|
contentId: this.homeworkInfo.content.id
|
||||||
};
|
};
|
||||||
// apicourseStudy.myHomeworkList(params).then(rs => {
|
|
||||||
// if (rs.status == 200) {
|
|
||||||
// this.homeworkInfo.records = rs.result;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
} else if (tab.name == "test") {
|
} else if (tab.name == "test") {
|
||||||
if (this.examInfo.records.length == 0) {
|
if (this.examInfo.records.length == 0) {
|
||||||
@@ -663,17 +640,6 @@ export default {
|
|||||||
studyId: this.studyId,
|
studyId: this.studyId,
|
||||||
contentId: this.examInfo.content.id
|
contentId: this.examInfo.content.id
|
||||||
};
|
};
|
||||||
apicourseStudy.myExamList2(params).then(examRs => {
|
|
||||||
if (examRs.status == 200) {
|
|
||||||
this.examInfo.records = examRs.result;
|
|
||||||
let len = examRs.result.length;
|
|
||||||
if (this.examInfo.info.times > len) {
|
|
||||||
this.examInfo.allowSubmit = true;
|
|
||||||
} else {
|
|
||||||
this.examInfo.allowSubmit = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else if (tab.name == "assess") {
|
} else if (tab.name == "assess") {
|
||||||
//console.log('加载评估信息');,评估只会有一个,所以主直接取
|
//console.log('加载评估信息');,评估只会有一个,所以主直接取
|
||||||
@@ -681,22 +647,8 @@ export default {
|
|||||||
studyId: this.studyId,
|
studyId: this.studyId,
|
||||||
contentId: this.assessInfo.content.id
|
contentId: this.assessInfo.content.id
|
||||||
};
|
};
|
||||||
// apicourseStudy.myAssessList(params).then(res => {
|
|
||||||
// if (res.status == 200) {
|
|
||||||
// if (res.result.length > 0) {
|
|
||||||
// this.assessInfo.allowSubmit = false;
|
|
||||||
// this.assessInfo.info = JSON.parse(res.result[0].asContent);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// this.$message.error(res.message);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
} else {
|
} else {
|
||||||
//在课件页面,记录开始时间
|
|
||||||
//console.log('记录课件学习信息');
|
|
||||||
if(!this.coursewareInfo.finish){
|
|
||||||
setTimeout(() => {$this.saveStudyInfo();}, 5000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveStudyInfo() {
|
saveStudyInfo() {
|
||||||
@@ -708,102 +660,20 @@ export default {
|
|||||||
if (this.coursewareInfo.finish) {
|
if (this.coursewareInfo.finish) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// let params = {
|
|
||||||
// studyId: this.studyId, //学习id,
|
|
||||||
// courseId: this.coursewareInfo.content.courseId, //课程id,
|
|
||||||
// contentId: this.coursewareInfo.content.id, //内容id,
|
|
||||||
// contentName: this.coursewareInfo.content.contentName, //内容名称
|
|
||||||
// progress: 100,
|
|
||||||
// contentTotal: this.totalContent
|
|
||||||
// };
|
|
||||||
// apicourseStudy.studyContent(params).then(res => {
|
|
||||||
// if (res.status == 200) {
|
|
||||||
// this.coursewareInfo.finish = true; //课件内容已学习,记录状态
|
|
||||||
// } else {
|
|
||||||
// console.log("记录学习失败:" + res.message + "," + res.error);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
startTest() {
|
startTest() {
|
||||||
this.examInfo.startTime = new Date();
|
this.examInfo.startTime = new Date();
|
||||||
this.testStart = true;
|
this.testStart = true;
|
||||||
},
|
},
|
||||||
countTest() {
|
|
||||||
//计算课程的分数
|
|
||||||
let scoreNum = null;
|
|
||||||
this.examInfo.paper.items.forEach(item => {
|
|
||||||
let isFind = true;
|
|
||||||
if (item.type != 102) {
|
|
||||||
item.options.forEach(it => {
|
|
||||||
if (it.answer == true && item.userAnswer == it.id) {
|
|
||||||
scoreNum += item.score;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
item.options.forEach(it => {
|
|
||||||
if (it.answer == false && it.isCheck && it.isCheck == true) {
|
|
||||||
isFind = false;
|
|
||||||
}
|
|
||||||
if (it.answer == true && it.isCheck && it.isCheck == true) {
|
|
||||||
if (isFind) {
|
|
||||||
scoreNum += item.score;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (scoreNum === null) scoreNum = 0;
|
|
||||||
return scoreNum;
|
|
||||||
},
|
|
||||||
// 提交考试
|
// 提交考试
|
||||||
submitTest() {
|
submitTest() {
|
||||||
let now = new Date();
|
|
||||||
let testScore = this.countTest();
|
|
||||||
let postData = {
|
|
||||||
studyId: this.studyId, //这个哪传来的?
|
|
||||||
studyItemId: this.examInfo.studyItemId, //前面已经给了
|
|
||||||
courseId: this.examInfo.info.courseId,
|
|
||||||
contentId: this.examInfo.info.contentId,
|
|
||||||
testId: this.examInfo.info.id,
|
|
||||||
testName: this.courseInfo.name, //应该是课程的名称 + 内容的名称
|
|
||||||
testDuration: 0,
|
|
||||||
score: testScore,
|
|
||||||
arrange: this.examInfo.info.arrange,
|
|
||||||
passLine: this.examInfo.info.passLine,
|
|
||||||
randomMode: this.examInfo.info.randomMode,
|
|
||||||
paperJson: JSON.stringify({ items: this.examInfo.paper.items }) //原来是对象,这里要也要对象
|
|
||||||
//startTime:formatDate(this.examInfo.startTime),//此时间需要格式化,格式化时间可以放在util中
|
|
||||||
//endTime:formatDate(now),
|
|
||||||
};
|
|
||||||
//计划考试的时长
|
|
||||||
var dateDiff = now.getTime() - this.examInfo.startTime.getTime(); //时间差的毫秒数
|
|
||||||
var minutes = Math.floor(dateDiff / 1000); //计算相差秒数,原来是分钟不行
|
|
||||||
postData.testDuration = minutes;
|
|
||||||
apicourseStudy.saveExam(postData).then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
this.examInfo.records.push(res.result);
|
|
||||||
this.examInfo.studyItemId = res.result.studyItemId; //设置考试的学习记录id
|
|
||||||
this.testStart = false;
|
|
||||||
let len = this.examInfo.records.length;
|
|
||||||
|
|
||||||
if (this.examInfo.info.times > len) {
|
|
||||||
this.examInfo.allowSubmit = true;
|
|
||||||
} else {
|
|
||||||
this.examInfo.allowSubmit = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
showExamAnswer(item) {
|
showExamAnswer(item) {
|
||||||
//显示试卷的答卷信息
|
//显示试卷的答卷信息
|
||||||
this.examInfo.detailShow=true;
|
this.examInfo.detailShow=true;
|
||||||
apicourseStudy.myExamPaper(item.id).then(rs=>{
|
|
||||||
if(rs.status==200){
|
|
||||||
this.examInfo.detailItems=JSON.parse(rs.result.paper).items
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
testType(type) {
|
testType(type) {
|
||||||
//此方法移到tools中
|
//此方法移到tools中
|
||||||
@@ -826,145 +696,9 @@ export default {
|
|||||||
this.homeworkInfo.filePath = res.result.filePath;
|
this.homeworkInfo.filePath = res.result.filePath;
|
||||||
},
|
},
|
||||||
removeHomeworkFile() {
|
removeHomeworkFile() {
|
||||||
this.$confirm("您确定要删除已上传的附件吗?", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(() => {
|
|
||||||
this.homeworkInfo.filePath = "";
|
|
||||||
//从服务器端删除
|
|
||||||
this.$message({ type: "success", message: "删除成功!" });
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
submitHomework() {
|
submitHomework() {
|
||||||
//提交作业
|
|
||||||
if (this.homeworkInfo.content.submitMode == 1) {
|
|
||||||
if (this.homeworkInfo.filePath == "") {
|
|
||||||
this.$message.error("请上传作业内容");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else if (this.homeworkInfo.content.submitMode == 2) {
|
|
||||||
if (this.homeworkInfo.answer == "") {
|
|
||||||
this.$message.error("请先填写作业内容");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (
|
|
||||||
this.homeworkInfo.answer == "" &&
|
|
||||||
this.homeworkInfo.filePath == ""
|
|
||||||
) {
|
|
||||||
this.$message.error("请填写或上传作业");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let pamars = {
|
|
||||||
studyItemId: this.homeworkInfo.studyItemId, //学习内容记录id,
|
|
||||||
studyId: this.studyId, //学习id,
|
|
||||||
courseId: this.courseInfo.id, //课程id,
|
|
||||||
contentId: this.homeworkInfo.content.id, //内容id,
|
|
||||||
hwId: this.homeworkInfo.info.id, //作业的id
|
|
||||||
hwName: this.homeworkInfo.info.name, //作业的名称
|
|
||||||
//hwContent: this.homeworkInfo.info.content,//作业的内容,先不要此字段了
|
|
||||||
filePath: this.homeworkInfo.filePath, //文件的路径,可以为空,
|
|
||||||
hwAnswer: this.homeworkInfo.answer, //文本提交的信息
|
|
||||||
score: 0
|
|
||||||
};
|
|
||||||
apicourseStudy.saveHomework(pamars).then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
this.$message.success("作业已提交");
|
|
||||||
this.homeworkInfo.filePath = "";
|
|
||||||
this.homeworkInfo.answer = "";
|
|
||||||
this.homeworkInfo.records.push(res.result);
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
appendStudyTime() {
|
|
||||||
if(this.studyId==''){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//追加学习时间
|
|
||||||
let $this = this;
|
|
||||||
if (this.appendStartTime == null) {
|
|
||||||
this.appendStartTime = new Date();
|
|
||||||
setTimeout(function() {
|
|
||||||
$this.appendStudyTime();
|
|
||||||
}, 60000);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let now = new Date();
|
|
||||||
let m = now.getTime() - this.appendStartTime.getTime(); //相差的毫秒数
|
|
||||||
let sen = parseInt(m / 1000); //计算秒数
|
|
||||||
if (sen > 0) {
|
|
||||||
let postData = {
|
|
||||||
studyId: this.studyId,
|
|
||||||
courseId: this.courseInfo.id,
|
|
||||||
contentId: this.coursewareInfo.content.id,
|
|
||||||
studyInfo:
|
|
||||||
this.courseInfo.name +
|
|
||||||
"-" +
|
|
||||||
this.coursewareInfo.content.contentName,
|
|
||||||
duration: sen
|
|
||||||
};
|
|
||||||
apicourseStudy.appendStudyTime(postData).then(rs => {
|
|
||||||
if (rs.status == 200) {
|
|
||||||
$this.appendStartTime = new Date(); //重置开始时间,10秒后再记录一次
|
|
||||||
setTimeout(function() {
|
|
||||||
$this.appendStudyTime();
|
|
||||||
}, 60000);
|
|
||||||
} else {
|
|
||||||
console.log(rs.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
setTimeout(function() {
|
|
||||||
$this.appendStudyTime();
|
|
||||||
}, 60000);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
loadStudyInfo() {
|
|
||||||
//获取学习信息
|
|
||||||
let $this = this;
|
|
||||||
this.loadScorePraiseAndTrample();
|
|
||||||
apicourseStudy.studyInfo(this.courseInfo.id).then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
res.result.signup ? (this.enrollStutas = 2) : (this.enrollStutas = 1);
|
|
||||||
if(res.result.signup) {
|
|
||||||
//this.loadScorePraiseAndTrample();
|
|
||||||
this.appendStudyTime();
|
|
||||||
this.studyId = res.result.studyId; //设置学习id
|
|
||||||
//需要判断此内容是否已学习完成,如果已学习完成,不需要再请不说了
|
|
||||||
res.result.contents.forEach(con => {
|
|
||||||
if (con.contentId == $this.coursewareInfo.content.id) {
|
|
||||||
$this.coursewareInfo.finish = true; //课件已学习
|
|
||||||
$this.coursewareInfo.studyItemId=con.id;
|
|
||||||
if(con.lastStudyTime!='' && con.lastStudyTime>0){
|
|
||||||
//当前视频学习的时间
|
|
||||||
$this.videoPlayingTime=con.lastStudyTime;
|
|
||||||
//如果视频已经播放完了
|
|
||||||
}
|
|
||||||
//console.log()
|
|
||||||
}else if (con.contentId == $this.homeworkInfo.content.id) {
|
|
||||||
$this.homeworkInfo.studyItemId = con.id;
|
|
||||||
}else if (con.contentId ==$this.examInfo.content.id) {
|
|
||||||
$this.examInfo.studyItemId = con.id;
|
|
||||||
}else if (con.contentId == $this.assessInfo.content.id) {
|
|
||||||
$this.assessInfo.studyItemId = con.id;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!$this.coursewareInfo.finish) {
|
|
||||||
setTimeout(() => {
|
|
||||||
$this.saveStudyInfo();
|
|
||||||
}, 5000); //5秒后记录学习
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
loadHomeworkInfo() {
|
loadHomeworkInfo() {
|
||||||
apiCourse.getHomework(this.homeworkInfo.content.id).then(res => {
|
apiCourse.getHomework(this.homeworkInfo.content.id).then(res => {
|
||||||
@@ -1018,137 +752,19 @@ export default {
|
|||||||
signType: 1,
|
signType: 1,
|
||||||
signInfo: ""
|
signInfo: ""
|
||||||
};
|
};
|
||||||
let $this = this;
|
this.enrollStutas = 2;
|
||||||
// apicourseStudy.signup(pamars).then(res => {
|
|
||||||
// if (res.status == 200) {
|
|
||||||
// this.$message({ type: "success", message: "报名成功" });
|
|
||||||
// this.enrollStutas = 2;
|
|
||||||
// this.appendStudyTime(); //报名成功记录开始时间
|
|
||||||
// //报名成功后,就直接记录课件学习情况,5秋后
|
|
||||||
// setTimeout(() => {
|
|
||||||
// $this.saveStudyInfo();
|
|
||||||
// }, 5000);
|
|
||||||
// } else {
|
|
||||||
// this.$message.error(res.message);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
assessSubmitFun() {
|
|
||||||
let dataJson = JSON.stringify(this.assessInfo.info);
|
|
||||||
//计算评估得分
|
|
||||||
let countStr = this.assessInfo.info.resultCount;
|
|
||||||
let countScore = 0;
|
|
||||||
let pass = true;
|
|
||||||
this.assessInfo.info.items.forEach((item, idx) => {
|
|
||||||
if (item.qType == 1) {
|
|
||||||
if (item.answer == 0) {
|
|
||||||
pass = false;
|
|
||||||
}
|
|
||||||
var str = "[q" + (idx + 1) + "]";
|
|
||||||
countStr = countStr.replace(str, item.answer);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!pass) {
|
|
||||||
this.$message.error("请填写完整再提交");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//console.log(countStr);
|
|
||||||
countScore = eval(countStr);
|
|
||||||
//console.log(countScore,"countScore");
|
|
||||||
let pamars = {
|
|
||||||
studyItemId: this.assessInfo.studyItemId, //学习内容记录id,
|
|
||||||
studyId: this.studyId, //学习id,
|
|
||||||
courseId: this.courseInfo.id, //课程id,
|
|
||||||
contentId: this.assessInfo.content.id, //内容id,
|
|
||||||
asContent: dataJson, //内容
|
|
||||||
asScore: countScore //评估得分
|
|
||||||
};
|
|
||||||
apicourseStudy.saveAssess(pamars).then(res => {
|
|
||||||
if (res.status == 200) {
|
|
||||||
this.assessInfo.allowSubmit = false;
|
|
||||||
this.$message.success("提交成功,谢谢您的评估");
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
loadScorePraiseAndTrample() {
|
loadScorePraiseAndTrample() {
|
||||||
//加载是否打过分
|
|
||||||
//if(this.enrollStutas>1){
|
|
||||||
apiCourseGrade.has(this.courseInfo.id).then(rs => {
|
|
||||||
if (rs.status == 200 && rs.result) {
|
|
||||||
this.scoreInfo.has = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//}
|
|
||||||
apiPraises.has(1, this.courseInfo.id).then(rs => {
|
|
||||||
if (rs.status == 200 && rs.result) {
|
|
||||||
this.isPraise = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
apiTrample.has(this.courseInfo.id).then(rs => {
|
|
||||||
if (rs.status == 200 && rs.result) {
|
|
||||||
this.isTrample = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
addScore() {
|
addScore() {
|
||||||
let postData = {
|
|
||||||
courseId: this.courseInfo.id,
|
|
||||||
studyId: this.studyId,
|
|
||||||
score: this.scoreInfo.score
|
|
||||||
};
|
|
||||||
if (this.scoreInfo.score > 0) {
|
|
||||||
apiCourseGrade.grade(postData).then(rs => {
|
|
||||||
if (rs.status == 200) {
|
|
||||||
this.$message.success("打分成功,谢谢您的打分");
|
|
||||||
this.scoreInfo.has = true;
|
|
||||||
} else {
|
|
||||||
this.$message.error("打分处理失败,请稍后再试");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
praiseContent() {
|
praiseContent() {
|
||||||
if(this.enrollStutas==1){
|
|
||||||
this.$message.error("报名学习之后才可以点赞");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(this.isTrample){
|
|
||||||
this.$message.error("您已踩过了,不能再赞了");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let postData = {
|
|
||||||
objType: 1,
|
|
||||||
objId: this.courseInfo.id,
|
|
||||||
title: this.courseInfo.name
|
|
||||||
};
|
|
||||||
apiPraises.save(postData).then(rs => {
|
|
||||||
if (rs.status == 200) {
|
|
||||||
this.$message.success("点赞成功");
|
|
||||||
this.isPraise = true;
|
|
||||||
} else {
|
|
||||||
this.$message.error("点赞失败,请稍后再试");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
treadContent() {
|
treadContent() {
|
||||||
if(this.enrollStutas==1){
|
|
||||||
this.$message.error("只有报名学习后才可以踩");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(this.isPraise){
|
|
||||||
this.$message.error("您已赞过了,不能再踩了");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
apiTrample.trample(this.courseInfo.id).then(rs => {
|
|
||||||
if (rs.status == 200) {
|
|
||||||
this.$message.success("已踩");
|
|
||||||
this.isTrample = true;
|
|
||||||
} else {
|
|
||||||
this.$message.error("踩失败,请稍后再试");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
loadAuthorInfo(list,ids){ //加载作者信息,头像,机构信息
|
loadAuthorInfo(list,ids){ //加载作者信息,头像,机构信息
|
||||||
if(ids.length==0){
|
if(ids.length==0){
|
||||||
@@ -1164,13 +780,13 @@ export default {
|
|||||||
// this.tearsex = item.sex;
|
// this.tearsex = item.sex;
|
||||||
console.log(this.tearsex)
|
console.log(this.tearsex)
|
||||||
console.log(author.sex,item.sex,'sexs')
|
console.log(author.sex,item.sex,'sexs')
|
||||||
|
|
||||||
// console.log(item.sex)
|
// console.log(item.sex)
|
||||||
if(author.avatar){
|
if(author.avatar){
|
||||||
item.avatar=this.fileBaseUrl + author.avatar;
|
item.avatar=this.fileBaseUrl + author.avatar;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
@@ -1432,7 +1048,7 @@ export default {
|
|||||||
.num {
|
.num {
|
||||||
color: #444444;
|
color: #444444;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
}
|
}
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<el-button @click="widthOpen(contentData.content)" type="primary">新窗口打开</el-button>
|
<el-button @click="widthOpen(contentData.content)" type="primary">新窗口打开</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="showiframe">
|
<div v-if="showiframe">
|
||||||
<iframe :src="contentData.content" style="width: 100%;border:0px;min-height: 473px;" frameborder="0"></iframe>
|
<iframe :src="contentData.content" style="width: 100%;border:0px;min-height: 473px;" frameborder="0"></iframe>
|
||||||
</div> -->
|
</div> -->
|
||||||
@@ -265,26 +265,26 @@ export default {
|
|||||||
//console.log("播放结束");
|
//console.log("播放结束");
|
||||||
},
|
},
|
||||||
onPlayerPlaying(itme){
|
onPlayerPlaying(itme){
|
||||||
//console.log("当前播放"+itme);
|
// //console.log("当前播放"+itme);
|
||||||
//console.log("当前播放11"+itme);
|
// //console.log("当前播放11"+itme);
|
||||||
if(this.contentData.contentType && this.contentData.contentType==10){
|
// if(this.contentData.contentType && this.contentData.contentType==10){
|
||||||
let intTime=parseInt(itme);
|
// let intTime=parseInt(itme);
|
||||||
this.contentData.lastStudyTime=intTime;
|
// this.contentData.lastStudyTime=intTime;
|
||||||
let saveTime=Math.floor(intTime%10);
|
// let saveTime=Math.floor(intTime%10);
|
||||||
if(intTime>10 && saveTime==0 && this.contentData.studyItemId!=''){
|
// if(intTime>10 && saveTime==0 && this.contentData.studyItemId!=''){
|
||||||
//记录播放时间
|
// //记录播放时间
|
||||||
//console.log('记录播放时间:'+intTime);
|
// //console.log('记录播放时间:'+intTime);
|
||||||
let postData={
|
// let postData={
|
||||||
itemId:this.contentData.studyItemId,
|
// itemId:this.contentData.studyItemId,
|
||||||
videoTime:intTime
|
// videoTime:intTime
|
||||||
}
|
// }
|
||||||
apiStudy.studyVideoTime(postData).then(rs=>{
|
// apiStudy.studyVideoTime(postData).then(rs=>{
|
||||||
if(rs.status!=200){
|
// if(rs.status!=200){
|
||||||
console.log('记录播放时间错误');
|
// console.log('记录播放时间错误');
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
audioPlaying(item){
|
audioPlaying(item){
|
||||||
@@ -327,88 +327,12 @@ export default {
|
|||||||
}
|
}
|
||||||
this.contentList=rs.result.contents;
|
this.contentList=rs.result.contents;
|
||||||
this.totalContent=rs.result.contents.length;
|
this.totalContent=rs.result.contents.length;
|
||||||
//加载学习的数据
|
|
||||||
this.loadStudyData();
|
|
||||||
}else{
|
}else{
|
||||||
this.$message.error(rs.message);
|
this.$message.error(rs.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loadStudyData() {
|
|
||||||
let $this=this;
|
|
||||||
apiStudy.studyInfo(this.courseId).then(res=>{
|
|
||||||
if(res.status == 200) {
|
|
||||||
if(res.result.signup){
|
|
||||||
// this.loadScorePraiseAndTrample();
|
|
||||||
this.studyId = res.result.studyId;
|
|
||||||
//对已学习的内容进行比对,重要的字段, 学习内容id,在后缀的
|
|
||||||
let playIndex=-1;
|
|
||||||
this.contentList.forEach((con,conIdx)=>{
|
|
||||||
res.result.contents.forEach((scon,sconIdx)=>{
|
|
||||||
if(scon.contentId==con.id){
|
|
||||||
//定位显示的内容
|
|
||||||
if($this.initContentId!='' && $this.initContentId==scon.contentId){
|
|
||||||
//定位当前学习的内容,是上一次学习的内容
|
|
||||||
playIndex=conIdx;
|
|
||||||
}else{
|
|
||||||
if(sconIdx==0 && con.contentType<52){
|
|
||||||
playIndex=conIdx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//console.log(scon.contentId,con.id);
|
|
||||||
con.lastStudyTime=scon.lastStudyTime;
|
|
||||||
con.status=9;//因为现在是只要有学习过的,就代表已学习完成,所以直接设置学习完成状态,
|
|
||||||
con.studyItemId=scon.id;//这个就是学习内容(条目)的id
|
|
||||||
//console.log(scon.id,"scon.id");
|
|
||||||
//console.log(con,"scon.id");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
//如果没有,就定位第一项内容
|
|
||||||
if(playIndex==-1){
|
|
||||||
this.showRes(this.contentList[0]);
|
|
||||||
}else{
|
|
||||||
this.showRes(this.contentList[playIndex]);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
// this.$message.error('您还未报名');
|
|
||||||
// if(this.courseInfo.type==10){
|
|
||||||
// location.href = this.webBaseUrl + "/course/micro?id="+this.courseId;
|
|
||||||
// }else{
|
|
||||||
// location.href = this.webBaseUrl + "/course/detail?id="+this.courseId;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$message.error(res.message);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
saveStudyInfo() { //记录课件学习信息
|
|
||||||
if(this.contentData.contentType>=60){
|
|
||||||
//只有在课件页面停留超过5秒才会记录
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(this.contentData.status==9){
|
|
||||||
//已学习完的,不用再添加
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let params ={
|
|
||||||
studyId: this.studyId,//学习id,
|
|
||||||
courseId: this.courseId,//课程id,
|
|
||||||
contentId: this.contentData.id,//内容id,
|
|
||||||
contentName: this.contentData.contentName,//内容名称
|
|
||||||
progress: 100,
|
|
||||||
contentTotal:this.totalContent
|
|
||||||
}
|
|
||||||
apiStudy.studyContent(params).then(res=>{
|
|
||||||
if(res.status == 200) {
|
|
||||||
this.contentData.status=9;//完成
|
|
||||||
this.contentData.studyItemId=res.result;//学习记录id
|
|
||||||
}else{
|
|
||||||
console.log('记录学习失败:'+res.message+','+res.error);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
ctabChange(e) {
|
ctabChange(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
},
|
},
|
||||||
@@ -439,91 +363,21 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// else if(r.contentType == 61) {// 考试
|
this.contentData = r;
|
||||||
|
|
||||||
// }else if(r.contentType == 60) {// 作业
|
|
||||||
|
|
||||||
// }else if(r.contentType == 62) {// 评估
|
|
||||||
// //评估不需要查找,因为内容就是content中
|
|
||||||
// console.log('评估处理');
|
|
||||||
// }
|
|
||||||
this.contentData = r;
|
|
||||||
// setTimeout(function(){$this.saveStudyInfo();},5000);//5秒后记录学习完成
|
|
||||||
|
|
||||||
},
|
},
|
||||||
videoEnd() {
|
videoEnd() {
|
||||||
//视频播放完成后的处理
|
|
||||||
},
|
},
|
||||||
handleChange(val) {
|
handleChange(val) {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
},
|
},
|
||||||
// loadScorePraiseAndTrample(){
|
|
||||||
// //加载是否请过分
|
|
||||||
// apiCourseGrade.has(this.courseId).then(rs=>{
|
|
||||||
// if(rs.status==200 && rs.result){
|
|
||||||
// this.scoreInfo.has=true;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// apiPraises.has(1,this.courseId).then(rs=>{
|
|
||||||
// if(rs.status==200 && rs.result){
|
|
||||||
// this.isPraise=true;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// apiTrample.has(this.courseId).then(rs=>{
|
|
||||||
// if(rs.status==200 && rs.result){
|
|
||||||
// this.isTrample=true;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
addScore(){
|
addScore(){
|
||||||
let postData={
|
|
||||||
courseId:this.courseInfo.id,
|
|
||||||
studyId:this.studyId,
|
|
||||||
score:this.scoreInfo.score
|
|
||||||
}
|
|
||||||
if(this.scoreInfo.score>0){
|
|
||||||
apiCourseGrade.grade(postData).then(rs=>{
|
|
||||||
if(rs.status==200){
|
|
||||||
this.$message.success('打分成功,谢谢您的打分');
|
|
||||||
this.scoreInfo.has=true;
|
|
||||||
}else{
|
|
||||||
this.$message.error('打分处理失败,请稍后再试');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
praiseContent(){
|
praiseContent(){
|
||||||
if(this.isTrample){
|
|
||||||
this.$message.error("您已踩过了,不能再赞了");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let postData={
|
|
||||||
objType:1,
|
|
||||||
objId:this.courseId,
|
|
||||||
title:this.courseInfo.name
|
|
||||||
}
|
|
||||||
apiPraises.save(postData).then(rs=>{
|
|
||||||
if(rs.status==200){
|
|
||||||
this.$message.success('点赞成功');
|
|
||||||
this.isPraise=true;
|
|
||||||
}else{
|
|
||||||
this.$message.error('点赞失败,请稍后再试');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
treadContent(){
|
treadContent(){
|
||||||
if(this.isPraise){
|
|
||||||
this.$message.error("您已赞过了,不能再踩了");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
apiTrample.trample(this.courseId).then(rs=>{
|
|
||||||
if(rs.status==200){
|
|
||||||
this.$message.success('已踩');
|
|
||||||
this.isTrample=true;
|
|
||||||
}else{
|
|
||||||
this.$message.error('踩失败,请稍后再试');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
loadAuthorInfo(list,ids){ //加载作者信息,头像,机构信息
|
loadAuthorInfo(list,ids){ //加载作者信息,头像,机构信息
|
||||||
if(ids.length==0){
|
if(ids.length==0){
|
||||||
@@ -564,7 +418,7 @@ img{
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
// display: -webkit-box;
|
// display: -webkit-box;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp: 1; /* 这里是超出几行省略 */
|
-webkit-line-clamp: 1; /* 这里是超出几行省略 */
|
||||||
}
|
}
|
||||||
@@ -615,7 +469,7 @@ word-break:break-all;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.collapse-title {
|
.collapse-title {
|
||||||
|
|
||||||
flex: 1 0 90%;
|
flex: 1 0 90%;
|
||||||
order: 1;
|
order: 1;
|
||||||
}
|
}
|
||||||
@@ -746,7 +600,7 @@ justify-content: space-between;
|
|||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
color: #5c5c5c;
|
color: #5c5c5c;
|
||||||
span{
|
span{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -975,7 +975,8 @@ export default {
|
|||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
.comment-content{
|
.comment-content{
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
word-break:break-all;
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
span{
|
span{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #409EFF
|
color: #409EFF
|
||||||
|
|||||||
@@ -449,17 +449,17 @@ export default {
|
|||||||
this.playerBoxShow = false;
|
this.playerBoxShow = false;
|
||||||
let $this=this;
|
let $this=this;
|
||||||
//console.log(this.contentData.status,'this.contentData.status');
|
//console.log(this.contentData.status,'this.contentData.status');
|
||||||
if(this.contentData.status<9){
|
// if(this.contentData.status<9){
|
||||||
let completeType=this.curriculumData.completeSetup;
|
// let completeType=this.curriculumData.completeSetup;
|
||||||
//console.log(completeType,'completeType');
|
// //console.log(completeType,'completeType');
|
||||||
if(completeType==0){
|
// if(completeType==0){
|
||||||
//默认5秒后学习完成.
|
// //默认5秒后学习完成.
|
||||||
$this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
|
// $this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
|
||||||
}else{
|
// }else{
|
||||||
//先记录进行中的学习内容
|
// //先记录进行中的学习内容
|
||||||
this.saveStudyItem();
|
// this.saveStudyItem();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
onPlayerPause() {
|
onPlayerPause() {
|
||||||
//console.log("暂停");
|
//console.log("暂停");
|
||||||
@@ -475,15 +475,15 @@ export default {
|
|||||||
this.appendStartTime=null;
|
this.appendStartTime=null;
|
||||||
//console.log("当前播放"+itme);
|
//console.log("当前播放"+itme);
|
||||||
//console.log("当前播放11"+itme);
|
//console.log("当前播放11"+itme);
|
||||||
if (this.contentData.contentType && this.contentData.contentType == 10) {
|
if (this.contentData.contentType && this.contentData.contentType == 10){
|
||||||
let intTime = parseInt(itme);
|
let intTime = parseInt(itme);
|
||||||
//判断是否完成
|
//判断是否完成
|
||||||
let completeType=this.curriculumData.completeSetup;
|
let completeType=this.curriculumData.completeSetup;
|
||||||
let completeSecond=this.curriculumData.second;
|
let completeSecond=this.curriculumData.second;
|
||||||
if(!completeSecond){
|
if(!completeSecond || completeType==0){
|
||||||
completeSecond=5;//如果没有就采用默认的时间了
|
completeSecond=5;//如果没有就采用默认的时间了
|
||||||
}
|
}
|
||||||
if(completeType>0 && this.contentData.status<9){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
|
if(this.contentData.status<9){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
|
||||||
if(completeType==1){
|
if(completeType==1){
|
||||||
let finishPercent=this.curriculumData.setupTage;
|
let finishPercent=this.curriculumData.setupTage;
|
||||||
let videDuration=this.contentData.duration;
|
let videDuration=this.contentData.duration;
|
||||||
@@ -491,7 +491,7 @@ export default {
|
|||||||
if(percent>=finishPercent){
|
if(percent>=finishPercent){
|
||||||
this.finishStudyItem();
|
this.finishStudyItem();
|
||||||
}
|
}
|
||||||
}else if(completeType==2){
|
}else{
|
||||||
if(intTime>=completeSecond){
|
if(intTime>=completeSecond){
|
||||||
this.finishStudyItem();
|
this.finishStudyItem();
|
||||||
}
|
}
|
||||||
@@ -520,10 +520,10 @@ export default {
|
|||||||
//判断是否完成
|
//判断是否完成
|
||||||
let completeType=this.curriculumData.completeSetup;
|
let completeType=this.curriculumData.completeSetup;
|
||||||
let completeSecond=this.curriculumData.second;
|
let completeSecond=this.curriculumData.second;
|
||||||
if(!completeSecond){
|
if(!completeSecond || completeType==0){
|
||||||
completeSecond=5;//如果没有就采用默认的时间了
|
completeSecond=5;//如果没有就采用默认的时间了
|
||||||
}
|
}
|
||||||
if(completeType>0 && this.contentData.status<9){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
|
if(this.contentData.status<9){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
|
||||||
if(completeType==1){
|
if(completeType==1){
|
||||||
let finishPercent=this.curriculumData.setupTage;
|
let finishPercent=this.curriculumData.setupTage;
|
||||||
let videDuration=this.contentData.duration;
|
let videDuration=this.contentData.duration;
|
||||||
@@ -531,7 +531,7 @@ export default {
|
|||||||
if(percent>=finishPercent){
|
if(percent>=finishPercent){
|
||||||
this.finishStudyItem();
|
this.finishStudyItem();
|
||||||
}
|
}
|
||||||
}else if(completeType==2){
|
}else{
|
||||||
if(intTime>=completeSecond){
|
if(intTime>=completeSecond){
|
||||||
this.finishStudyItem();
|
this.finishStudyItem();
|
||||||
}
|
}
|
||||||
@@ -556,16 +556,16 @@ export default {
|
|||||||
audioPlay() {
|
audioPlay() {
|
||||||
//console.log("开始播放");
|
//console.log("开始播放");
|
||||||
let $this=this;
|
let $this=this;
|
||||||
if(this.contentData.status!=9){
|
// if(this.contentData.status!=9){
|
||||||
let completeType=this.curriculumData.completeSetup;
|
// let completeType=this.curriculumData.completeSetup;
|
||||||
if(completeType==0){
|
// if(completeType==0){
|
||||||
//默认5秒后学习完成.
|
// //默认5秒后学习完成.
|
||||||
$this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
|
// $this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
|
||||||
}else{
|
// }else{
|
||||||
//先记录进行中的学习内容
|
// //先记录进行中的学习内容
|
||||||
this.saveStudyItem();
|
// this.saveStudyItem();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
audioPause() {
|
audioPause() {
|
||||||
//console.log("暂停");
|
//console.log("暂停");
|
||||||
|
|||||||
Reference in New Issue
Block a user