Commit 98d4e700 authored by 黄奎's avatar 黄奎

行程特色修改

parent 95cfebc3
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
<!-- ppt 模版行程 --> <!-- ppt 模版行程 -->
<div v-if="FeatureData.FeatureType==9&&FeatureDataFlag" v-loading="iframeLoading"> <div v-if="FeatureData.FeatureType==9&&FeatureDataFlag" v-loading="iframeLoading">
<iframe name="myIframe" :src="myIframeUrl" style="width: 100%;border: 0;" <iframe name="myIframe" :src="myIframeUrl" style="width: 100%;border: 0;"
:style="{'height':myIframeHeigth+'px'}" @load="resizeIframe"> :style="{'height':myIframeHeigth+'px'}">
</iframe> </iframe>
<!-- <div v-if="FeatureData.TripImageListNew&&FeatureData.TripImageListNew.length>0"> <!-- <div v-if="FeatureData.TripImageListNew&&FeatureData.TripImageListNew.length>0">
<template v-for="url in FeatureData.TripImageListNew"> <template v-for="url in FeatureData.TripImageListNew">
...@@ -373,17 +373,6 @@ ...@@ -373,17 +373,6 @@
}, },
methods: { methods: {
resizeIframe() {
const iframe = document.getElementsByName("myIframe");
if (iframe) {
const iframeWindow = iframe.contentWindow;
if (iframeWindow && iframeWindow.document && iframeWindow.document.readyState === 'complete') {
const body = iframeWindow.document.body;
const viewportHeight = iframeWindow.innerHeight;
this.myIframeHeigth = body.scrollHeight || viewportHeight;
}
}
},
//图片左移右移 //图片左移右移
ExchangeImg(type, index, IsMove) { ExchangeImg(type, index, IsMove) {
if (type == 1) { if (type == 1) {
...@@ -449,10 +438,8 @@ ...@@ -449,10 +438,8 @@
this.myIframeHeigth = datas[1]; this.myIframeHeigth = datas[1];
this.isPostMessage = true this.isPostMessage = true
} }
if (this.myIframeUrl && this.myIframeUrl != '') { if (this.myIframeUrl && this.myIframeUrl != '') {
this.myIframeUrl = this.myIframeUrl + `&t=${new Date().getTime()}` document.all.myIframe.src = this.myIframeUrl + `&t=${new Date().getTime()}`
document.all.myIframe.src = this.myIframeUrl;
} }
this.$emit('pptJourney', true) this.$emit('pptJourney', true)
} else if (event.data == '暂无行程数据') { } else if (event.data == '暂无行程数据') {
...@@ -464,6 +451,16 @@ ...@@ -464,6 +451,16 @@
} }
} }
//计算iframe高度
const iframe = document.getElementsByName("myIframe");
if (iframe) {
const iframeWindow = iframe.contentWindow;
if (iframeWindow && iframeWindow.document && iframeWindow.document.readyState === 'complete') {
const body = iframeWindow.document.body;
const viewportHeight = iframeWindow.innerHeight;
this.myIframeHeigth = body.scrollHeight || viewportHeight;
}
}
this.iframeLoading = false; this.iframeLoading = false;
}, },
// 添加编辑模版 // 添加编辑模版
...@@ -782,22 +779,10 @@ ...@@ -782,22 +779,10 @@
this.clickFeature(obj) this.clickFeature(obj)
} }
}, },
beforeDestroy() {
window.removeEventListener('message', this.handleMessage, false);
},
watch: { watch: {
myIframeUrl: {
//深度监听,可监听到对象、数组的变化
handler: function (val, oldVal) {
if (val != '' && val != oldVal) {
this.resizeIframe();
}
},
deep: true,
immediate: true
},
dataAll: {
handler: function (val, oldVal) {},
deep: true,
immediate: true
},
FeatureData: { FeatureData: {
//深度监听,可监听到对象、数组的变化 //深度监听,可监听到对象、数组的变化
handler: function (val, oldVal) { handler: function (val, oldVal) {
......
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