lsc 2 years ago
parent
commit
65b04f8f64

+ 2 - 2
config/index.js

@@ -51,8 +51,8 @@ module.exports = {
 
     productionSourceMap: true,
     // https://webpack.js.org/configuration/devtool/#production
-    devtool: '#source-map',
-    // devtool: 'cheap-module-eval-source-map',
+    // devtool: '#source-map',
+    devtool: 'cheap-module-eval-source-map',
 
     // Gzip off by default as many popular static hosts such as
     // Surge or Netlify already gzip all static assets for you.

+ 1 - 1
dist/index.html

@@ -18,4 +18,4 @@
       border-radius: 10px;
       -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
       background-color: rgba(0, 0, 0, 0.1);
-    }</style><link href=./static/css/app.a6d12d9a72cd67cb69932a0de53d0140.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.e0b99d2da8a8198154ec.js></script><script type=text/javascript src=./static/js/app.e2645e29e08c8aa51407.js></script></body></html><script>document.domain = "cocorobo.cn"</script>
+    }</style><link href=./static/css/app.b82405ff20690950f87dd56e73e9794a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.2f67952e7fcc55561412.js></script><script type=text/javascript src=./static/js/app.c29685ccf18b4f45dcde.js></script></body></html><script>document.domain = "cocorobo.cn"</script>

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.b82405ff20690950f87dd56e73e9794a.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.b82405ff20690950f87dd56e73e9794a.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.c29685ccf18b4f45dcde.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.e2645e29e08c8aa51407.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.e2645e29e08c8aa51407.js.map


+ 1 - 2
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js

@@ -1,2 +1 @@
-!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);
-//# sourceMappingURL=manifest.3ad1d5771e9b13dbdad2.js.map
+!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.2f67952e7fcc55561412.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.e0b99d2da8a8198154ec.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.e0b99d2da8a8198154ec.js.map


+ 2 - 1
src/components/components/pdf.vue

