|
@@ -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('?')
|
|
@@ -1105,16 +1105,50 @@ window.initHot = function (model) {
|
|
|
if (!openHot && !needExamine) return
|
|
|
|
|
|
if (openHot && this.info.linkType != "common" && this.info.iframe && this.info.iframe[0]) {
|
|
|
- // // 注意,因为网站用了vue router, url里看上去像是查询片段的那一段其实是放在hash片段中的。
|
|
|
- // const hotspotWebQuerySection = new URLSearchParams(this.info.iframe[0].split('?')[1])
|
|
|
- // // console.log('111', hotspotWebQuerySection.get('m'));
|
|
|
-
|
|
|
- // const mainWebQuerySection = new URLSearchParams(location.href.split('?')[1])
|
|
|
- // mainWebQuerySection.set('m', '1302')
|
|
|
- // const newLocation = location.href.split('?')[0] + '?' + mainWebQuerySection.toString()
|
|
|
- // location.assign(newLocation)
|
|
|
- // location.reload(true)
|
|
|
-
|
|
|
+ // 注意,因为网站用了vue router, url里看上去像是查询片段的那一段其实是放在hash片段中的。
|
|
|
+ const hotspotWebQuerySection = new URLSearchParams(this.info.iframe[0].split('?')[1])
|
|
|
+ const targetSceneCode = hotspotWebQuerySection.get('m')
|
|
|
+
|
|
|
+ if (targetSceneCode === '1300') {
|
|
|
+ const iframeElem = document.createElement('iframe')
|
|
|
+ iframeElem.style.position = 'absolute'
|
|
|
+ iframeElem.style.top = '0'
|
|
|
+ iframeElem.style.left = '0'
|
|
|
+ iframeElem.style.width = '100%'
|
|
|
+ iframeElem.style.height = '100%'
|
|
|
+ iframeElem.style.zIndex = '9999'
|
|
|
+ // iframeElem.src = 'http://192.168.20.16:8081/#/topic'
|
|
|
+ iframeElem.src = '/AnhuiDaily/quiz/index.html#/topic'
|
|
|
+ document.documentElement.appendChild(iframeElem)
|
|
|
+
|
|
|
+ const onMsg = (msg) => {
|
|
|
+ console.log('message received!', msg);
|
|
|
+ window.removeEventListener('message', onMsg, false)
|
|
|
+ if (msg.data === 'quiz over') {
|
|
|
+
|
|
|
+ // 注意,因为网站用了vue router, url里看上去像是查询片段的那一段其实是放在hash片段中的。
|
|
|
+ const hotspotWebQuerySection = new URLSearchParams(this.info.iframe[0].split('?')[1])
|
|
|
+
|
|
|
+ // 跳转到新场景
|
|
|
+ const mainWebQuerySection = new URLSearchParams(location.href.split('?')[1])
|
|
|
+ mainWebQuerySection.set('m', hotspotWebQuerySection.get('m'))
|
|
|
+ const newLocation = location.href.split('?')[0] + '?' + mainWebQuerySection.toString()
|
|
|
+ location.assign(newLocation)
|
|
|
+ location.reload(true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ window.addEventListener('message', onMsg, false)
|
|
|
+ } else {
|
|
|
+ // 跳转到新场景
|
|
|
+ const mainWebQuerySection = new URLSearchParams(location.href.split('?')[1])
|
|
|
+ mainWebQuerySection.set('m', targetSceneCode)
|
|
|
+ const newLocation = location.href.split('?')[0] + '?' + mainWebQuerySection.toString()
|
|
|
+ location.assign(newLocation)
|
|
|
+ location.reload(true)
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
|
|
|
|
|
|
var src = getLink(this.info.iframe[0])
|
|
@@ -1173,18 +1207,6 @@ window.initHot = function (model) {
|
|
|
var popup = document.getElementById("popup")
|
|
|
|
|
|
if (openHot) {
|
|
|
- // // 注意,因为网站用了vue router, url里看上去像是查询片段的那一段其实是放在hash片段中的。
|
|
|
- // const hotspotWebQuerySection = new URLSearchParams(this.info.link.split('?')[1])
|
|
|
- // // console.log('222', hotspotWebQuerySection.get('m'));
|
|
|
-
|
|
|
- // const mainWebQuerySection = new URLSearchParams(location.href.split('?')[1])
|
|
|
- // mainWebQuerySection.set('m', '1302')
|
|
|
- // const newLocation = location.href.split('?')[0] + '?' + mainWebQuerySection.toString()
|
|
|
- // location.assign(newLocation)
|
|
|
- // location.reload(true)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
g_currentHot = this,
|
|
|
popup.style.display = "block",
|
|
|
popup.classList.add("wait")
|