<!doctype html>
<html><head>
<meta charset="utf-8">
<title>购物车</title> 
<link rel="stylesheet" type="text/css" href="<{$__PUBLIC__}>css/common_uqcms.css"> 
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/public.css">  
<link rel="stylesheet" type="text/css" href="<{$__APP__}>public/css/cart.css?t=<{$smarty.now}>">  
<style type="text/css">
input[disabled],input:disabled{ background:#ccc; color:#666666; }
</style>
</head> 
<body>
<{include file="default/top.html"}>
<{include file="default/cart/header.html"}>
<div class="main_bar" style="margin:30px 0 50px 0; padding:20px 0 0 0;">
	<div class="main">  
		<div class="cm_zd">
			<div class="zd m0">&nbsp;</div>
			<div class="zd m1">商品名</div>
			<div class="zd m2">单价</div>
			<div class="zd m3">数量</div>
			<div class="zd m4">小计(元)</div> 
			<div class="zd m5">操作</div> 
		</div>
	<form action="?m=cart&a=settle" method="post" name="post_cart" id="post_cart"> 
		<div class="cart_box">
		<{uqcms m="cart" v="cart" c="cart_all:id=smarty.get.id"}>
		<{if $cart.list}>
			<div class="cart_list">
				<{foreach item=i from=$cart.list}> 
					<div class="spbox">  
						<div class="name">
							<i class="sp_icon"></i> <a href="index.php?m=shop&id=<{$i.id}>" target="_blank"><{$i.name}></a>
						</div>
					<{foreach item=ii from=$i.goods}> 
						<{if $ii.goods_status}>
							<div class="gsbox cart_detail_<{$ii.cartid}>">
								<div class="cart_id"><input type="checkbox" name="cartid[]" value="<{$ii.cartid}>" class="ckbox_cartid"  checked="checked"/></div> 
								<div class="cart_ttl"> 
									<div class="images">
										<a href="index.php?m=goods&a=detail&id=<{$ii.gid}>" target="_blank">
											<img src="<{$__IMG__}><{$ii.images|img_size:120x120}>" width="70"/>
										</a>
									</div>
									<div class="ttl">
										<div class="sttl">
											<a href="index.php?m=goods&a=detail&id=<{$ii.gid}>" target="_blank" class="gttl"><{$ii.title}></a>
										</div>
										<div class="sku">
											<{if $ii.sku_name}> 
												<{foreach item=iii from=$ii.sku_name}>
													 <span style="color:#999999;"><{$iii.0}>：<{$iii.1}> &nbsp;&nbsp;</span>
												<{/foreach}>
											<{/if}>
										</div>
									</div>
								</div> 
								<div class="cart_price">
									<p><span><{$ii.price}></span><{if $ii.act_status}><a class="cuxiao">促</a><{/if}></p>
									<s><{$ii.market_price}></s>
								</div>
								<div class="cart_num_box">
									<div class="cssCenter">
										<a href="javascript:;" class="cart_minus" cartid="<{$ii.cartid}>">-</a>
										<input type="text" id="cart_num_<{$ii.cartid}>" size="1" value="<{$ii.buy_num}>" autoComplete="off" class="num" cartid="<{$ii.cart_id}>"/>
										<a href="javascript:;" class="cart_plus" cartid="<{$ii.cartid}>">+</a>
									</div>
								</div>
								<div class="cart_total_price">¥ <span></span></div>
								<a href="javascript:;" cartid="<{$ii.cartid}>" class="cart_del del">删除</a>
							</div>	
						<{else}>
							<div class="gsbox cart_detail_<{$ii.cartid}>" style="background:#f9f9f9;">
								<div class="cart_id"><input type="checkbox" name="cartid[]" value="<{$ii.cartid}>" class="ckbox_cartid"  disabled="disabled"/></div>  
								<div class="cart_ttl"> 
									<div class="images">
										<a href="index.php?m=goods&a=detail&id=<{$ii.gid}>" target="_blank">
											<img src="<{$__IMG__}><{$ii.images|img_size:120x120}>" width="70"/>
										</a>
									</div>
									<div class="ttl">
										<div class="sttl">
											<a href="index.php?m=goods&a=detail&id=<{$ii.gid}>" target="_blank" class="gttl"><{$ii.title}></a>
										</div> 
									</div>
								</div>
								
								<div class="gs_remove">
									<a href="javascript:;" cartid="<{$ii.cartid}>" class="cart_del del_no">移除</a> 
									<span>该产品已经实效</span>
								</div> 
							</div> 
						<{/if}>
					<{/foreach}> 
					</div>
				<{/foreach}>
			</div>
			<!--购物总计-->
			<div class="cart_pay">
				<div class="lft"><a href="index.php" class="gobuy">继续购物</a></div>
				<div class="rit"> 
					<input type="hidden" name="total_price" value="" id="input_total_price"/> 
					<div class="total" id='total_num'>共计：<span></span>件</div> 
					<div class="total" id='total_price'>合计：<span>0.00</span> 元</div>
					<div class="total postage">(不含邮费)</div>
					<input type="submit" class="gopay" value="去结算" disabled="disabled"/>
				</div> 
			</div>
		<{else}>
			<div class="cart_null">
				<div class="cnull_center">
					<div class="l"><img src="<{$__PUBLIC__}>images/cart_null.png"/></div>
					<div class="r">
						<span>购物车内暂时没有商品</span><br>
						<a href="index.php">现在就去购物 >></a>	
					</div> 
				</div>
			</div> 
		<{/if}>
		
		</div>
	</form>
	</div>
</div>
<{include file="default/footer.html"}>
<script type="text/javascript">
var PUBLIC_PATH	= '<{$__PUBLIC__}>';
var APP_PATH	= '<{$__APP__}>';
var IMG_HOST 	= '<{$__IMG__}>'; 
</script>
<script type="text/javascript" src="<{$__PUBLIC__}>js/jquery.min.js"></script>
<script type="text/javascript" src="<{$__PUBLIC__}>js/common.js"></script> 
<script type="text/javascript" src="<{$__APP__}>public/js/cart.js"></script>
<script type="text/javascript">
$(function(){ 
	$(document).on("click", "input.gopay", function(){ 
		var count = 0;
		$("input[name='cartid[]']:checked").each(function(i){
			count += 1;
		});
		if(count <= 0){
			$.alert('没有选择商品'); return false;
		}
		<{if $UQCMS.sys_settle_login}>
			// 检测是否登录
			$.ajax({
				type:'post',
				url :'index.php?m=ajax&a=check_user_status', 
				async:false,
				success:function(result){
					data = jQuery.parseJSON(result); 
					if(data.status == '0'){ 
						sys_login(function(){ 
							$("form[name='post_cart']").submit(); 
						}); 
					}else{
						$("form[name='post_cart']").submit();
					}
				} 
			});
		<{else}>
			$("form[name='post_cart']").submit();
		<{/if}> 
		return false; 
	});  
});
</script>