Fix:3601 【商城小程序】加购或送礼,输入数量超过商品库存,页面点击无效
This commit is contained in:
@@ -138,7 +138,10 @@ export default {
|
||||
deep: true
|
||||
},
|
||||
cartNumber(val) {
|
||||
console.log(+val <= 1 || val === '', 'cartNumber');
|
||||
console.log(this.attr, 'cartNumber');
|
||||
if (val > this.attrObj.productSelect.stock) {
|
||||
val = this.attrObj.productSelect.stock
|
||||
}
|
||||
this.$emit('input', +val)
|
||||
this.$emit("changeFun", { action: "ChangeCartNum", value: +val })
|
||||
}
|
||||
@@ -154,6 +157,10 @@ export default {
|
||||
this.cartNumber = 1
|
||||
this.$forceUpdate()
|
||||
}
|
||||
if(+e > this.attrObj.productSelect.stock) {
|
||||
this.cartNumber = this.attrObj.productSelect.stock
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
reRender(data) {
|
||||
this.$set(this, 'attrObj', JSON.parse(JSON.stringify(data)))
|
||||
|
||||
Reference in New Issue
Block a user