Commit b2375b88 by zhuzhequan

工厂生产下载取素材图

parent 7fcca94c
......@@ -304,22 +304,9 @@ export default {
},
async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList) {
let imageResList = [];
let debug = false;
if (debug && this.detail.adjustable && designImagesCanvasJsonList) {
if (this.detail.diyId && this.detail.adjustable && designImagesCanvasJsonList) {
designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList);
if (designImagesCanvasJsonList[0].images) {
designImagesCanvasJsonList.forEach((el) => {
el.images.forEach((item) => {
imageResList.push({
productionFile: item,
title: el.title,
});
});
});
for (let item of imageResList) {
item.productionFile = await this.saveImgByUrl(item.productionFile);
}
} else {
if (!designImagesCanvasJsonList[0].images) {
let imageList = await this.canvasToImage(designImagesCanvasJsonList);
let fm = new FormData();
for (let img of imageList) {
......@@ -333,6 +320,19 @@ export default {
item.productionFile = item.url;
});
imageResList = Sres.data;
} else {
// designImagesCanvasJsonList.forEach((el) => {
// el.images.forEach((item) => {
// imageResList.push({
// productionFile: item,
// title: el.title,
// });
// });
// });
// for (let item of imageResList) {
// item.productionFile = await this.saveImgByUrl(item.productionFile);
// }
}
}
if (!imageResList.length) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment