谢杰标 2 anni fa
parent
commit
dbc5d4e4f2
3 ha cambiato i file con 169 aggiunte e 115 eliminazioni
  1. 129 0
      components/course/noteBox.vue
  2. 20 28
      components/myPlayer/polyvPlayer.vue
  3. 20 87
      pages3/polyv/detail.vue

+ 129 - 0
components/course/noteBox.vue

@@ -0,0 +1,129 @@
+<template>
+  <view>
+    <view v-if="noteList.length == 0" style="text-align: center">暂无笔记</view>
+    <view v-for="(item, index) in noteList" :key="index">
+      <view class="dateBox">{{ $method.timestampToTime(item.dateNote) }}</view>
+      <view class="noteBox">
+        <view
+          v-for="(item1, index1) in item.userNotes"
+          :key="index1"
+          style="margin-top: 30rpx"
+          @click="jumpNote(item1)"
+        >
+          <view style="display: flex">
+            <view class="left_ti">
+              <view>
+                <image
+                  src="/static/icon/note2.png"
+                  v-if="noteId != item1.noteId"
+                  style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
+                ></image>
+                <image
+                  src="/static/icon/note1.png"
+                  v-if="noteId == item1.noteId"
+                  style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
+                ></image>
+              </view>
+              <view
+                class="title"
+                style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
+                >{{ $method.secondToDate(item1.noteSecond) }}</view
+              >
+            </view>
+            <view style="margin-left: 10rpx">
+              <view class="t2Content leftPadding">{{ item1.sectionName }}</view>
+              <view class="tBox2">{{ item1.noteText }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+export default {
+  name: "SaasMiniprogramNoteBox",
+  props: {
+    params: {
+      type: Object,
+      defaule: {},
+    },
+  },
+  data() {
+    return {
+      noteList: [],
+      noteId: 0,
+    };
+  },
+  mounted() {
+    this.getNoteList();
+  },
+
+  methods: {
+    getNoteList() {
+      this.$api
+        .noteList({ ...this.param, ...{ sectionId: this.playSectionId } })
+        .then((res) => {
+          if (res.data.code == 200) {
+            this.noteList = res.data.rows;
+            console.log(this.noteList, 789);
+          }
+        });
+    },
+    jumpNote(item) {
+      this.noteId = item.noteId;
+      this.$emit('jumpNote', item);
+    },
+  },
+  computed: {
+    ...mapGetters(["playSectionId"]),
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.leftPadding {
+  margin-left: 8rpx;
+}
+.dateBox {
+  width: 216rpx;
+  height: 48rpx;
+  background: #ffffff;
+  border-radius: 24rpx;
+  font-size: 24rpx;
+  color: #666666;
+  text-align: center;
+  line-height: 48rpx;
+  margin: 16rpx 0rpx 8rpx;
+}
+.noteBox {
+  width: 100%;
+  background: #ffffff;
+  padding: 0rpx 10rpx 20rpx;
+  border-radius: 16rpx;
+  overflow: hidden;
+  .left_ti {
+    padding-top: 14rpx;
+    .title {
+      font-size: 24rpx;
+      color: #999999;
+    }
+  }
+}
+.t2Content {
+  font-size: 24rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: #999999;
+  line-height: 48rpx;
+}
+.tBox2 {
+  display: flex;
+  padding-top: 10rpx;
+  color: #333333;
+  font-size: 30rpx;
+  font-weight: 400;
+}
+</style>

+ 20 - 28
components/myPlayer/polyvPlayer.vue

@@ -87,12 +87,12 @@ export default {
     if (this.vid) {
       this.changeVid(this.vid);
     }
-    if (this.vct > 0) {
-      this.videoToastShow = true;
-      setTimeout(() => {
-        this.closeToast();
-      }, 3000);
-    }
+    // if (this.vct > 0) {
+    //   this.videoToastShow = true;
+    //   setTimeout(() => {
+    //     this.closeToast();
+    //   }, 3000);
+    // }
   },
   methods: {
     loadPlayerScript(callback) {
@@ -279,7 +279,9 @@ export default {
       if (!data) {
         return;
       }
-      this.config = this.$method.isObject(data) ? data : { vid: data };
+      this.config = this.$method.isObject(data)
+        ? data
+        : { vid: data, videoCurrentTime: this.videoCurrentTime };
       if (!this.vid) {
         return;
       }
@@ -318,27 +320,17 @@ export default {
     },
   },
   watch: {
-    // vid: {
-    //   handler(id, oldId) {
-    //     console.log("🚀 ~ file: polyvPlayer.vue:271 ~ handler ~ vid:", id);
-    //     if (id) {
-    //       this.changeVid();
-    //     }
-    //   },
-    //   immediate: true,
-    // },
-    // videoCurrentTime: {
-    //   handler(time) {
-    //     console.log("🚀 ~ file: polyvPlayer.vue:285 ~ handler ~ time:", time);
-    //     if (time > 0) {
-    //       this.videoToastShow = true;
-    //       setTimeout(() => {
-    //         this.closeToast();
-    //       }, 3000);
-    //     }
-    //   },
-    //   immediate: true,
-    // },
+    vct: {
+      handler(time) {
+        if (time > 0 && !this.videoToastShow) {
+          this.videoToastShow = true;
+          setTimeout(() => {
+            this.closeToast();
+          }, 3000);
+        }
+      },
+      immediate: true,
+    },
   },
 };
 </script>

+ 20 - 87
pages3/polyv/detail.vue

@@ -184,51 +184,11 @@
           ></handouts-box>
         </view>
         <!--笔记 -->
-        <view v-show="current == 2">
-          <view v-if="noteList.length == 0" style="text-align: center"
-            >暂无笔记</view
-          >
-          <view v-for="(item, index) in noteList" :key="index">
-            <view class="dateBox">{{
-              $method.timestampToTime(item.dateNote)
-            }}</view>
-            <view class="noteBox">
-              <view
-                v-for="(item1, index1) in item.userNotes"
-                :key="index1"
-                style="margin-top: 30rpx"
-                @click="jumpNote(item1)"
-              >
-                <view style="display: flex">
-                  <view class="left_ti">
-                    <view>
-                      <image
-                        src="/static/icon/note2.png"
-                        v-if="noteId != item1.noteId"
-                        style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
-                      ></image>
-                      <image
-                        src="/static/icon/note1.png"
-                        v-if="noteId == item1.noteId"
-                        style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
-                      ></image>
-                    </view>
-                    <view
-                      class="title"
-                      style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
-                      >{{ $method.secondToDate(item1.noteSecond) }}</view
-                    >
-                  </view>
-                  <view style="margin-left: 10rpx">
-                    <view class="t2Content leftPadding">{{
-                      item1.sectionName
-                    }}</view>
-                    <view class="tBox2">{{ item1.noteText }}</view>
-                  </view>
-                </view>
-              </view>
-            </view>
-          </view>
+        <view v-if="current == 2">
+          <note-Box
+            @jumpNote="jumpNote"
+            :params="params(['orderGoodsId', 'goodsId', 'courseId', 'gradeId'])"
+          ></note-Box>
         </view>
         <!--答疑 -->
         <view v-show="current == 3" class="Answering">
@@ -729,6 +689,7 @@ import handoutsBox from "@/components/course/handoutsBox.vue";
 import PopupPhoto from "@/components/popup/index.vue";
 import myCompressImage from "@/common/compressPhoto.js";
 import myPlayer from "../../components/myPlayer/polyvPlayer.vue";
+import noteBox from "../../components/course/noteBox.vue";
 import { mapGetters, mapMutations } from "vuex";
 import { lockAction } from "../../utils/lock";
 export default {
@@ -739,6 +700,7 @@ export default {
     PopupPhoto,
     handoutsBox,
     myPlayer,
+    noteBox,
   },
   data() {
     return {
@@ -877,6 +839,15 @@ export default {
       }
       return list;
     },
+    params: function () {
+      return (keys = ["orderGoodsId", "goodsId", "courseId"]) => {
+        let params = {};
+        for (const key of keys) {
+          params[key] = this[key];
+        }
+        return params;
+      };
+    },
   },
   watch: {
     showSet(n) {
@@ -942,15 +913,14 @@ export default {
     init() {
       // #ifdef MP-WEIXIN
       this.getCameraSetting();
-      this.isAllowSeek = "no"
+      this.isAllowSeek = "no";
       // #endif
       // #ifdef H5
-      this.isAllowSeek = "on" 
+      this.isAllowSeek = "on";
       // #endif
       // 锁
       lockAction();
       this.lockTimer = setInterval(lockAction, 10000);
-
     },
     // 新增微信公众号模板消息点击数据
     clickOfficial(informId) {
@@ -2100,7 +2070,6 @@ export default {
 
     jumpNote(item) {
       this.$u.toast("即将跳到笔记位置");
-      this.noteId = item.noteId;
       if (this.playSectionId != item.sectionId) {
         this.initPlayVideo({
           sectionType: 1,
@@ -3408,23 +3377,7 @@ export default {
   font-weight: 500;
   color: #333333;
 }
-.leftPadding {
-  margin-left: 8rpx;
-}
-.t2Content {
-  font-size: 24rpx;
-  font-family: PingFang SC;
-  font-weight: bold;
-  color: #999999;
-  line-height: 48rpx;
-}
-.tBox2 {
-  display: flex;
-  padding-top: 10rpx;
-  color: #333333;
-  font-size: 30rpx;
-  font-weight: 400;
-}
+
 .tBox {
   display: flex;
   align-items: center;
@@ -3478,27 +3431,7 @@ export default {
     margin-top: 12rpx;
   }
 }
-.noteBox {
-  width: 100%;
-  background: #ffffff;
-  padding: 0rpx 10rpx 20rpx;
-  border-radius: 16rpx;
-  overflow: hidden;
-  .left_ti {
-    padding-top: 14rpx;
-  }
-}
-.dateBox {
-  width: 216rpx;
-  height: 48rpx;
-  background: #ffffff;
-  border-radius: 24rpx;
-  font-size: 24rpx;
-  color: #666666;
-  text-align: center;
-  line-height: 48rpx;
-  margin: 16rpx 0rpx 8rpx;
-}
+
 .t_content1 {
   color: #007aff;
   margin-left: 10rpx;