谢杰标 2 years ago
parent
commit
03661e3d4b

+ 75 - 46
components/course/courseChapter.vue

@@ -25,7 +25,7 @@
             :menuItem="itemM"
             :levelId="levelId + '-' + itemM.sectionId"
             :testType="2"
-            :ChapterSectionExam='sectionExam'
+            :ChapterSectionExam="sectionExam"
             :menuAllList="menuAllList"
           ></courseSection>
           <!-- @togoBack='togoBack()' -->
@@ -129,19 +129,20 @@ export default {
     sectionMaxNum: {
       default: undefined,
     },
-    // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播	
+    // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
     goodsType: {
       type: [Number, String],
       default: 0,
-    }, 
-    menuAllList: { // 课程所有子目录结构列表
-			type: Array,
-			default: () => []
-		},
+    },
+    menuAllList: {
+      // 课程所有子目录结构列表
+      type: Array,
+      default: () => [],
+    },
     // sectionItem: { // 用户最后一次看的录播的信息
-		// 	type: Object,
-		// 	default: () => {}
-		// },
+    // 	type: Object,
+    // 	default: () => {}
+    // },
   },
   components: {
     courseSection,
@@ -156,8 +157,7 @@ export default {
     };
   },
   onLoad() {},
-  created() {
-  },
+  created() {},
   mounted() {
     // console.log('needOpen:', this.needOpen, this.chapterOpen);
     if (this.needOpen && this.chapterOpen) {
@@ -256,26 +256,29 @@ export default {
     // 新增用户视频学习日志
     studyLog() {
       this.$http({
-        url: '/user/study/log',
-        method: 'post',
+        url: "/user/study/log",
+        method: "post",
         data: {
           goodsId: this.goodsId,
           courseId: this.courseId,
-					moduleId: this.menuItem.moduleId || 0,
-					chapterId: this.menuItem.chapterId || 0,
+          moduleId: this.menuItem.moduleId || 0,
+          chapterId: this.menuItem.chapterId || 0,
           sectionId: this.menuItem.sectionId || this.menuItem.menuId,
           fromPlat: 1, //来源平台 1小程序 2PC网站
           goodsType: this.goodsType, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
           orderGoodsId: this.orderGoodsId,
-        }
+        },
       }).then((res) => {
-        console.log('考试的用户学习日志:', res)
-      })
+        console.log("考试的用户学习日志:", res);
+      });
     },
     /**
      * 去做题
      */
     async toDo(id, goodsId = 0, moduleId = 0, chapterId = 0, item, index) {
+      if (item.doType === 2 && item.learning == 1) {
+        return;
+      }
       // 查询用户商品今天学习节数- /goods/todayStudySectionNum
       let learnNum = await this.goodsTodayStudySectionNum();
       // 检查用户是否学习过节 - /grade/grade/checkGoodsStudy
@@ -313,10 +316,13 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1" + '&learning=' + item.learning
-                ,
+                "&type=1" +
+                "&learning=" +
+                item.learning +
+                "&isBackVideo=" +
+                1,
             });
