// 購物車數量減少$('.reduce').click(function () { addMinus(this,0)});// 購物車數量增加$('.increase').click(function () { addMinus(this,1)});function addMinus(t,stat ...
// 購物車數量減少
$('.reduce').click(function () {
addMinus(this,0)
});
// 購物車數量增加
$('.increase').click(function () {
addMinus(this,1)
});
function addMinus(t,state) {
var num=$(t).parent('.select_num').find('.num');
var msg='';
if(state==0){
msg = "寶貝不能再減少了哦"
if (num.text() <= 1) {
mui.alert(msg, "提示");
}else {
num.text(parseInt(num.text())-1)
}
}else if(state ==1){
msg = "寶貝不能再增加了哦"
if (num.text() >= 10) {
mui.alert(msg, "提示");
}else {
num.text(parseInt(num.text())+1)
}
}
}