lsc 3 minggu lalu
induk
melakukan
3728732599
1 mengubah file dengan 24 tambahan dan 0 penghapusan
  1. 24 0
      src/components/pptEasyClass/index_old.vue

+ 24 - 0
src/components/pptEasyClass/index_old.vue

@@ -40,7 +40,10 @@
 </template>
 
 <script>
+import { myMixin } from '../../mixins/mixin';
+
 export default {
+  mixins: [myMixin],
   data() {
     return {
       id: this.$route.query.courseId,
@@ -59,6 +62,7 @@ export default {
       courseDetail: {},
       pageLoading: false,
       inviteCode:"",
+      startTime: "",
       opertimer: null, // 定时器
     };
   },
@@ -205,8 +209,28 @@ export default {
   destroyed() {
     clearInterval(this.opertimer);
     this.opertimer = null;
+    if (this.courseDetail.userid == this.userid && this.tcid2 && this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840') {
+      let endTime = new Date().toLocaleString("zh-CN", {
+        hour12: false,
+        timeZone: "Asia/Shanghai"
+      }).replace(/\//g, "-")
+      let courseTime = Math.floor((new Date(endTime) - new Date(this.startTime)) / (1000 * 60))
+      this.syncClassData({
+        courseId: this.id,
+        title: this.courseDetail.title,
+        courseGrade: this.tcid2,
+        courseTime: courseTime,
+        startTime: this.startTime,
+        endTime: endTime,
+      })
+      console.log('同步数据')
+    }
   },
   mounted() {
+    this.startTime = new Date().toLocaleString("zh-CN", {
+      hour12: false,
+      timeZone: "Asia/Shanghai"
+    }).replace(/\//g, "-")
     this.getCourseDetail();
     this.setOperationTime();
   }