|
@@ -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>
|