main product injected

This commit is contained in:
Vion 2022-03-02 19:11:36 +08:00
parent 6c60d6296d
commit e4e1b5cdb9

View File

@ -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);