chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
var player = null;
    
$(function(){
    // 直播
    livePlay();
    // 点播
    playered();
    
    xjhjobList(xjhid,1,1);
 
    $('#send_content').keyup(function(event){
        if(event.keyCode ==13){
            send();
        }
    });
    $(document).on('click', function (e) {
        if($('#pagehtml').css('display')!='none'){
            $('#pagehtml').hide();
        }
    });
});
 
layui.use(['carousel'], function() {//layui 轮播  test1 test2 
    var carousel = layui.carousel;
    
    carousel.render({
        elem: '#test1',
        width: '880px',
        height: '495px',
        indicator: 'none'
    });
    carousel.render({
        elem: '#test2',
        width: '880px',
        height: '495px',
        indicator: 'none'
    });
});
if(livestatus == 1){
    var serverTime = new Date().getTime(),
        djsTimer = null;
    // 监测浏览器息屏和可见
    var hiddenProperty = 'hidden' in document ? 'hidden' : 'webkitHidden' in document ? 'webkitHidden' : 'mozHidden' in document ? 'mozHidden' :  null;
    // 不同浏览器的事件名
    var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange');
    var onVisibilityChange = function(){
        var nowTime = new Date().getTime();
        if(!document[hiddenProperty]){
            if(serverTime > 0 && (nowTime - serverTime > 60000)){
                clearTimeout(djsTimer);
                serverTime = nowTime;
                liveUtil();
            }
        }else{
            serverTime = nowTime;
        }
    }
    document.addEventListener(visibilityChangeEvent, onVisibilityChange);
    // 处理倒计时
    liveUtil();
}
function liveUtil(){
    layui.use('util', function() {
        var util = layui.util;
        var stime = $("#live_stime").val();
        var endTime = parseInt(stime) * 1000;
        
        if (serverTime < endTime) {
            util.countdown(endTime, serverTime, function(date, serverTime, timer) {
                djsTimer = timer;
                var str = "<span class='xjh_list_zbtime'>" + date[0] + "</span> 天  <span class='xjh_list_zbtime'>" + date[1] +
                    "</span> 时  <span class='xjh_list_zbtime'>" + date[2] + "</span> 分 <span class='xjh_list_zbtime'>" + date[3] +
                    "</span> 秒";
                layui.$('#countdown').html(str);
        
                if(date[0]==0 && date[1]==0 && date[2]==0 && date[3]==0){
        
                    $('.xjhwks_tip').hide();
                    $(".xjh_show_spbg").hide();
                    $('#waitshow').hide();
                    $('.xjh_show_eye').show();
                    //倒计时结束
                    clearTimeout(timer);
                    if(!document.getElementById('live_video')){
                        $('#livebody').append('<div id="live_video" class="show_box_header_opacity"></div>');
                        getXjhlive();
                    }
                }
            });
            $('.xjhwks_tip').show();
        }else{
            $('.xjhwks_tip').hide();
            $(".xjh_show_spbg").hide();
            getXjhlive();
        }
    });
}
function pageHtmlShow(){
    event.stopPropagation();
    $('#pagehtml').toggle();
}
function toxjPages(page){
    if(page==1){
        xjhjobList(xjhid,1,1);
    }else{
        xjhjobList(xjhid,parseInt(page-1),2);
    }
    
}
var tcsetval,
    tcsetwout;
