<script type='text/javascript' src="{webroot:public/javascript/cart.js}"></script>
<section class="breadcrumb">
	<span>您当前的位置：</span> <a href="{url:}">首页</a> » 购物车
</section>
<section class="web">
	<div id="cart_prompt" class="cart_prompts none">
		<strong>恭喜，您的订单已经满足了以下优惠活动！</strong>
		<ol id="cart_prompt_box"></ol>
	</div>
	<!--促销规则模板-->
	<script type="text/html" id="promotionTemplate">
		<li><%=item['plan']%>，<%=item['info']%></li>
	</script>

	<section class="cart_table">
		<h3><i class="icon-shopping-cart"></i>查看购物车</h3>
		<table>
			<col width="115">
			<col>
			<col width="120">
			<col width="120">
			<col width="120">
			<col width="114">
			<col width="120">
			<col width="120">
			<thead>
				<tr><th>图片</th><th>商品名称</th><th>赠送积分</th><th>单价</th><th>优惠</th><th>数量</th><th>小计</th><th>操作</th></tr>
			</thead>
			<tbody>
				{foreach:items = $this->goodsList key=$goodsKey}
				<script>var item{$goodsKey} = {echo:JSON::encode($item)};</script>
				<tr>
					<td><img src="{url:/pic/thumb/img/$item['img']/w/66/h/66}" alt="{$item['name']}"></td>
					<td>
						<a href="{url:/site/products/id/$item['goods_id']}" class="blue">{$item['name']}</a>
						{if:isset($item['spec_array'])}
						<p>
						{set:$spec_array=Block::show_spec($item['spec_array']);}
						{foreach:items=$spec_array item=$specValue key=$specName}
							{$specName}：{$specValue} &nbsp&nbsp
						{/foreach}
						</p>
						{/if}
					</td>
					<td>{$item['point']}</td>
					<td><em>￥{$item['sell_price']}</em></td>
					<td>减￥{$item['reduce']}</td>
					<td>
						<div class="goods_resize">
							<span class="reduce" onclick='cart_reduce(item{$goodsKey});'>─</span>
							<input class="input" type="text" onchange='cartCount(item{$goodsKey});' id="count_{$item['goods_id']}_{$item['product_id']}" value="{$item['count']}" maxlength="5" />
							<span class="add" onclick='cart_increase(item{$goodsKey});'>+</span>
						</div>
					</td>
					<td><em>￥<span id="sum_{$item['goods_id']}_{$item['product_id']}">{$item['sum']}</span></em></td>
					<td><span onclick='removeCartByJSON(item{$goodsKey})'>删除</span></td>
				</tr>
				{/foreach}

				<tr>
					<td colspan="8" class="stats">
						<span>商品总重量：<b id='weight'>{$this->weight}</b></span><br>
						<span>商品总金额：￥<b id='origin_price'>{$this->sum}</b> - 商品优惠：￥<b id='discount_price'>{$this->reduce}</b> - 促销活动优惠：￥<b id='promotion_price'>{$this->proReduce}</b></span><br>
						金额总计（不含运费）：￥<em id='sum_price'>{$this->final_sum}</em>
					</td>
				</tr>
			</tbody>
		</table>
		<div class="cart_btn">
			<div class="clear_cart_btn" onclick="delModel({msg:'确定要清空购物车么？',link:'{url:/simple/clearCart}'});">
				<i class="icon-remove"></i>
				<span>清空购物车</span>
			</div>
			<div class="go_back_btn" onclick="window.history.go(-1);">
				<i class="icon-reply"></i>
				<span>继续购物</span>
			</div>
			{if:$this->goodsList}
			<a class="gopay_btn" href="{url:/simple/cart2}">
				<i class="icon-credit-card"></i>
				<span>去结算</span>
			</a>
			{/if}
		</div>
	</section>

</section>