Bladeren bron

Merge branch 'dev_v1.1.4' of https://git.yishihui.com/DeNet/de-net into dev_v1.1.4

wenliming 2 jaren geleden
bovenliggende
commit
361e3bac25
3 gewijzigde bestanden met toevoegingen van 46 en 9 verwijderingen
  1. 1 1
      src/view/content/tool_box/full.vue
  2. 44 7
      src/view/content/tool_box/index.vue
  3. 1 1
      src/view/iframe/test/index.vue

+ 1 - 1
src/view/content/tool_box/full.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="denet-toolbox">
         <div class="head">
-            <span>Subway Surfers</span>
+            <span></span>
             <div>
                 <!-- 缩放 -->
                 <img :src="require('@/assets/img/icon-full.png')" alt class="fixed" @click="clickFull" />

+ 44 - 7
src/view/content/tool_box/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="denet-toolbox" @click.stop="clickHead" ref="dom_toolbox" :class="{ 'pre-view': pre_view }">
         <div class="head" @click.stop="clickHead">
-            <span>Subway Surfers</span>
+            <span></span>
             <div v-show="state.show_btn">
                 <img :src="require('@/assets/img/icon-fixed.png')" alt class="fixed" @click.stop="clickFixed" />
                 <img :src="require('@/assets/img/icon-full.png')" alt class="full" @click.stop="clickFull" />
@@ -72,7 +72,8 @@ let state = reactive({
     dom: {
         root: null,
         iframe: null
-    }
+    },
+    handle_type: ''
 })
 
 let props = defineProps({
@@ -107,7 +108,11 @@ const clickContinue = () => {
     if (state.checkbox) {
         setChromeStorage({ fullCheck: JSON.stringify({ fullCheck: 1 }) })
         // 全屏
-
+        if (state.handle_type == '全屏') {
+            handleFull()
+        } else {
+            handleFixed()
+        }
     }
 }
 onMounted(() => {
@@ -147,7 +152,9 @@ const getDetail = () => {
             iframe.onload = function () {
                 state.status = ''
             }
-            state.iframe_url = state.detail.originUrl
+            setTimeout(()=>{
+                state.iframe_url = state.detail.originUrl
+            },1000)
         } else {
             let iframe = dom_iframe.value
             state.detail.originUrl = 'https://www.bilibili.com'
@@ -157,7 +164,10 @@ const getDetail = () => {
             iframe.onload = function () {
                 state.status = ''
             }
-            state.iframe_url = state.detail.originUrl
+            setTimeout(()=>{
+                state.iframe_url = state.detail.originUrl
+            },1000)
+            
         }
     })
 }
@@ -167,6 +177,7 @@ const clickCancel = () => {
 }
 
 const clickFixed = () => {
+    state.handle_type = '固定'
     getChromeStorage('fullCheck', (res) => {
         if (res && res.fullCheck) {
             // 固定
@@ -178,10 +189,35 @@ const clickFixed = () => {
 }
 
 // 固定
-const handleFixed = () => {
+const handleFull = () => {
     if (state.status || !state.iframe_url) {
         return
     }
+    // 切换状态
+    state.status = '关闭'
+    // 操作全屏dom
+    let dom = document.querySelector('#denet-tool-box-fixed')
+    dom.style.cssText = `
+        width:100%;
+        height: 100%;
+        position: fixed;
+        right: 0px;
+        top: 0px;`
+    dom.style.display = 'block'
+    state.show_btn = false
+    sendEventInfo({
+        event_type: 'ToolBox_To_Fixed',
+        data: {
+            iframe_url: state.iframe_url,
+            tweetId: state.tweetId
+        }
+    })
+    // 清除当前iframe src
+    state.iframe_url = ''
+}
+
+// 全屏
+const handleFixed = () => {
     // 切换状态
     state.status = '固定右上角'
     // 操作全屏dom
@@ -200,10 +236,11 @@ const handleFixed = () => {
 }
 
 const clickFull = () => {
+    state.handle_type = '全屏'
     getChromeStorage('fullCheck', (res) => {
         if (res && res.fullCheck) {
             // 全屏
-
+            handleFull()
         } else {
             state.show_alert = true
         }

+ 1 - 1
src/view/iframe/test/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="denet-toolbox" @click.stop="clickHead">
         <div class="head" @click.stop="clickHead">
-            <span>Subway Surfers</span>
+            <span></span>
             <div>
                 <img :src="require('@/assets/img/icon-fixed.png')" alt class="fixed" @click.stop="clickFixed" />
                 <img :src="require('@/assets/img/icon-full.png')" alt class="full" @click.stop="clickFull" />