|
@@ -2,8 +2,8 @@
|
|
|
<div class="denet-toolbox" :class="{ 'pre-view': pre_view }">
|
|
|
<div class="head">
|
|
|
<div class="handle">
|
|
|
- <img :src="require('@/assets/svg/icon-iframe-left.svg')" />
|
|
|
- <img :src="require('@/assets/svg/icon-iframe-right.svg')" />
|
|
|
+ <img :src="require('@/assets/svg/icon-iframe-left.svg')" @click="clickBack" />
|
|
|
+ <img :src="require('@/assets/svg/icon-iframe-right.svg')" @click="clickGo" />
|
|
|
</div>
|
|
|
<span></span>
|
|
|
<div v-show="state.show_btn && state.status == 'iframe'">
|
|
@@ -16,7 +16,7 @@
|
|
|
</div>
|
|
|
<div class="content" v-else>
|
|
|
<iframe :src="state.iframe_url" v-show="state.status == 'iframe'" ref="dom_iframe" frameborder="0"
|
|
|
- scrolling="yes" allow="camera *;microphone *"></iframe>
|
|
|
+ id="test1" name="test1" scrolling="yes" allow="camera *;microphone *"></iframe>
|
|
|
<!-- sandbox="allow-same-origin allow-scripts allow-popups allow-top-navigation allow-forms allow-modals allow-popups-to-escape-sandbox" -->
|
|
|
<!-- 网页错误 -->
|
|
|
<div class="state" v-show="state.status == '网页错误'">
|
|
@@ -145,8 +145,29 @@ onMounted(() => {
|
|
|
|
|
|
})
|
|
|
|
|
|
+const clickGo = () => {
|
|
|
+ window.history.forward();
|
|
|
+}
|
|
|
+
|
|
|
+const clickBack = () => {
|
|
|
+ window.history.back();
|
|
|
+}
|
|
|
+
|
|
|
// detail函数
|
|
|
const getDetail = () => {
|
|
|
+ let iframe = dom_iframe.value
|
|
|
+ iframe.onerror = () => {
|
|
|
+ state.status = '网页错误'
|
|
|
+ }
|
|
|
+ iframe.onload = () => {
|
|
|
+ if (state.status == '加载' || state.status == 'iframe') {
|
|
|
+ state.show_btn = true
|
|
|
+ state.status = 'iframe'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ iframe.contentWindow.onpopstate = () => {
|
|
|
+ console.log('onpopstate')
|
|
|
+ }
|
|
|
getPostDetail({
|
|
|
params: {
|
|
|
postId: state.postId
|
|
@@ -165,7 +186,8 @@ const getDetail = () => {
|
|
|
if (state.detail.viewBgImagePath) {
|
|
|
state.cover_url = state.detail.viewBgImagePath
|
|
|
}
|
|
|
- state.iframe_url = state.detail.convertUrl
|
|
|
+ // state.iframe_url = state.detail.convertUrl
|
|
|
+ state.iframe_url = 'https://www.twitter.com'
|
|
|
} else {
|
|
|
state.status = '网页错误'
|
|
|
}
|