-            this.studyLog()
+            this.studyLog();
             //没有答题次数限制
           } else if (item.answerNum == 0) {
             uni.navigateTo({
@@ -335,9 +341,13 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1" + '&learning=' + item.learning,
+                "&type=1" +
+                "&learning=" +
+                item.learning +
+                "&isBackVideo=" +
+                1,
             });
-            this.studyLog()
+            this.studyLog();
           } else {
             uni.showToast({
               icon: "none",
@@ -355,7 +365,7 @@ export default {
       } else if (this.learningOrder == 2 && !item.rebuild) {
         let canLearn = this.list[index - 1].learning == 1;
 
-        let rows = this.menuAllList
+        let rows = this.menuAllList;
         let isStop = false;
         let newRows = [];
         for (let i = 0; i < rows.length; i++) {
@@ -408,9 +418,13 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1" + '&learning=' + item.learning,
+                "&type=1" +
+                "&learning=" +
+                item.learning +
+                "&isBackVideo=" +
+                1,
             });
-            this.studyLog()
+            this.studyLog();
             //没有答题次数限制
           } else if (item.answerNum == 0) {
             uni.navigateTo({
@@ -429,9 +443,13 @@ export default {
                 chapterId +
                 "&orderGoodsId=" +
                 this.orderGoodsId +
-				        "&type=1" + '&learning=' + item.learning,
+                "&type=1" +
+                "&learning=" +
+                item.learning +
+                "&isBackVideo=" +
+                1,
             });
-            this.studyLog()
+            this.studyLog();
           } else {
             uni.showToast({
               icon: "none",
@@ -468,9 +486,13 @@ export default {
               chapterId +
               "&orderGoodsId=" +
               this.orderGoodsId +
-              "&type=1" + '&learning=' + item.learning,
+              "&type=1" +
+              "&learning=" +
+              item.learning +
+              "&isBackVideo=" +
+              1,
           });
-          this.studyLog()
+          this.studyLog();
           //没有答题次数限制
         } else if (item.answerNum == 0) {
           uni.navigateTo({
@@ -489,9 +511,13 @@ export default {
               chapterId +
               "&orderGoodsId=" +
               this.orderGoodsId +
-              "&type=1" + '&learning=' + item.learning,
+              "&type=1" +
+              "&learning=" +
+              item.learning +
+              "&isBackVideo=" +
+              1,
           });
-          this.studyLog()
+          this.studyLog();
         } else {
           uni.showToast({
             icon: "none",
@@ -524,20 +550,23 @@ export default {
       if (!this.down && this.list.length == 0) {
         // console.log(item.id, 69);
         //获取章下面所有节试卷列表-course/sectionExamList
-        
-       this.$method.isLogin() && await this.$api.reSectionExamList({
-          chapterId: item.chapterId || item.menuId,
-          courseId: item.courseId,
-          gradeId: item.gradeId
-        }).then((res) => {
-          if (res.data.code == 200) {
-            this.sectionExam = res.data.data || []
-          }
-        })
+
+        this.$method.isLogin() &&
+          (await this.$api
+            .reSectionExamList({
+              chapterId: item.chapterId || item.menuId,
+              courseId: item.courseId,
+              gradeId: item.gradeId,
+            })
+            .then((res) => {
+              if (res.data.code == 200) {
+                this.sectionExam = res.data.data || [];
+              }
+            }));
 
         if (this.isBuy) {
           let moduleId = item.moduleId ? item.moduleId : 0;
-          let chapterId = item.chapterId || item.id
+          let chapterId = item.chapterId || item.id;
           if (this.isRebuild) {
             this.getReSectionList(chapterId, item.courseId, moduleId);
           } else {
@@ -566,7 +595,7 @@ export default {
     },
     getSectionList(chapterId) {
       let self = this;
-    //   url: '/app/common/course/sectionList/'+data,
+      //   url: '/app/common/course/sectionList/'+data,
       this.$api.sectionList(chapterId).then((res) => {
         if (res.data.code == 200) {
           for (let i = 0; i < res.data.data.length; i++) {
@@ -723,7 +752,7 @@ export default {
   height: 78rpx;
   display: flex;
   align-items: center;
-  border-bottom: 1rpx solid #EEEEEE;
+  border-bottom: 1rpx solid #eeeeee;
   .menu_name {
     font-size: 24rpx;
     font-family: PingFang SC;

+ 8 - 2
components/course/courseModule.vue

@@ -58,7 +58,7 @@
             <view v-if="isRebuild || itemM.rebuild > 0" class="tagRe"
               >待重修</view
             >
-            <view v-else> 
+            <view v-else>
               <view
                 :class="{
                   tagGreen: itemM.learning == 1,
@@ -254,11 +254,15 @@ export default {
       item,
       index
     ) {
+      if (item.doType === 2 && item.learning == 1) {
+        return;
+      }
       let newRows = [];
       newRows = this.menuAllList.filter((e) => e.moduleId == moduleId);
       let isAllLearn = newRows.every((item) => {
         return item.studyStatus == 1;
       });
+
       if (isAllLearn) {
         uni.navigateTo({
           url:
@@ -278,7 +282,9 @@ export default {
             this.orderGoodsId +
             "&type=3" +
             "&learning=" +
-            item.learning,
+            item.learning +
+            "&isBackVideo=" +
+            1,
         });
       } else {
         uni.showToast({

+ 8 - 17
pages2/class/questionBank.vue

@@ -967,6 +967,7 @@ export default {
       // h5
       faceUrl: "",
       simulateExamId: undefined,
+      isBackVideo: "",
     };
   },
   watch: {
@@ -991,7 +992,7 @@ export default {
     this.gradeId = option.gradeId || "";
     this.orderGoodsId = Number(option.orderGoodsId);
     let isBack = option.isback;
-
+    this.isBackVideo = option.isBackVideo;
     let showDialog = uni.getStorageSync("showDialog");
 
     if (showDialog) {
@@ -2286,26 +2287,16 @@ export default {
               setTimeout(() => {
                 uni.redirectTo({
                   url:
-                    "/pages2/class/question_report?rightQuestionNum=" +
-                    form.rightQuestionNum +
-                    "&doWrongQuestionNum=" +
-                    form.questionIds.length +
-                    "&score=" +
-                    form.performance +
-                    "&totalScore=" +
-                    form.totalScore +
-                    "&reportStatus=" +
-                    form.reportStatus +
-                    "&lessQuestionNum=" +
-                    form.lessQuestionNum +
-                    "&examId=" +
-                    this.id +
-                    "&recordId=" +
+                    "/pages2/class/question_report?recordId=" +
                     this.recordId +
                     "&type=" +
                     this.examType +
                     "&orderGoodsId=" +
-                    this.orderGoodsId,
+                    this.orderGoodsId +
+                    "&isBackVideo=" +
+                    this.isBackVideo +
+                    "&bankType=" +
+                    this.bankType,
                 });
               }, 1000);
             }

+ 8 - 9
pages2/class/question_report.vue

@@ -95,6 +95,7 @@
         </navigator>
         <view
           class="btnACs"
+          v-if="score < totalScore * 0.6 || bankType == 1"
           @click="
             doRepeat(
               reportdata.examId,
@@ -105,6 +106,9 @@
           "
           >重新做题</view
         >
+        <navigator v-if="isBackVideo" open-type="navigateBack">
+          <view class="btnACs">返回学习</view>
+        </navigator>
         <!-- <view class="btnACs" v-if="nextExamId" @click="backBank">继续做题</view> -->
       </view>
     </view>
@@ -200,6 +204,8 @@ export default {
       reportdata: {},
       examType: 0, // 3-模块,1-章,2-节
       orderGoodsId: "",
+      bankType: "",
+      isBackVideo: "",
     };
   },
   onPullDownRefresh() {
@@ -239,15 +245,8 @@ export default {
     this.recordId = option.recordId;
     this.examId = option.examId;
     this.orderGoodsId = option.orderGoodsId;
-    // this.examTime = option.examTime;
-    // this.doTime = option.doTime;
-    // this.reportStatus = option.reportStatus;
-    // this.rightQuestionNum = +option.rightQuestionNum;
-    // this.doWrongQuestionNum = +option.doWrongQuestionNum;
-    // this.score = +option.score;
-    // this.lessQuestionNum = option.lessQuestionNum;
-    // this.totalScore = +option.totalScore;
-    // this.hideBtns = Boolean(option.hideBtns);
+    this.bankType = option.bankType;
+    this.isBackVideo = option.isBackVideo;
     this.bankReport();
   },
   methods: {

+ 7 - 0
pages2/invoice/index.vue

@@ -55,6 +55,9 @@
                   v-model="form.invoiceTitle"
                 />
               </u-form-item>
+              <u-form-item label="发票备注" label-width="150">
+                <u-input placeholder="请输入发票备注" v-model="form.invoiceRemark" />
+              </u-form-item>
               <u-form-item label="邮箱" label-width="150" required prop="email">
                 <u-input placeholder="请输入邮箱" v-model="form.email" />
               </u-form-item>
@@ -178,6 +181,9 @@
                   v-model="form.invoiceTitle"
                 />
               </u-form-item>
+              <u-form-item label="发票备注" label-width="150">
+                <u-input placeholder="请输入发票备注" v-model="form.invoiceRemark" />
+              </u-form-item>
               <u-form-item label="邮箱" label-width="150" required prop="email">
                 <u-input placeholder="请输入邮箱" v-model="form.email" />
               </u-form-item>
@@ -741,6 +747,7 @@ export default {
         taxRegistryNumber: "",
         companyAddress: "",
         email: "",
+        invoiceRemark:"",
         phone: "",
         bankName: "",
         bankAccount: "",

+ 87 - 46
pages3/polyv/detail.vue

@@ -1182,11 +1182,11 @@ export default {
     },
     // 原来onshow里面的内容
     originOnShow() {
-      this.getbaseprofiletplists().then((res) => {
+      this.getbaseprofiletplists().then(async (res) => {
         this.courseDetail();
         this.getGoodsDetail();
         this.getAnswerList();
-        this.studyRecordMenuAllList();
+        await this.studyRecordMenuAllList();
         // this.answerTimer = setInterval(() => {
         //   this.getAnswerList();
         // }, 5000);
@@ -1615,6 +1615,36 @@ export default {
           this.updateLiveLast(res.data.data);
         });
     },
+    async initPlayVideo(sectionItem) {
+      this.moduleId = sectionItem.moduleId;
+      this.chapterId = sectionItem.chapterId;
+      if (sectionItem.sectionType == 1) {
+        //录播
+        this.$store.commit("setPlaySectionId", {
+          playSectionId: sectionItem.sectionId,
+        });
+        this.$store.commit("setPlayVID", {
+          playVID: sectionItem.recordingUrl,
+        });
+
+        this.sectionItem = sectionItem;
+        await this.getPhotoLastRecord(); // 获取拍照历史
+        this.playVideo(sectionItem);
+      } else if (sectionItem.sectionType == 2) {
+        //直播
+        this.studyRecordGetLastLive();
+      } else if (sectionItem.sectionType == 3) {
+        //回放
+        this.$store.commit("setPlaySectionId", {
+          playSectionId: sectionItem.sectionId,
+        });
+        this.$store.commit("setPlayVID", {
+          playVID: sectionItem.recordingUrl,
+        });
+        this.sectionItem = sectionItem;
+        this.playVideo(sectionItem);
+      }
+    },
     studyRecordQueryLiveLast() {
       // /study/record/queryLiveLast
       this.$api
@@ -1623,50 +1653,61 @@ export default {
           orderGoodsId: this.orderGoodsId,
           courseId: this.courseId,
         })
-        .then(async (res) => {
-          if (res.data.data) {
-            this.moduleId = res.data.data.moduleId;
-            this.chapterId = res.data.data.chapterId;
-            if (res.data.data.sectionType == 1) {
-              //录播
-              this.$store.commit("setPlaySectionId", {
-                playSectionId: res.data.data.sectionId,
-              });
-              this.$store.commit("setPlayVID", {
-                playVID: res.data.data.recordingUrl,
-              });
+        .then((res) => {
+          let { data } = res.data;
+          if (!data.sectionId) {
+            data = this.menuAllList[0];
+          }
+          this.initPlayVideo(data);
+          // if (res.data.data) {
+          //   this.moduleId = res.data.data.moduleId;
+          //   this.chapterId = res.data.data.chapterId;
+          //   if (res.data.data.sectionType == 1) {
+          //     //录播
+          //     this.$store.commit("setPlaySectionId", {
+          //       playSectionId: res.data.data.sectionId,
+          //     });
+          //     this.$store.commit("setPlayVID", {
+          //       playVID: res.data.data.recordingUrl,
+          //     });
 
-              this.sectionItem = res.data.data;
-              await this.getPhotoLastRecord(); // 获取拍照历史
-              this.playVideo(res.data.data);
-            } else if (res.data.data.sectionType == 2) {
-              //直播
-              this.studyRecordGetLastLive();
-            } else if (res.data.data.sectionType == 3) {
-              //回放
-              this.$store.commit("setPlaySectionId", {
-                playSectionId: res.data.data.sectionId,
-              });
-              this.$store.commit("setPlayVID", {
-                playVID: res.data.data.recordingUrl,
-              });
-              this.sectionItem = res.data.data;
-              this.playVideo(res.data.data);
-            }
+          //     this.sectionItem = res.data.data;
+          //     await this.getPhotoLastRecord(); // 获取拍照历史
+          //     this.playVideo(res.data.data);
+          //   } else if (res.data.data.sectionType == 2) {
+          //     //直播
+          //     this.studyRecordGetLastLive();
+          //   } else if (res.data.data.sectionType == 3) {
+          //     //回放
+          //     this.$store.commit("setPlaySectionId", {
+          //       playSectionId: res.data.data.sectionId,
+          //     });
+          //     this.$store.commit("setPlayVID", {
+          //       playVID: res.data.data.recordingUrl,
+          //     });
+          //     this.sectionItem = res.data.data;
+          //     this.playVideo(res.data.data);
+          //   }
 
-            // 查询用户最后一次看的录播的信息
-            this.$http({
-              url: "/study/record/getUserWatchLast",
-              method: "get",
-              data: {
-                orderGoodsId: this.orderGoodsId,
-              },
-            }).then((res) => {
-              if (res.data.code == 200) {
-                this.sectionItem = res.data.data || {};
-              }
-            });
-          }
+          //   // 查询用户最后一次看的录播的信息
+          //   this.$http({
+          //     url: "/study/record/getUserWatchLast",
+          //     method: "get",
+          //     data: {
+          //       orderGoodsId: this.orderGoodsId,
+          //     },
+          //   }).then((res) => {
+          //     if (res.data.code == 200) {
+          //       let { data } = res.data;
+          //       if (!data) {
+          //         const sectionItem = this.menuAllList[0];
+          //         sectionItem.sectionType == 1 && (data = sectionItem);
+          //         // initPlayVideo
+          //       }
+          //       this.sectionItem = data;
+          //     }
+          //   });
+          // }
         });
     },
     /**
@@ -1898,7 +1939,7 @@ export default {
     },
     studyRecordMenuAllList() {
       // study/record/menuAllList
-      this.$api
+      return this.$api
         .studyRecordMenuAllList({
           courseId: this.courseId,
           gradeId: this.gradeId,
@@ -1908,12 +1949,12 @@ export default {
           let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
           if (res.data.data) {
             this.menuAllList = res.data.data;
-            // console.log('======0', this.sectionItem);
             this.livingItem = res.data.data.find(
               (item) =>
                 item.liveStartTime <= nowTime && item.liveEndTime > nowTime
             );
           }
+          return Promise.resolve();
         });
     },
     getbaseprofiletplists() {