This commit is contained in:
2026-04-15 19:34:56 +05:00
parent 34ffed1e4a
commit e243821f50
26 changed files with 2072 additions and 1258 deletions

View File

@@ -335,6 +335,7 @@
<div class="text-center">
<img
id="uploadPreview"
:src="getPosterPreview()"
style="
width: 300px;
height: auto;
@@ -1172,6 +1173,12 @@ export default {
},
methods: {
getPosterPreview() {
if (this.product.poster instanceof File) {
return URL.createObjectURL(this.product.poster);
}
return this.product.poster;
},
async StoreProduct() {
const header = {
headers: {
@@ -1263,10 +1270,25 @@ export default {
screens < this.product.colors[i].screens.length;
screens++
) {
formData.append(
"colors[" + i + "][screens][" + screens + "][image]",
this.product.colors[i].screens[screens].file
);
if (this.product.colors[i].screens[screens].file) {
formData.append(
"colors[" + i + "][screens][" + screens + "][image]",
this.product.colors[i].screens[screens].file
);
}
}
if (this.product.colors[i].filesDataForUpload) {
for (
let f = 0;
f < this.product.colors[i].filesDataForUpload.length;
f++
) {
formData.append(
"colors[" + i + "][screens][new_" + f + "][image]",
this.product.colors[i].filesDataForUpload[f].file
);
}
}
}