Fix:3343 【礼品】购买礼品数量,增加可以手动输入数字

This commit is contained in:
linxi
2025-03-18 11:16:01 +08:00
parent 4c76fedeb8
commit 89b94a71dc
3 changed files with 52 additions and 8 deletions
+6 -2
View File
@@ -276,7 +276,11 @@ export default {
let stock = productSelect.stock || 0
let num = this.attr.productSelect
if (changeValue) {
num.cart_num++
if(changeValue > 1) {
num.cart_num = changeValue
} else {
num.cart_num++
}
if (num.cart_num > stock) {
if(stock < 1) {
this.$set(this.attr.productSelect, 'cart_num', 1)
@@ -291,7 +295,7 @@ export default {
this.$set(this, 'cart_num', 1)
} else {
this.$set(this.attr.productSelect, 'cart_num', num.cart_num)
this.$set(this, 'cart_num', num.cart_num)
// this.$set(this, 'cart_num', num.cart_num)
}
}
} else {