Jelajahi Sumber

注册 、登录 、忘记密码

ljj 7 tahun lalu
induk
melakukan
d0328112f8
5 mengubah file dengan 917 tambahan dan 106 penghapusan
  1. 461 0
      html/home/html/forgetPwd.html
  2. 177 39
      html/home/html/login.html
  3. 279 67
      html/home/html/regist-info.html
  4. TEMPAT SAMPAH
      html/home/images/biyan_icon.png
  5. TEMPAT SAMPAH
      html/home/images/kanjian_icon.png

+ 461 - 0
html/home/html/forgetPwd.html

@ -0,0 +1,461 @@
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>身份验证</title>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <link rel="stylesheet" href="../../../css/cross.css" type="text/css"/>
    <link rel="stylesheet" href="../../../css/cross.ui.css" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="../../../css/ss-style.css">
    <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css"/>
    <style>
        .n-list-info {
            position: relative;
        }
        .searchbar-clear {
            position: absolute;
            width: 28px;
            height: 28px;
            right: 0;
            top: 8px;
            opacity: 0;
            pointer-events: none;
            background-position: center;
            background-repeat: no-repeat;
            background-image: url(../../../images/delete01_pre.png);
            -webkit-background-size: 20px 20px;
            background-size: 20px 20px;
            -webkit-transition-duration: 300ms;
            transition-duration: 300ms;
            cursor: pointer;
        }
        #div-yzm {
            width: 80px;
            height: 29px;
            border: 1px solid #4DCD70;
            color: #4DCD70;
            font-size: 14px;
            line-height: 29px;
            text-align: center;
            border-radius: 10px;
            margin-top: 7px;
        }
        .c-btn-dcdcdc {
            background: #DCDCDC;
        }
        .c-btn.active {
            background: #4DCD70;
        }
        .mui-content-pad{
			margin-top: 0px;
		}
		.btn-lt {
			position: absolute;
			left: 10px;
		}
		.btn-rt{
			position: absolute;
			right: 10px;
		}
		a {
			text-decoration: none;
			color: #17b3ec;
			font-size: 14px;
		}
        .display{display: none}
		.iconImg{width:26px}
    </style>
</head>
<body>
<!--<div class="h45">
    <div class="demo-comtop">
        <a class="mui-action-back"></a>
        <h1>登录</h1>
    </div>
</div>-->
<div class="main">
    <div id="idcardBox">
        <ul class="n-list edit-info registered c-border-tb mt15 c-f15 form-register">
            <li>
                <div class="n-list-key" style="width: 2.3em;">
                    <img src="../images/zhanghao_icon.png"
                         style="width: 20px; height: 26px;padding-left: 3px;padding-top: 10px;">
                    <!--<i class="iconfont icon-shouji1"></i>-->
                </div>
                <div class="n-list-info">
                    <input id="idcardTxt" maxlength="18" minlength="11" type="text" class="width-100 c-f16 c-5b5b5b"
                           placeholder="身份证号" value="362321199703137824">
                    <a href="#" class="searchbar-clear"></a>
                </div>
                <div id="checkIdCard" class="n-list-key pl15 c-17b3ec" >
                    <span>身份验证</span>
                </div>
                <div id="checkIdCardmes" class="n-list-key pl15  display"  style="color: #4dcd70">
                    <span>验证通过</span>
                </div>
            </li>
            <li>
                <div class="n-list-key" style="width: 2.3em;">
                    <i class="iconfont icon-shouji1"></i>
                </div>
                <div class="n-list-info">
                    <input id="txtMobile" type="tel" class="width-100 c-f16 c-5b5b5b" maxlength="11"  placeholder="手机号" disabled/>
                    <a href="#" class="searchbar-clear"></a>
                </div>
            </li>
        </ul>
    </div>
    <div id="phoneBox" >
        <ul class="n-list edit-info registered c-border-tb mt15 c-f15 form-register">         
            <li>
                <div class="n-list-key" style="width: 2.3em;">
                    <i class="iconfont icon-yanzhengma01"></i>
                </div>
                <div class="n-list-info">
                    <input id="txtCode" type="text" class="width-100 c-f16 c-5b5b5b" placeholder="请输入验证码"/>
                    <a href="#" class="searchbar-clear"></a>
                </div>
                <div id="messageCode1" class="n-list-key pl15 c-17b3ec" onclick="sendCode()">
                    <span>获取短信验证码</span>
                </div>
                <div id="messageCode2" class="n-list-key pl15 c-999999" style="display: none;">
                    <span id="message" ></span>
                </div>
            </li>
            <li>
                <div class="n-list-key">
                    <span class="f-fs16 c-323232">设置密码</span>
                </div>
                <div class="n-list-info">
                    <input type="password" class="width-100 c-f16 c-5b5b5b reg-pwd" placeholder="请输入密码"/>
                    <a href="#" class="searchbar-clear"></a>
                </div>
              </li>
              <li>
                <div class="n-list-key">
                    <span class="f-fs16 c-323232">确认密码</span>
                </div>
                <div class="n-list-info">
                    <input id="apwd" type="password" class="width-100 c-f16 c-5b5b5b" placeholder="请再次输入密码"/>
                    <a href="#" class="searchbar-clear"></a>
                </div>
              </li>
        </ul>
        <div class="mb15 mlr15 mt20">
            <a id="phoneBtn" href="javascript:;" style="font-size: 18px;"
               class="c-btn c-btn-dcdcdc c-btn-full c-btn-radius c-f16">下一步</a>
        </div>
    </div>
    <p style="font-size: 16px;text-align: center;color: #323232;" class="mr15 c-t-right">返回<span style="font-size: 17px;font-style: italic;color: #17b3ec;"  onclick="changeLogin()">登录</span></p>
  
