test
This commit is contained in:
@@ -318,7 +318,7 @@
|
||||
<div class="text-center">
|
||||
<img
|
||||
id="uploadPreview"
|
||||
:src="product.poster"
|
||||
:src="getPosterPreview()"
|
||||
style="
|
||||
width: 300px;
|
||||
height: auto;
|
||||
@@ -1110,6 +1110,12 @@ export default {
|
||||
this.remaincharUZCount();
|
||||
this.setCategory();
|
||||
|
||||
this.products.childrens.forEach((child) => {
|
||||
if (!child.filesDataForUpload) {
|
||||
this.$set(child, "filesDataForUpload", []);
|
||||
}
|
||||
});
|
||||
|
||||
if (this.products.categories.length == 0) {
|
||||
this.watch_count = {
|
||||
first: 2,
|
||||
@@ -1120,6 +1126,12 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
getPosterPreview() {
|
||||
if (this.products.poster instanceof File) {
|
||||
return URL.createObjectURL(this.products.poster);
|
||||
}
|
||||
return this.products.poster;
|
||||
},
|
||||
setCategory() {
|
||||
if (this.products.categories[0]) {
|
||||
if (this.products.categories[0].parent) {
|
||||
@@ -1332,10 +1344,25 @@ export default {
|
||||
);
|
||||
}
|
||||
|
||||
formData.append(
|
||||
"colors[" + i + "][screens][" + screens + "][image]",
|
||||
this.products.childrens[i].screens[screens].file
|
||||
);
|
||||
if (this.products.childrens[i].screens[screens].file) {
|
||||
formData.append(
|
||||
"colors[" + i + "][screens][" + screens + "][image]",
|
||||
this.products.childrens[i].screens[screens].file
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.products.childrens[i].filesDataForUpload) {
|
||||
for (
|
||||
let f = 0;
|
||||
f < this.products.childrens[i].filesDataForUpload.length;
|
||||
f++
|
||||
) {
|
||||
formData.append(
|
||||
"colors[" + i + "][screens][new_" + f + "][image]",
|
||||
this.products.childrens[i].filesDataForUpload[f].file
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1410,6 +1437,7 @@ export default {
|
||||
sizes: [],
|
||||
article_number: null,
|
||||
screens: [],
|
||||
filesDataForUpload: [],
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user