xiongzhu 3 ani în urmă
părinte
comite
60dfb7b0dc
3 a modificat fișierele cu 13 adăugiri și 14 ștergeri
  1. 2 1
      .eslintrc.cjs
  2. 10 13
      index.html
  3. 1 0
      src/App.vue

+ 2 - 1
.eslintrc.cjs

@@ -14,7 +14,8 @@ module.exports = {
     globals: {
         wx: true,
         process: true,
-        tidioChatApi: true
+        tidioChatApi: true,
+        $: true
     },
     ignorePatterns: ['index.html']
 }

+ 10 - 13
index.html

@@ -29,28 +29,25 @@
     <script src="./jquery-3.6.1.min.js"></script>
     <script>
         function onTidioChatApiReady() {
+            $('#tidio-chat-iframe').css('display', 'none')
             $("#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>'));
+                head.append($('<style>textarea {color: black; background: white;} .chat-header{padding:40px 22px 0px !important} #button.chat-closed{display:none !important;}</style>'));
             });
 
-            window.tidioChatApi.hide()
             window.tidioChatApi.on('close', function () {
-                window.tidioChatApi.hide()
+                //tidioChatApi.hide()
+                $('#tidio-chat-iframe').css('display', 'none')
             })
 
             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);
+                $("#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;} .chat-header{padding:40px 22px 0px !important} #button.chat-closed{display:none !important;}</style>'));
+                });
             })
         }
 

+ 1 - 0
src/App.vue

@@ -26,6 +26,7 @@ onMounted(() => {
     useSystemStore().getSysConfigs()
 })
 const onClick = () => {
+    $('#tidio-chat-iframe').css('display', 'block')
     tidioChatApi.display(true)
     tidioChatApi.open()
 }