Fix:3094 【商城小程序】多规格商品点击购物车图标并加购成功后,再次点击购物车图标打开规格选择页面,购买数量会保留上一次的值

This commit is contained in:
modendeveloper
2025-01-19 21:24:16 +08:00
parent bd2338f16a
commit 6685638c54
+5
View File
@@ -254,6 +254,8 @@ export default {
postCartAdd(q).then(res => {
this.isOpen = false
this.attr.cartAttr = false
this.$set(this.attr.productSelect, 'cart_num', 1)
this.cart_num = 1
uni.showToast({
title: "添加购物车成功",
icon: "none",
@@ -308,12 +310,15 @@ export default {
// 修改了规格
this.attr.cartAttr = msg
this.$set(this.attr.productSelect, 'cart_num', 1)
this.$forceUpdate()
this.isOpen = false
},
// 打开属性插件
selecAttrTap() {
this.$set(this.attr.productSelect, 'cart_num', 1)
this.attr.cartAttr = true
this.isOpen = true
this.$forceUpdate()
},
ChangeAttr(res) {
const { index, subIndex, value } = res