Commit 350ea740 authored by 张伯涛's avatar 张伯涛

ar模块调整

parent ba4d1397
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
}; };
}, },
mounted() { mounted() {
document.addEventListener('visibilitychange', this.handleVisibilityChange); // document.addEventListener('visibilitychange', this.handleVisibilityChange);
document.title = "AR车间"; document.title = "AR车间";
console.log("----state----", this.$store.state, document.title); console.log("----state----", this.$store.state, document.title);
this.ip = window.location.hostname; this.ip = window.location.hostname;
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
this.getClientInfo(); this.getClientInfo();
}, },
unmounted() { unmounted() {
document.removeEventListener('visibilitychange', this.handleVisibilityChange); // document.removeEventListener('visibilitychange', this.handleVisibilityChange);
}, },
beforeDestroy() { beforeDestroy() {
console.log('销毁销毁销毁销毁销毁销毁销毁销毁销毁销毁销毁') console.log('销毁销毁销毁销毁销毁销毁销毁销毁销毁销毁销毁')
...@@ -85,40 +85,28 @@ export default { ...@@ -85,40 +85,28 @@ export default {
next(); next();
}, },
methods: { methods: {
handleVisibilityChange() { // handleVisibilityChange() {
if (document.hidden) { // if (document.hidden) {
console.log('隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏') // console.log('隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏')
if (this.control) { // if (this.control) {
this.control.setWindowStatus(2); // this.control.setWindowStatus(2);
this.control = null; // this.control = null;
} // }
} else { // } else {
// setTimeout(function () { // // setTimeout(function () {
console.log('显示显示显示显示显示显示显示显示显示显示显示') // console.log('显示显示显示显示显示显示显示显示显示显示显示',document.webkitFullscreenElement)
document.title = "AR车间"; // document.title = "AR车间";
this.ip = window.location.hostname; // this.ip = window.location.hostname;
this.protocolType = window.location.protocol.replace(':', '') // this.protocolType = window.location.protocol.replace(':', '')
if (window.location.port) { // if (window.location.port) {
this.port = window.location.port; // this.port = window.location.port;
} else { // } else {
this.port = this.protocolType === "https" ? "443" : "80"; // this.port = this.protocolType === "https" ? "443" : "80";
} // }
/* // 获取浏览器窗口的宽高 // this.getClientInfo();
const windowWidth = window.innerWidth; // // }, 2000);
// 获取屏幕的宽高 // }
const screenWidth = screen.width; // },
// 比较窗口尺寸与屏幕尺寸
if (windowWidth === screenWidth) {
} else {
}
console.log('windowWidth', windowWidth)
console.log('screenWidth', screenWidth)*/
this.getClientInfo();
// }, 2000);
}
},
init() { init() {
// 初始化 // 初始化
if (this.control) { if (this.control) {
...@@ -141,10 +129,10 @@ export default { ...@@ -141,10 +129,10 @@ export default {
const port = this.raData.port; const port = this.raData.port;
const userName = this.raData.username; const userName = this.raData.username;
const loginKey = this.raData.tgc; const loginKey = this.raData.tgc;
const left = '0'; // const left = '0';
const top = '100'; // const top = '100';
const width = window.innerWidth; // const width = window.innerWidth;
const height = window.innerHeight-25; // const height = window.innerHeight-25;
// const protocolType = this.protocolType // const protocolType = this.protocolType
const protocolType = 'https' const protocolType = 'https'
const domainId = 103 const domainId = 103
...@@ -156,10 +144,6 @@ export default { ...@@ -156,10 +144,6 @@ export default {
port, port,
userName, userName,
loginKey, loginKey,
left,
top,
width,
height,
protocolType, protocolType,
domainId, domainId,
arIndexCode, arIndexCode,
...@@ -168,6 +152,22 @@ export default { ...@@ -168,6 +152,22 @@ export default {
// 程序挂载成功 // 程序挂载成功
window.addEventListener("ar_start", event => { window.addEventListener("ar_start", event => {
console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk') console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk')
// // 获取浏览器窗口的宽高
// const windowWidth = window.innerWidth;
// const windowHeight = window.innerHeight;
// // 获取屏幕的宽高
// const screenWidth = screen.width;
// const screenHeight = screen.height;
// // 比较窗口尺寸与屏幕尺寸
// if (windowWidth === screenWidth && windowHeight > screenHeight - 200) {
// console.log('全屏')
// } else {
// setTimeout(function () {
//
// console.log('不全屏')
// }, 2000);
//
// }
this.videoLoading = false this.videoLoading = false
}); });
window.addEventListener("ar_loaded", event => { window.addEventListener("ar_loaded", event => {
...@@ -307,6 +307,9 @@ body { ...@@ -307,6 +307,9 @@ body {
padding-top: 45px; padding-top: 45px;
width: 100vw; /* 100% of the viewport width */ width: 100vw; /* 100% of the viewport width */
height: 94vh; /* 100% of the viewport height */ height: 94vh; /* 100% of the viewport height */
//width: 100%;
//height: 100%;
} }
.errorContent { .errorContent {
position: fixed; position: fixed;
......
...@@ -528,10 +528,6 @@ import store from "@/store/index.js"; ...@@ -528,10 +528,6 @@ import store from "@/store/index.js";
port, port,
userName, userName,
loginKey, loginKey,
left,
top,
width,
height,
protocolType, protocolType,
domainId, domainId,
arIndexCode, arIndexCode,
...@@ -557,11 +553,11 @@ import store from "@/store/index.js"; ...@@ -557,11 +553,11 @@ import store from "@/store/index.js";
this.arControlVisibility = false this.arControlVisibility = false
this.arDivVisibility = true this.arDivVisibility = true
// var _this$_getDomPosition = this._getDomPosition(), var _this$_getDomPosition = this._getDomPosition(),
// left = _this$_getDomPosition.left, left = _this$_getDomPosition.left,
// top = _this$_getDomPosition.top, top = _this$_getDomPosition.top,
// width = _this$_getDomPosition.width, width = _this$_getDomPosition.width,
// height = _this$_getDomPosition.height height = _this$_getDomPosition.height
this.controlSetupDom = document.createElement('a') this.controlSetupDom = document.createElement('a')
var title = window.top.document.title var title = window.top.document.title
...@@ -626,7 +622,6 @@ import store from "@/store/index.js"; ...@@ -626,7 +622,6 @@ import store from "@/store/index.js";
top = _this$_getDomPosition2.top, top = _this$_getDomPosition2.top,
width = _this$_getDomPosition2.width, width = _this$_getDomPosition2.width,
height = _this$_getDomPosition2.height height = _this$_getDomPosition2.height
_this.setPosition(left, top, width, height) _this.setPosition(left, top, width, height)
canRun = true canRun = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment