chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
function zphnetChat(id, eid, usertype, name,obj) {
    if(obj && $(obj).attr('data-zid')){
        var zid = $(obj).attr('data-zid');
        showLoading()
        $.post(wapurl + "index.php?c=zphnet&a=isJoin",{zid: zid}, function(data) {
            hideLoading('loading');
            var data = eval('(' + data + ')');
            if(data.code == 1){
                
                if(data.status == '1'){
                    resumeChat(id, eid, usertype, name,obj);
                }else if(data.status == '2'){
                    return showToast('参会报名审核未通过,请联系管理员');
                }else{
                    showToast('参会报名审核中');
                }
            }else{                
                showConfirm('您尚未参会,请先参会!', function(e){
                    if(e.index==1){
                        clickZphnet(id);
                    }
                })
            }
        });
    }else{
        return showToast('参数异常!');
    }
}
function resumeChat(id, eid, usertype, name,obj){
    if(usertype && usertype != ''){
        if(usertype==1){
            showToast('招聘者才能和求职者' + name);
            return false;
        }
        var zid  =  0;
        if(obj){
            zid = $(obj).attr('data-zid');
        }
        var i=showLoading()
        $.post(wapurl + "index.php?c=chat&a=getdown",{
                toid: id,
                eid: eid,
                nowtype: usertype,
                zid: zid
            },function(data){
            hideLoading();
            var res = eval('(' + data + ')');
            if(res.code == 0){
                showLoading();
                $.ajax({
                    url: wapurl + "index.php?c=chat&a=beginChat",
                    async: false,
                    data: {
                        id: id,
                        usertype: 1,
                        timestamp: Date.now()
                    },
                    type:'POST',
                    success:function (sdata) {
                        hideLoading();
                        var url = wapurl+'?c=chat&id='+id + '&type=1&eid=' + eid;
                        window.location.href = url;
                    }
                });
            }else if(res.code==1){
                  showConfirm('您还没有招聘中的职位,是否先发布职位?',function(){
                    window.location.href = wapurl+"/member/index.php?c=job";
                });
            }else if(res.code==2){
                  showConfirm('您还没有招聘中的职位,是否先发布职位?',function(){
                    window.location.href = wapurl+"/member/index.php?c=job&s=1";
                });
            }else if(res.code==3){
                  showConfirm(res.msg,function(){
                    window.location.href = wapurl + "member/index.php?c=server&server=chat&id="+ id;
                });
                return false;
            }else if(res.code==4){
                showToast(res.msg);
            }else if(res.code==5){
                pleaselogin('请先登录', wapurl+'?c=login');
            }else if(res.code==6){
                showToast('自己无法和自己' + name);return false;
            } else if (res.code == 7) {
                showToast('当前用户身份不符', function(){
                    location.reload();
                });
            } else if (res.code == 8) {
                showToast('您的账号还未通过审核,请联系网站客服');
                return false;
            } else if (res.code == 9) {
                showToast('您的账号已被锁定,请联系网站客服');
                return false;
            } else if (res.code == 10) {
                showToast('您的账号未通过审核,请联系网站客服');
                return false;
            }
        });
    }else{
        pleaselogin('请先登录', wapurl+'?c=login');
    }
}
function jobChat(id, jobtype, usertype, jobid,name,obj){
    if(usertype && usertype != ''){
        if(usertype != '1'){
            showToast('求职者才能和主管'+ name,2);
            return false;
        }
        var zid  =  0;
        if(obj){
            zid = $(obj).attr('data-zid');
        }
        var i=showLoading();
        $.post(wapurl+"index.php?c=chat&a=isResume",{jobtype: jobtype, id: id, jobid: jobid, nowtype: usertype, zid: zid},function(data){
            hideLoading();
            var res = eval('(' + data + ')');
            if(res.code==1 || res.code==5){
                showLoading();
                var pdata = {
                    id: id,
                    timestamp: Date.now(),
                    jobid: jobid,
                    jobtype: jobtype
                }
                if(jobtype == 'com'){
                    pdata.usertype = 2;
                }else{
                    pdata.usertype = 3;
                }
                $.ajax({
                    url: wapurl + "index.php?c=chat&a=beginChat",
                    async: false,
                    data: pdata,
                    type:'POST',
                    success:function (sdata) {
                        hideLoading();
                        var url = wapurl+'?c=chat&id='+id + '&type=' + pdata.usertype;
                        if(jobid){
                            url += '&jid=' + jobid;
                        }
                        window.location.href = url;
                    }
                });
            }else if(res.code==2){
                  showConfirm('您还没有简历,是否先添加简历?',function(){
                    window.location.href = wapurl+"member/index.php?c=addresume";
                });
            }else if(res.code==3){
                  showConfirm('您还没有简历,先去创建简历?',function(){
                    window.location.href = wapurl+"member/index.php?c=resume";
                });
            }else if(res.code==4){
                pleaselogin('请先登录', wapurl+'?c=login');
            }else if(res.code==6){
                showToast('您的简历未通过审核,无法'+name);return false;
            }else if(res.code==7){
                showToast('您的简历还在审核中,无法'+name);return false;
            }else if(res.code==8){
                showToast('您的简历已被举报,无法'+name);return false;
            }else if(res.code==9){
 
                showToast('请先向企业的在招职位投递简历');
                
                if($("#job")){
                    setTimeout(function(){
                        $("html,body").animate({scrollTop:$("#job").offset().top},300);
                    },2000)
                }
                
                
                return false;
 
            }else if(res.code==10){
                showToast('自己无法和自己' + name);return false;
            }else if (res.code == 11) {
                showToast('当前用户身份不符', function(){
                    location.reload();
                });
            }
        })
    }else{
        pleaselogin('请先登录', wapurl+'?c=login');
    }
}
function toChat(id,type){
    window.location.href = wapurl + 'index.php?c=chat&id=' + id + '&type=' + type;
}