|
@@ -3732,6 +3732,10 @@
|
|
<span>禁止学生查看所有阶段</span>
|
|
<span>禁止学生查看所有阶段</span>
|
|
<el-switch v-model="IsLookOpen" active-text="" class="switchCss" @change="updateLookOpen"></el-switch>
|
|
<el-switch v-model="IsLookOpen" active-text="" class="switchCss" @change="updateLookOpen"></el-switch>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="switch_box" v-if="courseDetail.userid == userid">
|
|
|
|
+ <span>开启跟随模式</span>
|
|
|
|
+ <el-switch v-model="IsFollow" active-text="" class="switchCss" @change="updateFollow"></el-switch>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
@@ -4882,6 +4886,7 @@ export default {
|
|
full: false,
|
|
full: false,
|
|
sIsOpen: false,
|
|
sIsOpen: false,
|
|
IsLookOpen: false,
|
|
IsLookOpen: false,
|
|
|
|
+ IsFollow:false,
|
|
pzDialog: false,
|
|
pzDialog: false,
|
|
contentDialog: false,
|
|
contentDialog: false,
|
|
mlDialog: false,
|
|
mlDialog: false,
|
|
@@ -7426,6 +7431,10 @@ export default {
|
|
window.parent.postMessage({ allScreen: this.screenType }, "*");
|
|
window.parent.postMessage({ allScreen: this.screenType }, "*");
|
|
},
|
|
},
|
|
nextOrpreSteps(t) {
|
|
nextOrpreSteps(t) {
|
|
|
|
+ if(this.IsFollow && this.courseDetail.userid != this.userid){
|
|
|
|
+ this.$message.error('已经开启跟随模式,请认真跟堂听讲')
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
var b = this.chapInfoList.length - 1;
|
|
var b = this.chapInfoList.length - 1;
|
|
if (t == 0) {
|
|
if (t == 0) {
|
|
if (this.courseType == 0) {
|
|
if (this.courseType == 0) {
|
|
@@ -7580,6 +7589,10 @@ export default {
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
openTask(s, n, i) {
|
|
openTask(s, n, i) {
|
|
|
|
+ if(this.IsFollow && this.courseDetail.userid != this.userid){
|
|
|
|
+ this.$message.error('已经开启跟随模式,请认真跟堂听讲')
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (this.IsLookOpen) {
|
|
if (this.IsLookOpen) {
|
|
if (
|
|
if (
|
|
!this.chapInfoList[s].chapterInfo[0].taskJson[n].isLook &&
|
|
!this.chapInfoList[s].chapterInfo[0].taskJson[n].isLook &&
|
|
@@ -7654,6 +7667,10 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
get(i) {
|
|
get(i) {
|
|
|
|
+ if(this.IsFollow && this.courseDetail.userid != this.userid){
|
|
|
|
+ this.$message.error('已经开启跟随模式,请认真跟堂听讲')
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.navList[i].isOpen = !this.navList[i].isOpen;
|
|
this.navList[i].isOpen = !this.navList[i].isOpen;
|
|
},
|
|
},
|
|
addQuestion() {
|
|
addQuestion() {
|
|
@@ -7955,6 +7972,9 @@ export default {
|
|
this.selectStudent();
|
|
this.selectStudent();
|
|
this.selectSWorks(gindex);
|
|
this.selectSWorks(gindex);
|
|
this.selectSLook();
|
|
this.selectSLook();
|
|
|
|
+ if(this.courseDetail.userid == this.userid && this.IsFollow){
|
|
|
|
+ this.setCTask();
|
|
|
|
+ }
|
|
let _this = this;
|
|
let _this = this;
|
|
if (_this.timer) {
|
|
if (_this.timer) {
|
|
clearInterval(_this.timer);
|
|
clearInterval(_this.timer);
|
|
@@ -8099,6 +8119,48 @@ export default {
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ updateFollow(){
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ sopen: this.IsFollow == false ? 1 : 2,
|
|
|
|
+ cid: this.id,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "updateCourseFollow", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (this.IsFollow == true) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "开启成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "关闭成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.setCTask();
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ setCTask(){
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ sopen: this.courseType + '-' + this.taskCount,
|
|
|
|
+ cid: this.id,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "updateCourseFollowC", params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
updateLookOpen() {
|
|
updateLookOpen() {
|
|
let params = [
|
|
let params = [
|
|
{
|
|
{
|
|
@@ -8138,11 +8200,24 @@ export default {
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
|
|
this.sIsOpen = res.data[0][0].sopen == 1 ? false : true;
|
|
this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
|
|
this.IsLookOpen = res.data[0][0].look == 1 ? false : true;
|
|
|
|
+ this.IsFollow = res.data[0][0].follow == 1 ? false : true;
|
|
if (!this.IsLookOpen) {
|
|
if (!this.IsLookOpen) {
|
|
this.setNavList();
|
|
this.setNavList();
|
|
} else {
|
|
} else {
|
|
this.getCourseState(1);
|
|
this.getCourseState(1);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(this.IsFollow && this.courseDetail.userid != this.userid){
|
|
|
|
+ let _followC = res.data[0][0].followC.split('-')
|
|
|
|
+ if(this.courseType != _followC[0] || this.taskCount != _followC[1]){
|
|
|
|
+ this.navList[this.courseType].isOpen = false;
|
|
|
|
+ this.courseType = _followC[0]
|
|
|
|
+ this.navList[this.courseType].isOpen = true;
|
|
|
|
+ this.taskCount = parseInt(_followC[1])
|
|
|
|
+ this.navId = res.data[0][0].followC;
|
|
|
|
+ this.getCourseDetail()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
console.error(err);
|
|
console.error(err);
|