function subxjh(id,uid){
    if(uid){
        $.post('index.php?m=xjhlive&c=xjhSubcribe', {
            xjhid: id
        }, function(data) {
            var res = eval('(' + data + ')');
            if (res.error == 9) {
                if(res.wxshow){
                    // 未绑定微信的,提示绑定微信
                    layer.msg('恭喜您预约成功', 2, 9, function() {
                        $.layer({
                            type: 1,
                            title: '绑定微信',
                            border: [10, 0.3, '#000', true],
                            area: ['340px', 'auto'],
                            page: {
                                dom: "#wxcontent"
                            },
                            close: function() {
                                clearInterval(tcsetval);
                                window.location.reload();
                            }
                        });
                    });
                    tcwxlogincode();
                }else{
                    layer.msg("恭喜您预约成功", 2, 9, function() {
                        window.location.reload();
                    });
                }
            }else if(res.error == 8){
                layer.msg("请登录个人用户", 2, 8);
            }else if(res.error == 7){
                layer.msg("您已预约,请勿重复预约", 2, 8);
            }else {
                layer.msg("数据异常请重试", 2, 8);
            }
        });
    }else{
        showlogin();
    }
}
function tcwxlogincode(){
    
    $.post(getwxurl, {
        t: 1
    }, function(wdata) {
        if (wdata == 0) {
            $('#wx_login_qrcode_spview').html('二维码获取失败..');
        } else {
            $('#wx_login_qrcode_spview').html('<img src="' + wdata + '" width="180" height="180">');
            tcsetval = setInterval(function() {
                $.post(getwxstatusurl, {
                    t: 1
                }, function(data) {
 
                    var data = eval('(' + data + ')');
 
                    if (data.url != '' && data.msg != '') {
                        clearInterval(tcsetval);
                        tcsetval = null;
                        layer.msg(data.msg, 2, 9, function() {
                            window.location.reload();
                        });
                    } else if (data.url != '') {
                        window.location.reload();
                    }
                });
            }, 2000);
            if(tcsetwout){
                clearTimeout(tcsetwout);
                tcsetwout = null;
            }
            tcsetwout = setTimeout(function(){
                clearInterval(tcsetval);
                tcsetval = null;
                var tcwx_sx = $("#tcwx_sx").html();
                $('#wx_login_qrcode_spview').html(tcwx_sx);
            },300*1000);
        }
    });
}
function detailtab(obj) {
    var choosedclass = 'xjh_show_botcur';
 
    var id = $(obj).attr('id');
 
    $('.xjh_show_botcur').removeClass('xjh_show_botcur');
    $(obj).addClass('xjh_show_botcur');
    $('*[id*="_show"]').hide();
    $('#' + id + '_show').show();
}
 
function wapdiypreview(){
    $.layer({
        type:1,
        title:'手机观看直播',
        closeBtn:[0,true],
        offset:['20%','30%'],
        border:[10 , 0.3 , '#000', true],
        area:['290px','330px'],
        page:{dom : '#getwapurl'}
    });
}
function livePlay(){
    if(document.getElementById('live_video')){
        var body = document.body,
            live_hls = document.getElementById('live_hls').value,
            live_poster = document.getElementById('live_poster').value,
            img = $("#stopLive").find('img').attr('src'),
            poster = img ? img : live_poster;
        player = new TcPlayer('live_video', {
            "m3u8": live_hls,
            "autoplay": true,
            "live": true,
            "poster": poster,
            "width": '880',
            "height": '495',
            "flash": false,
            "wording": {
                1001: "网络错误,请检查网络配置",
                1002: "主持人暂时离开,请稍候片刻",
            },
            "listener": function(msg){
                if(msg.type == 'load'){
                    body.addEventListener('click',function(){
                        player.play();
                    });
                }else if (msg.type == 'playing') {
                    
                }else if(msg.type == 'error'){
                    player.errclear();
                }
            }
        });
    }
}
function playered(){
    if(document.getElementById('playered')){
        var url = $("#playurl").val();
        // 实例化播放器
        player = new QPlayer({
            url: url,
            container: document.getElementById("playered"),
            autoplay: true,
            loggerLevel: 3,
            defaultViewConfig:{
                settingsIcon: mbstyle +'/images/qiniuset.png'
            }
        });
    }
}
 
