define([],function(){return{render_cart:(a=$.cookie("cookieid").split(","),n=$.cookie("cookienum").split(","),!void $.ajax({url:"http://localhost/h5/umyjs/taobaoitem_test/php/list.php",dataType:"json"}).done(function(i){a&&$(".empty-cart").hide();for(var s="",t=0,c=0;c<=a.length;c++)$.each(i,function(i,e){e.sid==a[c]&&(s+='<div class="goods-item goods-item-sele"><div class="goods-info"> <div class="cell b-checkbox"><div class="cart-checkbox"><input type="checkbox" checked="" name="" id="" value="" /> <span class="line-circle"></span></div></div><div class="cell b-goods"><div class="goods-name"><div class="goods-pic"><a href=""><img src="'+e.url+'" alt="" /></a></div><div class="goods-msg"><div class="goods-d-info"><a href="">'+e.title+'</a> </div><div class="goods-ex"><span class="promise"></span></div></div></div> </div> <div class="cell b-props"><div class="prop-text"></div></div> <div class="cell b-price"><strong>'+e.price+'</strong><div class="sales-promotion-dropdown"> </div></div> <div class="cell b-quantity"><div class="quantity-form"><a class="quantity-down" href="javascript:void(0)">-</a><input type="text" value="'+n[c]+'" /> <a class="quantity-add" href="javascript:void(0)">+</a></div></div><div class="cell b-sum"><strong>'+(e.price*n[c]).toFixed(2)+'</strong> </div><div class="cell b-action"><a href="javascript:void(0)">删除</a></div></div></div>',t+=Number((e.price*n[c]).toFixed(2)))});$(".item-list").append(s);var e=$(".allsel"),o=$(".b-checkbox  .cart-checkbox input").not(".allsel");e.on("click",function(){$(this).prop("checked")?(o.prop("checked",!0),$(".totalprice").html(t)):(o.prop("checked",!1),$(".totalprice").html((0).toFixed(2)))}),o.on("click",function(){$(".b-checkbox  .cart-checkbox input:checked").size()===o.size()?e.prop("checked",!0):e.prop("checked",!1),t=0,$(".goods-item-sele").each(function(i,e){$(".totalprice").html((0).toFixed(2)),$(this).find(".b-checkbox  .cart-checkbox input").prop("checked")&&(t+=Number($(this).find(".b-sum strong").html()))}),$(".totalprice").html(t)}),$(".goods-item-sele").each(function(s,i){$(this).find(".quantity-add").on("click",function(){var i=parseInt($(this).siblings("input").prop("value"));i++,$(this).siblings("input").prop("value",i),n.splice(s,1,i),$.cookie("cookienum",n,{expires:10,path:"/"});var e=$(this).parent().parent().siblings(".b-price ").find("strong").html();Number(e),$(this).parent().parent().siblings(" .b-sum ").find("strong").html(i*e)}),$(this).find(".quantity-down").on("click",function(){var i=parseInt($(this).siblings("input").prop("value"));i--,$(this).siblings("input").prop("value",i),n.splice(s,1,i),$.cookie("cookienum",n,{expires:10,path:"/"});var e=$(this).parent().parent().siblings(".b-price ").find("strong").html();Number(e),$(this).parent().parent().siblings(" .b-sum ").find("strong").html(i*e)})}),$(".goods-item-sele").each(function(i,e){$(this).find(" .b-action a").on("click",function(){confirm("你确定要删除")&&(e.remove(),n.splice(i,1),a.splice(i,1),$.cookie("cookienum",n,{expires:10,path:"/"}),$.cookie("cookieid",a,{expires:10,path:"/"}))})})}))};var a,n});