diff --git a/mixins/goCartMixins.js b/mixins/goCartMixins.js index 6b84eef..3ae1a2e 100644 --- a/mixins/goCartMixins.js +++ b/mixins/goCartMixins.js @@ -14,7 +14,7 @@ export default { isOpen: false, attrTxt: '', attrValue: '', - id: null, + m_id: null, productValueArr: [], attr: { cartAttr: false, @@ -51,7 +51,7 @@ export default { } }, getSkuActiveStatus(selectedSku) { - getProductSkuBySelected({ id: this.id, selectedSku }).then(res => { + getProductSkuBySelected({ id: this.m_id, selectedSku }).then(res => { const { success, data } = res if (success) { for (const key in data) { @@ -75,7 +75,7 @@ export default { }) }, productCon() { - getProductDetail(this.id).then(res => { + getProductDetail(this.m_id).then(res => { const { data } = res this.storeInfo = {...data.storeInfo} if(data.storeInfo.stock === 0) { @@ -235,7 +235,7 @@ export default { // 点击加入购物车按钮 addToCart(item, id = 'id') { console.log(item, 'addToCart --------- item'); - this.id = item[id] + this.m_id = item[id] this.$nextTick(() => { this.productCon() @@ -259,7 +259,7 @@ export default { return } const q = { - productId: this.id, + productId: this.m_id, cartNum: this.attr.productSelect.cart_num, new: 0, uniqueId: this.attr.productSelect !== undefined ? this.attr.productSelect.unique : ''