Fix:3094 【商城小程序】多规格商品点击购物车图标并加购成功后,再次点击购物车图标打开规格选择页面,购买数量会保留上一次的值
This commit is contained in:
@@ -254,6 +254,8 @@ export default {
|
|||||||
postCartAdd(q).then(res => {
|
postCartAdd(q).then(res => {
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
this.attr.cartAttr = false
|
this.attr.cartAttr = false
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
this.cart_num = 1
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "添加购物车成功",
|
title: "添加购物车成功",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
@@ -308,12 +310,15 @@ export default {
|
|||||||
// 修改了规格
|
// 修改了规格
|
||||||
this.attr.cartAttr = msg
|
this.attr.cartAttr = msg
|
||||||
this.$set(this.attr.productSelect, 'cart_num', 1)
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
|
this.$forceUpdate()
|
||||||
this.isOpen = false
|
this.isOpen = false
|
||||||
},
|
},
|
||||||
// 打开属性插件
|
// 打开属性插件
|
||||||
selecAttrTap() {
|
selecAttrTap() {
|
||||||
|
this.$set(this.attr.productSelect, 'cart_num', 1)
|
||||||
this.attr.cartAttr = true
|
this.attr.cartAttr = true
|
||||||
this.isOpen = true
|
this.isOpen = true
|
||||||
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
ChangeAttr(res) {
|
ChangeAttr(res) {
|
||||||
const { index, subIndex, value } = res
|
const { index, subIndex, value } = res
|
||||||
|
|||||||
Reference in New Issue
Block a user