谢杰标 il y a 2 ans
Parent
commit
4870651004
4 fichiers modifiés avec 65 ajouts et 113 suppressions
  1. 8 3
      pages/learn/index.vue
  2. 13 38
      pages2/order/confirm_list.vue
  3. 1 1
      pages2/verify/input.vue
  4. 43 71
      pages3/polyv/detail.vue

+ 8 - 3
pages/learn/index.vue

@@ -157,9 +157,7 @@
               <view class="rights">
                 <view class="learn_progress">
                   <view class="progress_up">
-                    <view class="cou_titles line2"
-                      >{{ item.goodsName }}</view
-                    >
+                    <view class="cou_titles line2">{{ item.goodsName }}</view>
                     <view class="classHour">
                       <text
                         >{{
@@ -297,6 +295,13 @@
               </view>
             </view>
             <view class="study_tips">
+              <div
+                v-if="
+                  item.erJianErZao && !item.classEndTime && !item.classStartTime
+                "
+              >
+                温馨提示:当前班级正在申请中,正式开班后方可进行学习,请耐心等待
+              </div>
               <div
                 v-if="
                   $method.GetRTime(item.serviceEndTime) <= 20 &&

+ 13 - 38
pages2/order/confirm_list.vue

@@ -65,17 +65,6 @@
             </view>
           </view>
         </view>
-        <!-- <view v-if="detail.templateType!=null&&detail.goodsType==1">
-						<u-line color="#D6D6DB" />
-						<view v-if="detail.templateType=='class'" style="display: flex;justify-content: space-between;align-items: center;height: 80rpx;padding:16rpx;" @click="openPopup(0)">
-							<view style="color: #666666;font-size: 24rpx;">{{gradeIndex < 0 ?'选择班级':gradeList[gradeIndex].className}}</view>
-							<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
-						</view>
-						<view v-if="detail.templateType=='apply'"  style="display: flex;justify-content: space-between;align-items: center;height: 80rpx;padding:16rpx;" @click="openPopup(1)">
-							<view style="color: #666666;font-size: 24rpx;" >{{!applyAreas.areaName?'报考地区':examDate.examineName+'-'+applyAreas.areaName+'-'+applyAreas.cityName}}</view>
-							<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
-						</view>
-					</view> -->
       </view>
       <!-- </view> -->
     </view>
@@ -227,8 +216,8 @@ export default {
   components: { ClassTimeTip },
   data() {
     return {
-      gradeValue: -1,
-      gradeIndex: -1,
+      gradeValue: 0,
+      gradeIndex: 0,
       id: 0,
       indicatorStyle: `height: 50px;`,
       showArea: true,
@@ -328,6 +317,7 @@ export default {
         this.show1 = false;
       }
     },
+    
     checkAreaData() {
       if (this.examine.length == 0) {
         uni.showModal({
@@ -337,22 +327,6 @@ export default {
         });
         return false;
       }
-      // if(this.provinceList.length==0){
-      // 	uni.showModal({
-      // 		title: "提示",
-      // 		content: '请选择报考地区',
-      // 		showCancel: false
-      // 	})
-      // 	return false
-      // }
-      // if(this.cityList.length==0){
-      // 	uni.showModal({
-      // 		title: "提示",
-      // 		content: '请选择报考地区',
-      // 		showCancel: false
-      // 	})
-      // 	return false
-      // }
       return true;
     },
     isAble() {
@@ -412,19 +386,17 @@ export default {
       console.log(e);
     },
     goodsGradeList() {
-      let self = this;
       this.$api.goodsGradeList({ goodsId: this.id }).then((res) => {
         if (res.data.code == 200) {
-          self.gradeList = res.data.rows;
-
-          if (self.gradeList.length == 0) {
+          this.gradeList = res.data.rows;
+          if (this.gradeList.length == 0) {
             let item = {
               className: "系统分班",
               gradeId: 0,
             };
-            self.gradeList.push(item);
+            this.gradeList.push(item);
           } else {
-            let isGradeFull = self.gradeList.every(
+            let isGradeFull = this.gradeList.every(
               (item) =>
                 item.studentNum > 0 && item.studentNum == item.studentUpper
             );
@@ -434,9 +406,10 @@ export default {
                 className: "系统分班",
                 gradeId: 0,
               };
-              self.gradeList.unshift(item);
+              this.gradeList.unshift(item);
             }
           }
+          this.detail.gradObj = this.gradeList[this.gradeIndex];
         }
       });
     },
@@ -475,6 +448,9 @@ export default {
       this.$api.commonGoodsDetail(this.id).then((res) => {
         if (res.data.code == 200) {
           self.detail = res.data.data;
+          if (self.detail.templateType != null && self.detail.goodsType == 1) {
+            this.goodsGradeList();
+          }
           self.getExamine(self.detail.projectId);
         }
       });
@@ -510,10 +486,9 @@ export default {
     openPopup(index) {
       if (index == 0) {
         this.show = true;
-        this.goodsGradeList();
       } else {
+        this.getProvinceList()
         this.show1 = true;
-        this.getProvinceList();
       }
     },
     closePop(index) {

+ 1 - 1
pages2/verify/input.vue

@@ -729,8 +729,8 @@ export default {
     this.goodsId = Number(option.id);
     this.gradeId = Number(option.gradeId);
     !this.userInfo && this.$api.refreshUserInfo();
-    await this.getInfo();
     await this.getGoodsDetail();
+    await this.getInfo();
   },
   onReady(res) {
     this.handwriting = new Handwriting({

+ 43 - 71
pages3/polyv/detail.vue

@@ -997,7 +997,7 @@ export default {
     if (this.$method.isGoLogin()) {
       return;
     }
-    this.closePhoto()
+    this.closePhoto();
     this.courseCourseList();
   },
   onUnload() {
@@ -1663,66 +1663,15 @@ export default {
         })
         .then((res) => {
           let { data } = res.data;
-          console.log(data, 789);
           if (!data.sectionId) {
             data = this.menuAllList[0];
           } else {
             if (data.learning == 1 && this.orderNum == 2) {
               let next = this.menuAllList.find((e) => e.studyStatus != 1);
-              console.log(next, 789);
               next && (data = next);
             }
           }
           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.$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;
-          //     }
-          //   });
-          // }
         });
     },
     /**
@@ -2621,7 +2570,7 @@ export default {
         clearInterval(this.timer);
       }
       // #ifdef H5
-      await this.clears();
+      // await this.clears();
       // #endif
       if (this.vid) {
         //切换视频
@@ -2885,9 +2834,9 @@ export default {
         PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
         // #endif
       }
-      // if (currentTime < 15 && !this.ossAvatarUrl) {
-      //   return;
-      // }
+      if (currentTime < 10 && !this.ossAvatarUrl) {
+        return;
+      }
       if (this.playChannelId > 0) {
         currentTime = 2; //直播无法获取,无论开始结束都传2秒
       }
@@ -3667,9 +3616,7 @@ export default {
         if (self.goodsData.goodsPlayConfig) {
           self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
           if (self.goodsPlayConfig.autoPlay > 0) {
-            // #ifdef H5
             self.autoplay = true;
-            // #endif
           }
           if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
             // #ifdef MP-WEIXIN
@@ -3880,11 +3827,8 @@ export default {
     loadPlayer() {
       const polyvPlayer = window.polyvPlayer;
       this.$api.polyvVideoSign(this.vid).then(async (res) => {
-        this.player = await polyvPlayer({
-          wrap: "#player",
-          width: "100%",
+        let option = {
           showLine: "off",
-          height: 218,
           ban_history_time: "on",
           vid: this.vid,
           forceH5: true,
@@ -3897,9 +3841,38 @@ export default {
           watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
           ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
           sign: res.data.data.sign, // 移动端播放加密视频所需的签名
-        });
-        polyvPlayerContext = this.player;
-        this.player.on("s2j_onPlayStart", async (vid) => {
+        };
+        if (polyvPlayerContext) {
+          polyvPlayerContext.changeVid(option);
+        } else {
+          option = {
+            wrap: "#player",
+            width: "100%",
+            height: 218,
+            ...option,
+          };
+          polyvPlayerContext = await polyvPlayer(option);
+        }
+        // polyvPlayerContext = await polyvPlayer({
+        //   wrap: "#player",
+        //   width: "100%",
+        //   showLine: "off",
+        //   height: 218,
+        //   ban_history_time: "on",
+        //   vid: this.vid,
+        //   forceH5: true,
+        //   autoplay: this.autoplay, // 自动播放
+        //   ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
+        //   speed: this.playbackRate, // 倍数
+        //   teaser_show: 1,
+        //   tail_show: 1,
+        //   hideSwitchPlayer: true,
+        //   watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
+        //   ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
+        //   sign: res.data.data.sign, // 移动端播放加密视频所需的签名
+        // });
+        // polyvPlayerContext = this.player;
+        polyvPlayerContext.on("s2j_onPlayStart", async (vid) => {
           // 视频初次播放时触发
           console.log("视频初次播放时触发:");
           // #ifdef H5
@@ -3927,7 +3900,7 @@ export default {
           this.loadedmetadata();
           this.postStudyRecord(0);
         });
-        this.player.on("s2j_onVideoPause", () => {
+        polyvPlayerContext.on("s2j_onVideoPause", () => {
           // 视频暂停时触发
           console.log("视频暂停时触发", this.vid);
           this.erJianErZaoPauseTip();
@@ -3936,8 +3909,7 @@ export default {
           clearInterval(this.studyTimer);
           clearInterval(this.timer);
         });
-
-        this.player.on("s2j_onVideoPlay", () => {
+        polyvPlayerContext.on("s2j_onVideoPlay", () => {
           // 视频初次播放或由暂停恢复播放时触发
           console.log("视频初次播放或由暂停恢复播放时触发");
           if (this.needSeek) {
@@ -3969,8 +3941,7 @@ export default {
             this.postStudyRecord(0, this.playSectionId);
           }, 15000);
         });
-
-        this.player.on("s2j_onPlayOver", async () => {
+        polyvPlayerContext.on("s2j_onPlayOver", async () => {
           // 当前视频播放完毕时触发
           this.hasStart = false;
           this.clearBarTimer();
@@ -3988,7 +3959,8 @@ export default {
     clears() {
       return new Promise((resolve, reject) => {
         this.vid = "";
-        this.player && this.player.destroy();
+        polyvPlayerContext && polyvPlayerContext.destroy();
+        polyvPlayerContext = null;
         resolve();
       });
     },