|
@@ -4,16 +4,218 @@
|
|
|
|
|
|
|
|
|
|
(function(){
|
|
(function(){
|
|
|
|
+
|
|
|
|
+ var panduan;
|
|
$("#zhuangjia").click(function(){
|
|
$("#zhuangjia").click(function(){
|
|
- console.log(1);
|
|
+ panduan=$("#zhuangjia").val();
|
|
- var a=$("#zhuangjia").val();
|
|
+ if(panduan==0){
|
|
- console.log(a);
|
|
+ $(".businessName").css("display","block");
|
|
|
|
+ $(".linkmanName").css("display","block");
|
|
|
|
+ $(".zhuangjiaName").css("display","none");
|
|
|
|
|
|
|
|
+ }
|
|
});
|
|
});
|
|
$("#qiye").click(function(){
|
|
$("#qiye").click(function(){
|
|
- console.log(2);
|
|
+ panduan=$("#qiye").val();
|
|
-
|
|
+ if(panduan==1){
|
|
|
|
+ $(".businessName").css("display","none");
|
|
|
|
+ $(".linkmanName").css("display","none");
|
|
|
|
+ $(".zhuangjiaName").css("display","block");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $('#checks').attr('checked',false)
|
|
|
|
+ $('.login_check label input').click(function(){
|
|
|
|
+ var Cheack=$(this).prop('checked')
|
|
|
|
+ if(Cheack){
|
|
|
|
+ $(this).parent().css({"background":"url(../imgeck_lo.png) no-repeat center left","background-size":"25% 40%"})
|
|
|
|
+ }else{
|
|
|
|
+ $(this).parent().css({"background":"url(../imgeck_lono.png) no-repeat center left","background-size":"25% 40%"})
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ $('.sub').attr('disabled', true)
|
|
|
|
+ $('.sub').css({background: '#CCCCCC',border: 'none'})
|
|
|
|
+ var pattern = /^1[3|4|5|7|8][0-9]{9}$/;
|
|
|
|
+ var pass_pattern=/^\w{6,12}$/;
|
|
|
|
+ $('#username,#userpassword,#piccode,#photo_num,#business,#linkman,#man').keyup(function() {
|
|
|
|
+ $('.sub').attr('disabled', true)
|
|
|
|
+ $('.sub').css({background: '#CCCCCC',border: 'none'})
|
|
|
|
+ var pp = $('#username').val();
|
|
|
|
+ var mim = $('#userpassword').val();
|
|
|
|
+ var toname = $('#business').val();
|
|
|
|
+ var lxr = $('#linkman').val();
|
|
|
|
+ var zj=$('#man').val();
|
|
|
|
+ var yzm = $('#piccode').val();
|
|
|
|
+ var sjyzm = $('#photo_num').val();
|
|
|
|
+ var typel = $('#zhuangjia').prop("checked") ? '1' : '0';
|
|
|
|
+ if(typel==1){
|
|
|
|
+ if(pp!==''&&toname!==''&&lxr!==''&&mim!==''&& pass_pattern.test(mim) && sjyzm!==''&& yzm!==''&&pattern.test(pp)){
|
|
|
|
+ $('.sub').attr('disabled', false);
|
|
|
|
+ $('.sub').css({background: '#F18101',border: 'none'})
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(typel==0){
|
|
|
|
+ if(pp!==''&&zj!==''&&mim!==''&& pass_pattern.test(mim) && sjyzm!==''&& yzm!==''&&pattern.test(pp)){
|
|
|
|
+ $('.sub').attr('disabled', false);
|
|
|
|
+ $('.sub').css({background: '#F18101',border: 'none'})
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ function pass1(){
|
|
|
|
+ $('#userpassword').blur(function () {
|
|
|
|
+ var pass1 = $(this).val();
|
|
|
|
+ if (pass1=='') {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请输入6-12位数密码');
|
|
|
|
+ } else if (!pass_pattern.test(pass1)) {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '格式:字母、数字、下划线');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ pass1();
|
|
|
|
+
|
|
|
|
+ pass2();
|
|
|
|
+ function pass2(){
|
|
|
|
+
|
|
|
|
+ $('#userpassword2').blur(function () {
|
|
|
|
+ var orepeat = $(this).val();
|
|
|
|
+ var passw = $('#userpassword').val();
|
|
|
|
+ if (passw !== orepeat) {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '两次密码不相同')
|
|
|
|
+ } else if (passw == '') {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请再次输入密码')
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $('#userpassword').blur(function () {
|
|
|
|
+ var tt=$(userpassword2).val();
|
|
|
|
+ var kk=$(this).val();
|
|
|
|
+ if ($(this).val() == '') {
|
|
|
|
+ $('#userpassword2').attr('placeholder', '请再次输入密码')
|
|
|
|
+ }else if(tt!==kk){
|
|
|
|
+ $('#userpassword2').val('');
|
|
|
|
+ $('#userpassword2').attr('placeholder', '两次密码不相同')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function photo1(){
|
|
|
|
+ var pho_pattern=/^1[3|4|5|7|8][0-9]{9}$/;
|
|
|
|
+ $('#username').blur(function () {
|
|
|
|
+ var pho = $(this).val();
|
|
|
|
+ if (pho=='') {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请输入您的手机号码');
|
|
|
|
+ } else if (!pho_pattern.test(pho)) {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请输入正确的手机号码');
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ photo1();
|
|
|
|
+
|
|
|
|
+ function photo_num(){
|
|
|
|
+ $('#photo_num').blur(function () {
|
|
|
|
+ var phoa = $(this).val();
|
|
|
|
+ if (phoa=='') {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请输入手机上的验证码');
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ photo_num();
|
|
|
|
+
|
|
|
|
+ function photo_name(){
|
|
|
|
+ $('#business').blur(function () {
|
|
|
|
+ var name = $(this).val();
|
|
|
|
+ if (name=='') {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请填写工商局注册的全称');
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ photo_name();
|
|
|
|
+
|
|
|
|
+ function lxr_name(){
|
|
|
|
+ $('#linkman').blur(function () {
|
|
|
|
+ var name = $(this).val();
|
|
|
|
+ if (name=='') {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请填写单位联系人的姓名');
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ lxr_name();
|
|
|
|
+
|
|
|
|
+ function zj_name(){
|
|
|
|
+ $('#man').blur(function () {
|
|
|
|
+ var name = $(this).val();
|
|
|
|
+ if (name=='') {
|
|
|
|
+ $(this).val('');
|
|
|
|
+ $(this).attr('placeholder', '请填写您的姓名');
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ zj_name();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $("form").submit(function(e) {
|
|
|
|
+ var user = $("#username").val();
|
|
|
|
+ var password = $("#userpassword").val();
|
|
|
|
+ var types = $('#zhuangjia').prop("checked") ? '1' : '0';
|
|
|
|
+ var oname = $('#business').val();
|
|
|
|
+ var opeople = $('#linkman').val();
|
|
|
|
+ var Code = $("#piccode").val();
|
|
|
|
+ var mobileCode = $('#photo_num').val();
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ console.log(user, password, types, oname, opeople, Code, mobileCode);
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "POST",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ url: globalConfig.context + "/register",
|
|
|
|
+ data: {
|
|
|
|
+ "mobile": user,
|
|
|
|
+ "password": password,
|
|
|
|
+ "type": types,
|
|
|
|
+ "companyName": oname,
|
|
|
|
+ "contacts": opeople,
|
|
|
|
+ "verficationCode":Code,
|
|
|
|
+ "mobileCode": mobileCode
|
|
|
|
+ },
|
|
|
|
+ success: function (data) {
|
|
|
|
+ if (data.error && data.error.length) {
|
|
|
|
+ $('.msg span').html(data.error[0].message);
|
|
|
|
+ console.log(data.error[0].message);
|
|
|
|
+ } else {
|
|
|
|
+ console.log(data);
|
|
|
|
+ $('.msg span').html("恭喜注册成功!")
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
})();
|
|
})();
|
|
|
|
|
|
|
|
|