Commit b2375b88 by zhuzhequan

工厂生产下载取素材图

parent 7fcca94c
...@@ -304,22 +304,9 @@ export default { ...@@ -304,22 +304,9 @@ export default {
}, },
async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList) { async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList) {
let imageResList = []; let imageResList = [];
let debug = false; if (this.detail.diyId && this.detail.adjustable && designImagesCanvasJsonList) {
if (debug && this.detail.adjustable && designImagesCanvasJsonList) {
designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList); designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList);
if (designImagesCanvasJsonList[0].images) { 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 {
let imageList = await this.canvasToImage(designImagesCanvasJsonList); let imageList = await this.canvasToImage(designImagesCanvasJsonList);
let fm = new FormData(); let fm = new FormData();
for (let img of imageList) { for (let img of imageList) {
...@@ -333,6 +320,19 @@ export default { ...@@ -333,6 +320,19 @@ export default {
item.productionFile = item.url; item.productionFile = item.url;
}); });
imageResList = Sres.data; 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) { 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