{if:$msgNum>0}
<div class="prompt">
	<strong>温馨提示：</strong> 您有<span class="red">{$msgNum}</span> 条站内未读短信息，<a href="{url:/ucenter/message}">现在去看看</a>
</div>
{/if}
<!-- 用户信息 -->
<div class="uc_info">
	{set:$user_ico = $this->user['head_ico']}
	<!-- 用户信息-左侧 -->
	<div class="uc_info_left">
		<img onclick="select_ico()" id="user_ico_img" src="{url:$user_ico}" onerror="this.src='{skin:image/user_ico.gif}'">
		<div class="info_block">
			<h4>{$this->user['username']}</h4>
			<ol class="user_stat">
				<li>待评价商品：(<strong>{echo:statistics::countUserWaitComment($this->user['user_id'])}</strong>)</li>
				<li>待付款订单：(<strong>{echo:statistics::countUserWaitPay($this->user['user_id'])}</strong>)</li>
				<li>待确认收货：(<strong>{echo:statistics::countUserWaitCommit($this->user['user_id'])}</strong>)</li>
			</ol>
			<time>上一次登录时间：{echo:ISafe::get('last_login')}</time>
		</div>
	</div>
	<!-- 用户信息-右侧 -->
	<div class="user_info_right">
		<!-- 我的资产 -->
		<div class="my_asset">
			<h4>我的资产</h4>
			<span class="remainder_integral">
				显示余额及积分
				<ol class="user_info_content">
					<li>总消费额：<em>￥{$statistics['amount']}</em></li>
					<li>预存款余额：<em>￥{$user['balance']}</em></li>
					<li>账户总积分：<em>{$user['point']} 分</em></li>
					<a href="{url:/ucenter/integral}">查看积分历史</a>
				</ol>
			</span>
		</div>
		<!-- 我的订单 -->
		<div class="my_order">
			<h4>我的订单</h4>
			<span class="remainder_integral">
				显示订单、经验值及代金券
				<ol class="user_info_content">
					<li>代金券：<em>{$propData['prop_num']} 张</em></li>
					<li>经验值：<em>{$user['exp']}</em></li>
					<li>
						订单交易数：<em>{$statistics['num']} 笔</em>
					</li>
					<a href="{url:/ucenter/order}">进入订单列表</a>
				</ol>
			</span>
		</div>
	</div>
</div>
<!-- 我的订单 -->
<header class="uc_head mt10">
	<h3 class="current">我的订单</h3>
	<a href="{url:/ucenter/order}" class="more">更多 »</a>
</header>
{set:$orderDetail = Api::run('getOrderListByUserid',array('#user_id#',$user['user_id']))}
{if:$orderDetail}
<section class="uc_table">
	<table>
		<thead>
			<tr>
				<th>订单编号</th><th>下单日期</th><th>收货人</th><th>支付方式</th><th>总金额</th><th>订单状态</th>
			</tr>
		</thead>
		<tbody>
			{foreach:items = $orderDetail}
			<tr>
				<td><a href="{url:/ucenter/order_detail/id/$item[id]}">{$item['order_no']}</a></td>
				<td>{$item['create_time']}</td>
				<td>{$item['accept_name']}</td>
				<td>{$this->payments[$item['pay_type']]['name']}</td>
				<td>￥{echo:($item['order_amount'])}</td>
				<td>
					{set:$orderStatus = Order_Class::getOrderStatus($item)}
					<b class="{if:$orderStatus >= 6}green{else:}orange{/if}">{echo:Order_Class::orderStatusText($orderStatus)}</b>
				</td>
			</tr>
			{/foreach}
		</tbody>
	</table>
</section>
{else:}
<section class="nodata">暂无数据</section>
{/if}

<!-- 推荐 -->
<section class="artice_goods">
	<h3>根据浏览猜你喜欢</h3>
	<ul>
		{foreach:items=Api::run('getGoodsByCommendgoods',8)}
		<li>
			<a href="{url:/site/products/id/$item['id']}">
				<img src="{url:/pic/thumb/img/$item[img]/w/220/h/220}" alt="{$item['name']}">
				<div>
					<strong>{$item['name']}</strong>
					<em>￥{$item['sell_price']} <span>大聚惠</span></em>
				</div>
			</a>
		</li>
		{/foreach}
	</ul>
</section>


<script>
//选择头像
function select_ico(){
	{set:$callback = urlencode(IUrl::creatUrl('/ucenter/user_ico_upload'))}
	art.dialog.open('{url:/block/photo_upload?callback=$callback}',
	{
		'id':'user_ico',
		'title':'设置头像',
		'ok':function(iframeWin, topWin)
		{
			iframeWin.document.forms[0].submit();
			return false;
		}
	});
}

//头像上传回调函数
function callback_user_ico(content){
	var content = eval(content);
	if(content.isError == true){
		alert(content.message);
	}else{
		$('#user_ico_img').prop('src',content.data);
	}
	art.dialog({id:'user_ico'}).close();
}
</script>
