|
@@ -97,7 +97,7 @@ $(function(){
|
|
|
"mobile": Suser,
|
|
|
"password": Spass,
|
|
|
"type": experts,
|
|
|
- "remember": false,
|
|
|
+ "remember": false
|
|
|
},
|
|
|
success: function (rest) {
|
|
|
if (rest.error && rest.error.length) {
|
|
@@ -150,6 +150,240 @@ $(function(){
|
|
|
_MEIQIA('entId', 77931);
|
|
|
_MEIQIA('withoutBtn');
|
|
|
|
|
|
-
|
|
|
-})
|
|
|
+ //忘记密码事件
|
|
|
+ //首先设定确认按钮为不能点击,并且颜色为灰色
|
|
|
+ //$('.forget_sub').attr('disabled', true);
|
|
|
+ //$('.forget_sub').css({background: '#CCCCCC',border: 'none'});
|
|
|
+ //$('.new_password_sub').attr('disabled', true);
|
|
|
+ //$('.new_password_sub').css({background: '#CCCCCC',border: 'none'});
|
|
|
+ var phone_number="";
|
|
|
+ var reset_code="";
|
|
|
+ //企业和个人的选择,图形改变
|
|
|
+ $('#forget_checks').attr('checked',true);
|
|
|
+ $('#forget_checks').click(function(){
|
|
|
+ var Cheack=$(this).prop('checked');
|
|
|
+ if(Cheack){
|
|
|
+ $('#checks').attr('checked',true);
|
|
|
+ $(this).parent().removeClass("lab_checkno").addClass("lab_check");
|
|
|
+ $('#forget_checkst').prop('checked',false);
|
|
|
+ $('#forget_checkst').parent().removeClass("lab_check").addClass("lab_checkno");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#forget_checkst').click(function(){
|
|
|
+ var Cheack_no=$(this).prop('checked');
|
|
|
+ if(Cheack_no){
|
|
|
+ $(this).parent().removeClass("lab_checkno").addClass("lab_check");
|
|
|
+ $('#forget_checks').prop('checked',false);
|
|
|
+ $('#forget_checks').parent().removeClass("lab_check").addClass("lab_checkno");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //点击登录界面的忘记密码 ,将会弹出忘记密码界面
|
|
|
+ $('.login_check a').click(function(e){
|
|
|
+ e.preventDefault();
|
|
|
+ $('.login').fadeOut(800);
|
|
|
+ $('#form_register').fadeOut(800);
|
|
|
+ $("#forget").fadeIn(800);
|
|
|
+ });
|
|
|
+ //点击忘记密码右上角的×,将会关闭界面并清空里面的内容
|
|
|
+ $('#forget .login_close').click(function(){
|
|
|
+ $('#forget').fadeOut(800);
|
|
|
+ $('#form_register').fadeIn(800);
|
|
|
+ $("#forget_phone").val("");
|
|
|
+ $("#forget_yanzheng").val("");
|
|
|
+ $("#photo_n").val("");
|
|
|
+ });
|
|
|
+ //点击取消,相当于点击×
|
|
|
+ $("#forget .fastener_right").click(function(){
|
|
|
+ $('#forget .login_close').click();
|
|
|
+ });
|
|
|
+ //点击重置密码右上角的×,将会关闭界面并清空里面的内容
|
|
|
+ $('#new_password .login_close').click(function(){
|
|
|
+ $('#new_password').fadeOut(800)
|
|
|
+ $('#form_register').fadeIn(800)
|
|
|
+ });
|
|
|
+ //点击取消,相当于点击×
|
|
|
+ $("#new_password .fastener_right").click(function(){
|
|
|
+ $('#new_password .login_close').click();
|
|
|
+ });
|
|
|
+ //点击忘记密码里面的确认,则发送一个请求,并跳转到重置密码界面
|
|
|
+ $('#forget_form').submit(function(e){
|
|
|
+ e.preventDefault();
|
|
|
+ var phone_forget=$("#forget_phone").val();
|
|
|
+ var yanzheng_forget=$("#forget_yanzheng").val();
|
|
|
+ var phone_n_forget=$("#photo_n").val();
|
|
|
+ var types = $('#forget_checks').prop("checked") ? '0' : '1';//团体/个人
|
|
|
+ if(phone_forget==''||yanzheng_forget==''||phone_n_forget==''){
|
|
|
+ return false;
|
|
|
+ }else {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ url: globalConfig.context + "/open/checkMCode",
|
|
|
+ data: {
|
|
|
+ //"mobile": phone_forget,
|
|
|
+ "mobileCode": phone_n_forget
|
|
|
+ },
|
|
|
+ success: function (rest) {
|
|
|
+ if (rest.error && rest.error.length) {
|
|
|
+ $('#msg').val(rest.error[0].message);
|
|
|
+ msg();
|
|
|
+ } else {
|
|
|
+ $('#forget').fadeOut(800);
|
|
|
+ $('#form_register').fadeOut(800);
|
|
|
+ $("#new_password").fadeIn(800);
|
|
|
+ $(".password_top>h4").attr("val",rest.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ function pass_new(){
|
|
|
+ $('#new_pass').blur(function () {
|
|
|
+ var pass_pattern=/^\w{6,12}$/;
|
|
|
+ var new_pass=$("#new_pass").val();
|
|
|
+ var new_pass_again=$("#new_pass_again").val();
|
|
|
+ if (new_pass==''||!pass_pattern.test(new_pass)) {
|
|
|
+ $(this).val('');
|
|
|
+ $(this).attr('placeholder', '请输入6-12位数密码');
|
|
|
+ }
|
|
|
+ if (new_pass!==new_pass_again) {
|
|
|
+ $('#new_pass_again').val('')
|
|
|
+ $('#new_pass_again').attr('placeholder', '确认密码')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ pass_new();
|
|
|
+ function pass_new_again(){
|
|
|
+ //密码相同验证
|
|
|
+ $('#new_pass_again').blur(function () {
|
|
|
+ var new_pass=$("#new_pass").val();
|
|
|
+ var new_pass_again=$("#new_pass_again").val();
|
|
|
+ if (new_pass !== new_pass_again||new_pass_again == '') {
|
|
|
+ $(this).val('');
|
|
|
+ $(this).attr('placeholder', '确认密码')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ pass_new_again()
|
|
|
+ //点击重置密码里面的确认,则发送一个请求,并关闭重置密码界面
|
|
|
+ $('#new_password_form').submit(function(e){
|
|
|
+ e.preventDefault();
|
|
|
+ var pass_pattern=/^\w{6,12}$/;
|
|
|
+ var phone_forget=$("#forget_phone").val();
|
|
|
+ var new_pass=$("#new_pass").val();
|
|
|
+ var new_pass_again=$("#new_pass_again").val();
|
|
|
+ var types = $('#forget_checks').prop("checked") ? '0' : '1';//团体/个人
|
|
|
+ var reset_code=$(".password_top>h4").attr("val");
|
|
|
+ if(new_pass==''||!pass_pattern.test(new_pass)||new_pass!==new_pass_again){
|
|
|
+ return false;
|
|
|
+ }else {
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ dataType: "json",
|
|
|
+ url: globalConfig.context + "/open/resetPwd",
|
|
|
+ data: {
|
|
|
+ "mobile": phone_forget,
|
|
|
+ "type": types,
|
|
|
+ "resetCode":reset_code,
|
|
|
+ "newPwd": new_pass
|
|
|
+ },
|
|
|
+ success: function (rest) {
|
|
|
+ if (rest.error && rest.error.length) {
|
|
|
+ $('#msg').val(rest.error[0].message);
|
|
|
+ msg();
|
|
|
+ } else {
|
|
|
+ $('.login').fadeIn(800);
|
|
|
+ $('#form_register').fadeOut(800);
|
|
|
+ $("#new_password").fadeOut(800);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ //手机号码的验证
|
|
|
+ function photoyanzheng(){
|
|
|
+ var pho_pattern=/^1[3|4|5|7|8][0-9]{9}$/;
|
|
|
+ $("#forget_phone").keyup(function(){
|
|
|
+ var phol= $(this).val();
|
|
|
+ if(pho_pattern.test(phol)){
|
|
|
+ $('#photo_m').attr('disabled', false);
|
|
|
+ $("#photo_m").css("color","#F18101");
|
|
|
+ }else if(!pho_pattern.test(phol)){
|
|
|
+ $('#photo_m').attr('disabled', true);
|
|
|
+ $("#photo_m").css("color","#ccc");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#forget_phone').blur(function () {
|
|
|
+ var pho= $(this).val();
|
|
|
+ if (pho==''||!pho_pattern.test(pho)) {
|
|
|
+ $(this).val('');
|
|
|
+ $(this).attr('placeholder', '请输入正确的号码')
|
|
|
+ } else{
|
|
|
+ $('#photo_m').attr('disabled', false);
|
|
|
+ $("#photo_m").css("color","#F18101");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ photoyanzheng();
|
|
|
+ //手机验证码
|
|
|
+ function photo_n(){
|
|
|
+ $('#photo_n').blur(function () {
|
|
|
+ var phoa = $(this).val();
|
|
|
+ if (phoa=='') {
|
|
|
+ $(this).val('');
|
|
|
+ $(this).attr('placeholder', '请输入验证码');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ photo_n();
|
|
|
+ //点击刷新图片验证码
|
|
|
+ $('.yanzhengma_cont_').click(function () {
|
|
|
+ $('.yanzhengma_cont_ img').attr('src', (globalConfig.context + "/open/getVCode?t=" + Math.random()))
|
|
|
+ });
|
|
|
+ var tt = 30;
|
|
|
+ $('#photo_m').click(function () {
|
|
|
+ //手机验证功能
|
|
|
+ var ophoto = $('#forget_phone').val();
|
|
|
+ var types = $('#forget_checks').prop("checked") ? '0' : '1';
|
|
|
+ var phott = $('#forget_yanzheng').val();
|
|
|
+ //验证码倒计时
|
|
|
+ $('#photo_m').attr('disabled', true);
|
|
|
+ $(this).attr('disabled', true);
|
|
|
+ var timer = setInterval(function () {
|
|
|
+ tt -= 1;
|
|
|
+ $('#photo_m').attr('disabled', true);
|
|
|
+ $(this).val("发送"+'('+tt+'s'+')');
|
|
|
+ $(this).css({color:'#cccccc'})
|
|
|
+ if (tt == 0) {
|
|
|
+ clearInterval(timer);
|
|
|
+ $('#photo_m').attr('disabled', false);
|
|
|
+ $(this).attr('disabled', false);
|
|
|
+ tt=30;
|
|
|
+ $(this).css({color:'rgb(241, 129, 1)'})
|
|
|
+ $(this).val('重新发送');
|
|
|
+ }
|
|
|
+ }.bind(this), 1000);
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: globalConfig.context + "/open/getMCode",
|
|
|
+ data: {
|
|
|
+ "mobile": ophoto,
|
|
|
+ "sign": true,
|
|
|
+ "type": types,
|
|
|
+ "verificationCode": phott
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ $('#msg').val(data.error[0].message);
|
|
|
+ msg();
|
|
|
+ } else {
|
|
|
+ $('#msg').val('发送成功');
|
|
|
+ msg();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+});
|
|
|
|