read(row) {
this.open = true;
console.log("row", row.coursewareid);
console.log(row);
this.id = row.id;
this.status = row.status;
getCourseware(row.coursewareid).then(response => {
this.coursewareform = response.data;
console.log("this.coursewareform ", this.coursewareform);
this.title = "课件内容";
const TIME_COUNT = response.data.readtime;
if (row.status == 0) {
if (TIME_COUNT < 10) {
this.minute = "0" + TIME_COUNT;
} else {
this.minute = TIME_COUNT + "";
}
this.second = "00";
this.timer = setInterval(() => {
if (this.second == "00" && parseInt(this.minute) > 0) {
this.minute = parseInt(this.minute) - 1 + "";
if (this.minute < 10) {
this.minute = "0" + this.minute;
} else {
this.minute = this.minute + "";
}
this.second = 59 + "";
} else {
if (parseInt(this.second) > 0) {
this.second = parseInt(this.second) - 1 + "";
if (this.second < 10) {
this.second = "0" + this.second;
} else {
this.second = this.second + "";
}
}
}
if (this.second == "00" && this.minute == "00") {
changeTrainingtaskUser(row.id).then(res => {});
this.showClose = true;
}
}, 1000);
} else {
this.timeShow = false;
this.showClose = true;
}
});
},
closReda() {
if (this.status == 0) {
this.status = 1;
}
console.log(this.id, "2");
console.log(this.status, "1是");
changeTrainingtaskUser(this.id).then(res => {
console.log(res);
});
this.open = false;
this.getList();
},