|
@@ -76,24 +76,16 @@ window.onload=function(){
|
|
|
$('#form_register').fadeIn(800)
|
|
|
}
|
|
|
})
|
|
|
- $('#form_login').submit(function(e){
|
|
|
- let hrefs=window.location.href,jump=window.location.hash,jumpState=false,
|
|
|
- urls = hrefs.split('/').pop();
|
|
|
- if(urls=='evaluate'||urls=='shopList'||jump=='#jump'){
|
|
|
- jumpState=true;
|
|
|
- }
|
|
|
- e.preventDefault();
|
|
|
- var Suser=$('#Lo_user').val();
|
|
|
- var Spass=$('#Lo_pass').val();
|
|
|
- var type=$(".login_pass>#customerType").val();
|
|
|
- var check_experts=$('#checks').prop('checked');
|
|
|
- if(Suser==''||Spass==''){
|
|
|
- msg('请填写用户名/密码.');
|
|
|
- return false;
|
|
|
- }else{
|
|
|
+ //登录调用;
|
|
|
+ function loginBegin(type){
|
|
|
+ let hrefs=window.location.href,jump=window.location.hash,jumpState=false,
|
|
|
+ urls = hrefs.split('/').pop();
|
|
|
+ if(urls=='evaluate'||urls=='shopList'||jump=='#jump'){
|
|
|
+ jumpState=true;
|
|
|
+ }
|
|
|
$('.loading').show();
|
|
|
- let txt = "登录中,请稍后...",htmls=[],i=0,
|
|
|
- txtArr = txt.split('');
|
|
|
+ let txt = "登录中,请稍后...",htmls=[],
|
|
|
+ txtArr = txt.split('');
|
|
|
txtArr.map(item=>{
|
|
|
htmls.push(`
|
|
|
<span>${item}</span>
|
|
@@ -105,9 +97,9 @@ window.onload=function(){
|
|
|
dataType: "json",
|
|
|
url: globalConfig.context + "/signin",
|
|
|
data: {
|
|
|
- "mobile": Suser,
|
|
|
- "password": Spass,
|
|
|
- 'type':type
|
|
|
+ "mobile": $('#Lo_user').val(),
|
|
|
+ "password": $('#Lo_pass').val(),
|
|
|
+ 'type':type
|
|
|
},
|
|
|
success: function (rest) {
|
|
|
$('.loading').hide();
|
|
@@ -127,22 +119,87 @@ window.onload=function(){
|
|
|
} else {
|
|
|
if(!jumpState){
|
|
|
msg('登录成功,2秒后跳转个人中心');
|
|
|
- setTimeout(()=>{
|
|
|
- window.location.href = globalConfig.context + "/user/account/index.html";
|
|
|
- },2000)
|
|
|
- }else{
|
|
|
- msg('登录成功');
|
|
|
- setTimeout(()=>{
|
|
|
- window.location.reload();
|
|
|
- },1000)
|
|
|
- }
|
|
|
+ setTimeout(()=>{
|
|
|
+ window.location.href = globalConfig.context + "/user/account/index.html";
|
|
|
+ },2000)
|
|
|
+ }else{
|
|
|
+ msg('登录成功');
|
|
|
+ setTimeout(()=>{
|
|
|
+ window.location.reload();
|
|
|
+ },1000)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+ }
|
|
|
+ $('#form_login').submit(function(e){
|
|
|
+ e.preventDefault();
|
|
|
+ var Suser=$('#Lo_user').val();
|
|
|
+ var Spass=$('#Lo_pass').val();
|
|
|
+ if(Suser==''||Spass==''){
|
|
|
+ msg('请填写用户名/密码.');
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ ininUserType(Suser,Spass)
|
|
|
}
|
|
|
})
|
|
|
+ function ininUserType(user,pass){
|
|
|
+ $.ajax({
|
|
|
+ method:'get',
|
|
|
+ dataType:'json',
|
|
|
+ url:globalConfig.context+'/open/loginCheck',
|
|
|
+ data:{
|
|
|
+ "mobile":user,
|
|
|
+ "password":pass,
|
|
|
+ },
|
|
|
+ success:function(data){
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ msg(data.error[0].message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(data.data.type!=null){
|
|
|
+ loginBegin(data.data.type);
|
|
|
+ }else{
|
|
|
+ $('.modeBj').show(200);
|
|
|
+ $('.modeLogin').addClass('active');
|
|
|
+ modelLogin(data.data.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function modelLogin(ids){
|
|
|
+ $('.modeLogin div p').click(function(){
|
|
|
+ $(this).addClass('active').siblings('p').removeClass('active');
|
|
|
+ });
|
|
|
+ $('.modeLogin .btn-default,.modeLogin .delLogin').click(function(){
|
|
|
+ $('.modeLogin').removeClass('active');
|
|
|
+ $('.modeBj').hide(100);
|
|
|
+ });
|
|
|
+ $('.modeLogin .btn-success').click(function(){
|
|
|
+ let typeMode = $('.modeLogin div .active')[1].getAttribute('data-val');
|
|
|
+ if(typeMode==null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ method:'post',
|
|
|
+ dataType:'json',
|
|
|
+ url: globalConfig.context+'/open/updateUser',
|
|
|
+ data:{
|
|
|
+ type:typeMode,
|
|
|
+ id:ids
|
|
|
+ },
|
|
|
+ success:function(data){
|
|
|
+ if(data.error&&data.error.length){
|
|
|
+ msg(data.error[0].message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ loginBegin(typeMode);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
//提示框渐隐函数
|
|
|
function msg(mess) {
|
|
|
if($('.smg').hasClass('active')){
|