Fix:4726 【旅居商城小程序】点击“产品”类目下方商品的加购图标后,千县攻略、资讯类目的数据加载失败
This commit is contained in:
@@ -14,7 +14,7 @@ export default {
|
|||||||
isOpen: false,
|
isOpen: false,
|
||||||
attrTxt: '',
|
attrTxt: '',
|
||||||
attrValue: '',
|
attrValue: '',
|
||||||
id: null,
|
m_id: null,
|
||||||
productValueArr: [],
|
productValueArr: [],
|
||||||
attr: {
|
attr: {
|
||||||
cartAttr: false,
|
cartAttr: false,
|
||||||
@@ -51,7 +51,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSkuActiveStatus(selectedSku) {
|
getSkuActiveStatus(selectedSku) {
|
||||||
getProductSkuBySelected({ id: this.id, selectedSku }).then(res => {
|
getProductSkuBySelected({ id: this.m_id, selectedSku }).then(res => {
|
||||||
const { success, data } = res
|
const { success, data } = res
|
||||||
if (success) {
|
if (success) {
|
||||||
for (const key in data) {
|
for (const key in data) {
|
||||||
@@ -75,7 +75,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
productCon() {
|
productCon() {
|
||||||
getProductDetail(this.id).then(res => {
|
getProductDetail(this.m_id).then(res => {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
this.storeInfo = {...data.storeInfo}
|
this.storeInfo = {...data.storeInfo}
|
||||||
if(data.storeInfo.stock === 0) {
|
if(data.storeInfo.stock === 0) {
|
||||||
@@ -235,7 +235,7 @@ export default {
|
|||||||
// 点击加入购物车按钮
|
// 点击加入购物车按钮
|
||||||
addToCart(item, id = 'id') {
|
addToCart(item, id = 'id') {
|
||||||
console.log(item, 'addToCart --------- item');
|
console.log(item, 'addToCart --------- item');
|
||||||
this.id = item[id]
|
this.m_id = item[id]
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.productCon()
|
this.productCon()
|
||||||
@@ -259,7 +259,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const q = {
|
const q = {
|
||||||
productId: this.id,
|
productId: this.m_id,
|
||||||
cartNum: this.attr.productSelect.cart_num,
|
cartNum: this.attr.productSelect.cart_num,
|
||||||
new: 0,
|
new: 0,
|
||||||
uniqueId: this.attr.productSelect !== undefined ? this.attr.productSelect.unique : ''
|
uniqueId: this.attr.productSelect !== undefined ? this.attr.productSelect.unique : ''
|
||||||
|
|||||||
Reference in New Issue
Block a user