function showErrMsg(msg) { layer.msg(msg, { icon: 5, time: 3000, shade: 0.5, shadeClose: true }); } function showErrMsgTime(msg, times) { layer.msg(msg, { icon: 5, time: (times * 1000), shade: 0.5, shadeClose: true }); } function showOk(msg) { layer.msg(msg, { icon: 1, time: 3000, shade: 0.5, shadeClose: true }); } function showOkTime(msg,times) { layer.msg(msg, { icon: 1, time: (times * 1000), shade: 0.5, shadeClose: true }); } function showMsg(title,msg) { layer.open({ type: 1, title: title, shadeClose: true, skin: 'layui-layer-rim', //鍔犱笂杈规 area: ['420px', '300px'], //瀹介珮 content: '

'+msg+'

' }); } //function showOk(msg, times) { // layer.msg(msg, { icon: 1, time: (times * 1000), shade: 0.5, shadeClose: true }); //} /*=======================鎵嬫満绔皝瑁呮柟娉曞紑濮婟==========================================*/ function MobileError(Msg) { //淇℃伅妗 layer.open({ content: '' + Msg + '', time: 3, skin: 'msg' }); } function MobileInfoTime(Msg,times) { //淇℃伅妗 layer.open({ content: '' + Msg + '', time: times, skin: 'msg' }); } function MobileShowInfo(Msg) { //淇℃伅妗 layer.open({ content: '' + Msg + '', time: 2, skin: 'msg' }); } function MobileConfimUrl(msg, url) { layer.open({ content: msg, time: 3, skin: 'msg', end: function () { location.href = url; } }); } function MobileShowInfoTimesAndUrl(times, msg, url) { layer.open({ content: msg, time: times, skin: 'msg', end: function () { location.href = url; } }); } function MobileShowAndLogin() { layer.open({ content: '璇ユ搷浣滈渶鐧诲綍鍚庢墠鍙户缁紝鏄惁绔嬪嵆鐧诲綍锛?, btn: [' 绔嬪嵆鐧诲綍 ', ' 鏆備笉鐧诲綍 '], shadeClose: true, yes: function () { location.href = "/Mobile/Passport/Login.aspx?return_link=" + encodeURIComponent(location.href); }, no: function () { return false; } }); } /*========================鎵嬫満绔皝瑁呮柟娉曠粨鏉烗===========================================================*/ //璇籆ookie function getCookie(objName) {//鑾峰彇鎸囧畾鍚嶇О鐨刢ookie鐨勫€ if (objName !=null) { var objName = 'cn'+objName var arrStr = document.cookie.split("; "); for (var i = 0; i < arrStr.length; i++) { var temp = arrStr[i].split("="); if (temp[0] == objName) return unescape(temp[1]); } return ""; } } //鍒犻櫎cookie function delCookie(name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval = getCookie(name); if (cval != null) document.cookie ='cn'+name + "=" + cval + ";expires=" + exp.toGMTString()+"; path=/"; } /*=================================================*/ function PCShowInfo(msg) { layer.msg(msg, { shade: [0.3], shadeClose: true, time: 2000 }); } function PCShowConfirmToUrl(msg, btnYes, btnNo, url) { layer.open({ content: msg, btn: [btnYes, btnNo], shadeClose: true, yes: function (index) { location.href = url; }, no: function () { } }); } function ShowCloseWindow(msg, url) { layer.alert('' + msg + '', { closeBtn: 0 }, function () { location.href = url; }); } function PCUpdateMobileLogin(msg, btnYes, url) { layer.open({ content: msg, btn: [btnYes], shadeClose: true, yes: function (index) { location.href = url; }, no: function () { } }); } function showAndLogin() { layer.open({ content: '璇ユ搷浣滈渶鐧诲綍鍚庢墠鍙户缁紝鏄惁绔嬪嵆鐧诲綍锛?, btn: [' 绔嬪嵆鐧诲綍 ', ' 鏆備笉鐧诲綍 '], shadeClose: true, yes: function () { location.href = "/login.html?return_link=" + encodeURIComponent(location.href); }, no: function () { return false; } }); } function PCShowInfoAndJumpInfo(times, msg, url) { layer.msg(msg, { time: (times*1000), shade: [0.3], shadeClose: true, end: function (index) { location.href = url; } }); } function PCShowInfoAndJump(msg, url) { layer.msg(msg, { time: 3000, shade: [0.3], shadeClose: true, end: function (index) { location.href = url; } }); } function PCShowInfoAndRefresh(msg) { layer.msg(msg, { time: 3000, shade: [0.3], shadeClose: true, end: function (index) { location.reload(); } }); } /*=================================================*/ function GetRequest() { var url = location.search; var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for (var i = 0; i < strs.length; i++) { theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]); } } return theRequest; } function inputCheck(input_type, input) { switch (input_type) { case "num": //楠岃瘉鏄惁鏄暟瀛 if (!(/^\d+$/.test(input))) { return false; } return true; case "qq": //楠岃瘉QQ鍙风爜 if (!(/^[1-9]{1}[0-9]{4,}$/.test(input))) { return false; } return true; case "email": //楠岃瘉Email if (!(/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(input))) { return false; } return true; case "mobile": //楠岃瘉鎵嬫満鍙风爜 if (!(/^(13[0-9]|14[57]|15[0-9]|17[0-9]|18[0-9])[0-9]{8}$/.test(input))) { return false; } return true; case "phone": //楠岃瘉鐢佃瘽鍙风爜 if (/^(400|800)([0-9\\-]{7,10})?$/.test(input)) { return true; } if (/^(\d{4}-|\d{3}-)?(\d{8}|\d{7})?$/.test(input)) { return true; } return false; case "fax": //楠岃瘉浼犵湡鍙风爜 if (/^(400|800)([0-9\\-]{7,10})?$/.test(input)) { return true; } if (/^(\d{4}-|\d{3}-)?(\d{8}|\d{7})?$/.test(input)) { return true; } return true; case "postalCode": //楠岃瘉閭紪 if (!(/^\d{6}$/.test(input))) { return false; } return true; case "username": //楠岃瘉鐢ㄦ埛鍚 if (input.length < 4 || input.length > 20) { //鐢ㄦ埛鍚嶅繀椤绘槸4-20浣 return false; } if (!(/^[A-Za-z]+|[A-Za-z].*[0-9]|[0-9].*[A-Za-z]$/.test(input))) { //鐢ㄦ埛鍚嶄腑涓嶈兘鏄函鏁板瓧 return false; } return true; case "money": if (!(/^[0-9]+(.[0-9]{1,2})?$/.test(input))) { return false; } return true; case "password": //楠岃瘉瀵嗙爜 if (input.length < 8 || input.length > 20) {//瀵嗙爜蹇呴』鏄?-20浣 return false; } if (!(/^[A-Za-z].*[0-9]|[0-9].*[A-Za-z]$/.test(input))) {//瀵嗙爜涓暟瀛楀拰鑻辨枃瀛楁瘝蹇呴』鍚屾椂瀛樺湪 return false; } return true; case "en": if (!(/^[A-Za-z ]+$/.test(input))) { //鐢ㄦ埛鍚嶄腑涓嶈兘鏄函鏁板瓧 return false; } return true; case "enandnumber": if (!(/^[A-Za-z\d ]+$/.test(input))) { //鐢ㄦ埛鍚嶄腑涓嶈兘鏄函鏁板瓧 return false; } return true; default: return true; } }