cs.html
3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>CS</title>
<link rel="stylesheet" href="cs.css?5">
<style>
.rongcloud-blueBg {
background: none;
background-color: #dbb25f;
}
</style>
</head>
<body>
<div id="rcs-app"></div>
<script src="./RongIMLib-cs.min.js"></script>
<script src="./RongIMEmoji.js"></script>
<script src="//cdn.ronghub.com/RongIMVoice-2.2.4.min.js"></script>
<script src="utils.js"></script>
<script src="upload.js"></script>
<script src="template.js"></script>
<script src="emoji.js"></script>
<script src="cs.js"></script>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<!-- 实例化 -->
<script>
apiready = function () {
var rongYunToken = api.pageParam.rongYunToken;
var userId = api.pageParam.userId;
alert(rongYunToken);
RCS.init({
appKey: "8w7jv4qb82s2y",
token: rongYunToken,
target: document.getElementById('rcs-app'),
customerServiceId: "KEFU150535341165880", // 客服Id
userIcon: 'http://7xo1cb.com1.z0.glb.clouddn.com/rongcloudkefu2.png',//用户默认头像,在用户没有头像的时候显示
csIcon: 'http://fsprodrcx.cn.ronghub.com/UQRxDVEHcD6_gHENUQRxDUs9XOZRBH25PGECfjBjFA/base64.png',//客服默认头像,在客服没有头像的时候显示,建议线上地址
showButton: false,
//是否需要按钮主动发起,设为false的时候,init()方法直接唤起聊天窗口,需客户自己编写按钮,点击之后调用init(),templates中的button模板不可用;设为true的时候,init()首先唤起客服咨询按钮,点击之后才连接客服,唤起聊天窗口,在进入页面之后就需调用init()方法。此参数是为了方便客户在点击客服按钮后自行获取token,在获取到token之后,执行init()即可。
connectingCallback: function () {
console.log('连接中');
},//连接中的执行的方法,例如显示加载页面,可不传
connectedCallback: function () {
},//连接成功之后的方法,例如关闭加载页面,可不传
disconnectedCallback: function () {
alert('连接断开');
},//断开连接之后的操作,可不传
templates: {
button: ['<div class="rongcloud-consult">',
' <button onclick="RCS.showCommon()"><span>客服咨询</span></button>',
'</div>',
'<div class="customer-service" style="display: none;"></div>'].join('')//"templates/button.html",
// chat: "templates/chat.html",
// closebefore: 'templates/closebefore.html',
// conversation: 'templates/conversation.html',
// endconversation: 'templates/endconversation.html',
// evaluate: 'templates/evaluate.html',
// imageView: 'templates/imageView.html',
// leaveword: 'templates/leaveword.html',
// main: 'templates/main.html',
// message: 'templates/message.html',
// messageTemplate: 'templates/messageTemplate.html',
// userInfo: 'templates/userInfo.html',
}
});
}
</script>
</body>
</html>