$(function(){
$(".child_tab tr :last-child").find("td").css({borderBottom:'none'})
//Get the text box object
var t = $(".amount-input");
//Amount increase operation
$(".amount-up").click(function(e){
var c1=parseInt($(this).prev().val());
$(this).prev().val(c1 1);
e.preventDefault()
setTotal();
});
//Quantity reduction operation
$ (".amount-down").click(function(e){
var c1=parseInt($(this).next().val());
if(c1>=1){
$(this).next().val(c1-1);
};
e.preventDefault()
setTotal();
});
function setTotal( ){
//Get the value of each condition
var num1=$(".sum1").text();
var num2=$(".sum2").text();
var num3=$(".sum3").text();
var total=0;
var x1=4,x2=10,x3=49;
//Traverse the total number of pieces
t.each(function(index,ele){
total =parseInt($(ele).val());
});
$(".figure").html(total );
//Judge which requirement the number meets
if(totalb2=num1
}else if(total>=x2&&total<=x3){
b2= num2
}else if(total>=x3){
b2=num3
}
$(".money").html((total*b2).toFixed(2) '元' );//toFixed() is a function that retains decimal points and is very practical
}
//Initialization
setTotal();
})