Przeglądaj źródła

补全orderGoodsId: this.orderGoodsId

xiejiebiao 2 lat temu
rodzic
commit
ddfde6083e

+ 43 - 52
components/course/courseChapter.vue

@@ -8,13 +8,8 @@
       </view>
 
       <view class="fl">
-        <view class="title_status gre" v-if="menuItem.commonSign == 1"
-          >公共章</view
-        >
-        <view
-          class="title_status"
-          :class="['grey', 'blue', 'gre'][learnStatus + 1]"
-        >
+        <view class="title_status gre" v-if="menuItem.commonSign == 1">公共章</view>
+        <view class="title_status" :class="['grey', 'blue', 'gre'][learnStatus + 1]">
           {{ ["待学习", "学习中", "已学完"][learnStatus + 1] }}
         </view>
       </view>
@@ -22,61 +17,39 @@
     <view v-show="!down">
       <view v-for="(itemM, indexM) in list" :key="indexM">
         <view v-if="itemM.type != 2">
-          <courseSection
-            ref="ChapterSection"
-            :isLive="isLive"
-            :orderGoodsId="orderGoodsId"
-            :sectionMaxNum="sectionMaxNum"
-            :preItem="list[indexM - 1] || preItem"
-            :learningOrder="learningOrder"
-            :courseId="courseId"
-            @playEnd="refreshList($event)"
-            :goodsId="goodsId"
-            :isBuy="isBuy"
-            :nextMenuItem="findNextSection(indexM)"
-            :isRebuild="isRebuild"
-            :gradeId="gradeId"
-            :menuItem="itemM"
-            :levelId="levelId + '-' + itemM.sectionId"
-            :testType="2"
-            :ChapterSectionExam="sectionExam"
-            :menuAllList="menuAllList"
-          ></courseSection>
+          <courseSection ref="ChapterSection" :isLive="isLive" :orderGoodsId="orderGoodsId" :sectionMaxNum="sectionMaxNum"
+            :preItem="list[indexM - 1] || preItem" :learningOrder="learningOrder" :courseId="courseId"
+            @playEnd="refreshList($event)" :goodsId="goodsId" :isBuy="isBuy" :nextMenuItem="findNextSection(indexM)"
+            :isRebuild="isRebuild" :gradeId="gradeId" :menuItem="itemM" :levelId="levelId + '-' + itemM.sectionId"
+            :testType="2" :ChapterSectionExam="sectionExam" :menuAllList="menuAllList"></courseSection>
           <!-- @togoBack='togoBack()' -->
           <u-line v-if="indexM < list.length - 1"></u-line>
         </view>
         <!-- 章卷 -->
         <view v-if="itemM.type == 2">
           <u-line></u-line>
-          <view
-            class="examBox"
-            @click="
-              toDo(
-                itemM.typeId,
-                goodsId,
-                itemM.moduleId,
-                itemM.chapterId,
-                itemM,
-                indexM
-              )
-            "
-          >
+          <view class="examBox" @click="
+            toDo(
+              itemM.typeId,
+              goodsId,
+              itemM.moduleId,
+              itemM.chapterId,
+              itemM,
+              indexM
+            )
+            ">
             <view class="exam">
               <view class="eTag">
                 {{ itemM.doType == 1 ? "练习" : "考试" }}
               </view>
               <view style="margin-left: 15rpx; flex: 1">{{ itemM.name }}</view>
             </view>
-            <view v-if="isRebuild || itemM.rebuild > 0" class="tagRe"
-              >待重修</view
-            >
+            <view v-if="isRebuild || itemM.rebuild > 0" class="tagRe">待重修</view>
             <view v-else>
-              <view
-                :class="{
-                  tagGreen: itemM.learning == 1,
-                  tagRe: itemM.learning == 0 || itemM.rebuild > 0,
-                }"
-              >
+              <view :class="{
+                tagGreen: itemM.learning == 1,
+                tagRe: itemM.learning == 0 || itemM.rebuild > 0,
+              }">
                 <text v-if="itemM.rebuild > 0">待重测</text>
                 <text v-else-if="itemM.learning == 1">合格</text>
                 <text v-else-if="itemM.learning == 0">不及格(需重考)</text>
@@ -156,7 +129,7 @@ export default {
     sectionItem: {
       // 用户最后一次看的录播的信息
       type: Object,
-      default: () => {},
+      default: () => { },
     },
   },
   components: {
@@ -171,8 +144,8 @@ export default {
       sectionExam: [],
     };
   },
