<?xml version="1.0"?>
<labeltemplate>
   <label>
    <![CDATA[
	
<form name="bundleform" id="bundleform" action="{M:HomeDir}ShoppingCart.aspx" method="post">
	<div class="othercp">
	  <div class="title">产品套餐</div>
	  <div class="othercpbox">
	  <div class="dqcp">
	    <ul>
		  <li><a href="{KS:LinkUrl}"><img src="{KS:DefaultPic}" alt="image01" /></a>
		  <div>{KS:Title}<span class="bindattr"></span></div>
		     
			    <label>
			      <input type="checkbox" name="checkbox" value="checkbox"  checked="checked" disabled="disabled"/>
		        </label> 
				价格<span class="showDynamicPrice">{$GetCurrencySymbol}{KS:Field:Price_Member}</span>
		  </li>
		</ul>
	  </div>
	  
	  
     <!--上下滚动效果-->
		<div id="tj_container" class="tj_container">
			<!--<div class="tj_nav">
				<span id="tj_prev" class="tj_prev">Previous</span>
				<span id="tj_next" class="tj_next">Next</span>
			</div>
			-->
			<div class="tj_wrapper">
				<ul class="tj_gallery"  id="BundleSale">
				    [recordloop]
					<div class="and"> + </div>
					<li><a href="{KS:LinkUrl}" title="{KS:Title}" target="_blank"><img src="{KS:DefaultPic}" alt="{KS:Title}" /></a>
					<div style="overflow:hidden" title="{KS:Title}">{KS:Title}</div>
						<label>
						  <input type="checkbox" name="BandleSaleID" data-market="{KS:Price}" data-pricekb="{KS:KBPrice}" data-score="{KS:Score}" onclick="return(checkBundleSale())" value="{KS:InfoID}" {KS:Checked}/><span>价格{$GetCurrencySymbol}{KS:KBPrice}</span>
						</label> 
				    </li>
					
					[/recordloop]
					
				</ul>
			</div>
				
		</div>

<!--上下滚动效果-->

	  </div>

	  <div class="price_r">
	        <input type="hidden" name="attrid" value="0" id="attrid_b"/>
			 <input type="hidden" name="ID" value="{KS:InfoID}" />
			<input type="hidden" name="BundleIDs" id="BundleIDs" value="{KS:CheckBundleID}"/>
			<input type="hidden" name="IsBundleSale" id="IsBundleSale" value="1"/>
	      <div class="tcj">套餐价：{$GetCurrencySymbol}<span id="BundPromotPrice">{KS:PromotPrice}</span></div>
		  <div class="orij">价格：<del><span id="BundOriginPrice">{KS:OriginPrice}</span>{$GetCurrencyUnit}</del></div>
		  <div class="clear"></div>
	      <div class="jsj">省{$GetCurrencySymbol}<span id="BundSaleSave">0</span>{$GetCurrencyUnit}</div>	      
	      <div class="buynow"><input onclick="return(checkbindbuy())" type="image" src="{M:HomeDir}shop/images/bunnow.png" style="width:150px;height:33px"/></div>
	      <!--
		  <div class="carbuy"><a href="#"><img src="/images/shop/carbuy.png" /></a></div>
		  -->
		  
		  <div style="display:none">
		   <div>{KS:Title}</div>
		   <div id="bundleProList">+{KS:CheckedTitle}</div>
		   <div>赠　送：<span style="color:green"><span id="BundTotalScore">{KS:TotalScore}</span></span>个积分</div>
          </div>
		  
	  </div>
	</div>
	
</form>
	
	
	
<script type="text/javascript">
 $(window).load(function(){
    checkBundleSale();
 });
 function checkBundleSale(){
   var rprice=$('.showDynamicPrice').eq(0).html().replace(priceunit,'').replace(priceunitsymbol,'');
   if (!isNaN(rprice)){
			promotPrice=parseFloat(rprice);
   }
 
   var obj=jQuery("#tj_container").find("input[type=checkbox]");
   var ced=false;
   var totalMarket=parseFloat({KS:Price});
   var totalScore=parseInt({KS:Score});
   var titleList='';
   var bundleId='';
   obj.each(function(){
   
     if ($(this).prop("checked")==true) {
	  titleList+='<br/>+'+$(this).next().text();
	 ced=true;
	 totalMarket+=parseFloat($(this).attr("data-market"));
	 promotPrice+=parseFloat($(this).attr("data-pricekb"));
	 totalScore+=parseInt($(this).attr("data-score"));
	 if (bundleId=='')
	 bundleId=$(this).val();
	 else
	 bundleId+=","+$(this).val();
	 }
   });
   if (ced==false){
    KesionJS.Alert('请至少搭配一件商品才能享受优惠!');
	return false;
   }else{
   
     $("#BundOriginPrice").html(totalMarket.toFixed(2));
	 $("#BundPromotPrice").html(promotPrice.toFixed(2));
	 $("#BundTotalScore").html(totalScore);
	 $("#bundleProList").html(titleList);
	 $("#BundleIDs").val(bundleId);
	 $("#BundSaleSave").html((totalMarket-promotPrice).toFixed(2));
//alert(totalMarket+'=='+promotPrice);
	 return true;
   }
 }
 function checkbindbuy(){
  $("#attrid_b").val($("#attrid").val());
  return shop.check(alen);
 }
</script>
	]]>
   </label>
</labeltemplate>