<{import file="common.html" title="会员登陆"}>
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/login.css?<{$smarty.now|date_format:"%Y%m%d%H%M%S"}>"/>
<div class="cnav"><a class="back">&nbsp;</a>账户登陆<a href="javascript:;" class="thome">主页</a></div> 
<div class="main"> 
	<div class="loginBox"> 
		<form action="#" method="post">
			<div id="error_msg" style="display:none;"></div>
			<div class="tbtr"><i>手机号码</i><p><input type="text" name="username" class="input_text" placeholder="请输入手机号码"/></p></div>
			<div class="tbtr"><i>密码</i><p><input type="password" name="password" class="input_pass" placeholder="请输入登陆密码"/></p></div>
			<div class="tbtr">
				<i>验证码</i>
				<p><input type="text" name="vcode" class="input_vcode" placeholder="请输入验证码"/>
				<a href="javascript:;"><img id="vcode" src="index.php?m=ajax&a=vcode"></a>
			</div>
			<div class="tbtr" style=" border-bottom:none; padding:10px 0 0 0;">
				<input type="submit" name="vcode" class="submit_login" value="登陆"/>
			</div>
		</form>
		<{if $UQCMS.browser == 'wchat'}>
			<a href="wap.php?m=member&a=login_conn&alias=wchat" class="wlogin">微信自动登陆</a>
		<{/if}>
		<div class="find_pass">
			<a href="?m=member&a=forget" class="l">找回密码</a>
			<a href="?m=member&a=register" class="r">立即注册</a>
		</div>
		<{if $UQCMS.browser != 'wchat'}>
			<{uqcms m="api" v="conn" c="login_list"}> 
			<{if $conn}>
				<div class="conn_name">第三方账号登陆</div>
				<div class="conn_box">
					<{foreach item=i from=$conn}>
						<a href="member.php?a=connect&alias=<{$i.alias}>&state=<{math equation=rand(0,10000)}>"><img src="<{$__PUBLIC__}>images/connect/32<{$i.alias}>.png"></a>
					<{/foreach}>
				</div>
			<{/if}> 
		<{/if}> 
	</div>
</div> 
<{include file="default/footer.html"}>
<script type="text/javascript">
$(function(){
	$('form').submit(function(){
		var username = $('input[name=username]').val();
		var password = $('input[name=password]').val();
		var vcode = $('input[name=vcode]').val();
		if(username == ''){ $.alert('用户名不能为空'); return false;} 
		if(password == ''){ $.alert('密码不能为空'); return false;} 
		if(vcode == ''){ $.alert('验证码不能为空'); return false;} 
		$('.submit_login').attr("disabled", true).val('正在登陆..');
		$.ajax({
			type:'POST',
			url:'member.php?a=login_do',
			data:{username:username, password:password, vcode:vcode}, 
			success:function(result){
				var data = jQuery.parseJSON(result); 
				if(data.error == '0'){
					<{if $smarty.get.returnUrl}>
						window.location.href=GetQueryString('returnUrl'); 
					<{else}>
						window.location.href="wap.php?m=member";
					<{/if}> 
				}else{
					$.alert(data.msg);
					$('.submit_login').attr("disabled", false).val('登陆');
					$('input.input_vcode').val('');
					freshVcode();
				}  
			},
			error:function(){
				alert('错误');
				$('.submit_login').attr("disabled", false).val('登陆');
			}
		});
		return false; 
	}); 
});
</script>
