You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.0 KiB
67 lines
2.0 KiB
|
2 months ago
|
<template>
|
||
|
|
<div class="content">
|
||
|
|
<p class="font-w">使用简介</p>
|
||
|
|
<p class="text-i">网页内快速接入客服,让网页拥有客服窗口,请把一下代码复制到网页最底部。</p>
|
||
|
|
<Divider />
|
||
|
|
<p class="typetitle">获取代码</p>
|
||
|
|
|
||
|
|
<div class="fenlei">
|
||
|
|
<div class="code-content-wrap">
|
||
|
|
<textarea id="NormalCodeTextarea1" class="code" rows="22">
|
||
|
|
<script>
|
||
|
|
(function() {
|
||
|
|
_s = document.createElement('script');
|
||
|
|
_s.src="{{ siteUrl }}/customerServer.js"
|
||
|
|
_s.onload = function(){
|
||
|
|
var option = {
|
||
|
|
"authInit":true,
|
||
|
|
openUrl: '{{ siteUrl }}',
|
||
|
|
isShowTip: true, // 初始化成功后,界面右下角会自动创建 “联系客服按钮”, 如无需默认展示,则填写false即可,默认为true
|
||
|
|
mobileIcon: '', // 手机端悬浮客服图片
|
||
|
|
pcIcon: '', // pc端悬浮客服图片
|
||
|
|
windowStyle:'center',//默认空 右下角小弹窗, center 普通中间弹窗样式
|
||
|
|
};
|
||
|
|
var canCustomerServer = new initCustomerServer(option);
|
||
|
|
canCustomerServer.init();
|
||
|
|
}
|
||
|
|
document.head.appendChild(_s)
|
||
|
|
})();
|
||
|
|
</script>
|
||
|
|
</textarea
|
||
|
|
>
|
||
|
|
<div class="other-wrap">
|
||
|
|
<a class="btn btn-blue btn-large mr10" href="javascript:void(0);" @click="jiazai">点击体验</a>
|
||
|
|
<a class="btn btn-blue btn-large" href="javascript:void(0);" @click="getCopy('NormalCodeTextarea1')"><span>复制代码</span></a>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
<script setup lang="ts">
|
||
|
|
import { defineProps, defineEmits } from 'vue';
|
||
|
|
|
||
|
|
const props = defineProps<{
|
||
|
|
tokeninfo?: any;
|
||
|
|
siteUrl?: string;
|
||
|
|
}>();
|
||
|
|
|
||
|
|
const emit = defineEmits<{ (e: 'cgetCopy', id: string): void }>();
|
||
|
|
|
||
|
|
function jiazai() {
|
||
|
|
const token = props.tokeninfo?.token_md5 || '';
|
||
|
|
window.open(`${location.origin}/chat/index?token=${token}&noCanClose=1`);
|
||
|
|
}
|
||
|
|
|
||
|
|
function getCopy(id: string) {
|
||
|
|
emit('cgetCopy', id);
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
<style>
|
||
|
|
.a {
|
||
|
|
display: none;
|
||
|
|
display: block;
|
||
|
|
border-radius: 8px;
|
||
|
|
overflow: hidden;
|
||
|
|
}
|
||
|
|
</style>
|