@@ -135,14 +130,14 @@
-
+
{{courseInfo.praises}}
-
+
@@ -155,47 +150,22 @@
{{courseInfo.name}}
{{courseInfo.studys}}人学习
-
-
录播课
{{item}}
-
-
{{toScore(courseInfo.score)}}分
未评分
-
-
-
-
-
-
-
-
-
-
@@ -233,12 +203,9 @@
@@ -264,23 +231,13 @@ import portalHeader from "@/components/PortalHeader.vue";
import comments from "@/components/Portal/comments.vue";
import portalFooter from "@/components/PortalFooter.vue";
import interactBar from "@/components/Portal/interactBar.vue";
-import apiCourse from "@/api/modules/course.js";
import apiCourseFile from "@/api/modules/courseFile.js";
import apiCoursePortal from "@/api/modules/coursePortal.js";
import apiUser from '@/api/system/user.js';
import exam from '@/components/Course/exam';
import homework from '@/components/Course/homework';
import assess from '@/components/Course/assess';
-import {
- formatDate,
- resListMap,
- toScore,
- courseType,
- getType,
- numberToLetter,
- correctJudgment,
- userAvatarText
-} from "@/utils/tools.js";
+import {toScore,courseType, getType, numberToLetter, correctJudgment,userAvatarText} from "@/utils/tools.js";
import apicourseStudy from "@/api/modules/courseStudy.js";
import apiVideoStudy from "@/api/modules/videoStudy.js";
import apiCourseGrade from "@/api/modules/courseGrade.js";
@@ -288,7 +245,6 @@ import apiPraises from "@/api/modules/praises.js";
import apiTrample from "@/api/modules/trample.js";
import FileUpload from "@/components/FileUpload/index.vue";
import pdfPreview from "@/components/PdfPreview/index.vue";
-// import {resOwnerIndexName} from '@/utils/type.js';
import { setTimeout } from "timers";
import videoPlayer from '@/components/VideoPlayer/index.vue';
import audioPlayer from '@/components/AudioPlayer/index.vue';
@@ -330,7 +286,6 @@ export default {
studyId: "",
tags: [],
numberToLetter: numberToLetter,
- // resOwnerListMap: resOwnerIndexName,
fileBaseUrl: this.$Constants.fileBaseUrl,
blobUrl:'',//播放的文件地址,新添加,采用blob方式
getType: getType,
@@ -401,20 +356,18 @@ export default {
};
},
mounted() {
+ let id = this.$route.query.id;
+ this.courseInfo.id = id;
this.showQrimage();
this.$watermark.set(this.userInfo.name+this.userInfo.loginName);
this.loadResOwners();
- let id = this.$route.query.id;
- this.courseInfo.id = id;
let $this = this;
//页面只支取一次,所以先直接写在这里面
- apiCoursePortal.detail(id).then(rs => {
+ apiCoursePortal.detail(id,false).then(rs => {
if (rs.status == 200) {
this.courseInfo = rs.result.course;
- // this.courseInfo.score = this.toScore(rs.result.course.score);
if(rs.result.course.tags != '') this.tags = rs.result.course.tags.split(",");
this.teachers = rs.result.teachers;
-
if(rs.result.teachers && rs.result.teachers.length > 0){
let userIds=[];
let ctoUsers=[];
@@ -447,7 +400,6 @@ export default {
}
//对url进行加密处理
$this.createPlayUrl(con.contentRefId,this.curriculumData.url);
-
} else if (con.contentType == 40) {
//需要读取pdf的路径
apiCourseFile.detail($this.coursewareInfo.content.contentRefId).then(cfrs=>{
@@ -460,12 +412,10 @@ export default {
$this.coursewareInfo.content.content=cfrs.result.filePath;
$this.curCFile=2;
}
-
}else{
$this.$message.error('加载pdf课件文件失败');
}
});
- //let url = this.fileBaseUrl + r.content;
}else if(con.contentType ==52){
if(con.content.startsWith('\{')){
this.conLink=JSON.parse(con.content);
@@ -497,6 +447,9 @@ export default {
//study info
this.loadStudyInfo();
} else {
+ if(rs.status==204){ //无查看此课程的权限
+ this.courseInfo.name=rs.result.course.name;
+ }
this.$message.error(rs.message);
}
});
@@ -506,9 +459,7 @@ export default {
let nowDate=new Date();
let ctime=parseInt(nowDate.getTime()/1000);
let beforeUrl=parseInt(nowDate.getTime()/1000)+'/'+fid;
- //console.log(beforeUrl,'beforeUrl');
let urlSign=encodeURIComponent(encrypt(beforeUrl));
- //console.log(urlSign,'urlSign');
cookies.set('PLAYSIGN_TIME', ctime);//写客户端的cookie保存
//以下判断是为了区分本地环境和服务器环境
if(process.env.NODE_ENV == 'development'){
@@ -521,21 +472,22 @@ export default {
let urlPre=window.location.protocol+'//'+window.location.host;
// https://u.boe.com/mobile/pages/resource/microDetail?id=963456709515939840
// this.qrcode = this.webBaseUrl+'/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
- this.qrcode =urlPre+ '/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
- //console.log(this.qrcode,'qrcode');
+ urlPre='https://u.boe.com/m?returnUrl=https://u.boe.com/mobile/pages/login/loading?returnUrl=';
+ this.qrcode =urlPre+ '/pages/resource/microDetail?id='+this.courseInfo.id;
this.$nextTick(() => {
this.crateQrcode();
});
},
crateQrcode(){
this.qr = new QRCode('qrcode', {
- width: 80,
- height: 80, // 高度
+ width: 150,
+ height: 150, // 高度
text: this.qrcode // 二维码内容
// render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
// background: '#f0f'
// foreground: '#ff0'
});
+ this.qr._el.title = '';
},
...mapActions({
getResOwnerTree:'resOwner/getResOwnerTree',
@@ -630,11 +582,9 @@ export default {
this.playerBoxShow = false;
//console.log("开始播放");
this.isAppendTime=false;
-
//视频类的内容,开始播放时才会记录完成情况
//2022-05-24修改,判断播放的
let $this=this;
- //console.log(this.curriculumData,'this.curriculumData');
//完成类型 completeSetup 0表默认,打开后5秒算学完,1表按进度,2表按时间
//完成值(非默认情况下起作用) setupTage
if(!$this.coursewareInfo.finish){
@@ -673,7 +623,6 @@ export default {
if(!completeSecond){
completeSecond=5;//如果没有就采用默认的时间了
}
-
if(completeType>0 && !this.coursewareInfo.finish){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
if(completeType==1){
let finishPercent=this.curriculumData.setupTage;
@@ -687,7 +636,6 @@ export default {
this.finishStudyItem();
}
}
-
}
//以下是每10秒记录一次学习时长
let saveTime=Math.floor(intTime%10);
@@ -708,14 +656,12 @@ export default {
},
audioPlaying(item,currentTime){
let intTime=parseInt(currentTime);//秒
- //console.log("当前播放时间="+item+',currentTime='+intTime);
//判断是否完成
let completeType=this.curriculumData.completeSetup;
let completeSecond=this.curriculumData.second;
if(!completeSecond){
completeSecond=5;//如果没有就采用默认的时间了
}
-
if(completeType>0 && !this.coursewareInfo.finish){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
if(completeType==1){
let finishPercent=this.curriculumData.setupTage;
@@ -767,7 +713,6 @@ export default {
},
audioEnd(){
// this.playerBoxShow = true;
- //console.log("播放结束");
if(!this.coursewareInfo.finish){
this.finishStudyItem();
}
@@ -879,7 +824,6 @@ export default {
//首先从本地读取
let duration=studyUtil.getStudyDuration();
-
//追加学习时间
let $this = this;
if(this.appendStartTime == null) {
@@ -890,14 +834,10 @@ export default {
}
return;
}
-
//当前进行的时间
let now = new Date();
let m = now.getTime() - this.appendStartTime.getTime(); //相差的毫秒数
let sen = parseInt(m / 1000); //计算秒数
-
- //console.log(duration,'duration')
- //console.log(sen,'sen')
duration=duration+sen;
if(flag){
//这个时候才进行存储 ,否则只能是存储在本地
@@ -940,14 +880,12 @@ export default {
if(res.result.signup) {
//this.bootTabActive = 'commnets';//系统自动报名,这里不进行切换了
this.studyId = res.result.studyId; //设置学习id
-
//需要判断此内容是否已学习完成,如果已学习完成,不需要再请不说了
res.result.contents.forEach(con => {
if (con.contentId == $this.coursewareInfo.content.id) {
$this.coursewareInfo.studyItemId=con.id;
$this.coursewareInfo.status=con.status;
$this.coursewareInfo.progress=con.progress;
-
if(con.contentType==10 || con.contentType==20){
if(con.progress==100 || con.status==9){
$this.coursewareInfo.finish = true;
@@ -957,7 +895,6 @@ export default {
}else{
$this.coursewareInfo.finish = true; //课件已学习
}
-
if(con.lastStudyTime){
//如果上次课件已经播放完成,此处应该是$this.coursewareInfo.content.duration
//也就是从头开开始
@@ -1025,7 +962,6 @@ export default {
if (rs.status == 200 && rs.result) {
this.scoreInfo.has = true;
}
- //console.log(rs.result,'rs.result');
});
//}
apiPraises.has(1, this.courseInfo.id).then(rs => {
@@ -1180,12 +1116,8 @@ export default {
background: none;
border: none;
}
-
-
.player-box{
position: absolute;
- // top: 62px;
- // left: 184px;
width: 300px;
left: 50%;
top: 50%;
@@ -1207,46 +1139,23 @@ export default {
}
}
::v-deep .el-tabs__nav-wrap::after {
- // content: "";
- // position: absolute;
- // left: 0;
- // bottom: 0;
- // width: 100%;
- // height: 2px;
background-color: #fff;
- // z-index: 1;
}
::v-deep .el-tabs__nav-wrap::after {
- // content: "";
- // position: absolute;
- // left: 0;
- // bottom: 0;
- // width: 100%;
- // height: 2px;
background-color: #fff;
- // z-index: 1;
}
.qrcode{
display: inline-block;
img {
- width: 132px;
- height: 132px;
+ width: 200px;
+ height: 200px;
background-color: #fff; //设置白色背景色
padding: 6px; // 利用padding的特性,挤出白边
box-sizing: border-box;
}
}
.ref-score{
- // background: #e4e4e4;
- // width: 64px;
- // height: 32px;
- // border-radius: 17px;
- // line-height: 32px;
- // // opacity: 0.24;
- // color: #000;
- // font-size: 14px;
- // border: none;
- // text-align: center;
+
}
.portal-content ::v-deep .el-rate__icon{
font-size: 24px !important;
@@ -1389,13 +1298,6 @@ export default {
transform: rotate(180deg);
}
}
- // margin-bottom: 50px;
- // line-height: 20px;
- // .el-link{
- // font-size: 30px;
- // color: #70a5f4;
- // margin: 0 30px;
- // }
}
}
}
@@ -1413,9 +1315,7 @@ export default {
color: #FFB30F ;
font-family: "Arial";
margin-left: 23px;
- // font-weight: 600;
}
- // margin-bottom: 19px;
.score-no{
color: #FFB30F;
padding: 5px 0;
diff --git a/src/views/portal/course/microPreview.vue b/src/views/portal/course/microPreview.vue
index dacd0b61..a8fa2ceb 100644
--- a/src/views/portal/course/microPreview.vue
+++ b/src/views/portal/course/microPreview.vue
@@ -96,13 +96,10 @@
上传作业
-
- 作业附件请点击下面的提交
-
-
+
+
-
+
-->
@@ -302,7 +298,7 @@
@@ -481,13 +477,14 @@ export default {
};
},
mounted() {
- this.showQrimage();
+
this.loadResOwners();
let id = this.$route.query.id;
this.courseInfo.id = id;
+ this.showQrimage();
let $this = this;
//页面只支取一次,所以先直接写在这里面
- apiCoursePortal.detail(id).then(rs => {
+ apiCoursePortal.detail(id,true).then(rs => {
if (rs.status == 200) {
console.log(rs,'2')
this.courseInfo = rs.result.course;
@@ -550,8 +547,7 @@ export default {
$this.loadAssessInfo();
}
});
- //study info
- // this.loadStudyInfo();
+
} else {
this.$message.error(rs.message);
}
@@ -561,7 +557,7 @@ export default {
showQrimage(row){
this.qrcode = this.webBaseUrl+'/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
this.$nextTick(() => {
- this.crateQrcode();
+ //this.crateQrcode();
});
},
crateQrcode(){
@@ -605,21 +601,6 @@ export default {
//console.log("当前播放11"+itme);
let intTime=parseInt(itme);
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){
//console.log("当前播放22"+item);
@@ -651,11 +632,7 @@ export default {
studyId: this.studyId,
contentId: this.homeworkInfo.content.id
};
- // apicourseStudy.myHomeworkList(params).then(rs => {
- // if (rs.status == 200) {
- // this.homeworkInfo.records = rs.result;
- // }
- // });
+
}
} else if (tab.name == "test") {
if (this.examInfo.records.length == 0) {
@@ -663,17 +640,6 @@ export default {
studyId: this.studyId,
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") {
//console.log('加载评估信息');,评估只会有一个,所以主直接取
@@ -681,22 +647,8 @@ export default {
studyId: this.studyId,
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 {
- //在课件页面,记录开始时间
- //console.log('记录课件学习信息');
- if(!this.coursewareInfo.finish){
- setTimeout(() => {$this.saveStudyInfo();}, 5000);
- }
+
}
},
saveStudyInfo() {
@@ -708,102 +660,20 @@ export default {
if (this.coursewareInfo.finish) {
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() {
this.examInfo.startTime = new Date();
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() {
- 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) {
//显示试卷的答卷信息
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) {
//此方法移到tools中
@@ -826,145 +696,9 @@ export default {
this.homeworkInfo.filePath = res.result.filePath;
},
removeHomeworkFile() {
- this.$confirm("您确定要删除已上传的附件吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.homeworkInfo.filePath = "";
- //从服务器端删除
- this.$message({ type: "success", message: "删除成功!" });
- });
+
},
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() {
apiCourse.getHomework(this.homeworkInfo.content.id).then(res => {
@@ -1018,137 +752,19 @@ export default {
signType: 1,
signInfo: ""
};
- let $this = this;
- // 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);
- }
- });
+ this.enrollStutas = 2;
},
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() {
- 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() {
- 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() {
- 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){ //加载作者信息,头像,机构信息
if(ids.length==0){
@@ -1164,13 +780,13 @@ export default {
// this.tearsex = item.sex;
console.log(this.tearsex)
console.log(author.sex,item.sex,'sexs')
-
+
// console.log(item.sex)
if(author.avatar){
item.avatar=this.fileBaseUrl + author.avatar;
-
+
}
-
+
return true;
}else{
@@ -1432,7 +1048,7 @@ export default {
.num {
color: #444444;
font-size: 16px;
-
+
}
margin-bottom: 15px;
}
diff --git a/src/views/portal/course/rePreview.vue b/src/views/portal/course/rePreview.vue
index e270f2e3..57a034f9 100644
--- a/src/views/portal/course/rePreview.vue
+++ b/src/views/portal/course/rePreview.vue
@@ -58,7 +58,7 @@
新窗口打开
-->
@@ -265,26 +265,26 @@ export default {
//console.log("播放结束");
},
onPlayerPlaying(itme){
- //console.log("当前播放"+itme);
- //console.log("当前播放11"+itme);
- if(this.contentData.contentType && this.contentData.contentType==10){
- let intTime=parseInt(itme);
- this.contentData.lastStudyTime=intTime;
- let saveTime=Math.floor(intTime%10);
- if(intTime>10 && saveTime==0 && this.contentData.studyItemId!=''){
- //记录播放时间
- //console.log('记录播放时间:'+intTime);
- let postData={
- itemId:this.contentData.studyItemId,
- videoTime:intTime
- }
- apiStudy.studyVideoTime(postData).then(rs=>{
- if(rs.status!=200){
- console.log('记录播放时间错误');
- }
- })
- }
- }
+ // //console.log("当前播放"+itme);
+ // //console.log("当前播放11"+itme);
+ // if(this.contentData.contentType && this.contentData.contentType==10){
+ // let intTime=parseInt(itme);
+ // this.contentData.lastStudyTime=intTime;
+ // let saveTime=Math.floor(intTime%10);
+ // if(intTime>10 && saveTime==0 && this.contentData.studyItemId!=''){
+ // //记录播放时间
+ // //console.log('记录播放时间:'+intTime);
+ // let postData={
+ // itemId:this.contentData.studyItemId,
+ // videoTime:intTime
+ // }
+ // apiStudy.studyVideoTime(postData).then(rs=>{
+ // if(rs.status!=200){
+ // console.log('记录播放时间错误');
+ // }
+ // })
+ // }
+ // }
},
audioPlaying(item){
@@ -300,7 +300,7 @@ export default {
//console.log("播放结束");
},
loadData() {
- apiCoursePortal.detail(this.courseId).then(rs=>{
+ apiCoursePortal.detail(this.courseId,true).then(rs=>{
if(rs.status==200){
//设置必须的字段
rs.result.sections.forEach(sec=>{
@@ -327,88 +327,12 @@ export default {
}
this.contentList=rs.result.contents;
this.totalContent=rs.result.contents.length;
- //加载学习的数据
- this.loadStudyData();
+
}else{
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) {
console.log(e);
},
@@ -439,91 +363,21 @@ export default {
}
}
- // else if(r.contentType == 61) {// 考试
-
- // }else if(r.contentType == 60) {// 作业
-
- // }else if(r.contentType == 62) {// 评估
- // //评估不需要查找,因为内容就是content中
- // console.log('评估处理');
- // }
- this.contentData = r;
- // setTimeout(function(){$this.saveStudyInfo();},5000);//5秒后记录学习完成
-
+ this.contentData = r;
},
videoEnd() {
- //视频播放完成后的处理
},
handleChange(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(){
- 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(){
- 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(){
- 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){ //加载作者信息,头像,机构信息
if(ids.length==0){
@@ -564,7 +418,7 @@ img{
white-space: nowrap;
word-break: break-all;
text-overflow: ellipsis;
- // display: -webkit-box;
+ // display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1; /* 这里是超出几行省略 */
}
@@ -615,7 +469,7 @@ word-break:break-all;
}
}
.collapse-title {
-
+
flex: 1 0 90%;
order: 1;
}
@@ -746,7 +600,7 @@ justify-content: space-between;
padding-left: 20px;
color: #5c5c5c;
span{
-
+
}
}
}
diff --git a/src/views/portal/qa/Answer.vue b/src/views/portal/qa/Answer.vue
index 6e12204a..70961039 100644
--- a/src/views/portal/qa/Answer.vue
+++ b/src/views/portal/qa/Answer.vue
@@ -1,230 +1,279 @@