@@ -72,7 +72,8 @@ export default {
     pageTotalNum(val) {
       if (val) {
         this.loading.close();
-        this.$parent.setData();
+        // this.$parent.setData();
+        this.$parent.getRealTimeClass();
       }
       this.$emit("getPageTotal", val);
     },

+ 139 - 21
src/components/liveProjectDetail.vue

@@ -1007,6 +1007,7 @@ export default {
       LuAudioUrl: "",
       isRecord: false,
       isPlayerRecord: false,
+      handle: {},
     };
   },
   methods: {
@@ -1748,16 +1749,26 @@ export default {
       this.selectSWork();
     },
     pick() {
+      this.handle.type = 0;
+      this.handle.userid = "";
       let params = [
         {
-          h: "",
+          h: JSON.stringfy(this.handle),
           cid: this.cid,
         },
       ];
       this.ajax
-        .post(this.$store.state.api + "updatePPTHandle", params)
+        .post(this.$store.state.api + "updatePptPage", params)
         .then((res) => {
           // this.dialogVisiblePick = false;
+          let mindinfo = this.setInfo(
+            this.cid,
+            "us.mindNetwork",
+            this.handle,
+            "update",
+            this.userid
+          );
+          this.updateSocket(mindinfo);
         })
         .catch((err) => {
           console.error(err);
@@ -1775,21 +1786,18 @@ export default {
         .get(this.$store.state.api + "selectPptPage", params)
         .then((res) => {
           if (res.data[0].length > 0) {
+            let _res = JSON.parse(res.data[0][0].page);
+            this.handle = _res;
             if (
-              res.data[0][0].handle &&
-              JSON.parse(res.data[0][0].handle).type == 2 &&
-              JSON.parse(res.data[0][0].handle).userid == this.userid &&
+              _res.type == 2 &&
+              _res.userid == this.userid &&
               this.isBlock != 10 &&
-              this.tools[res.data[0][0].page - 1].tools.indexOf(12) != -1
+              this.tools[_res.page - 1].tools.indexOf(12) != -1
             ) {
               this.dialogVisiblePick = true;
             }
-            if (
-              res.data[0][0].handle &&
-              JSON.parse(res.data[0][0].handle).type == 1 &&
-              this.videoList.length
-            ) {
-              let handle = JSON.parse(res.data[0][0].handle);
+            if (_res.type == 1 && this.videoList.length) {
+              let handle = _res;
               let a = this.$refs.zVideo;
 
               if (handle.isPlay == 1) {
@@ -1801,10 +1809,10 @@ export default {
               this.$refs.zVideo.player.pause();
             }
 
-            if (this.ppage == res.data[0][0].page && this.isBlock !== 0) {
+            if (this.ppage == _res.page && this.isBlock !== 0) {
               return;
             } else {
-              this.ppage = res.data[0][0].page;
+              this.ppage = _res.page;
               // this.ppage = 1;
               // this.ppage = 11;
               this.typeC = [];
@@ -1903,20 +1911,130 @@ export default {
         _this.setPage();
       }, 1000);
     },
+    getRealTimeClass() {
+      let params = [
+        {
+          type: "getRealTimeClass",
+          docid: this.cid,
+          pageid: window.parent.US.pageId,
+          userid: this.userid,
+          post: "1",
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.socket, params)
+        .then((res) => {
+          if (res.data[0].length) {
+            let _res = {};
+            try {
+              _res = JSON.parse(res.data[0][0].page);
+            } catch (error) {
+              _res = res.data[0][0].page;
+            }
+            this.setPptData(_res)
+          }
+          console.log(res);
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    setPptData(res) {
+      let _res = res
+      this.handle = _res;
+      if (
+        _res.type == 2 &&
+        _res.userid == this.userid &&
+        this.isBlock != 10 &&
+        this.tools[_res.page - 1].tools.indexOf(12) != -1
+      ) {
+        this.dialogVisiblePick = true;
+      }
+      if (_res.type == 1 && this.videoList.length) {
+        let handle = _res;
+        let a = this.$refs.zVideo;
+
+        if (handle.isPlay == 1) {
+          a.player.play();
+        } else if (handle.isPlay == 2) {
+          a.player.pause();
+        }
+      } else if (this.$refs.zVideo) {
+        this.$refs.zVideo.player.pause();
+      }
+
+      if (this.ppage == _res.page && this.isBlock !== 0) {
+        return;
+      } else {
+        this.ppage = _res.page;
+        // this.ppage = 1;
+        // this.ppage = 11;
+        this.typeC = [];
+        this.isAnswer = false;
+        this.howPage(this.ppage);
+      }
+    },
+    setInfo(id, navid, content, type, userid) {
+      var _data = {
+        "us.realTimeClass": [
+          {
+            sendId: userid, //发送人id
+            receiveId: id, //文件id
+            type: navid, //消息类型
+            messageInfo: {
+              id: id, //操作ID
+              type: type, //类型
+              content: content, //内容
+              docId: id, //文档id
+              pageId: top.US.pageId, //当前页面id
+            },
+          },
+        ],
+      };
+      return _data;
+    },
+    updateSocket(mindinfo) {
+      let params = [
+        {
+          type: "send",
+          mindinfo: encodeURIComponent(
+            encodeURIComponent(JSON.stringify(mindinfo))
+          ),
+          post: 1,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.socket, params)
+        .then((res) => {
+          console.log(res);
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
   },
   beforeDestroy() {
     clearInterval(this.timer);
     this.timer = null;
-    // window.removeEventListener("message");
+    window.removeEventListener("message");
   },
   created() {
     this.getData();
-    // window.addEventListener("message", function (e) {
-    //   // 监听 message 事件
-    //   if (e.data.type && e.data.type == "shishi_canvas") {
-    //     console.log(e.data.data);
-    //   }
-    // });
+    // this.getRealTimeClass()
+
+    let _this = this;
+    window.addEventListener("message", function (e) {
+      // 监听 message 事件
+      if (
+        e.data.type &&
+        e.data.type == "realTimeClass_update" &&
+        e.data.info.docId == _this.cid
+      ) {
+        // _this.data[e.data.info.id] = e.data.info.content;
+        this.setPptData(e.data.info.content)
+      }
+      _this.$forceUpdate();
+    });
   },
 };
 </script>

+ 1 - 0
src/config/config.js

@@ -10,6 +10,7 @@ const store = new Vuex.Store({
         userInfo: {},
         nCount: 0,
         api: 'https://pbl.cocorobo.cn/api/pbl/',
+        socket: "https://poll.cocorobo.cn",
         // api: 'http://localhost:7003/api/pbl/',
     },
 

Some files were not shown because too many files changed in this diff