123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- loginStatus();
- var _height = document.documentElement.clientHeight;
- var boxHeight = $(".loginbox-invite").height();
- $(".loginbox-invite").css({ top: (_height - boxHeight) / 2 +"px" });
-
- var phonePass = false;
-
- function phoneVal(){
- var phone= $("#phone").val();
- if(phone.length==0){
- $(".msg1").text("请输入您的手机号码或邮箱地址");
- }else{
-
- var hun=/\s+/;
- if(hun.test(phone.trim()))
- {
- $(".msg1").text("请输入");
- phonePass = false;
- }else{
-
- var gunf= /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
- if(gunf.test(phone.trim()))
- {
- $(".msg1").text("");
- phonePass = true;
- }else{
- var hunPhone=/^1[3|4|5|7|8]\d{9}$/;
- if(hunPhone.test(phone.trim())){
- $(".msg1").text("");
- phonePass = true;
- }else{
- phonePass = false;
- $(".msg1").text("格式不对,请输入正确的格式");
- }
- }
- }
- }
-
- }
-
- var codePass = false;
- function codeVal(){
- var code = $("#code").val();
- if(code.length==0){
- $(".msg2").text("请输入正确的邀请码");
- codePass = false;
- }else{
- $(".msg2").text("");
- codePass = true;
- }
- }
- function loginSub(){
- phoneVal();
- codeVal();
- if(phonePass && codePass){
- $.ajax("/ajax/invitelogin",{
- type:"POST",
- async: false,
- success:function(data){
-
- if(data.success){
- if(data.data != "null" && data.data != null){
- if(data.data.auth == true){
- location.href="index.html";
- }else{
- location.href="login-first.html";
- }
- }else{
- $(".msg3").text("手机或邮箱和邀请码不匹配,请确认后登录!");
- }
- }else{
- $(".msg3").text("系统异常!");
-
- }
- },
- error:function(){$.MsgBox.Alert('message','fail')},
- data:{"code":$("#code").val(),"key":$("#phone").val()},
- dataType: 'json'
- });
- }
- }
- function restSub(data) {
- $(".msg3").text("");
- }
|