chengkun
2025-05-12 b6bc92ec11e1e280185ce7682d17589cb45c20f3
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
        <script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
        <script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui/custom_layer.js?v={yun:}$config.cachecode{/yun}"></script>
        <title>后台管理</title>
    </head>
    <style type="text/css">
        .layui-form-radio {
            margin-top: 0;
        }
    </style>
    <body class="body_ifm">
        <div class="infoboxp">
 
            <div class="tty-tishi_top">
                <div class="tag_box">
                    <iframe id="supportiframe" name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
                    <form id="chatform" class="layui-form" action="index.php?m=admin_chat_config&c=save" method="post" onsubmit="return ckchat()"
                     enctype="multipart/form-data" target="supportiframe">
                        <table width="100%" class="table_form">
                            <tr>
                                <th width="160">聊天开放:待开发</th>
                                <td>
                                    <div class="layui-input-block">
                                        <input type="checkbox" name="sy_chat_open" lay-skin="switch" lay-text="开放|关闭" {yun:}if $config.sy_chat_open=="1"
                                         {/yun} checked {yun:}/if{/yun} />
                                    </div>
                                </td>
                            </tr>
                            <!--
                            <tr class="admin_table_trbg">
                                <th width="160">聊天图标:</th>
                                <td>
                                    <button type="button" class="yun_bth_pic adminupload" lay-data="{name: 'sy_chat_logo',imgid: 'imgicon',path: 'logo',source:'back'}" style="float: none;">上传图片</button>
                                    <input type="hidden" id="layupload_type" value="2" />
                                    <img id="imgicon" src="{yun:}$config.sy_ossurl{/yun}/{yun:}$config.sy_chat_logo{/yun}" style="max-width:100px;width:100px;" {yun:}if !$config.sy_chat_logo{/yun}class="none"{yun:}/if{/yun}> 
 
                                </td> 
                            </tr> 
                            <tr class="admin_table_trbg">
                                <th width="160">个人使用条件:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <input name="sy_chat_limit" value="1" title="拥有简历" {yun:}if $config.sy_chat_limit=="1" {/yun} checked {yun:}/if{/yun} type="radio" />
                                        <input name="sy_chat_limit" value="2" title="申请职位" {yun:}if $config.sy_chat_limit=="2" {/yun} checked {yun:}/if{/yun} type="radio" />
                                    </div>
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160">消费模式:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <input name="sy_chat_rates" value="1" title="完全免费" {yun:}if $config.sy_chat_rates=="1" {/yun} checked {yun:}/if{/yun} type="radio" />
                                        <input name="sy_chat_rates" value="2" title="回复免费" {yun:}if $config.sy_chat_rates=="2" {/yun} checked {yun:}/if{/yun} type="radio" />
                                        <input name="sy_chat_rates" value="3" title="回复收费" {yun:}if $config.sy_chat_rates=="3" {/yun} checked {yun:}/if{/yun} type="radio" />
                                    </div>
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160">模式说明:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <span class="admin_web_tip">完全免费:企业主动发起、回复聊天都免费</span>
                                        <span class="admin_web_tip">回复免费:企业主动发起聊天要付费,回复聊天免费</span>
                                        <span class="admin_web_tip">回复收费:企业主动发起、回复聊天都要付费</span>
                                    </div>
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160">聊天代替词:</th>
                                <td>
                                    <input name="sy_chat_name" id="sy_chat_name" autocomplete="off" class="tty_input t_w250" type="text" value="{yun:}$config.sy_chat_name{/yun}" size="20" maxlength="20" />
                                    <span class="admin_web_tip">如直聊、云聊、沟通</span>
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160">前端记录展示天数:</th>
                                <td>
                                    <input name="sy_chat_day" id="sy_chat_day" autocomplete="off" class="tty_input t_w250" type="text" value="{yun:}$config.sy_chat_day{/yun}" size="20" maxlength="20" />
                                    <span class="admin_web_tip">前端展示聊天历史记录天数,默认30天</span>
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160">App Key:</th>
                                <td>
                                    <input name="sy_chat_appkey" id="sy_chat_appkey" autocomplete="off" class="tty_input t_w250" type="text" value="{yun:}$config.sy_chat_appkey{/yun}" size="60" maxlength="50" />
                                    <span class="admin_web_tip"><a href="https://u.phpyun.com" target="_blank">前往申请聊天秘钥</a></span>
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160">App Secret:</th>
                                <td>
                                    <input name="sy_chat_appsecret" id="sy_chat_appsecret" autocomplete="off" class="tty_input t_w250" type="text" value="{yun:}$config.sy_chat_appsecret{/yun}" size="60" maxlength="50" />
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160">发送位置Key:</th>
                                <td>
                                    <input name="sy_chat_mapkey" id="sy_chat_mapkey" autocomplete="off" class="tty_input t_w250" type="text" value="{yun:}$config.sy_chat_mapkey{/yun}" size="60" maxlength="50" />
                                    <span class="admin_web_tip">App和小程序支持发送位置。<span style="color: red">高德地图,添加Key时请选择Web服务,其他Key无效!!!</span><a href="https://lbs.amap.com/api/webservice/guide/create-project/get-key" target="_blank">前往申请</a></span>
                                </td>
                            </tr>
                            <tr>
                                <th width="150">服务状态:</th>
                                <td>
                                    <input class="tty_input t_w160" type="text" id="rest_num" value="" readonly="readonly" size="10" />
                                </td>
                            </tr>
                            <tr>
                                <th width="160">换电话/微信:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <input type="checkbox" name="sy_chat_exphone" lay-skin="switch" lay-text="开启|关闭" {yun:}if !$config.sy_chat_exphone || $config.sy_chat_exphone=="2" {/yun} checked {yun:}/if{/yun} />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th width="160">内容安全检测:</th>
                                <td>
                                    <div class="layui-input-block">
                                        <input type="checkbox" name="sy_chat_concheck" lay-skin="switch" lay-text="开启|关闭" {yun:}if $config.sy_chat_concheck=="2" {/yun} checked {yun:}/if{/yun} />
                                    </div>
                                </td>
                            </tr>
                            <tr class="admin_table_trbg">
                                <th width="160"></th>
                                <td>
                                    <input type="hidden" name="pytoken" id='pytoken' value="{yun:}$pytoken{/yun}">
                                    <input class="layui-btn tty_sub" id="chatconfig" type="submit" value="提交" />&nbsp;&nbsp;
                                    <input class="layui-btn tty_cz" type="reset" value="重置" />
                                </td>
                            </tr>
                            -->
                        </table>
                    </form>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            var weburl = '{yun:}$config.sy_weburl{/yun}';
            layui.use(['layer', 'form'], function() {
                var layer = layui.layer,
                    form = layui.form,
                    $ = layui.$;
            });
            $(function(){
                var pytoken = $("#pytoken").val();
                    $.post("index.php?m=admin_chat_config&c=get_restnum",{pytoken : pytoken},function(data){
                        if(data){
                            var res = eval('('+data+')');
                            if(res.error){
                                $("#rest_num").val('不可用');
                            }else{
                                $("#rest_num").val('可用');
                            }
                        }
                    });
            })
            
            function ckchat() {
                var sy_chat_open = $("input[name=sy_chat_open]").is(":checked") ? 1 : 2,
                    sy_chat_name = $("#sy_chat_name").val(),
                    sy_chat_day = $("#sy_chat_day").val(),
                    sy_chat_appkey = $("#sy_chat_appkey").val(),
                    sy_chat_appsecret = $("#sy_chat_appsecret").val();
                if (sy_chat_open == 1) {
                    if (sy_chat_name == '') {
                        parent.layer.msg("请填写聊天代替词!", 2, 8);
                        return false;
                    }
                    var regPos = /^[0-9]+.?[0-9]*$/;
                    if(!regPos.test(sy_chat_day)){
                        parent.layer.msg("请填写正确的展示天数!", 2, 8);
                        return false;
                    }
                    if (sy_chat_appkey == '') {
                        parent.layer.msg("请填写appkey!", 2, 8);
                        return false;
                    }
                    if (sy_chat_appsecret == '') {
                        parent.layer.msg("请填写appsecret!", 2, 8);
                        return false;
                    }
                }
                loadlayer();
            }
        </script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/layui.upload.js?v={yun:}$config.cachecode{/yun}" type='text/javascript'></script>
    </body>
</html>