|
@@ -155,9 +155,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
async toCourse() {
|
|
async toCourse() {
|
|
|
let item = this.goodsInfo;
|
|
let item = this.goodsInfo;
|
|
|
- // if (!(await this.lockLockStatus())) {
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
// // 二建继教
|
|
// // 二建继教
|
|
|
// if (this.is2Education && !(await this.userConfirmInfoDetail())) {
|
|
// if (this.is2Education && !(await this.userConfirmInfoDetail())) {
|
|
|
// return;
|
|
// return;
|
|
@@ -174,6 +171,7 @@ export default {
|
|
|
// this.$refs.rebuildModal.showModal(item);
|
|
// this.$refs.rebuildModal.showModal(item);
|
|
|
// return;
|
|
// return;
|
|
|
// }
|
|
// }
|
|
|
|
|
+
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
path: `/my-course-detail/${item.goodsId}`,
|
|
path: `/my-course-detail/${item.goodsId}`,
|
|
|
query: {
|
|
query: {
|
|
@@ -185,10 +183,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
toExam() {
|
|
toExam() {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
- path: "/person-center/learn-center/goods-bank",
|
|
|
|
|
- // query: {
|
|
|
|
|
- // goodsId: this.goodsInfo.goodsId,
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ path: `/person-center/learn-center/goods-bank/index/${this.goodsInfo.goodsId}`,
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
userConfirmInfoDetail() {
|
|
userConfirmInfoDetail() {
|
|
@@ -225,23 +220,47 @@ export default {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- lockLockStatus() {
|
|
|
|
|
- return this.$request
|
|
|
|
|
- .lockLockStatus({
|
|
|
|
|
- action: "jxjy",
|
|
|
|
|
- uuid: sessionStorage.getItem("uuid"),
|
|
|
|
|
- })
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- //有其他端在操作,不能学习
|
|
|
|
|
|
|
+ async exceedLearnNum(courseLists, section) {
|
|
|
|
|
+ let learnNum = await this.goodsTodayStudySectionNum(section);
|
|
|
|
|
+ let hasLearn = await this.gradeCheckGoodsStudy(courseLists, section);
|
|
|
|
|
+
|
|
|
|
|
+ if (this.goodsData.sectionMaxNum > 0) {
|
|
|
|
|
+ if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: "warning",
|
|
type: "warning",
|
|
|
- message: res.msg,
|
|
|
|
|
|
|
+ message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
|
|
|
});
|
|
});
|
|
|
- return Promise.resolve(false);
|
|
|
|
|
- })
|
|
|
|
|
- .catch((err) => {
|
|
|
|
|
- return Promise.resolve(true);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ },
|
|
|
|
|
+ gradeCheckGoodsStudy(courseItem, option) {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ this.$request
|
|
|
|
|
+ .gradeCheckGoodsStudy({
|
|
|
|
|
+ goodsId: this.goodsData.goodsId,
|
|
|
|
|
+ gradeId: courseItem.gradeId,
|
|
|
|
|
+ moduleId: option.moduleId || 0,
|
|
|
|
|
+ chapterId: option.chapterId || 0,
|
|
|
|
|
+ sectionId: option.sectionId || option.menuId,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ resolve(res.data);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ goodsTodayStudySectionNum(option) {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ this.$request
|
|
|
|
|
+ .goodsTodayStudySectionNum({
|
|
|
|
|
+ goodsId: this.goodsData.goodsId,
|
|
|
|
|
+ gradeId: option.gradeId,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ resolve(res.data);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|