谢杰标 %!s(int64=3) %!d(string=hai) anos
pai
achega
4d7e99db35

+ 1 - 1
src/components/courseTree/CourseTree.vue

@@ -1029,7 +1029,7 @@ export default {
       });
       return this.$request
         .courseTeacherList({
-          goodsId: this.$route.params.goodsId,
+          goodsId: this.goodsId,
         })
         .then(({ data }) => {
           data.forEach((ele) => {

+ 40 - 21
src/pages/person-center/learn-center/GoodsItem.vue

@@ -155,9 +155,6 @@ export default {
     },
     async toCourse() {
       let item = this.goodsInfo;
-      // if (!(await this.lockLockStatus())) {
-      //   return;
-      // }
       // // 二建继教
       // if (this.is2Education && !(await this.userConfirmInfoDetail())) {
       //   return;
@@ -174,6 +171,7 @@ export default {
       //   this.$refs.rebuildModal.showModal(item);
       //   return;
       // }
+
       this.$router.push({
         path: `/my-course-detail/${item.goodsId}`,
         query: {
@@ -185,10 +183,7 @@ export default {
     },
     toExam() {
       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() {
@@ -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({
             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: {

+ 10 - 1
src/pages/person-center/my-bank/index/index.vue

@@ -24,7 +24,16 @@ export default {
     };
   },
   mounted() {
-    this.getList();
+    // this.getList();
+    // this.getInfoData()
+    // console.log(this.$route.params.goodsId);
+    this.$request.goodsDetail(1105).then((res) => {
+      res.data.orderGoodsId = 3470;
+      this.bankData = res.data;
+      this.$nextTick(() => {
+        this.$refs.bankDetailCopy.initData(this.bankData);
+      });
+    });
   },
   methods: {
     getInfoData(data) {

+ 2 - 2
src/router/index.js

@@ -6,7 +6,7 @@ import { Notification, MessageBox, Message } from 'element-ui'
 import tools from '../common/tools'
 Vue.use(Router)
 
-let bankAdmin = ['/person-center/bank-record', '/person-center/my-bank/index', '/person-center/free-bank/index', '/person-center/my-collect', '/person-center/my-wrong', '/person-center/my-bank/bank-detail/', '/person-center/my-bank/bank-statistics/', '/person-center/my-bank/bank-explain-detail/', '/person-center/free-bank/bank-detail/', '/person-center/free-bank/bank-statistics/', '/person-center/free-bank/bank-explain-detail/', '/bank-exam-continue/', '/bank-exam/', '/subject/collect-bank/', '/bank-exam-explain/', '/bank-report/'];
+let bankAdmin = ['/person-center/bank-record', '/person-center/learn-center/goods-bank', '/person-center/free-bank/index', '/person-center/my-collect', '/person-center/my-wrong', '/person-center/my-bank/bank-detail/', '/person-center/my-bank/bank-statistics/', '/person-center/my-bank/bank-explain-detail/', '/person-center/free-bank/bank-detail/', '/person-center/free-bank/bank-statistics/', '/person-center/free-bank/bank-explain-detail/', '/bank-exam-continue/', '/bank-exam/', '/subject/collect-bank/', '/bank-exam-explain/', '/bank-report/'];
 let canToBank = null;
 let courseAdmin = ['/my-course-detail/', '/course-exam/']
 let canToCourse = null;
@@ -474,7 +474,7 @@ const router = new Router({
                   redirect: 'index',
                 },
                 {
-                  path: 'index',
+                  path: 'index/:goodsId',
                   component: resolve => require(['@/pages/person-center/my-bank/index/index'], resolve),
                   name: '自购题卷',
                 },