</div>
</body>
<script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
<script type="text/javascript" src="../../../js/common_http.js"></script>
<script type="text/javascript" src="../../../js/weixin_common.js"></script>
<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.js"></script>
<script type="text/javascript" src="../../../js/commit_validate.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="../../../js/mui.min.js"></script>
<script type="text/javascript">
    var dd = dialog({contentType: 'load', skin: 'bk-popup', content: '验证中...'});
    var Request = new Object();
    Request = GetRequest();
    var openid = Request["openid"];
    var type = Number(Request["type"]);
    var mobile1 = Request["mobile"];
    var clock = "";
    var nums = 60;
    var loginParams = Request["loginParams"];
    var $phoneBox = $('#phoneBox');
    var $idcardBox = $('#idcardBox');
    bindEvents();
    if (loginParams) {
        loginParams = JSON.parse(decodeURIComponent(Request["loginParams"]));
    }
    $(function () {
        var userAgent = window.localStorage.getItem(agentName);
        if (userAgent) {
            var paurl = "";
            if (type == 0) {
                paurl = "wx/html/home/html/login.html?type=0&openid=" + openid;
            }
            else {
                if (mobile1) {
                    paurl = "wx/html/home/html/login.html?type=" + type + "&openid=" + openid + "&mobile=" + mobile1;
                }
                else {
                    paurl = "wx/html/home/html/login.html?type=" + type + "&openid=" + openid;
                }
            }
            //从后台那边获取签名等信息
            var params = {};
            params.pageUrl = window.location.href;
            $.ajax(server + "weixin/getSign", {
                data: params,
                dataType: "json",
                type: "post",
                success: function (res) {
                    if (res.status == 200) {
                        var t = res.data.timestamp;
                        var noncestr = res.data.noncestr;
                        var signature = res.data.signature;
                        wx.config({
                            //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
                            appId: appId, // 必填,公众号的唯一标识
                            timestamp: t, // 必填,生成签名的时间戳
                            nonceStr: noncestr, // 必填,生成签名的随机串
                            signature: signature,// 必填,签名,见附录1
                            jsApiList: [
                                'closeWindow'
                            ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
                        });
                    }
                }
            });
            wx.ready(function () {
                wx.closeWindow();
            });
        }
        else {
            if (!openid) {
                dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: 'openid获取失败'}).show();
            }
            if (mobile1) {
                $("#txtMobile").val(mobile1);
            }
        }
    })
    function bindEvents() {
        $("#checkIdCard").on("click", function () {
            var idcard = $('#idcardTxt').val();
            var data = {}
            if (idcard == "") {
                dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '身份证不能为空'}).show();
                return;
            }
            if (!isIdcard(idcard)) {
                dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '请输入正确的身份证号'}).show();
                return;
            }
            data.idCard = idcard;
            sendPost("weixin/getMobile", data, "json", "post", operateFailed, operateSuccesss);
            function operateSuccesss(res) {
                if (res.status == -1) {
                    dd.close();
                    if (res && res.msg) {
                        dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
                    setTimeout(function () {
                        mui.openWindow({
                            url: "regist-info.html",
                            waiting: {
                                autoShow: false, //自动显示等待框,默认为true
                                title: '正在加载...'
                            }
                        });
                    },1500)
                    return;
                    }
                } else if (res.status == -2) {
                    dd.close();
                    if (res && res.msg) {
                        dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '您还未绑定手机,无法重置密码,请尝试使用默认密码登录。'}).show();
                    setTimeout(function () {
                        mui.openWindow({
                            url: "zhmm-login.html",
                            waiting: {
                                autoShow: false, //自动显示等待框,默认为true
                                title: '正在加载...'
                            }
                        });
                    },1500)
                    }
                } else if (res.status == 200) {
                    dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
                    var mobile = res.data.mobile;
                    var phoneNum = mobile.substring(0, 3) + "*****" + mobile.substring(8, 11);
                    $('#txtMobile').val(mobile);
                    $('#checkIdCard').hide().next().show();
                }
            };
            function operateFailed(res) {
                dd.close();
                if (res && res.msg) {
                    dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
                } else {
                    dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '校验失败'}).show();
                }
            };
        })
        $("#phoneBtn").on("click", function () {
            if ($(this).hasClass("active")) {
                commit();
            }
            else{
                dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content:'请将相关信息补充完毕'}).show();
            }
        })
        $("input").on("focus", function () {
            $(".searchbar-clear").css("pointer-events", "none").css("opacity", 0);
            if ($(this).val()) {
                $(this).next().css("pointer-events", "auto").css("opacity", 1);
            }
        }).on("input", function () {
            $(this).next().css("pointer-events", "auto").css("opacity", 1);
        });
        $("input").on('keyup',function(){
            var allHaveValue = true,
                a = $('input');
            $('input').each(function(){
                if(!$(this).val()) {
                    allHaveValue = false;
               }
            });
            
            if(allHaveValue){
                $("#phoneBtn").addClass("active");
            }
            else{
                $("#phoneBtn").removeClass("active");
            }
        })
        $(".n-list-info").on("click", ".searchbar-clear", function () {
            $(this).prev().val("");
            $(this).css("pointer-events", "none").css("opacity", 0);
            $(this).prev().focus();
            return false;
        });
    }
    
    function sendCode() {
        var mobile = document.getElementById("txtMobile").value;
        if (!mobile) {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '请先校验身份证'}).show();
            return;
        }
        if (!isphone(mobile)) {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '手机号格式不正确'}).show();
            return;
        }
        $("#messageCode1").hide();
        document.getElementById("message").innerHTML = nums + '秒后可重新获取';
        $("#messageCode2").show();
        clock = setInterval(doLoop, 1000); //一秒执行一次
        var data = {};
        data.mobile = mobile;
        data.type = 2;
        sendPost("common/captcha", data, "json", "post", sendFailed, sendSuccesss);
    }
    //失败
    function sendFailed(res) {
        clearInterval(clock); //清除js定时器
        $("#messageCode1").show();
        $("#messageCode2").hide();
        nums = 60; //重置时间
        if (res && res.msg) {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
        } else {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '获取失败'}).show();
        }
    }
    function sendSuccesss(res) {
        if (res.status == 200) {
        }
        else {
            sendFailed(res);
        }
    }
    function doLoop() {
        nums--;
        if (nums > 0) {
            document.getElementById("message").innerHTML = nums + '秒后可重新获取';
        } else {
            clearInterval(clock); //清除js定时器
            $("#messageCode1").show();
            $("#messageCode2").hide();
            nums = 60; //重置时间
        }
    }
    var mobile;
    function commit() {
        mobile = document.getElementById("txtMobile").value;
        var captcha = document.getElementById("txtCode").value;
        if (!mobile || !captcha) {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '手机号和验证码不能为空'}).show();
            return;
        }
        if (!isphone(mobile)) {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '手机号格式不正确'}).show();
            return;
        }
        dd.showModal();
        //拼请求内容
        var data = {};
        data.mobile = mobile;
        data.captcha = captcha;
        data.type = 2;
        sendPost("common/check_captcha", data, "json", "post", operateFailed, operateSuccesss);
    }
    //失败
    function operateFailed(res) {
        dd.close();
        if (res && res.msg) {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: res.msg}).show();
        } else {
            dialog({contentType: 'tipsbox', bottom: true, skin: 'bk-popup', content: '验证码验证失败'}).show();
        }
    }
    //成功调用登录接口
    function operateSuccesss(res) {
        var idcard = $('#idcardTxt').val();
        if (res.status == 200) {
            window.location.href = "reset-password.html?type=" + type + "&openid=" + openid + "&mobile=" + mobile + '&idcard=' + idcard;
            dd.close();
        } else {
            //非200则为失败
            operateFailed(res);
        }
    }
    
    $('#accounts').on('tap',function(){
		mui.openWindow({
			id: "account_back",
			url: "../../yjfk/html/account_back.html",
			extras: {
				
			}
		});
	})
    function changeLogin(){
		window.location.href = "login.html?type=" + type + "&openid=" + openid;
	}
