Fix:3711 【商城小程序】商详页选择的商品数量与订单页面的数据没有同步
This commit is contained in:
@@ -138,7 +138,6 @@ export default {
|
|||||||
deep: true
|
deep: true
|
||||||
},
|
},
|
||||||
cartNumber(val) {
|
cartNumber(val) {
|
||||||
console.log(this.attr, 'cartNumber');
|
|
||||||
if (val > this.attrObj.productSelect.stock) {
|
if (val > this.attrObj.productSelect.stock) {
|
||||||
val = this.attrObj.productSelect.stock
|
val = this.attrObj.productSelect.stock
|
||||||
}
|
}
|
||||||
@@ -148,11 +147,9 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$set(this, 'attrObj', JSON.parse(JSON.stringify(this.attr)))
|
this.$set(this, 'attrObj', JSON.parse(JSON.stringify(this.attr)))
|
||||||
console.log(this.attrObj)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
inputNumer(e) {
|
inputNumer(e) {
|
||||||
console.log(e);
|
|
||||||
if(e === '') {
|
if(e === '') {
|
||||||
this.cartNumber = 1
|
this.cartNumber = 1
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
@@ -177,6 +174,7 @@ export default {
|
|||||||
},
|
},
|
||||||
CartNumDes() {
|
CartNumDes() {
|
||||||
if(this.cartNumber === 1) return
|
if(this.cartNumber === 1) return
|
||||||
|
console.log(this.cartNumber, 'cartNumber');
|
||||||
this.cartNumber--
|
this.cartNumber--
|
||||||
this.$emit("changeFun", { action: "ChangeCartNum", value: this.cartNumber })
|
this.$emit("changeFun", { action: "ChangeCartNum", value: this.cartNumber })
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1252,8 +1252,8 @@ export default {
|
|||||||
let stock = productSelect.stock || 0
|
let stock = productSelect.stock || 0
|
||||||
let num = this.attr.productSelect
|
let num = this.attr.productSelect
|
||||||
if (changeValue) {
|
if (changeValue) {
|
||||||
console.log(changeValue);
|
console.log(num.cart_num);
|
||||||
if(changeValue > 1) {
|
if(changeValue >= 1) {
|
||||||
num.cart_num = changeValue
|
num.cart_num = changeValue
|
||||||
} else {
|
} else {
|
||||||
num.cart_num++
|
num.cart_num++
|
||||||
|
|||||||
Reference in New Issue
Block a user