-  onLoad() {},
-  created() {},
+  onLoad() { },
+  created() { },
   mounted() {
     // console.log('needOpen:', this.needOpen, this.chapterOpen);
     if (this.needOpen && this.chapterOpen) {
@@ -197,6 +170,7 @@ export default {
           .goodsTodayStudySectionNum({
             goodsId: this.goodsId,
             gradeId: this.gradeId,
+            orderGoodsId: this.orderGoodsId
           })
           .then((res) => {
             if (res.data.code == 200) {
@@ -242,6 +216,7 @@ export default {
             courseId: this.courseId,
             gradeId: this.gradeId,
             goodsId: this.goodsId,
+            orderGoodsId: this.orderGoodsId
           })
           .then((res) => {
             if (res.data.code == 200) {
@@ -262,6 +237,7 @@ export default {
             moduleId: this.menuItem.moduleId || 0,
             chapterId: this.menuItem.chapterId || 0,
             examId: id,
+            orderGoodsId: this.orderGoodsId
           })
           .then((res) => {
             resolve(res.data.data);
@@ -561,6 +537,7 @@ export default {
             courseId: this.courseId,
             moduleId: 0,
             examId: examId,
+            orderGoodsId: this.orderGoodsId
           })
           .then((res) => {
             resolve(res.data.data);
@@ -584,6 +561,7 @@ export default {
               chapterId: item.chapterId || item.menuId,
               courseId: item.courseId,
               gradeId: item.gradeId,
+              orderGoodsId: this.orderGoodsId
             })
             .then((res) => {
               if (res.data.code == 200) {
@@ -659,6 +637,7 @@ export default {
           courseId: courseId,
           rebuild: 1,
           moduleId: moduleId,
+          orderGoodsId: this.orderGoodsId
         })
         .then((res) => {
           if (res.data.code == 200) {
@@ -696,6 +675,7 @@ export default {
           gradeId: this.gradeId,
           courseId: courseId,
           moduleId: moduleId,
+          orderGoodsId: this.orderGoodsId
         })
         .then((res) => {
           if (res.data.code == 200) {
@@ -769,6 +749,7 @@ export default {
   color: #ffffff;
   text-align: center;
 }
+
 .tagGreen {
   width: 80rpx;
   height: 28rpx;
@@ -778,6 +759,7 @@ export default {
   color: #ffffff;
   text-align: center;
 }
+
 .eTag {
   width: 64rpx;
   height: 36rpx;
@@ -788,21 +770,25 @@ export default {
   border-radius: 8rpx;
   color: #ffffff;
 }
+
 .examBox {
   display: flex;
   align-items: center;
   justify-content: space-between;
 }
+
 .exam {
   font-size: 30rpx;
   display: flex;
   align-items: center;
   margin: 20rpx 0;
 }
+
 .icon_up {
   width: 24rpx;
   height: 24rpx;
 }
+
 .title {
   // margin-bottom: 30rpx;
   height: 78rpx;
@@ -810,6 +796,7 @@ export default {
   justify-content: space-between;
   align-items: center;
   border-bottom: 1rpx solid #eeeeee;
+
   .menu_name {
     font-size: 24rpx;
     font-family: PingFang SC;
@@ -820,6 +807,7 @@ export default {
     text-overflow: ellipsis;
     margin-left: 8rpx;
   }
+
   .title_status {
     padding: 2rpx 8rpx;
     border-radius: 8rpx;
@@ -828,12 +816,15 @@ export default {
     text-align: center;
     margin-left: 4rpx;
   }
+
   .gre {
     background: #34c759;
   }
+
   .blue {
     background: #409eff;
   }
+
   .grey {
     background: #909399;
   }

+ 2 - 0
components/course/courseModule.vue

@@ -215,6 +215,7 @@ export default {
           gradeId: this.gradeId,
           courseId: courseId,
           rebuild: 1,
+          orderGoodsId: this.orderGoodsId
         })
         .then((res) => {
           if (res.data.code == 200) {
@@ -233,6 +234,7 @@ export default {
           moduleId: moduleId,
           gradeId: this.gradeId,
           courseId: courseId,
+          orderGoodsId: this.orderGoodsId
         })
         .then((res) => {
           if (res.data.code == 200) {

+ 103 - 125
components/course/courseSection.vue

@@ -1,52 +1,28 @@
 <template>
-  <view
-    style="display: flex; justify-content: space-between; align-items: center"
-    @click="getVideo"
-  >
-    <view
-      style="
+  <view style="display: flex; justify-content: space-between; align-items: center" @click="getVideo">
+    <view style="
         display: flex;
         justify-content: space-between;
         align-items: center;
         margin: 20rpx 0;
         width: 100%;
-      "
-    >
+      ">
       <view style="display: flex; align-items: center; flex: 1">
         <view class="tag tagColor1" v-if="menuItem.sectionType == 1">视频</view>
         <view class="tag tagColor2" v-if="menuItem.sectionType == 2">直播</view>
         <view class="tag tagColor3" v-if="menuItem.sectionType == 3">回放</view>
         <view class="t_content">
-          <view
-            v-if="menuItem.sectionType == 1"
-            :class="
-              playSectionId == newId && playNextId == playId ? 'color1' : ''
-            "
-            >{{ menuItem.name || "" }}</view
-          >
-          <view
-            v-if="menuItem.sectionType == 2"
-            :class="
-              playSectionId == newId && playNextId == playId ? 'color2' : ''
-            "
-            >{{ menuItem.name || "" }}</view
-          >
-          <view
-            v-if="menuItem.sectionType == 3"
-            :class="
-              playSectionId == newId && playNextId == playId ? 'color3' : ''
-            "
-            >{{ menuItem.name || "" }}</view
-          >
-          <view
-            style="font-size: 20rpx; color: #ff3b30"
-            v-if="menuItem.sectionType == 2 && menuItem.liveStartTime"
-          >
+          <view v-if="menuItem.sectionType == 1" :class="playSectionId == newId && playNextId == playId ? 'color1' : ''
+            ">{{ menuItem.name || "" }}</view>
+          <view v-if="menuItem.sectionType == 2" :class="playSectionId == newId && playNextId == playId ? 'color2' : ''
+            ">{{ menuItem.name || "" }}</view>
+          <view v-if="menuItem.sectionType == 3" :class="playSectionId == newId && playNextId == playId ? 'color3' : ''
+            ">{{ menuItem.name || "" }}</view>
+          <view style="font-size: 20rpx; color: #ff3b30" v-if="menuItem.sectionType == 2 && menuItem.liveStartTime">
             <view v-if="menuItem.liveStartTime > nowTime || !isBuy">
               <text>{{
                 $method.timestampToTime(menuItem.liveStartTime, (isDay = false))
-              }}</text
-              >-
+              }}</text>-
               <text>{{
                 $method.timestampToTime(menuItem.liveEndTime, (isDay = false))
               }}</text>
@@ -66,10 +42,7 @@
 							<text>回放</text>
 						</view> -->
           </view>
-          <view
-            style="font-size: 20rpx; color: #ff3b30"
-            v-if="menuItem.sectionType == 3"
-          >
+          <view style="font-size: 20rpx; color: #ff3b30" v-if="menuItem.sectionType == 3">
             <view v-if="!menuItem.recordingUrl">
               <text>当前直播回放视频请稍后再查看</text>
             </view>
@@ -80,31 +53,18 @@
           menuItem.name || ""
         }}</view>
         <!-- 学习中 -->
-        <view
-          v-if="playSectionId == newId && playNextId == playId"
-          class="learnings"
-        >
-          <image
-            src="/pages3/static/imgs/learning_icon.gif"
-            class="learning_icon"
-          ></image>
+        <view v-if="playSectionId == newId && playNextId == playId" class="learnings">
+          <image src="/pages3/static/imgs/learning_icon.gif" class="learning_icon"></image>
         </view>
       </view>
-      <view
-        style="font-size: 20rpx; color: #ff3b30"
-        v-if="menuItem.liveStartTime && menuItem.sectionType != 3 && isBuy"
-      >
+      <view style="font-size: 20rpx; color: #ff3b30" v-if="menuItem.liveStartTime && menuItem.sectionType != 3 && isBuy">
         <template v-if="!isLast() && !isLive">
           <view class="tagWillPlay" v-if="menuItem.liveStartTime > nowTime">
             <text>待开播</text>
           </view>
-          <view
-            class="tagPlaying"
-            v-if="
-              menuItem.liveStartTime <= nowTime &&
-              menuItem.liveEndTime > nowTime
-            "
-          >
+          <view class="tagPlaying" v-if="menuItem.liveStartTime <= nowTime &&
+            menuItem.liveEndTime > nowTime
+            ">
             <text>直播中</text>
           </view>
           <view class="tagPlayed" v-if="menuItem.liveEndTime < nowTime">
@@ -114,19 +74,13 @@
       </view>
       <!-- 直播课程没有学习状态 -->
       <template v-if="!isLive">
-        <view v-if="isRebuild || menuItem.rebuild > 0" class="tagRe"
-          >待重修</view
-        >
+        <view v-if="isRebuild || menuItem.rebuild > 0" class="tagRe">待重修</view>
         <view v-else>
           <view v-if="menuItem.learning == 1" class="tagGreen">已学完</view>
         </view>
       </template>
 
-      <view
-        v-if="checkTest()"
-        class="exercises"
-        @click.stop="toDoSectionExam()"
-      >
+      <view v-if="checkTest()" class="exercises" @click.stop="toDoSectionExam()">
         <text class="exe_w">习题</text>
         <u-icon name="arrow-right" color="#498AFE" size="28"></u-icon>
       </view>
@@ -222,7 +176,7 @@ export default {
       // newMenuAllList: [],
     };
   },
-  onLoad() {},
+  onLoad() { },
   created() {
     if (this.testType == 3) {
       // 模块下的所有节试卷列表
@@ -231,6 +185,7 @@ export default {
           chapterId: 0,
           courseId: this.courseId,
           gradeId: this.gradeId,
+          orderGoodsId: this.orderGoodsId
         })
         .then((res) => {
           if (res.data.code == 200) {
@@ -249,11 +204,10 @@ export default {
     let moduleId = this.menuItem.moduleId || 0;
     let chapterId = this.menuItem.chapterId || 0;
     let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
-    let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}${
-      this.isRebuild ? "isRebuild" : ""
-    }`;
+    let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}${this.isRebuild ? "isRebuild" : ""
+      }`;
     this.playId = playNextId;
-    if(this.playSectionId == this.newId){
+    if (this.playSectionId == this.newId) {
       this.$store.commit("updatePlayNextId", playNextId);
     }
     uni.$off("playNext" + playNextId); //绑定前先移除之前的事件
@@ -404,6 +358,7 @@ export default {
             courseId: this.courseId,
             gradeId: this.gradeId,
             goodsId: this.goodsId,
+            orderGoodsId: this.orderGoodsId
           })
           .then((res) => {
             if (res.data.code == 200) {
@@ -421,6 +376,7 @@ export default {
             moduleId: this.menuItem.moduleId || 0,
             chapterId: this.menuItem.chapterId || 0,
             sectionId: this.menuItem.sectionId || this.menuItem.menuId,
+            orderGoodsId: this.orderGoodsId
           })
           .then((res) => {
             resolve(res.data.data);
@@ -433,6 +389,7 @@ export default {
           .goodsTodayStudySectionNum({
             goodsId: this.goodsId,
             gradeId: this.gradeId,
+            orderGoodsId: this.orderGoodsId
           })
           .then((res) => {
             if (res.data.code == 200) {
@@ -554,9 +511,9 @@ export default {
           return;
         }
         /* if(this.playSectionId==this.newId){
-					//切换为同一节
-					return
-				} */
+          //切换为同一节
+          return
+        } */
         // 回放
         if (this.menuItem.sectionType == 3) {
           let moduleId = this.menuItem.moduleId || 0;
@@ -566,32 +523,32 @@ export default {
           // buyCourse 是否购买课程:1是 0否,type=vod是回放
           let encode = encodeURIComponent(
             this.config.hostLive +
-              "/pages/live/index?token=" +
-              uni.getStorageSync("token") +
-              "&userInfo=" +
-              JSON.stringify(this.userInfo) +
-              "&channelId=" +
-              this.menuItem.liveUrl +
-              "&gradeId=" +
-              this.gradeId +
-              "&courseId=" +
-              this.courseId +
-              "&goodsId=" +
-              this.goodsId +
-              "&orderGoodsId=" +
-              this.orderGoodsId +
-              "&sectionId=" +
-              sectionId +
-              "&chapterId=" +
-              chapterId +
-              "&moduleId=" +
-              moduleId +
-              "&buyCourse=1" +
-              "&ident=" +
-              uuid +
-              "&sectionType=3" +
-              "&vid=" +
-              this.menuItem.recordingUrl
+            "/pages/live/index?token=" +
+            uni.getStorageSync("token") +
+            "&userInfo=" +
+            JSON.stringify(this.userInfo) +
+            "&channelId=" +
+            this.menuItem.liveUrl +
+            "&gradeId=" +
+            this.gradeId +
+            "&courseId=" +
+            this.courseId +
+            "&goodsId=" +
+            this.goodsId +
+            "&orderGoodsId=" +
+            this.orderGoodsId +
+            "&sectionId=" +
+            sectionId +
+            "&chapterId=" +
+            chapterId +
+            "&moduleId=" +
+            moduleId +
+            "&buyCourse=1" +
+            "&ident=" +
+            uuid +
+            "&sectionType=3" +
+            "&vid=" +
+            this.menuItem.recordingUrl
           );
           uni.navigateTo({
             url: `../../pages/webview/index?url=` + encode,
@@ -693,30 +650,30 @@ export default {
         // buyCourse 是否购买课程:1是 0否
         let encode = encodeURIComponent(
           this.config.hostLive +
-            "/pages/live/index?token=" +
-            uni.getStorageSync("token") +
-            "&userInfo=" +
-            JSON.stringify(this.userInfo) +
-            "&channelId=" +
-            this.menuItem.liveUrl +
-            "&gradeId=" +
-            this.gradeId +
-            "&courseId=" +
-            this.courseId +
-            "&goodsId=" +
-            this.goodsId +
-            "&orderGoodsId=" +
-            this.orderGoodsId +
-            "&sectionId=" +
-            sectionId +
-            "&chapterId=" +
-            chapterId +
-            "&moduleId=" +
-            moduleId +
-            "&buyCourse=1" +
-            "&ident=" +
-            uuid +
-            "&sectionType=2"
+          "/pages/live/index?token=" +
+          uni.getStorageSync("token") +
+          "&userInfo=" +
+          JSON.stringify(this.userInfo) +
+          "&channelId=" +
+          this.menuItem.liveUrl +
+          "&gradeId=" +
+          this.gradeId +
+          "&courseId=" +
+          this.courseId +
+          "&goodsId=" +
+          this.goodsId +
+          "&orderGoodsId=" +
+          this.orderGoodsId +
+          "&sectionId=" +
+          sectionId +
+          "&chapterId=" +
+          chapterId +
+          "&moduleId=" +
+          moduleId +
+          "&buyCourse=1" +
+          "&ident=" +
+          uuid +
+          "&sectionType=2"
         );
         uni.navigateTo({
           url: `../../pages/webview/index?url=` + encode,
@@ -750,6 +707,7 @@ export default {
   color: #ffffff;
   text-align: center;
 }
+
 .tagWillPlay {
   width: 80rpx;
   height: 28rpx;
@@ -759,6 +717,7 @@ export default {
   color: #007aff;
   text-align: center;
 }
+
 .tagPlaying {
   width: 80rpx;
   height: 28rpx;
@@ -768,6 +727,7 @@ export default {
   color: #ff9500;
   text-align: center;
 }
+
 .tagPlayed {
   width: 80rpx;
   height: 28rpx;
@@ -777,6 +737,7 @@ export default {
   color: #666666;
   text-align: center;
 }
+
 .tagRe {
   width: 80rpx;
   height: 28rpx;
@@ -786,6 +747,7 @@ export default {
   color: #ffffff;
   text-align: center;
 }
+
 .tryBox {
   width: 103rpx;
   height: 48rpx;
@@ -797,61 +759,77 @@ export default {
   text-align: center;
   border: 1rpx solid #3577e8;
 }
+
 .icon_up {
   width: 24rpx;
   height: 24rpx;
 }
+
 .t_content3 {
   color: #007aff;
 }
+
 .t_content2 {
   color: #007aff;
 }
+
 .t_content1 {
   color: #007aff;
 }
+
 .t_content {
   font-size: 30rpx;
   margin-left: 10rpx;
   color: #666666;
   flex: 1;
 }
+
 .tagColor3 {
   border: 2rpx solid #ff9500;
   color: #ff9500;
 }
+
 .tagColor2 {
   border: 2rpx solid #ff3b30;
   color: #ff3b30;
 }
+
 .tagColor1 {
   border: 2rpx solid #007aff;
   color: #007aff;
 }
+
 .color3 {
   color: #ff9500;
 }
+
 .color2 {
   color: #ff3b30;
 }
+
 .color1 {
   color: #007aff;
 }
+
 .tag {
   border-radius: 8rpx;
   font-size: 20rpx;
   padding: 4rpx 10rpx;
 }
+
 .exercises {
   margin-left: 10rpx;
   font-size: 26rpx;
   color: #498afe;
-  > text {
+
+  >text {
     margin-right: 6rpx;
   }
 }
+
 .learnings {
   margin-right: 8rpx;
+
   .learning_icon {
     width: 40rpx;
     height: 40rpx;

+ 1 - 0
pages3/polyv/detail.vue

@@ -1939,6 +1939,7 @@ export default {
           courseId: this.courseId,
           gradeId: this.gradeId,
           goodsId: this.goodsId,
+          orderGoodsId: this.orderGoodsId
         })
         .then((res) => {
           let nowTime = Number(new Date().getTime() / 1000).toFixed(0);