diff --git a/src/views/goodsDetails/index.vue b/src/views/goodsDetails/index.vue index 540dc11..ce8db8d 100644 --- a/src/views/goodsDetails/index.vue +++ b/src/views/goodsDetails/index.vue @@ -429,7 +429,7 @@ export default { filteredProductParams() { return this.goodDetail.productParams.filter( (item) => - item.waresItemsParamsList && item.waresItemsParamsList.length > 0 + item.waresItemsParamsList && item.waresItemsParamsList?.length > 0 ); }, }, @@ -446,8 +446,8 @@ export default { if (ctem.value == this.specialArea) { this.labelName = ctem.label; } - if (ctem.children.length > 0) { - ctem.children.forEach((stem) => { + if (ctem.children?.length > 0) { + ctem.children?.forEach((stem) => { if (stem.value == this.specialArea) { this.labelName = stem.label; } diff --git a/src/views/shoppingMall/index.vue b/src/views/shoppingMall/index.vue index f9295ad..fb6a4ad 100644 --- a/src/views/shoppingMall/index.vue +++ b/src/views/shoppingMall/index.vue @@ -489,7 +489,7 @@ export default { this.specialArea0 = n.query.id; this.specialArea = n.query.idTh; // || - this.zoneList.forEach((item) => { + this.zoneList?.forEach((item) => { if (item.value == this.specialArea0) { this.areaTwoList = item.children; } @@ -828,11 +828,11 @@ export default { }, goDetails(item) { let label; - this.zoneList.forEach((stem) => { + this.zoneList?.forEach((stem) => { if (stem.value == this.specialArea) { label = stem.label; } else { - stem.children.forEach((ctem) => { + stem.children?.forEach((ctem) => { if (ctem.value == this.specialArea) { label = ctem.label; }