<{import file="common.html" title="购物车"}> 
<link rel="stylesheet" href="<{$__APP__}>public/css/cart.css?t=<{$smarty.now}>"> 
<div class="cnav">
	<a class="back">&nbsp;</a>购物车<a href="javascript:;" class="thome">主页</a>
</div>
<form action="?m=cart&a=settle" method="post">
<div class="cart"> 
	<{uqcms m="cart" v="cart" c="cart_all:id=smarty.get.id"}>
	<{if $cart}>
		<{foreach item=i from=$cart.list}>
			<div class="sp_cart">
				<div class="cgname">
					<em></em><a class="spname" href="wap.php?a=shop&id=<{$i.id}>" target="_blank"><{$i.name}></a> 
				</div>
				<{if $i.reduce_name}> <span class="reduce_box"><{$i.reduce_name}></span><{/if}>
				<div class="cgbox">
					<{foreach item=ii from=$i.goods}>
						<{if $ii.goods_status}>
							<div class="cgone"> 
								<div class="cart_img">  
									<div class="ckbox">
										<input type="checkbox" name="cartid[]" value="<{$ii.cartid}>" class="ckbox_cartid" <{if $ii.goods_status}> checked="checked"<{else}> disabled="disabled"<{/if}>/>
									</div>
									<div class="img"><img src="<{$__IMG__}><{$ii.images|img_size:200x200}>"/></div> 
								</div>
							 
								<div class="cart_ttl">
									<div class="sttl"><a href="?m=goods&a=detail&id=<{$ii.gid}>" class="gttl"><{$ii.title}></a></div>
									<{if $ii.sku_name}>
										<div class="sku">
											<{foreach item=s from=$ii.sku_name}>
												 <span><{$s.0}>:<{$s.1}></span>
											<{/foreach}> 
										</div>
									<{/if}> 
									<div class="price price_<{$ii.cart_id}>">
										<span>¥ <i><{$ii.price}></i></span> 
									</div>
									
									<div class="num"> 
										<div class="numBox num_<{$ii.cartid}>">
											<a href="javascript:;" class="cart_minus" data-cartid="<{$ii.cartid}>">-</a>
											<input type="text" id="cart_num_<{$ii.cartid}>" class="cnum"  size="1" value="<{$ii.buy_num}>" autoComplete="off" cartid="<{$ii.cart_id}>"/>
											<a href="javascript:;" class="cart_plus" data-cartid="<{$ii.cartid}>">+</a>
										</div>
										<div class="del"> 
											<a href="javascript:;" class="delCart" data-cartid="<{$ii.cartid}>">删除</a>
											<a href="javascritp:;" class="rmCollect" data-gid="<{$ii.gid}>">移入关注</a>
										</div>	
									</div>
								</div> 
								
							</div> 
						<{else}>
							<div class="cgone cart_detail_<{$ii.cartid}>" style="background:#f9f9f9;"> 
								<div class="cart_img">  
									<div class="ckbox">
										<input type="checkbox" name="cartid[]" value="<{$ii.cartid}>" class="ckbox_cartid" <{if $ii.goods_status}> checked="checked"<{else}> disabled="disabled"<{/if}>/>
									</div>
									<div class="img"><img src="<{$__IMG__}><{$ii.images|img_size:200x200}>"/></div> 
								</div> 
								<div class="cart_goods_invalid">
									<span>该产品已经实效</span> 
									<a href="javascritp:;" class="rmCollect" data-gid="<{$ii.gid}>">移入关注</a>
									<a href="javascript:;" class="delCart" data-cartid="<{$ii.cartid}>">删除</a>
								</div>
							</div>
						<{/if}>
					<{/foreach}> 
				</div>
			</div>
		<{/foreach}>	
		
		<!--去下单--> 
		<div class="cart_pay">
			<div class="lft">
				<div class="pay_price">
					<input id="input_total_price" name="total_price" type="hidden" value=""/> 
					<div class="total_price" id="total_price">合计 <i>0.00</i> 元</div>
					<div class="total_express postage">(不含邮费)</div>
				</div>
			</div>
			<div class="rit">
				<div class="goPayBox"><input value="去结算" name="submit" type="submit" class="gopay" disabled="disabled"/></div>
			</div> 
		</div>
	<{else}>
		<div class="nomsg">
			<span>购物车没有商品</span><br>
			<a href="wap.php">现在就去购物</a>
		</div> 
	<{/if}> 
</div> 
<form>
<{import file="footer.html"}> 
<script type="text/javascript" src="<{$__APP__}>public/js/cart.js?t=<{$smarty.now}>"></script>  
<script type="text/javascript">
$(function(){ 
	// 下单提交 
	$(".gopay").click(function(){
		var conts = 0;
		var aa = 0;
		$("input[name='cartid[]']:checked").each(function(i){
			aa += 1;
		});
		if(aa <= 0){
			alert('没有选择商品'); return false;
		}
		$.ajax({
			type:'post',
			url :'index.php?m=ajax&a=check_user_status',
			datatype:'text',
			async:false,
			success:function(data){
				if(data == '2'){ 
					location.href="wap.php?m=member&a=login&returnUrl=<{$UQCMS.request_url}>";
					ajaxres = '2';
					return false; 
				}else{
					ajaxres = '1'; 
				}
			} 
		});
		if(ajaxres != '1'){
			return false; 
		}
	}); 
});
function ajax_login_submit(){ 
	location.reload(); 
}
</script>