xiongzhu 3 سال پیش
والد
کامیت
70e74b8a88
4فایلهای تغییر یافته به همراه38 افزوده شده و 5 حذف شده
  1. 2 2
      index.html
  2. 24 1
      src/App.vue
  3. BIN
      src/assets/icon_custumer.png
  4. 12 2
      src/views/TabsPage.vue

+ 2 - 2
index.html

@@ -21,8 +21,8 @@
 <body>
     <div id="app"></div>
     <script type="module" src="/src/main.js"></script>
-    <script src="https://assets.salesmartly.com/js/project_9355_9754_1670553307.js"></script>
-    <!-- <script src="//code.tidio.co/kguf93rbmc3c9icmkbgbh3akvjznunfo.js" async></script> -->
+    <!-- <script src="https://assets.salesmartly.com/js/project_9355_9754_1670553307.js" async></script> -->
+    <script src="//code.tidio.co/kguf93rbmc3c9icmkbgbh3akvjznunfo.js" async></script>
     <script src="./jquery-3.6.1.min.js"></script>
     <script>
         $("#s-chat-plugin").ready(function () {

+ 24 - 1
src/App.vue

@@ -4,6 +4,7 @@
             <ion-router-outlet />
         </ion-app>
     </vant-config-provider>
+    <img id="btn-customer" src="@/assets/icon_custumer.png" @click="onClick" />
 </template>
 
 <script setup>
@@ -13,7 +14,6 @@ import { onMounted } from 'vue'
 import { useSystemStore } from './stores/system'
 import { App } from '@capacitor/app'
 import { useSettingsStore } from '@/stores/settings'
-
 const store = useSettingsStore()
 
 const ionRouter = useIonRouter()
@@ -24,7 +24,23 @@ 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)
+    tidioChatApi.open()
+}
 </script>
 <style lang="less" scoped>
 .consult {
@@ -50,4 +66,11 @@ onMounted(() => {
         font-size: 24px;
     }
 }
+#btn-customer {
+    position: fixed;
+    right: 10px;
+    width: 48px;
+    height: 48px;
+    bottom: calc(var(--ion-safe-area-bottom) + 110px);
+}
 </style>

BIN
src/assets/icon_custumer.png


+ 12 - 2
src/views/TabsPage.vue

@@ -1,5 +1,6 @@
 <template>
     <ion-page class="tabs">
+        <img :src="tabIconRank" class="btn-float" alt="" />
         <ion-tabs ref="tab" @ionTabsDidChange="tabChange">
             <ion-router-outlet></ion-router-outlet>
             <ion-tab-bar slot="bottom">
@@ -7,13 +8,12 @@
                     <img class="tab-icon1" :src="activeTab === 'home' ? tabIconHomePre : tabIconHome" />
                     <ion-label>{{ $t('common.home') }}</ion-label>
                 </ion-tab-button>
-
                 <ion-tab-button tab="BLF" href="/BLF">
                     <img class="tab-icon1" :src="activeTab === 'BLF' ? tabIconBlfPre : tabIconBlf" />
                     <ion-label>BLF</ion-label>
                 </ion-tab-button>
                 <ion-tab-button class="bigTab" tab="rank" href="/rank">
-                    <img :src="tabIconRank" class="tab-icon" alt="" />
+                    <!-- <img :src="tabIconRank" class="tab-icon" alt="" /> -->
                 </ion-tab-button>
                 <ion-tab-button tab="distribution" href="/distribution1">
                     <img class="tab-icon1" :src="activeTab === 'distribution' ? tabIconProfitPre : tabIconProfit" />
@@ -109,4 +109,14 @@ ion-icon {
 //         -webkit-text-fill-color: transparent;
 //     }
 // }
+.btn-float {
+    position: absolute;
+    margin: auto;
+    left: 0;
+    right: 0;
+    bottom: 30px;
+    width: 56px;
+    height: 49px;
+    z-index: 100;
+}
 </style>