|
|
@@ -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>
|