<template>
|
<div class="service-box flex flex-col pb-40">
|
<iframe height="100%" :src="iframeSrc"></iframe>
|
</div>
|
</template>
|
|
<script setup>
|
import { computed } from 'vue'
|
import { useUserStore } from '@/store/user'
|
|
const BASE_URL = 'https://chatlink.chatslink.net/widget/standalone.html?eid=d6b703ce3568fa3d1c3793e8bc535a0c&agentid=96308ae67647106ecf8fe4b52b54a7f6&language=en'
|
|
const userStore = useUserStore()
|
|
const iframeSrc = computed(() => {
|
const userInfo = userStore.userInfo || {}
|
const usercode = userInfo.usercode != null ? encodeURIComponent(String(userInfo.usercode)) : ''
|
const username = userInfo.username != null ? encodeURIComponent(String(userInfo.username)) : ''
|
let url = BASE_URL
|
// if (usercode) url += '&userCode=' + usercode
|
// if (username) url += '&name=' + username
|
var params = { userCode: usercode, name: username }
|
if (username) url += '&metadata=' + JSON.stringify(params);
|
return url
|
})
|
</script>
|
<style lang="scss" scoped>
|
.service-box {
|
font-size: 14px;
|
width: 100%;
|
height: 100vh;
|
box-sizing: border-box;
|
background: $mainBgColor;
|
overflow: hidden;
|
|
:deep(.van-hairline--bottom::after) {
|
border-color: $mainBgColor;
|
}
|
}
|
</style>
|