function getUserZd(){
    window.location.href = weburl + "/member/index.php?c=expect&act=add";
}
function xjhjobList(xjhid,page,updown){
 
    if(xjhid){
        var updown = updown ? updown : 1;
        var param = {
            xjhid:xjhid,
            updown:updown,
            page:page,
            limit:5
        }
        $.post(weburl+"/index.php?m=xjhlive&c=xjhJoblist",param,function(data){
            var res = eval('(' + data + ')');
            var joblist    =    res.joblist;
            var jobpage    =    res.jobpage ? res.jobpage : 1;
            var maxpage    =    res.maxpage;
            var html = '';
            if(joblist && joblist.length>0){
                for(var i=0;i<joblist.length;i++){
                    html +='<li>';
                    html +='<div class="xjh_job_name"><a href="'+joblist[i].joburl+'" target="_blank">'+joblist[i].name+'</a></div>';
                    html +='<div class="xjh_job_info">'+joblist[i].com_name+'<i class="xjh_job_line">|</i> ';
 
                    if(joblist[i].citystr){
                        html +='工作地点: '+joblist[i].citystr+'<i class="xjh_job_line">|</i> ';
                    }
                    if(joblist[i].job_number){
                        html +='招聘人数:'+joblist[i].job_number+' <i class="xjh_job_line">|</i> ';
                    }
                    if(joblist[i].job_edu){
                        html +='学历要求:'+joblist[i].job_edu+'</div>';
                    }
                    if(joblist[i].job_salary){
                        html +='<div class="xjh_job_zy">薪资:'+joblist[i].job_salary+'</div>';
                    }
                    if(uid){
                        if (usertype==2){
                            html +='<a onclick="layer.msg(\'只有个人用户才能申请\', 2, 8)" href="javascript:;" class="xjh_job_bth">投简历</a>';
                        }else if (usertype==1 && !eid){
                            html +='<a href="javascript:;" onclick="getUserZd()" class="xjh_job_bth">投简历</a>';
                        }else {
                            html +='<a href="'+joblist[i].joburl+'" target="_blank" class="xjh_job_bth">投简历</a>';
                        }
                    }else{
                        html +='<a href="javascript:void(0);"  onclick="showlogin();" class="xjh_job_bth">投简历</a>';
                    }
                    html +='</li>';
                    
                }
                if(maxpage>1){
                    html +='<div class="fypages">';
                    html +='<a href="javascript:void(0);" class="fypages_a" onclick="xjhjobList('+xjhid+','+jobpage+',1);">上一页</a>';
                    
                    html +='<div class="pages_sz">';
                    html +='    <div id="nowpage" class="pages_szbox" onclick="pageHtmlShow()">'+jobpage+'</div>';
                    html +='    <div id="pagehtml" class="pages_sz_s" style="display:none">';
                    for(var i=1;i<=maxpage;i++){
                        html +='    <a href="javascript:void(0);" onclick="toxjPages('+i+')" class="pages_sz_a">'+i+'</a>';
                    }
                    html +='    </div>';
                    html +='</div>';
                    
                    html +='<a href="javascript:void(0);" class="fypages_a" onclick="xjhjobList('+xjhid+','+jobpage+',2);">下一页</a>';
                    html +='<span class="fypages_pageAll">共'+maxpage+'页</span>';
                    html +='</div>';
                }
            }else{
                html +='<div class="xjh_notip">暂无职位信息</div>';
            }
            
            $('#xjjob_show').html(html);
        });
    }
}
// 检查宣讲会直播状态
function getXjhlive(){
    $.post(weburl +"/index.php?m=xjhlive&c=getXjhlive",{id: xjhid},function(data){
        if(data){
            var res = eval('(' + data + ')');
            if(parseInt(res.livestatus) > 0){
                if(res.livestatus == 3 || res.iscaster == 1){
                    // 直播中或导播台开启到了直播时间
                    if(res.hls){
                        $("#live_hls").val(res.hls);
                    }
                    if(document.getElementById('live_video')){
                        if(!player){
                            livePlay();
                        }
                    }else{
                        $('#waitshow').hide();
                        $(".xjh_show_spbg").hide();
                        $('#livebody').append('<div id="live_video" class="show_box_header_opacity"></div>');
                        livePlay();
                    }
                }else if(res.livestatus == 2){
                    // 直播结束
                    if(player){
                        player.destroy();
                    }
                    var html = $("#codvideo").html();
                    $("#livebody").html(html);
                }
            }
        }
    });
}