<!DOCTYPE html>
<html lang=zh-cn>
<head>
	<meta charset=utf-8>
	<title>个人信息纵横通行帐号</title>
	<meta name=description content=一个帐号通用纵横旗下所有网络产品。>
	<meta name=copyright content=smartcost.com.cn>
	<link rel=stylesheet href={{rootUrl_CSS}}global.css>
	<script src={{rootUrl_JS}}jquery-1.7.1.min.js></script>
	<script src={{rootUrl_JS}}global.js></script>
</head>
<body>
<!-- include '_header' -->
<!-- include '_body_top' -->
<div class="globalContent width950">
	<div class="formContent clearfix">
		<!-- include '_left_profile' -->
		<div class="mainContent formItem userProfile">
			<div class="voucher">
				<div class="voucher-list">
					<legend>历史账单</legend>
					<table class="table table-hover table-bordered">
						<thead>
						<th>类型</th>
						<th>来源</th>
						<th>金额</th>
						<th>日期</th>
						</thead>
						<tbody id="incomepaylist">
						<!-- if isset({{incomepaylist}}) -->
						<!-- loop incomepaylist -->
						<tr>
							<td><!-- if {{incomepaylist' value.type}} == 1 -->收入<!-- else -->支出<!-- endif --></td>
							<td>{{incomepaylist' value.comefrom}}</td>
							<td>￥{{incomepaylist' value.money}}</td>
							<td>{{formatDate(incomepaylist' value.addtime)}}</td>
						</tr>
						<!-- endloop -->
						<!-- endif -->
						</tbody>
					</table>
					<!-- if {{incomepaynum}} > 20 -->
					<a page="1">查看更多</a>
					<!-- endif -->
				</div>
			</div>
		</div>
	</div>
</div>
<!-- include '_footer' -->
<!-- if {{incomepaynum}} > 20 -->
<script>
	$(function(){
		$('.voucher-list a').click(function(){
			$.ajax({
				type: 'get',
				url: '/getorder/'+$(this).attr('page'),
				dataType: 'json',
				success: function(result){
					console.log(result);
					if(result.code == 200){
						var html = '';
						$.each(result.incomepaylist,function(k,v){
							if(v.type == 1){
								var note = '收入';
							}else{
								var note = '支出';
							}
							html += '<tr><td>'+note+'</td><td>'+v.comefrom+'</td><td>￥'+v.money+'</td><td>'+v.addtime+'</td></tr>'
						});
						if(result.num == 0){
							$('.voucher-list a').remove();
						}else{
							$('.voucher-list a').attr('page',result.num);
						}
						$('#incomepaylist').append(html);
					}
				}
			})
		})
	})
</script>
<!-- endif -->
</body>
