//计算总价 function cartTotal(){ var total = 0;
//循环计算的列,选中计算的数量和价格
//accAdd为精BigDecimal准计算方法 $.each($(".eatmenu_foot"), function() { var priceSplit = $(this).children(":first").text().split('¥'); var price = parseInt(priceSplit[1]); var count = $(this).children(":last-child").children("input").val(); total = accAdd(total,accMul(price,count)); }); $("#sum").text("¥"+total); }