// 购物车数量减少
$('.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)
}
}
}
如对本文有疑问, 点击进行留言回复!!
网友评论