|
@@ -6,18 +6,20 @@ import './public.js'
|
|
|
(function(){
|
|
|
//选择专家和企业时要切换
|
|
|
var panduan;
|
|
|
- $("#zhuangjia").click(function(){
|
|
|
- panduan=$("#zhuangjia").val();
|
|
|
- if(panduan==0){
|
|
|
+ $("#qiye").click(function(){
|
|
|
+ panduan=$('#zhuangjia').prop("checked") ? '0' : '1';
|
|
|
+ console.log(panduan);
|
|
|
+ if(panduan==1){
|
|
|
$(".businessName").css("display","block");
|
|
|
$(".linkmanName").css("display","block");
|
|
|
$(".zhuangjiaName").css("display","none");
|
|
|
|
|
|
}
|
|
|
});
|
|
|
- $("#qiye").click(function(){
|
|
|
- panduan=$("#qiye").val();
|
|
|
- if(panduan==1){
|
|
|
+ $("#zhuangjia").click(function(){
|
|
|
+ panduan=$('#zhuangjia').prop("checked") ? '0' : '1';
|
|
|
+ console.log(panduan);
|
|
|
+ if(panduan==0){
|
|
|
$(".businessName").css("display","none");
|
|
|
$(".linkmanName").css("display","none");
|
|
|
$(".zhuangjiaName").css("display","block");
|
|
@@ -29,25 +31,47 @@ import './public.js'
|
|
|
});
|
|
|
//修改单选框的样式
|
|
|
//$('.leibie input').css("display","none");
|
|
|
- $(".leibie").css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"});
|
|
|
- $('.leibie input').click(function(){
|
|
|
- var Cheack=$(this).prop('checked');
|
|
|
+ $(".qiye_lab").css({"background":"url(../img/checked.jpg) no-repeat center left","background-size":"13px 13px"});
|
|
|
+ $(".zhuangjia_lab").css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"});
|
|
|
+ $(".protocol_lab").css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"});
|
|
|
+ $('#qiye').click(function(){
|
|
|
+ var Cheack=$(this).prop('checked')
|
|
|
if(Cheack){
|
|
|
- //$(this).css("display","none");
|
|
|
- $(".leibie").css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"});
|
|
|
$(this).parent().css({"background":"url(../img/checked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
+ $('#zhuangjia').prop('checked',false)
|
|
|
+ $('#zhuangjia').parent().css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
}else{
|
|
|
- // $(this).css("display","none");
|
|
|
- $(".leibie").css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"});
|
|
|
+ $('#zhuangjia').prop('checked',true)
|
|
|
+ $('#zhuangjia').parent().css({"background":"url(../img/checked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
$(this).parent().css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
+ $('#zhuangjia').click(function(){
|
|
|
+ var Cheack_no=$(this).prop('checked')
|
|
|
+ if(Cheack_no){
|
|
|
+ $(this).parent().css({"background":"url(../img/checked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
+ $('#qiye').prop('checked',false)
|
|
|
+ $('#qiye').parent().css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
+ }else{
|
|
|
+ $('#qiye').prop('checked',true)
|
|
|
+ $('#qiye').parent().css({"background":"url(../img/checked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
+ $(this).parent().css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $('#protocol').click(function(){
|
|
|
+ var Cheack_no=$(this).prop('checked')
|
|
|
+ if(Cheack_no){
|
|
|
+ $(this).parent().css({"background":"url(../img/checked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
+ }else{
|
|
|
+ $(this).parent().css({"background":"url(../img/unchecked.jpg) no-repeat center left","background-size":"13px 13px"})
|
|
|
+ }
|
|
|
+ })
|
|
|
//表单验证
|
|
|
$('.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() {
|
|
|
+ $('#username,#userpassword,#userpassword2,#piccode,#photo_num,#business,#linkman,#man').keyup(function() {
|
|
|
$('.sub').attr('disabled', true)
|
|
|
$('.sub').css({background: '#CCCCCC',border: 'none'})
|
|
|
var pp = $('#username').val();//手机号码
|
|
@@ -57,7 +81,10 @@ import './public.js'
|
|
|
var zj=$('#man').val();//联系人
|
|
|
var yzm = $('#piccode').val();//验证码
|
|
|
var sjyzm = $('#photo_num').val();//手机验证码
|
|
|
- var typel = $('#zhuangjia').prop("checked") ? '1' : '0';
|
|
|
+ var typel = $('#zhuangjia').prop("checked") ? '0' : '1';
|
|
|
+ var xieyi=$('#protocol').prop("checked");
|
|
|
+ console.log(xieyi);
|
|
|
+ console.log(typel);
|
|
|
if(typel==1){
|
|
|
if(pp!==''&&toname!==''&&lxr!==''&&mim!==''&& pass_pattern.test(mim) && sjyzm!==''&& yzm!==''&&pattern.test(pp)){
|
|
|
$('.sub').attr('disabled', false);
|
|
@@ -200,35 +227,84 @@ import './public.js'
|
|
|
var password = $("#userpassword").val();
|
|
|
var types = $('#zhuangjia').prop("checked") ? '0' : '1';//团体/个人
|
|
|
var oname = $('#business').val();//企业名称
|
|
|
- var opeople = $('#linkman').val();//联系人
|
|
|
+ var opeople = $('#linkman').val();//企业联系人
|
|
|
+ var people=$('#man').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;
|
|
|
+ if(types==0){
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ url: globalConfig.context + "/register",
|
|
|
+ data: {
|
|
|
+ "mobile": user,
|
|
|
+ "password": password,
|
|
|
+ "type": types,
|
|
|
+ "contacts": people,
|
|
|
+ "verficationCode":Code,
|
|
|
+ "mobileCode": mobileCode
|
|
|
+ },
|
|
|
+ success: function (rest) {
|
|
|
+ if (rest.error && rest.error.length) {
|
|
|
+ message.warning(rest.error[0].message);
|
|
|
+ } else {
|
|
|
+ var data = rest.data;
|
|
|
+ if (data && data.requestURI) {
|
|
|
+ var path = globalConfig.context + data.requestURI
|
|
|
+ if (data.queryString) {
|
|
|
+ path += '?' + data.queryString;
|
|
|
+ }
|
|
|
+ if (window.location.hash) {
|
|
|
+ path += window.location.hash;
|
|
|
+ }
|
|
|
+ window.location.href = path;
|
|
|
+ } else {
|
|
|
+ window.location.href = globalConfig.context + "/user/account/index.html";
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else if(types==1){
|
|
|
+ $.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 (rest) {
|
|
|
+ if (rest.error && rest.error.length) {
|
|
|
+ message.warning(rest.error[0].message);
|
|
|
+ } else {
|
|
|
+ var data = rest.data;
|
|
|
+ if (data && data.requestURI) {
|
|
|
+ var path = globalConfig.context + data.requestURI
|
|
|
+ if (data.queryString) {
|
|
|
+ path += '?' + data.queryString;
|
|
|
+ }
|
|
|
+ if (window.location.hash) {
|
|
|
+ path += window.location.hash;
|
|
|
+ }
|
|
|
+ window.location.href = path;
|
|
|
+ } else {
|
|
|
+ window.location.href = globalConfig.context + "/user/account/index.html";
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
//点击刷新图片验证码
|
|
|
$('.yanzhengma_cont').click(function () {
|