|
@@ -37,8 +37,8 @@ window.initHot = function (model) {
|
|
|
var getLink = function (link) {
|
|
|
var querySectionInLink = link.split('?')[1]
|
|
|
var langParam = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
|
|
|
- return `http://192.168.20.16:8085/#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
|
|
|
- // return `/AnhuiDaily/hotspot/index.html#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
|
|
|
+ // return `http://192.168.20.16:8085/#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
|
|
|
+ return `/AnhuiDaily/hotspot/index.html#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
|
|
|
}
|
|
|
var removeSrcPostMark = function (url) {//去除texture.load时自动加上的'?'
|
|
|
var index = url.indexOf('?')
|
|
@@ -1088,159 +1088,150 @@ window.initHot = function (model) {
|
|
|
|
|
|
|
|
|
examine(options = {}) {
|
|
|
- console.log('打开热点,关闭背景音乐');
|
|
|
-
|
|
|
- // 判断当前背景音乐是开的还是关的
|
|
|
- let tempp =document.querySelector('#openMusic')
|
|
|
- if(tempp.style.display==='block') {
|
|
|
- // 背景音乐当前为关闭状态
|
|
|
- window.musicFlagNow = '音乐关'
|
|
|
- } else {
|
|
|
- window.musicFlagNow = '音乐开'
|
|
|
- SoundManager.pause('bgm')
|
|
|
+ console.log('打开热点,关闭背景音乐')
|
|
|
+
|
|
|
+ // 判断当前背景音乐是开的还是关的
|
|
|
+ let tempp = document.querySelector('#openMusic')
|
|
|
+ if (tempp.style.display === 'block') {
|
|
|
+ // 背景音乐当前为关闭状态
|
|
|
+ window.musicFlagNow = '音乐关'
|
|
|
+ } else {
|
|
|
+ window.musicFlagNow = '音乐开'
|
|
|
+ SoundManager.pause('bgm')
|
|
|
+ }
|
|
|
+
|
|
|
+ var openHot = this.info.link && this.info.actionType.openHot && !options.dontOpen
|
|
|
+ var needExamine = options.examine || (!settings.dontExamHot && this.info.actionType.examine)
|
|
|
+ if (!openHot && !needExamine) return
|
|
|
+
|
|
|
+
|
|
|
+ if (openHot && this.info.linkType != "common" && this.info.iframe && this.info.iframe[0]) {
|
|
|
+ var src = getLink(this.info.iframe[0])
|
|
|
+
|
|
|
+ if (this.info.linkType == "jumpLink") {
|
|
|
+ var newPage = window.open(src, "_blank")
|
|
|
+ newPage.focus()
|
|
|
+
|
|
|
+ } else if (this.info.linkType == "iframeDiv") {
|
|
|
+
|
|
|
+ var div = document.createElement("div")
|
|
|
+ div.style.position = 'fixed'
|
|
|
+ div.style.width = div.style.height = "100%"
|
|
|
+ div.style.left = div.style.top = '0'
|
|
|
+ div.style["z-index"] = "999"
|
|
|
+
|
|
|
+ var exit = document.createElement("div")
|
|
|
+ exit.style["background-image"] = "url(images/vrOffImg.png)"
|
|
|
+ exit.style.position = 'absolute'
|
|
|
+ exit.style.width = exit.style.height = "50px"
|
|
|
+ exit.style.left = '17px'; exit.style.top = "20px"
|
|
|
+ exit.style.cursor = "pointer"
|
|
|
+ exit.style["background-repeat"] = "no-repeat"
|
|
|
+ exit.style["background-size"] = "25%"
|
|
|
+ exit.style["background-position"] = "center center"
|
|
|
+ exit.style["background-color"] = "rgba(0, 0, 0, 0.2)"
|
|
|
+ exit.style["border-radius"] = "50%"
|
|
|
+ exit.style["z-index"] = "3"
|
|
|
+ exit.onclick = () => {
|
|
|
+ $(div).remove()
|
|
|
+
|
|
|
+ Hot.closePopup()
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ var myElement = document.createElement("iframe")
|
|
|
+ myElement.style.position = 'absolute'
|
|
|
+ myElement.style.width = myElement.style.height = "100%"
|
|
|
+ myElement.style.left = myElement.style.top = '0'
|
|
|
+
|
|
|
+ myElement.src = src
|
|
|
+
|
|
|
+ $("body").append(div)
|
|
|
+ div.appendChild(exit)
|
|
|
+ div.appendChild(myElement)
|
|
|
+
|
|
|
+ SoundManager.play('hot')
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- var openHot = this.info.link && this.info.actionType.openHot && !options.dontOpen
|
|
|
- var needExamine = options.examine || (!settings.dontExamHot && this.info.actionType.examine)
|
|
|
- if (!openHot && !needExamine) return;
|
|
|
-
|
|
|
-
|
|
|
- if (openHot && this.info.linkType != "common" && this.info.iframe && this.info.iframe[0]) {
|
|
|
- var src = getLink(this.info.iframe[0]);
|
|
|
-
|
|
|
- if (this.info.linkType == "jumpLink") {
|
|
|
- var newPage = window.open(src, "_blank");
|
|
|
- newPage.focus();
|
|
|
-
|
|
|
- } else if (this.info.linkType == "iframeDiv") {
|
|
|
-
|
|
|
- var div = document.createElement("div");
|
|
|
- div.style.position = 'fixed';
|
|
|
- div.style.width = div.style.height = "100%";
|
|
|
- div.style.left = div.style.top = '0';
|
|
|
- div.style["z-index"] = "999"
|
|
|
-
|
|
|
- var exit = document.createElement("div");
|
|
|
- exit.style["background-image"] = "url(images/vrOffImg.png)";
|
|
|
- exit.style.position = 'absolute';
|
|
|
- exit.style.width = exit.style.height = "50px";
|
|
|
- exit.style.left = '17px'; exit.style.top = "20px"
|
|
|
- exit.style.cursor = "pointer";
|
|
|
- exit.style["background-repeat"] = "no-repeat";
|
|
|
- exit.style["background-size"] = "25%";
|
|
|
- exit.style["background-position"] = "center center";
|
|
|
- exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
|
|
|
- exit.style["border-radius"] = "50%";
|
|
|
- exit.style["z-index"] = "3"
|
|
|
- exit.onclick = () => {
|
|
|
- $(div).remove()
|
|
|
-
|
|
|
- Hot.closePopup()
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- var myElement = document.createElement("iframe");
|
|
|
- myElement.style.position = 'absolute';
|
|
|
- myElement.style.width = myElement.style.height = "100%";
|
|
|
- myElement.style.left = myElement.style.top = '0';
|
|
|
-
|
|
|
- myElement.src = src
|
|
|
-
|
|
|
- $("body").append(div);
|
|
|
- div.appendChild(exit);
|
|
|
- div.appendChild(myElement)
|
|
|
-
|
|
|
- SoundManager.play('hot')
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- return;
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!player.currentPano) return
|
|
|
+
|
|
|
+ var popup = document.getElementById("popup")
|
|
|
+
|
|
|
+ if (openHot) {
|
|
|
+ g_currentHot = this,
|
|
|
+ popup.style.display = "block",
|
|
|
+ popup.classList.add("wait")
|
|
|
+ var n = document.createElement("iframe")
|
|
|
+
|
|
|
+ SoundManager.play('hot')
|
|
|
+
|
|
|
+ var src = getLink(this.info.link)
|
|
|
+ n.src = src
|
|
|
+ n.id = "id1",
|
|
|
+ n.allowTransparency = "true"
|
|
|
+ var a = document.getElementById("id1")
|
|
|
+ if (void 0 === a || null == a) {
|
|
|
+ document.querySelector(".popup-content").appendChild(n)
|
|
|
+ var s = !1
|
|
|
+ window.loaddingSuccess = function () {
|
|
|
+ s = !0
|
|
|
+ }
|
|
|
+ ,
|
|
|
+ setTimeout(function e() {
|
|
|
+ if (s) {
|
|
|
+ var t = document.querySelector("#id1").contentWindow.document
|
|
|
+ t.querySelector("video") && (t.querySelector("video").play(),
|
|
|
+ !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
|
|
|
+ t.querySelector("audio") && t.querySelector("audio").play()
|
|
|
+ } else
|
|
|
+ setTimeout(e, 300)
|
|
|
+ }, 800)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- if (!player.currentPano) return;
|
|
|
-
|
|
|
-
|
|
|
- var popup = document.getElementById("popup");
|
|
|
-
|
|
|
- if (openHot) {
|
|
|
- g_currentHot = this,
|
|
|
- popup.style.display = "block",
|
|
|
- popup.classList.add("wait");
|
|
|
- var n = document.createElement("iframe");
|
|
|
-
|
|
|
- SoundManager.play('hot')
|
|
|
-
|
|
|
- var src = getLink(this.info.link)
|
|
|
- n.src = src;
|
|
|
- n.id = "id1",
|
|
|
- n.allowTransparency = "true";
|
|
|
- var a = document.getElementById("id1");
|
|
|
- if (void 0 === a || null == a) {
|
|
|
- document.querySelector(".popup-content").appendChild(n);
|
|
|
- var s = !1;
|
|
|
- window.loaddingSuccess = function () {
|
|
|
- s = !0
|
|
|
- }
|
|
|
- ,
|
|
|
- setTimeout(function e() {
|
|
|
- if (s) {
|
|
|
- var t = document.querySelector("#id1").contentWindow.document;
|
|
|
- t.querySelector("video") && (t.querySelector("video").play(),
|
|
|
- !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
|
|
|
- t.querySelector("audio") && t.querySelector("audio").play()
|
|
|
- } else
|
|
|
- setTimeout(e, 300)
|
|
|
- }, 800)
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ var done = function () {
|
|
|
+ player.flyingToTag = !1
|
|
|
+ openHot && popup.classList.remove("wait")
|
|
|
+ }.bind(this)
|
|
|
+
|
|
|
+ if (!needExamine) {
|
|
|
+ done()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var c = this.closestPanoTowardTag(player.mode, player.currentPano) || player.currentPano
|
|
|
+ , h = this.mesh.getWorldPosition()
|
|
|
+ player.flyingToTag = !0
|
|
|
+
|
|
|
+ if (player.mode === 'panorama') {
|
|
|
+ var d = {
|
|
|
+ pano: c,
|
|
|
+ lookAtPoint: h,
|
|
|
+ duration: options.duration,
|
|
|
+ maxDistanceOverride: null,
|
|
|
+ skipWarpingCheck: !1,
|
|
|
+ aimDuration: options.aimDuration,
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- var done = function () {
|
|
|
- player.flyingToTag = !1;
|
|
|
- openHot && popup.classList.remove("wait")
|
|
|
- }.bind(this);
|
|
|
-
|
|
|
-
|
|
|
- if (!needExamine) {
|
|
|
- done()
|
|
|
- return;
|
|
|
+ player.flyToPano(d, done)
|
|
|
+ } else {
|
|
|
+ var p = {
|
|
|
+ pano: c
|
|
|
}
|
|
|
-
|
|
|
- var c = this.closestPanoTowardTag(player.mode, player.currentPano) || player.currentPano
|
|
|
- , h = this.mesh.getWorldPosition();
|
|
|
- player.flyingToTag = !0;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (player.mode === 'panorama') {
|
|
|
- var d = {
|
|
|
- pano: c,
|
|
|
- lookAtPoint: h,
|
|
|
- duration: options.duration,
|
|
|
- maxDistanceOverride: null,
|
|
|
- skipWarpingCheck: !1,
|
|
|
- aimDuration: options.aimDuration,
|
|
|
-
|
|
|
- };
|
|
|
- player.flyToPano(d, done)
|
|
|
- } else {
|
|
|
- var p = {
|
|
|
- pano: c
|
|
|
- };
|
|
|
- if (h) {
|
|
|
- var f = (new THREE.Matrix4).lookAt(c.position, h, new THREE.Vector3(0, 1, 0));
|
|
|
- p.quaternion = (new THREE.Quaternion).setFromRotationMatrix(f)
|
|
|
- }
|
|
|
- p.callback = done,
|
|
|
- p.duration = options.duration || 1500,
|
|
|
- p.mode = 'panorama',
|
|
|
- p.aimDuration = options.aimDuration
|
|
|
- player.flyToNewMode(p)
|
|
|
+ if (h) {
|
|
|
+ var f = (new THREE.Matrix4).lookAt(c.position, h, new THREE.Vector3(0, 1, 0))
|
|
|
+ p.quaternion = (new THREE.Quaternion).setFromRotationMatrix(f)
|
|
|
}
|
|
|
+ p.callback = done,
|
|
|
+ p.duration = options.duration || 1500,
|
|
|
+ p.mode = 'panorama',
|
|
|
+ p.aimDuration = options.aimDuration
|
|
|
+ player.flyToNewMode(p)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|