diff --git a/rc-busness/pages/productdetails/producted.vue b/rc-busness/pages/productdetails/producted.vue index 2ae661d9..2cd059b7 100644 --- a/rc-busness/pages/productdetails/producted.vue +++ b/rc-busness/pages/productdetails/producted.vue @@ -336,7 +336,10 @@ export default { productAttachmentList = [insertTmpObj]; userbuy = false; } else { - mainProduct = await productQuery(mainProductCode); + if(mainProductCode && mainProductCode.length>2) { + mainProduct = await productQuery(mainProductCode); + mainProduct = mainProduct.pop(); + } let stopLeftAllotmentChecking = false; let stopIndex = 0; for(let singleCode of productCode) { @@ -597,12 +600,18 @@ export default { if(item.packageTypeIds!='1') { dateChecked=false; } - if(this.mainProduct && this.mainProduct.petType) { + if(this.mainProduct && this.mainProduct.petType && item.petCategoryIds) { if(this.mainProduct.petType===0 && item.petCategoryIds!='1') dateChecked=false; if(this.mainProduct.petType===1 && item.petCategoryIds!='2') dateChecked=false; } + if(this.mainProduct && this.mainProduct.tagUsedAge && item.petAgeTypeIds) { + let productToCouponAgeId = this.util.getAgeMapping(this.mainProduct.tagUsedAge); + if(item.petAgeTypeIds!=productToCouponAgeId) + dateChecked=false; + } + if(dateChecked && item.activityId!=10) { if(!item.productCodes) { menualist.push(item);