storage url o'zgartirildi
This commit is contained in:
@@ -1048,13 +1048,15 @@ export default {
|
||||
|
||||
"category.two": function (newVal) {
|
||||
if (this.watch_count.two > 1) {
|
||||
if (newVal.parents.length > 0) {
|
||||
if (!newVal || !newVal.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (newVal.parents && newVal.parents.length > 0) {
|
||||
this.DetectCategoryTwo();
|
||||
} else {
|
||||
if (newVal.id) {
|
||||
this.products.category_id = newVal.id;
|
||||
this.getCharacteristics(newVal.id);
|
||||
}
|
||||
this.products.category_id = newVal.id;
|
||||
this.getCharacteristics(newVal.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1063,6 +1065,10 @@ export default {
|
||||
|
||||
"category.three": function (newVal) {
|
||||
if (this.watch_count.three > 1) {
|
||||
if (!newVal || !newVal.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.DetectCategoryThree();
|
||||
}
|
||||
|
||||
@@ -1206,6 +1212,10 @@ export default {
|
||||
},
|
||||
|
||||
DetectCategoryThree() {
|
||||
if (!this.category.three || !this.category.three.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.getCharacteristics(this.category.three.id);
|
||||
this.products.category_id = this.category.three.id;
|
||||
},
|
||||
|
||||
@@ -1153,7 +1153,9 @@ export default {
|
||||
|
||||
watch: {
|
||||
"product.category_id": function (newVal) {
|
||||
this.getCharacteristics(newVal);
|
||||
if (newVal) {
|
||||
this.getCharacteristics(newVal);
|
||||
}
|
||||
},
|
||||
|
||||
"category.first": function (newVal) {
|
||||
@@ -1161,16 +1163,22 @@ export default {
|
||||
},
|
||||
|
||||
"category.two": function (newVal) {
|
||||
if (newVal.parents.length > 0) {
|
||||
if (!newVal || !newVal.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (newVal.parents && newVal.parents.length > 0) {
|
||||
this.DetectCategoryTwo();
|
||||
} else {
|
||||
if (newVal.id) {
|
||||
this.product.category_id = newVal.id;
|
||||
}
|
||||
this.product.category_id = newVal.id;
|
||||
}
|
||||
},
|
||||
|
||||
"category.three": function (newVal) {
|
||||
if (!newVal || !newVal.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.DetectCategoryThree();
|
||||
},
|
||||
},
|
||||
@@ -1367,6 +1375,13 @@ export default {
|
||||
},
|
||||
|
||||
async getCharacteristics(id) {
|
||||
id = id && id.id ? id.id : id;
|
||||
|
||||
if (!id) {
|
||||
this.characteristics = [];
|
||||
return;
|
||||
}
|
||||
|
||||
const { data } = await axios.get(
|
||||
"/dashboard/products/characteristics/" + id
|
||||
);
|
||||
@@ -1382,10 +1397,16 @@ export default {
|
||||
this.category.three = {};
|
||||
this.category.three_view = false;
|
||||
|
||||
if (this.category.first.parents.length > 0) {
|
||||
if (!this.category.first || !this.category.first.id) {
|
||||
this.product.category_id = null;
|
||||
return;
|
||||
}
|
||||
|
||||
this.product.category_id = this.category.first.id;
|
||||
this.getCharacteristics(this.category.first.id);
|
||||
|
||||
if (this.category.first.parents && this.category.first.parents.length > 0) {
|
||||
this.category.two_view = true;
|
||||
} else {
|
||||
this.product.category_id = this.category.first.id;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1393,12 +1414,23 @@ export default {
|
||||
this.category.three = {};
|
||||
this.category.three_view = false;
|
||||
|
||||
if (this.category.two.parents.length > 0) {
|
||||
if (!this.category.two || !this.category.two.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.product.category_id = this.category.two.id;
|
||||
this.getCharacteristics(this.category.two.id);
|
||||
|
||||
if (this.category.two.parents && this.category.two.parents.length > 0) {
|
||||
this.category.three_view = true;
|
||||
}
|
||||
},
|
||||
|
||||
DetectCategoryThree() {
|
||||
if (!this.category.three || !this.category.three.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.product.category_id = this.category.three.id;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user