<!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>
</head>
<body>

<div id="rcs-app"></div>

<link rel="stylesheet" href="cs.css?5">

<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>
RCS.init({
    appKey: "c9kqb3rdkh4jj",
    token: "qjxXwJizd7Y62DTmUEluw5lzpNwuJBCkPrRErVG12EKi1UP6giNGqszv6IQX0IndGKwjoGwevVmUVSN0x458KOqK0LwxTuhy",
    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>