PageSourceSearch

http://cccme.org.cn/enter/js/login.js

js cccme.org.cn collected 2026-09-24 21:58:30 UTC 14,350 bytes, 334 lines download raw bytes

1var curView = "account";
2var apiURL = config.WebURL;
3
4$(document).ready(function () {
5    $("#imgAccountCode").attr("src", apiURL+"Common/ValidateCode.ashx?" + Math.random());
6
7    initEvent();
8
9});
10
11function initEvent() {
12
13    $("#account_view_link").click(function () {
14        if (!$("#account_view_link").hasClass("activelogin")) {
15            $("#account_view_link").addClass("activelogin");
16        }
17        if ($("#code_view_link").hasClass("activelogin")) {
18            $("#code_view_link").removeClass("activelogin");
19        }
20
21        if ($("#account_box").hasClass("hide")) {
22            $("#account_box").removeClass("hide")
23        }
24        if (!$("#sms_box").hasClass("hide")) {
25            $("#sms_box").addClass("hide")
26        }
27        curView = "account";
28
29        $("#imgAccountCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
30        $("#imgSMSCode").attr("src", "");
31    });
32
33
34    $("#code_view_link").click(function () {
35        if (!$("#code_view_link").hasClass("activelogin")) {
36            $("#code_view_link").addClass("activelogin");
37        }
38        if ($("#account_view_link").hasClass("activelogin")) {
39            $("#account_view_link").removeClass("activelogin");
40        }
41
42        if ($("#sms_box").hasClass("hide")) {
43            $("#sms_box").removeClass("hide")
44        }
45        if (!$("#account_box").hasClass("hide")) {
46            $("#account_box").addClass("hide")
47        }
48        curView = "code";
49        $("#imgSMSCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
50        $("#imgAccountCode").attr("src", "");
51    });
52
53    $("#btnLogin").click(function () {
54        if (curView == "account") {
55            accountLogin();
56        }
57        else {
58            smsCodeLogin();
59        }
60    });
61
62    $("#btnGetCode").click(function () {
63        getSMSCode();
64    });
65
66    $("#imgAccountCode").click(function () {
67        $("#imgAccountCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
68    });
69    $("#imgSMSCode").click(function () {
70        $("#imgSMSCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
71    });
72
73    $("#btnRegister").click(function () {
74        window.location.href = "register.html";
75    });
76}
77
78function accountLogin() {
79    var str_url = window.location.href;
80    var str_pos = str_url.indexOf("=");
81    var str_surl = str_url.substring(str_pos + 1);
82
83    if ($("#txtAccount").val() == "") {
84        layer.msg('手机号不能为空!'); 
85        return false;
86    }
87    if ($("#txtPassword").val() == "") {
88        layer.msg('密码不能为空!'); 
89        return false;
90    }
91    if ($("#txtCode").val() == "") {
92        layer.msg('验证码不能为空!'); 
93        return false;
94    }
95    var index = layer.load(1, { shade: [0.4, "#000000"] });
96    var url = "&Name=" + $("#txtAccount").val() + "&pwd=" + $("#txtPassword").val() + "&code=" + $("#txtCode").val()  + "&language=cn";
97    
98       var ajax = new Ajax("xy0014",url);
99
100       ajax.onSuccess = function () {
101           layer.close(index);
102           if (ajax.state.result == 0 || ajax.state.result == -1) {
103               if (ajax.state.result == -1) { //使用企业账号登录 
104
105                   var tempNames = ajax.state.message.split('┆');
106                   userCode = tempNames[0];
107                   //                   document.getElementById("explain_alert_title").innerHTML = "关于创建个人账号的说明";
108
109                   var contentHTML = '<div class="servicedesc downdesc">' + tempNames[1] + '</div>' +
110                              '<div class="servicedesc">尊敬的 先生/女士:</div>' +
111                              '<div class="servicedesc">您好!</div>' +
112                              '<div class="servicedesc">欢迎使用中国机电产品进出口商会网站!<br/></div>' +
113                              '<div class="servicedesc">为了方便您使用个人信息便捷登陆系统,机电国际商机小程序和中国机电产品进出口商会网站已统一改为使用“企业账号+个人账号”的用户体系。您只要在企业账号下快速创建个人账号即可登录使用原有的功能。已创建的个人账号在小程序和网站中通用。<br/></div>' +
114                              '<div class="servicepartname">如有任何问题请联系机电商会信息部</div>' +
115                              '<div class="servicepartdesc">电话:010-58280711/710/922</div>' +
116                              '<div class="servicepartdesc">邮件:[email protected]</div>';
117                   //                   layer.alert(contentHTML, 0, "关于创建个人账号的说明");
118
119                   var layerTip = layer.open({
120                       title: '关于创建个人账号的说明',
121                       content: contentHTML,
122                       shade: 0.1,
123                       btnAlign: 'center',
124                       yes: function (index, layero) {
125                           layer.close(index);
126                       }
127                   });
128                   $("#imgAccountCode").attr("src", apiURL+"Common/ValidateCode.ashx?" + Math.random());
129                   $("#txtCode").val("");
130                   return false;
131               }
132               else {
133                   var tempMessage = ajax.state.message;
134                   tempMessage = tempMessage.replace("ss", "<span style='color:#fa5151;'>");
135                   tempMessage = tempMessage.replace("se", "</span>");
136                   layer.msg("<div style='text-align:center;'>" + tempMessage + "</div>");
137                   $("#imgAccountCode").attr("src", apiURL+"Common/ValidateCode.ashx?" + Math.random());
138                   $("#txtCode").val("");
139                   return false;
140               }
141           }
142           else {
143               //如果是信息页面登录并登录成功以后,更新页面信息
144               if (ajax.state.message == "ok") {
145
146               }
147
148               //如果是通过登录页面登录,则导航到相应会员中心
149               var folderName = "ucenter";
150               if (ajax.data.userinfo[0].usertype == "user") folderName = "usercenter";
151
152               if (str_pos > 0)
153                   window.location.href = unescape(str_surl);
154               else {
155                   window.location.href = config.WebURL + folderName + "/index.html";
156               }
157
158               return true;
159           }
160       };
161       ajax.onError = function () {
162           $("#imgAccountCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
163           $("#txtCode").val("");
164           layer.close(index);
165       }
166
167   }
168
169   //发送验证码
170   var InterValObj;  //timer变量,控制时间
171   var curCount = 0;
171 //间隔函数,1秒执行
172   var code = "";
173   function getSMSCode() {
174       if (curCount > 0) {
175           layer.msg('请稍后再获取短信验证码!');
176           return false;
177       }
178       if ($("#txtMobile").val() == "") {
179           layer.msg('手机号不能为空!');
180           return false;
181       }
182       else if ($("#txtMobile").val().search(/^(1[3|4|5|6|7|8|9])[\d]{9}$/) == -1) {
183           layer.msg('手机号格式错误!');
184           return false;
185       }
186       if ($("#txtImgCode").val() == "") {
187           layer.msg('图片验证码不能为空!');
188           return false;
189       }
190       var currentPage = window.location.href || window.location.pathname;
191       var index = layer.load(1, { shade: [0.4, "#000000"] });
192       var query = "&mobile=" + $("#txtMobile").val() + "&code=" + $("#txtImgCode").val()+"&fromPage="+currentPage;
193    
194       var ajaxcls = new Ajax("xy00221", query);
195       ajaxcls.onSuccess = function () {
196           layer.close(index);
197           if (ajaxcls.state.result == "1") {
198               if (ajaxcls.data.info != undefined) {
199                   curCount = 60;
200//                   code = decrypt(ajaxcls.data.info);
201                   //console.log("code==" + code);
202                   layer.msg("短信验证码发送成功");
203                   $("#btnGetCode").html("已发送(" + curCount + ")");
204                   $("#btnGetCode").unbind("click"); 
205
206                   InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器,1秒执行一次
207               }
208               else {
209                   curCount = 0;
210                   layer.msg("短信验证码发送失败");
211               }
212           } else if (ajaxcls.state.result == "0") {
213               curCount=0;
214               //失败
215               layer.msg(ajaxcls.state.message);
216               return false;
217           } else {
218                curCount=0;
219               //参数不完整
220               layer.msg(ajaxcls.state.message);
221               return false;
222           }
223       }
224       ajaxcls.onError = function () {
225           curCount = 0;
226           layer.close(index);
227       }
228   }
229
230
231   //倒计时
232   function SetRemainTime() {
233       if (curCount == 0) {
234           window.clearInterval(InterValObj); //停止计时器
235           $("#btnGetCode").html("重新发送验证码");
236           $("#btnGetCode").click(function () { getSMSCode(); }); 
237           code = ""; //清除验证码。如果不清除,过时间后,输入收到的验证码依然有效    
238       }
239       else {
240           curCount--;
241            $("#btnGetCode").html("已发送(" + curCount + ")");
242       }
243    }
244
245
246    function smsCodeLogin() {
247        var str_url = window.location.href;
248        var str_pos = str_url.indexOf("=");
249        var str_surl = str_url.substring(str_pos + 1);
250
251        if ($("#txtMobile").val() == "") {
252            layer.msg('账号不能为空!');
253            return false;
254        }
255        else if ($("#txtMobile").val().search(/^(1[3|4|5|6|7|8|9])[\d]{9}$/) == -1) {
256            layer.msg('账号格式错误!');
257            return false;
258        }
259        if ($("#txtSMSCode").val() == "") {
260            layer.msg('验证码不能为空!');
261            return false;
262        }
263        var index = layer.load(1, { shade: [0.4, "#000000"] });
264        var url = "&Account=" + $("#txtMobile").val() + "&code=" + $("#txtImgCode").val() + "&SMS=" + $("#txtSMSCode").val() + "&language=cn";
265
266        var ajax = new Ajax("xy00141", url);
267
268        ajax.onSuccess = function () {
269            layer.close(index);
270            console.log(ajax.state.result);
271            if (ajax.state.result == 0 || ajax.state.result == -1) {
272                if (ajax.state.result == -1) { //使用企业账号登录  
273                    var tempNames = ajax.state.message.split('┆');
274                    userCode = tempNames[0];
275//                    document.getElementById("explain_alert_title").innerHTML = "关于创建个人账号的说明";
276
277                    var contentHTML = '<div class="servicedesc downdesc">' + tempNames[1] + '</div>' +
278                              '<div class="servicedesc">尊敬的 先生/女士:</div>' +
279                              '<div class="servicedesc">您好!</div>' +
280                              '<div class="servicedesc">欢迎使用中国机电产品进出口商会网站!<br/></div>' +
281                              '<div class="servicedesc">为了方便您使用个人信息便捷登陆系统,机电国际商机小程序和中国机电产品进出口商会网站已统一改为使用“企业账号+个人账号”的用户体系。您只要在企业账号下快速创建个人账号即可登录使用原有的功能。已创建的个人账号在小程序和网站中通用。<br/></div>' +
282                              '<div class="servicepartname">如有任何问题请联系机电商会信息部</div>' +
283                              '<div class="servicepartdesc">电话:010-58280711/710/922</div>' +
284                              '<div class="servicepartdesc">邮件:[email protected]</div>';
285                    var layerTip = layer.open({
286                        title: '关于创建个人账号的说明',
287                        content: contentHTML,
288                        shade: 0.1,
289                        btnAlign: 'center',
290                        yes: function (index, layero) {
291                            layer.close(index);
292                        }
293                    });
294
295                    $("#imgSMSCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
296                    $("#txtImgCode").val("");
297                    return false;
298                }
299                else {
300                    var tempMessage = ajax.state.message; 
301                    tempMessage = tempMessage.replace("ss", "<span style='color:#fa5151;'>");
302                    tempMessage = tempMessage.replace("se", "</span>");
303                    layer.msg("<div style='text-align:center;'>" + tempMessage + "</div>");
304                    //                    layer.msg(tempMessage);
305                    $("#imgSMSCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
306                    $("#txtImgCode").val("");
307                    return false;
308                }
309            }
310            else {
311                //如果是信息页面登录并登录成功以后,更新页面信息
312                if (ajax.state.message == "ok") {
313
314                }
315
316                //如果是通过登录页面登录,则导航到相应会员中心
317                var folderName = "ucenter";
318                if (ajax.data.userinfo[0].usertype == "user") folderName = "usercenter";
319
320                if (str_pos > 0)
321                    window.location.href = unescape(str_surl);
322                else {
323                    window.location.href = config.WebURL + folderName + "/index.html";
324                }
325
326                return true;
327            }
328        };
329        ajax.onError = function () {
330            $("#imgSMSCode").attr("src", apiURL + "Common/ValidateCode.ashx?" + Math.random());
331            $("#txtImgCode").val("");
332            layer.close(index);
333        }
334    }

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.