<!DOCTYPE html>
<html>
<head>
    <title>修改密码 - {wc:fun:_cfg("web_name_two")}触屏版</title>
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link href="{G_TEMPLATES_CSS}/mobile/comm.css" rel="stylesheet" type="text/css" />
	<link href="{G_TEMPLATES_CSS}/mobile/login.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="{G_TEMPLATES_CSS}/mobile/top.css">
	<script src="{G_TEMPLATES_JS}/mobile/jquery190.js" language="javascript" type="text/javascript"></script>
</head>
<body>
    <div class="h5-1yyg-v1" id="content">

<!-- 栏目页面顶部 -->


<!-- 内页顶部 -->

    <header class="g-header">
        <div class="head-l">
	        <a href="javascript:;" onClick="history.go(-1)" class="h-count white"><s></s><b></b></a>
        </div>
        <h2>修改密码</h2>
        <div class="head-r">
	        <a href="{WEB_PATH}/mobile/mobile" class="z-Home"></a>
        </div>
    </header>


        <section>
		<form class="registerform" method="post" action="{wc:WEB_PATH}/mobile/home/userpassword">
	        <div class="registerCon">
    	        <ul class="form">
					{wc:if $member['password']=='e10adc3949ba59abbe56e057f20f883e'}
        	        <li>
						如果您还没有设置过密码，请使用初始密码: 123456
                    </li>
					{wc:if:end}
        	        <li>
						<input name="password" type="password" placeholder="请输入原密码" value="" style="padding-left: 60px;">
						<span style="border: none;height: 34px;width: 60px;background-position: 0 -25px;position: absolute;top: 12px;left: 5px;">原密码：</span>
                    </li>
        	        <li>
						<input name="userpassword" type="password" placeholder="请输入新密码" value="" style="padding-left: 60px;">
 						<span style="border: none;height: 34px;width: 60px;background-position: 0 -25px;position: absolute;top: 12px;left: 5px;">新密码：</span>
                    </li>
        	        <li>
						<input name="userpassword2" type="password" placeholder="请重复输入新密码" value="" style="padding-left: 60px;">
 						<span style="border: none;height: 34px;width: 60px;background-position: 0 -25px;position: absolute;top: 12px;left: 5px;">新密码：</span>
                    </li>
                    <li>
						<input id="btnSubmitSave" type="submit" class="bluebut" value="确定修改" >
					</li>
                </ul>
	        </div>
			</form>
        </section>

<script>
$(function(){

    var b = function() {
		var submiting = false;
		var pwd1 = $('input[name=pwd1]');
		var pwd2 = $('input[name=pwd2]');
		var pwd3 = $('input[name=pwd3]');
		$('#btnSave').click(function(){
			if (submiting) {
				return false;
			}
			var post = {
				pwd1 : pwd1.val(),
				pwd2 : pwd2.val(),
				pwd3 : pwd3.val()
			};
			if ( post.pwd1 == '' ) {
				$.PageDialog.fail("原密码不能为空哦");
				return false;
			}
			if ( post.pwd2 == '' ) {
				$.PageDialog.fail("新密码不能为空哦");
				return false;
			}
			if ( post.pwd2 != post.pwd3 ) {
				$.PageDialog.fail("两次新密码输入不一致哦");
				return false;
			}
			if ( post.pwd2.length < 6 || post.pwd2.length > 20) {
				$.PageDialog.fail("密码长度为6-20个字符！");
				return false;
			}

			var the = $(this).text('正在提交');
			submiting = true;
			$.post("{WEB_PATH}/mobile/user/password",post,function(s){
				if (s=='ok') {
					$.PageDialog.ok('修改成功！', function(){
						window.location.href="{WEB_PATH}/mobile/home";
					});

				} else {
					submiting = false;
					the.text('修改');
					$.PageDialog.fail(s);
				}
			},'text');


		});
	};

    var a = function() {
        Base.getScript(Path.Skin + "/js/mobile/pageDialog.js", b);
    };
    Base.getScript(Path.Skin + "/js/mobile/Comm.js", a);
});

</script>

{wc:templates "mobile/index","footer"}
<script language="javascript" type="text/javascript">
  var Path = new Object();
  Path.Skin="{G_TEMPLATES_STYLE}";
  Path.Webpath = "{WEB_PATH}";

var Base={head:document.getElementsByTagName("head")[0]||document.documentElement,Myload:function(B,A){this.done=false;B.onload=B.onreadystatechange=function(){if(!this.done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){this.done=true;A();B.onload=B.onreadystatechange=null;if(this.head&&B.parentNode){this.head.removeChild(B)}}}},getScript:function(A,C){var B=function(){};if(C!=undefined){B=C}var D=document.createElement("script");D.setAttribute("language","javascript");D.setAttribute("type","text/javascript");D.setAttribute("src",A);this.head.appendChild(D);this.Myload(D,B)},getStyle:function(A,B){var B=function(){};if(callBack!=undefined){B=callBack}var C=document.createElement("link");C.setAttribute("type","text/css");C.setAttribute("rel","stylesheet");C.setAttribute("href",A);this.head.appendChild(C);this.Myload(C,B)}}
Base.getScript('{G_TEMPLATES_JS}/mobile/Bottom.js');
</script>

    </div>
</body>
</html>