</script>
</html>

+ 177 - 39
html/home/html/login.html

@ -15,9 +15,17 @@
    <style>
        .n-list-info{position: relative;}
        .searchbar-clear{position: absolute;width: 28px;height: 28px;right: 0;top:8px;opacity:0;pointer-events:none;background-position:center;background-repeat:no-repeat;background-image:url(../../../images/delete01_pre.png);-webkit-background-size:20px 20px;background-size:20px 20px;-webkit-transition-duration:300ms;transition-duration:300ms;cursor:pointer;}
        .div-zczh{width:auto;height:29px;border:0;color:#4DCD70;font-size:14px;line-height:29px;text-align:center;border-radius:10px;color:#17b3ec;float: left;margin-left: 20px;}
        .div-zhmmdl{width:auto;height:29px;border:0;color:#4DCD70;font-size:14px;line-height:29px;text-align:center;border-radius:10px;color:#17b3ec;float: right; margin-right: 20px;}
        .div-zczh{width:auto;height:29px;border:0;color:#4DCD70;font-size:14px;line-height:29px;text-align:center;border-radius:10px;color:#17b3ec;margin-left: 20px;}
        .div-zhmmdl{width:auto;height:29px;border:0;color:#4DCD70;font-size:14px;line-height:29px;text-align:center;border-radius:10px;color:#17b3ec;margin-right: 20px;}
        .bgc-fa8888{background-color: #FA8888;}
		.tabox{background: #fff;display: flex}
		.tabcontent{width: 50%;padding-top: 15px;}
		.tabcontent span{padding: 0 5px}
		.fc{display: flex;justify-content: center;align-items: center;}
		.fjs{display:flex;justify-content:space-between}
		.activeTab{border-bottom: 5px solid #ccc}
		.display{display: none}
		.iconImg{width:26px}
    </style>
</head>
<body>
@ -30,38 +38,73 @@
<div class="main">
    <div class="bgc-fa8888 ptb10 plr10">
        <span class="c-f14 c-fff">已签约居民可直接使用身份证号及默认密码登录</span>
    </div>
    <ul class="n-list edit-info registered c-border-tb mt15 c-f15 form-register">
        <li>
            <div class="n-list-key" style="width: 2.3em;">
                <i class="iconfont icon-shouji1"></i>
            </div>
            <div class="n-list-info">
                <input id="txtMobile" type="tel" class="width-100 c-f16 c-5b5b5b" maxlength="11" placeholder="请输入手机号码" onkeyup="this.value=this.value.replace(/[^\d]/g,'')"/>
                <a href="#" class="searchbar-clear"></a>
            </div>
        </li>
        <li>
            <div class="n-list-key" style="width: 2.3em;">
                <i class="iconfont icon-yanzhengma01"></i>
            </div>
            <div class="n-list-info">
                <input id="txtCode" type="text" class="width-100 c-f16 c-5b5b5b" placeholder="请输入验证码"/>
                <a href="#" class="searchbar-clear"></a>
            </div>
            <div id="messageCode1" class="n-list-key pl15 c-17b3ec" onclick="sendCode()">
                <span>获取短信验证码</span>
            </div>
            <div id="messageCode2" class="n-list-key pl15 c-999999" style="display: none;">
                <span id="message"></span>
            </div>
        </li>
    </ul>
    <div class="mb15 mlr15 mt20">
        <a href="javascript:;" style="font-size: 18px;" class="c-btn c-btn-4dcd70 c-btn-full c-btn-radius c-f16" onclick="commit()">登录</a>
    </div>
    <div class="div-zczh" onclick="regist()">注册账号</div>
    <div class="div-zhmmdl" onclick="zhmmLogin()">账号密码登录</div>
	</div>
	<div class="tabox">
			<div class="tabcontent fc " name="fastLogin"><span class="activeTab">手机号快捷登录</span></div>
			<div class="tabcontent fc" name="passwordLogin"><span>账号密码登录</span></div>
	</div>
	<div>
		    <ul class="n-list edit-info registered c-border-tb mt15 c-f15 form-register tabList" id="fastLogin">
					<li>
						<div class="n-list-key" style="width: 2.3em;">
							<i class="iconfont icon-shouji1"></i>
						</div>
						<div class="n-list-info">
							<input id="txtMobile" onblur="setPhone()" type="tel" class="width-100 c-f16 c-5b5b5b" maxlength="11" placeholder="请输入手机号码" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" value="15980862610"/>
							<a href="#" class="searchbar-clear"></a>
						</div>
						<div id="messageCode1" class="n-list-key pl15 c-17b3ec" onclick="sendCode()">
								<span>获取短信验证码</span>
							</div>
							<div id="messageCode2" class="n-list-key pl15 c-999999" style="display: none;">
								<span id="message"></span>
							</div>
					</li>
					<li>
						<div class="n-list-key" style="width: 2.3em;">
							<i class="iconfont icon-yanzhengma01"></i>
						</div>
						<div class="n-list-info">
							<input id="txtCode" type="text" class="width-100 c-f16 c-5b5b5b" placeholder="请输入验证码"/>
							<a href="#" class="searchbar-clear"></a>
						</div>						
					</li>
			</ul>
			<ul class="n-list edit-info registered c-border-tb mt15 c-f15 form-register display tabList" id="passwordLogin">
					<li>
					  <div class="n-list-key" style="width: 2.3em;">
						  <img src="../images/zhanghao_icon.png" style="width: 20px; height: 26px;padding-left: 3px;padding-top: 10px;" />
						  <!--<i class="iconfont icon-shouji1"></i>-->
					  </div>
					  <div class="n-list-info">
						  <input id="txtMobile2" maxlength="18" minlength="11" type="text" class="width-100 c-f16 c-5b5b5b" placeholder="身份证号/手机号"/>
						  <a href="#" class="searchbar-clear"></a>
					  </div>
					</li>
					<li>
					  <div class="n-list-key" style="width: 2.3em;">
						  <i class="iconfont icon-yanzhengma01"></i>
					  </div>
					  <div class="n-list-info">
						  <input id="txtCode2" type="password" class="width-100 c-f16 c-5b5b5b" placeholder="初始密码为身份证后6位"/>
							 <a href="#" class="searchbar-clear"></a>
					  </div>
					  <div class="n-list-key fc" >
						<img  id="showPass" class="iconImg"  src="../images/biyan_icon.png">
						<img  id="hidePass" class="iconImg display"  src="../images/kanjian_icon.png">
					  </div>
					</li>
			</ul>
	</div>
	<div class="fjs">
		    <div class="div-zczh" onclick="regist()">新注册</div>
	      <div class="div-zhmmdl" onclick="forgetPwd()">忘记密码?</div>
	</div>
	<div class="mb15 mlr15 mt20">
			<a href="javascript:;" style="font-size: 18px;" class="c-btn c-btn-4dcd70 c-btn-full c-btn-radius c-f16" onclick="commit()">登录</a>
		</div>
    
    <!--<p class="c-17b3ec mr15 c-t-right" style="font-size: 16px;" onclick="regist()">立即注册</p>-->
</div>
@ -71,6 +114,8 @@
<script type="text/javascript" src="../../../js/weixin_common.js?11=11" ></script>
<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.js"></script>
<script type="text/javascript" src="../../../js/mui.min.js" ></script>
<script src="../../../js/security.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="../../../js/commit_validate.js" ></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
@ -80,15 +125,23 @@
	var openid = Request["openid"];
	var type = Number(Request["type"]);
	var mobile1 = Request["mobile"];
	var idcard = Request["idcard"];
	var clock = "";
	var nums = 60;
	var loginParams = Request["loginParams"];
	var loginParams = Request["loginParams"],
		loginType = Request["loginType"] || 'yzm';//选择的登录方式
	if(loginParams) {
		loginParams = JSON.parse(decodeURIComponent( Request["loginParams"]));
	}
	$(function (){
		if(loginType = 'yzm'){
			$('.tabcontent[name="fastLogin"]').click();
		}
		else if(loginType = 'password'){
			$('.tabcontent[name="passwordLogin"]').click();
		}
		var userAgent = window.localStorage.getItem(agentName);
		if(userAgent){
			var paurl = "";
@ -138,6 +191,10 @@
			}
			if(mobile1){
				$("#txtMobile").val(mobile1);
				$("#txtMobile2").val(mobile1);
			}
			if(idcard) {
				$("#txtMobile2").val(idcard);
			}
		}
@ -160,6 +217,24 @@
			$(this).prev().focus();
			return false;
		});
		$('.tabcontent').click(function(){
			var id = $(this).attr('name');
			$('#'+id).removeClass('display').siblings().addClass('display');
			$(this).children().addClass('activeTab');
			$(this).siblings().children().removeClass('activeTab');
			switch (id){
				case 'fastLogin':loginType = 'yzm';break;
				case 'passwordLogin':loginType = 'password';break;
			}
		})
		$('#showPass').click(function(){
			$(this).hide().siblings().show();
			$('#txtCode2').prop('type','text');
		})
		$('#hidePass').click(function(){
			$(this).hide().siblings().show();
			$('#txtCode2').prop('type','password');
		})
	}
	function sendCode(){
@ -187,6 +262,19 @@
		$("#messageCode1").show();
		$("#messageCode2").hide();
		nums = 60; //重置时间
		if(res && res.msg=="该手机号未注册!" && res.status == -1){
			dialog({
                title: "",
                content: '您的手机尚未注册<br>请完善信息再登录',
                okValue: "去注册",
                ok: function() {
					regist()
                },
                cancelValue: "取消",
                cancel: function(){}
            }).showModal();
			return 
		}
		if (res && res.msg) {
			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
		} else {
@ -214,8 +302,15 @@
			nums = 60; //重置时间
		}
	}
	function commit(){
		if(loginType =='yzm'){
			commitYzm()
		}
		else if(loginType =='password'){
			commitPassword()
		}
	}
	function commitYzm(){
		var mobile = document.getElementById("txtMobile").value;
		var captcha = document.getElementById("txtCode").value;
		if (!mobile || !captcha) {
@ -237,6 +332,45 @@
		sendPost("weixin/login", data, "json", "post", operateFailed, operateSuccesss);
	}
	function commitPassword(){
		var mobile = $.trim(document.getElementById("txtMobile2").value);
		if(mobile.length!=15&&mobile.length!=18&&mobile.length!=11){
			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入正确的手机号/身份证号'}).show(); 
			return;
		}
		if(mobile.length==11&&!isphone(mobile)){
			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入正确的手机号'}).show(); 
			return;
		}
		if((mobile.length==18||mobile.length==15)&&!isIdcard(mobile)){
			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入正确的身份证号'}).show(); 
			return;
		}
		var captcha = document.getElementById("txtCode2").value;	
		if (!mobile || !captcha) {
			dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'账号和密码不能为空'}).show(); 
			return;
		}
		dd.showModal();
		//加密设置:获取公钥
		var encryURL = server + "login/public_key";
		var key = RSAUtils.getKeyFromServer(encryURL);
		//拼请求内容
		var data = {};
		data.mobile = mobile;
		data.password = RSAUtils.encryStr(key, captcha);
		if(openid == "undefined"){
		    var openidObj = window.localStorage.getItem(OpenidAgent);
		    if(openidObj){
		        openidObj = JSON.parse(openidObj);
		        openid = openidObj.openid
		    }else{
		        openid = "undefined";
		    }
		}
		data.openid = openid;
		sendPost("weixin/login", data, "json", "post", operateFailed, operateSuccesss);	
	}
	//失败
	function operateFailed(res) {
		dd.close();
@ -285,9 +419,13 @@
	function regist(){
		window.location.href = "regist-info.html?type=" + type + "&openid=" + openid;
	}
	//帐号密码登录
	function zhmmLogin(){
		window.location.href = "zhmm-login.html?type=" + type + "&openid=" + openid;
	//忘记密码
	function forgetPwd(){
		window.location.href = "forgetPwd.html?type=" + type + "&openid=" + openid;
	}
	//将第一个inpput的值同步到第二个Input
	function setPhone(){
		$('#txtMobile2').val($('#txtMobile').val())	
	}
</script>
</html>

File diff ditekan karena terlalu besar
+ 279 - 67
html/home/html/regist-info.html


TEMPAT SAMPAH
html/home/images/biyan_icon.png


TEMPAT SAMPAH
html/home/images/kanjian_icon.png