xiongzhu 3 年之前
父節點
當前提交
46e15b9cf3
共有 5 個文件被更改,包括 39 次插入21 次删除
  1. 2 3
      capacitor.config.json
  2. 34 2
      index.html
  3. 0 12
      src/App.vue
  4. 3 0
      src/main.js
  5. 0 4
      src/styles/main.less

+ 2 - 3
capacitor.config.json

@@ -4,7 +4,7 @@
     "webDir": "dist",
     "bundledWebRuntime": false,
     "server": {
-        "url": "https://firstcash.site/h5/home",
+        "url": "http://192.168.6.215:5174/",
         "clearText": true
     },
     "android": {
@@ -19,8 +19,7 @@
     },
     "plugins": {
         "SplashScreen": {
-            "launchShowDuration": 1500,
-            "launchAutoHide": true
+            "launchAutoHide": false
         }
     }
 }

+ 34 - 2
index.html

@@ -28,11 +28,43 @@
     <script src="//code.tidio.co/kguf93rbmc3c9icmkbgbh3akvjznunfo.js" async></script>
     <script src="./jquery-3.6.1.min.js"></script>
     <script>
+        function onTidioChatApiReady() {
+            $("#tidio-chat-iframe").ready(function () {
+                console.log('tidio-chat-iframe open')
+                var head = $("#tidio-chat-iframe").contents().find("head");
+                head.append($('<meta name="color-scheme" content="dark">'));
+                head.append($('<style>textarea {color: black; background: white;}</style>'));
+            });
+
+            window.tidioChatApi.hide()
+            window.tidioChatApi.on('close', function () {
+                window.tidioChatApi.hide()
+            })
+
+            window.tidioChatApi.on('open', function () {
+                console.log('open')
+                setTimeout(() => {
+                    $("#tidio-chat-iframe").ready(function () {
+                        console.log('tidio-chat-iframe open')
+                        var head = $("#tidio-chat-iframe").contents().find("head");
+                        head.append($('<meta name="color-scheme" content="dark">'));
+                        head.append($('<style>textarea {color: black; background: white;}</style>'));
+                    });
+                }, 500);
+            })
+        }
+
+        if (window.tidioChatApi) {
+            window.tidioChatApi.on('ready', onTidioChatApiReady)
+        } else {
+            document.addEventListener('tidioChat-ready', onTidioChatApiReady)
+        }
         $("#s-chat-plugin").ready(function () {
             var head = $("#s-chat-plugin").contents().find("head");
-           head.append($('<meta name="color-scheme" content="dark">'));
-           head.append($('<style>textarea {color: black; background: white;}</style>'));
+            head.append($('<meta name="color-scheme" content="dark">'));
+            head.append($('<style>textarea {color: black; background: white;}</style>'));
         });
+
     </script>
 </body>
 

+ 0 - 12
src/App.vue

@@ -24,18 +24,6 @@ useBackButton(-1, () => {
 })
 onMounted(() => {
     useSystemStore().getSysConfigs()
-    function onTidioChatApiReady() {
-        window.tidioChatApi.hide()
-        window.tidioChatApi.on('close', function () {
-            window.tidioChatApi.hide()
-        })
-    }
-
-    if (window.tidioChatApi) {
-        window.tidioChatApi.on('ready', onTidioChatApiReady)
-    } else {
-        document.addEventListener('tidioChat-ready', onTidioChatApiReady)
-    }
 })
 const onClick = () => {
     tidioChatApi.display(true)

+ 3 - 0
src/main.js

@@ -88,4 +88,7 @@ if (Capacitor.isNativePlatform()) {
     Openinstall.getInstallCanRetry(data => {
         console.log('getInstallCanRetry', data)
     })
+    setTimeout(() => {
+        SplashScreen.hide()
+    }, 1000)
 }

+ 0 - 4
src/styles/main.less

@@ -97,10 +97,6 @@ ion-modal.dialog {
     background: fade(#9f8dff, 20);
     margin-right: 10px;
 }
-#tidio-chat-iframe,
-#s-chat-plugin {
-    bottom: calc(env(safe-area-inset-bottom, 0px) + 50px) !important;
-}
 input:-webkit-autofill,
 input:-webkit-autofill:hover,
 input:-webkit-autofill:focus,