mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
自动报名
This commit is contained in:
@@ -66,6 +66,9 @@ const countSignup = function(courseId) {
|
|||||||
return ajax.post('/xboe/school/study/signup/count-by-course',{courseId});
|
return ajax.post('/xboe/school/study/signup/count-by-course',{courseId});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const studyIndex = function(courseId) {
|
||||||
|
return ajax.get('/xboe/school/study/course/studyIndex?cid='+courseId+'&addView=true');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 课程学习,根据课程id来获取,
|
* 课程学习,根据课程id来获取,
|
||||||
@@ -374,6 +377,7 @@ export default {
|
|||||||
deleteSignup,
|
deleteSignup,
|
||||||
importSignup,
|
importSignup,
|
||||||
countSignup,
|
countSignup,
|
||||||
|
studyIndex,
|
||||||
studyInfo,
|
studyInfo,
|
||||||
studyVideoTime,
|
studyVideoTime,
|
||||||
lastStudy,
|
lastStudy,
|
||||||
|
|||||||
@@ -52,12 +52,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="last-study-info">
|
<div class="last-study-info">
|
||||||
<div class="one-line-ellipsis">
|
<div class="one-line-ellipsis" style="color: #000000;">
|
||||||
<router-link :to="'/course/studyindex?id='+lastStudy.courseId" >最近学习:{{lastStudy.courseName}} </router-link>
|
<router-link :to="'/course/studyindex?id='+lastStudy.courseId" >最近学习: {{lastStudy.courseName}} </router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="tobe-icon">
|
<!-- <div class="tobe-icon">
|
||||||
<img :src="`${webBaseUrl}/images/homeWu/Pending.png`" alt="">
|
<img :src="`${webBaseUrl}/images/homeWu/Pending.png`" alt="">
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<ul class="personal-ul">
|
<ul class="personal-ul">
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -85,6 +85,7 @@
|
|||||||
<div class="course-card-favorite">
|
<div class="course-card-favorite">
|
||||||
<interactBar :type="1" nodeWidth="20px" :data="cinfo" :courseExclusive="true" :comments="false" :praises="false" :shares="false" :views="false"></interactBar>
|
<interactBar :type="1" nodeWidth="20px" :data="cinfo" :courseExclusive="true" :comments="false" :praises="false" :shares="false" :views="false"></interactBar>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <a :href="toCourseDetail(cinfo)"> -->
|
||||||
<a :href="toCourseDetail(cinfo)">
|
<a :href="toCourseDetail(cinfo)">
|
||||||
<div class="course-image-box">
|
<div class="course-image-box">
|
||||||
<course-image :course="cinfo"></course-image>
|
<course-image :course="cinfo"></course-image>
|
||||||
@@ -291,6 +292,7 @@ import portalFloatTools from "@/components/PortalFloatTools.vue";
|
|||||||
import authorInfo from "@/components/Portal/authorInfo.vue";
|
import authorInfo from "@/components/Portal/authorInfo.vue";
|
||||||
import courseItem from "@/components/Portal/course/courseItem.vue";
|
import courseItem from "@/components/Portal/course/courseItem.vue";
|
||||||
import apiCoursePortal from "@/api/modules/coursePortal.js";
|
import apiCoursePortal from "@/api/modules/coursePortal.js";
|
||||||
|
import apiCourseStudy from "@/api/modules/courseStudy.js";
|
||||||
import courseForm from "@/components/Course/courseForm.vue";
|
import courseForm from "@/components/Course/courseForm.vue";
|
||||||
import apiType from "@/api/modules/type.js";
|
import apiType from "@/api/modules/type.js";
|
||||||
import apiCourse from "@/api/modules/coursePortal.js";
|
import apiCourse from "@/api/modules/coursePortal.js";
|
||||||
@@ -536,16 +538,24 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
toCourseDetail(item) {
|
toCourseDetail(item) {
|
||||||
|
let $this=this;
|
||||||
if (item.source == 1) {
|
if (item.source == 1) {
|
||||||
return `${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.type}`;
|
return `${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.type}`;
|
||||||
//此处使用window.open有问题
|
//此处使用window.open有问题
|
||||||
//window.open(`${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.type}`);
|
//window.open(`${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.type}`);
|
||||||
} else {
|
} else {
|
||||||
// if (item.type == 10) {
|
if (item.type == 10) {
|
||||||
// return this.webBaseUrl + "/course/micro?id=" + item.id;
|
return this.webBaseUrl + "/course/studyindex?id=" + item.id;
|
||||||
// } else if (item.type == 20) {
|
} else if (item.type == 20) {
|
||||||
return this.webBaseUrl + "/course/detail?id=" + item.id;
|
// apiCourseStudy.hasSignup(item.id).then(rs=>{
|
||||||
// }
|
// if(rs.status==200){
|
||||||
|
// return $this.webBaseUrl + "/course/studyindex?id=" + item.id;
|
||||||
|
// }else{
|
||||||
|
// return $this.webBaseUrl + "/course/detail?id=" + item.id;
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
return $this.webBaseUrl + "/course/detail?id=" + item.id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -1023,16 +1023,16 @@
|
|||||||
},
|
},
|
||||||
loadData() {
|
loadData() {
|
||||||
let $this=this;
|
let $this=this;
|
||||||
apiCoursePortal.detail(this.courseId, false).then(rs => {
|
apiStudy.studyIndex(this.courseId).then(rs => {
|
||||||
if (rs.status == 200) {
|
if (rs.status == 200) {
|
||||||
if(rs.result.contents.length==0){
|
if(rs.result.contents.length==0){
|
||||||
$this.$message.error('课程内容已删除或课程已不再使用');
|
$this.$message.error('课程内容已删除或课程已不再使用');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if(!rs.result.course.enabled){
|
if(!rs.result.course.enabled){
|
||||||
// $this.$message.error('十分抱歉,此课程已停用,如需使用,请联系管理员。');
|
$this.$message.error('十分抱歉,此课程已停用,如需使用,请联系管理员。');
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
//设置必须的字段
|
//设置必须的字段
|
||||||
if(rs.result.contents.length==1){
|
if(rs.result.contents.length==1){
|
||||||
$this.tab=2;
|
$this.tab=2;
|
||||||
@@ -1105,81 +1105,61 @@
|
|||||||
//处理内容的名称
|
//处理内容的名称
|
||||||
this.totalContent = rs.result.contents.length;
|
this.totalContent = rs.result.contents.length;
|
||||||
//加载学习的数据
|
//加载学习的数据
|
||||||
this.loadStudyData();
|
//this.loadStudyData();
|
||||||
|
this.loadStudyData(rs.result);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(rs.message);
|
this.$message.error(rs.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadStudyData() {
|
loadStudyData(result) {
|
||||||
let $this = this;
|
let $this=this;
|
||||||
apiStudy.studyInfo(this.courseId).then(res => {
|
this.loadScorePraiseAndTrample();
|
||||||
if (res.status == 200) {
|
this.studyId = result.studyId;
|
||||||
if (res.result.signup) {
|
//对已学习的内容进行比对,重要的字段, 学习内容id,在后缀的
|
||||||
this.loadScorePraiseAndTrample();
|
let playIndex = -1;
|
||||||
this.studyId = res.result.studyId;
|
this.contentList.forEach((con, conIdx) => {
|
||||||
//对已学习的内容进行比对,重要的字段, 学习内容id,在后缀的
|
result.contentStudys.forEach((scon, sconIdx) => {
|
||||||
let playIndex = -1;
|
if (scon.contentId == con.id) {
|
||||||
this.contentList.forEach((con, conIdx) => {
|
//定位显示的内容
|
||||||
res.result.contents.forEach((scon, sconIdx) => {
|
if ($this.initContentId != '' && $this.initContentId == scon.contentId) {
|
||||||
if (scon.contentId == con.id) {
|
//定位当前学习的内容,是上一次学习的内容
|
||||||
//定位显示的内容
|
playIndex = conIdx;
|
||||||
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;
|
|
||||||
//以下判断是为了兼容之前的问题,学习状态
|
|
||||||
if (scon.status) {
|
|
||||||
con.status = scon.status;
|
|
||||||
} else {
|
|
||||||
con.status = 9;
|
|
||||||
}
|
|
||||||
con.studyItemId = scon.id; //这个就是学习内容(条目)的id
|
|
||||||
//console.log(scon.id,"scon.id");
|
|
||||||
//console.log(con,"scon.id");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.courseInfo.type == 10) {
|
|
||||||
///console.log(this.contentList[0],'ccccc11111')
|
|
||||||
this.showRes(this.contentList[0]);
|
|
||||||
} else {
|
} else {
|
||||||
//如果没有,就定位第一项内容
|
if (sconIdx == 0 && con.contentType < 52) {
|
||||||
if (playIndex === -1) {
|
playIndex = conIdx;
|
||||||
// this.showRes(this.contentList[0]);
|
|
||||||
//console.log(this.catalogTree,'ccccc22222')
|
|
||||||
this.showRes(this.catalogTree[0].children[0])
|
|
||||||
} else {
|
|
||||||
//console.log(this.contentList[0],'ccccc3333')
|
|
||||||
this.showRes(this.contentList[playIndex]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//console.log(scon.contentId,con.id);
|
||||||
} else {
|
con.lastStudyTime = scon.lastStudyTime;
|
||||||
if(!$this.courseInfo.enabled || $this.courseInfo.deleted){
|
//以下判断是为了兼容之前的问题,学习状态
|
||||||
$this.$message.error('十分抱歉,此课程已停用,如需使用,请联系管理员。');
|
if (scon.status) {
|
||||||
location.href = this.webBaseUrl + '/course/detail?id=' + this.courseId;
|
con.status = scon.status;
|
||||||
}else{
|
} else {
|
||||||
this.$message.error('您还未报名');
|
con.status = 9;
|
||||||
// if (this.courseInfo.type == 10) {
|
|
||||||
// location.href = this.webBaseUrl + '/course/micro?id=' + this.courseId;
|
|
||||||
// } else {
|
|
||||||
location.href = this.webBaseUrl + '/course/detail?id=' + this.courseId;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
con.studyItemId = scon.id; //这个就是学习内容(条目)的id
|
||||||
|
//console.log(scon.id,"scon.id");
|
||||||
|
//console.log(con,"scon.id");
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
this.$message.error(res.message);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.courseInfo.type == 10) {
|
||||||
|
///console.log(this.contentList[0],'ccccc11111')
|
||||||
|
this.showRes(this.contentList[0]);
|
||||||
|
} else {
|
||||||
|
//如果没有,就定位第一项内容
|
||||||
|
if (playIndex === -1) {
|
||||||
|
// this.showRes(this.contentList[0]);
|
||||||
|
//console.log(this.catalogTree,'ccccc22222')
|
||||||
|
this.showRes(this.catalogTree[0].children[0])
|
||||||
|
} else {
|
||||||
|
//console.log(this.contentList[0],'ccccc3333')
|
||||||
|
this.showRes(this.contentList[playIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
saveStudyInfo() {
|
saveStudyInfo() {
|
||||||
//记录课件学习信息
|
//记录课件学习信息
|
||||||
|
|||||||
Reference in New Issue
Block a user