| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>编辑管理员</title>
- <link rel="shortcut icon" href="favicon.ico">
- <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
- <link href="__CSS__/font-awesome.min.css?v=4.4.0" rel="stylesheet">
- <link href="__CSS__/animate.min.css" rel="stylesheet">
- <link href="__JS__/layui/css/layui.css" rel="stylesheet">
- <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
- </head>
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-8">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>会话设置</h5>
- </div>
- <div class="ibox-content">
- <form class="form-horizontal m-t layui-form" id="commentForm" method="post" action="{:url('system/conversation')}">
- <h4 style="margin-bottom: 10px;">双方静默超时设置</h4>
- <div class="ibox-title">
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">在设置的时间内没有新消息产生,系统将自动关闭会话;在自动关闭前1分钟,系统会发送会话即将关闭的提示。</p>
- <label class="col-sm-3 control-label">超时时间:</label>
- <div class="input-group col-sm-1">
- <input type="text" class="form-control" name="overtime" required="" aria-required="true" value="{$systemconfig[0]['systemconfig_data']}">
- </div>
- <label class="control-label" style="margin-left: 20px;">秒,</label>
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <label class="col-sm-3 control-label">给与提示语:</label>
- <div class="input-group col-sm-8">
- <input type="text" class="form-control" name="overtimeInfo" required="" aria-required="true" value="{$systemconfig[0]['systemconfig_content']}">
- </div>
- </div>
- <h4 style="margin-bottom: 10px; margin-top: 40px">无效会话关闭设置</h4>
- <div class="ibox-title">
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">访客开启会话框后,在设置的时间内,访客没有任何操作,系统将发出提示语并立即关闭对话。</p>
- <label class="col-sm-3 control-label">超时时间:</label>
- <div class="input-group col-sm-1">
- <input type="text" class="form-control" name="unoperated" required="" aria-required="true" value="{$systemconfig[1]['systemconfig_data']}">
- </div>
- <label class="control-label" style="margin-left: 20px;">秒,</label>
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <label class="col-sm-3 control-label">给与提示语:</label>
- <div class="input-group col-sm-8">
- <input type="text" class="form-control" name="unoperatedInfo" required="" aria-required="true" value="{$systemconfig[1]['systemconfig_content']}">
- </div>
- </div>
- <h4 style="margin-bottom: 10px; margin-top: 40px">会话时长设置</h4>
- <div class="ibox-title">
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">设置访客进入到会话结束时的时间间隔值,作为客服的质检标准。</p>
- <label class="col-sm-3 control-label">标准值:</label>
- <div class="input-group col-sm-1">
- <input type="text" class="form-control" name="verifyAllTime" required="" aria-required="true" value="{$systemconfig[2]['systemconfig_data']}">
- </div>
- <label class="control-label" style="margin-left: 20px;">秒</label>
- </div>
- <h4 style="margin-bottom: 10px; margin-top: 40px">会话响应时长设置</h4>
- <div class="ibox-title">
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">设置访客访问到客服回复的时间间隔值,作为客服的质检标准。</p>
- <label class="col-sm-3 control-label">标准值:</label>
- <div class="input-group col-sm-1">
- <input type="text" class="form-control" name="verifyReturnTime" required="" aria-required="true" value="{$systemconfig[3]['systemconfig_data']}">
- </div>
- <label class="control-label" style="margin-left: 20px;">秒</label>
- </div>
- <h4 style="margin-bottom: 10px; margin-top: 40px">满意度评价回合限制</h4>
- <div class="ibox-title">
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">设置会话回合数后,会话聊天条数没超过设置的值时,访客端右上角评价按钮隐藏,所有系统邀评都不触发。系统消息条数不计算在内。</p>
- <label class="col-sm-3 control-label">起始值:</label>
- <div class="input-group col-sm-1" style="width: 45px">
- <input type="text" class="form-control" name="round" required="" aria-required="true" value="{$systemconfig[4]['systemconfig_data']}">
- </div>
- <label class="control-label" style="margin-left: 20px;">回合</label>
- </div>
- <h4 style="margin-bottom: 10px; margin-top: 40px">客服接待设置</h4>
- <div class="ibox-title">
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">当客服服务达到上限时,顾客会进入排队等待状态。当排队人数达上限,后续不再接入顾客。</p>
- <label class="col-sm-3 control-label">单个客服接待人数:</label>
- <div class="input-group col-sm-1" style="width: 45px">
- <input type="text" class="form-control" name="max_service" required="" aria-required="true" value="{$systemconfig[6]['systemconfig_data']}">
- </div>
- <label class="control-label" style="margin-left: 20px;">人</label>
- </div>
- <div class="form-group" style="flex-wrap: wrap; display: flex">
- <label class="col-sm-3 control-label">最大排队人数上限:</label>
- <div class="input-group col-sm-1" style="width: 45px">
- <input type="text" class="form-control" name="kfConfig_maxWait" required="" aria-required="true" value="{$systemconfig[7]['systemconfig_data']}">
- </div>
- <label class="control-label" style="margin-left: 20px;">人</label>
- </div>
- <div class="form-group" style="margin-top: 40px;">
- <label class="col-sm-3 control-label"></label>
- <div class="input-group col-sm-4">
- <button class="btn btn-primary btn-sm" type="submit">提交</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="__JS__/jquery.min.js?v=2.1.4"></script>
- <script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
- <script src="__JS__/content.min.js?v=1.0.0"></script>
- <script src="__JS__/plugins/validate/jquery.validate.min.js"></script>
- <script src="__JS__/plugins/validate/messages_zh.min.js"></script>
- <script src="__JS__/plugins/layer/layer.min.js"></script>
- <script src="__JS__/layui/layui.js"></script>
- <script src="__JS__/jquery.form.js"></script>
- <script src="/static/customer/js/md5.js"></script>
- <script type="text/javascript">
- let config = {
- socket: '{$socket}',
- };
- let date = new Date(new Date().setHours(0, 0, 0, 0)) / 1000;
- let getLocation = window.location.href;
- let host = getLocation.split('/admin')[0];
- //let apiToken = hex_md5('customer-service'+date+host);
- let apiToken = hex_md5('customer-service'+host);
- layui.use(['form', 'upload'], function(){
- var form = layui.form;
- var upload = layui.upload;
- //执行实例
- var uploadInst = upload.render({
- elem: '#up-avatar' //绑定元素
- ,url: "{:url('users/upAvatar')}" //上传接口
- ,exts: 'png|jpg|jpeg|gif'
- ,done: function(res){
- //上传完毕回调
- if(0 == res.code){
- $("#avatar").html('<img src="' + res.data.src + '" width="50px" height="50px">');
- $("#advertisement_img").val(res.data.src);
- }else{
- layer.msg(res.msg);
- }
- }
- ,error: function(){
- //请求异常回调
- }
- });
- form.on('select(group)', function(value){
- $("#group_id").val(value.value);
- });
- });
- var index = '';
- function showStart(){
- index = layer.load(0, {shade: false});
- return true;
- }
- function showSuccess(res){
- let socket = new WebSocket('ws://' + config.socket+'?apiToken=' + apiToken);
- socket.onopen = function(res) {
- console.log('握手成功');
- socket.send(JSON.stringify({
- type: 'updatecache',
- data: {dtype: ''},
- }));
- };
- layer.ready(function(){
- layer.close(index);
- if(1 == res.code){
- layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
- window.location.href = res.data;
- });
- }else if(111 == res.code){
- window.location.reload();
- }else{
- layer.msg(res.msg, {anim: 6});
- }
- });
- }
- $(document).ready(function(){
- // 添加管理员
- var options = {
- beforeSubmit:showStart,
- success:showSuccess
- };
- $('#commentForm').submit(function(){
- $(this).ajaxSubmit(options);
- return false;
- });
- });
- // 表单验证
- $.validator.setDefaults({
- highlight: function(e) {
- $(e).closest(".form-group").removeClass("has-success").addClass("has-error")
- },
- success: function(e) {
- e.closest(".form-group").removeClass("has-error").addClass("has-success")
- },
- errorElement: "span",
- errorPlacement: function(e, r) {
- e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
- },
- errorClass: "help-block m-b-none",
- validClass: "help-block m-b-none"
- });
- </script>
- </body>
- </html>
|