Commit e4af5316 by linjinhong

fix:修改问题

parent 205e3d15
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "JomallProductionAssistant", "name": "JomallProductionAssistant",
"productName": "JomallProductionAssistant", "productName": "JomallProductionAssistant",
"description": "", "description": "",
"version": "1.0.27", "version": "1.0.30",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
......
...@@ -749,7 +749,7 @@ export default { ...@@ -749,7 +749,7 @@ export default {
); );
return img?.productionFile; return img?.productionFile;
}, },
getBackFile({ files, size }, callback) { async getBackFile({ files, size }, callback) {
const isCp = this.productMark == "custom_part" ? true : false; const isCp = this.productMark == "custom_part" ? true : false;
let that = this; let that = this;
let bw = document.getElementById("line"); let bw = document.getElementById("line");
...@@ -760,93 +760,90 @@ export default { ...@@ -760,93 +760,90 @@ export default {
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
files[i].url = files[i]?.productionFile || files[i].url; files[i].url = files[i]?.productionFile || files[i].url;
that.$nextTick(async () => { await that.$nextTick();
let w = bw / 2; let w = bw / 2;
let h = bh / 2; let h = bh / 2;
let width_px, height_px, rate, x, y; let width_px, height_px, rate, x, y;
let data = await that.getImageSize(files[i].url); let data = await that.getImageSize(files[i].url);
const isCut = files[i].isCut; const isCut = files[i].isCut;
if (size && !isCut) { if (size && !isCut) {
//带黄点模判断是否是cp类,cp类按照newMmToPxFn方法重新计算宽高 //带黄点模判断是否是cp类,cp类按照newMmToPxFn方法重新计算宽高
if (isCp) { if (isCp) {
width_px = newMmToPxFn(size.width); width_px = newMmToPxFn(size.width);
height_px = newMmToPxFn(size.height); height_px = newMmToPxFn(size.height);
} else {
width_px = mmToPx(size.width);
height_px = mmToPx(size.height);
}
x = w;
y = height_px / 2;
rate = height_px / width_px;
if (this.newDesktopDevice == 3) {
//惠立彩 直接获取图片原始像素进行技术
const scale = bh / data.height;
width_px = data.width * scale;
height_px = data.height * scale;
x = (bw - data.w) / 2;
y = h;
rate = height_px / width_px;
}
} else { } else {
rate = data.height / data.width; width_px = mmToPx(size.width);
height_px = mmToPx(size.height);
if (rate > 1) {
height_px = bh * (7.5 / 10);
width_px = height_px / rate;
x = w;
y = height_px / 2;
} else {
width_px = bw * (2 / 3);
height_px = width_px * rate;
x = width_px / 2;
y = height_px / 2;
}
} }
this.currentImgData = { ...data }; x = w;
y = height_px / 2;
that.imgList = []; rate = height_px / width_px;
that.imgList.push({
url: files[i].url, if (this.newDesktopDevice == 3) {
fileName: files[i].fileName, //惠立彩 直接获取图片原始像素进行技术
rate, const scale = bh / data.height;
w: width_px, width_px = data.width * scale;
zIndex: that.imgList.length, height_px = data.height * scale;
x, x = (bw - data.w) / 2;
y, y = h;
h: height_px, rate = height_px / width_px;
r: 0, }
}); } else {
rate = data.height / data.width;
that.selectIndex = that.imgList.length - 1;
that.showImgSetting = true;
isCp ? that.ev("x_center") : that.ev("cover");
if (!size) that.ev("cover");
if (isCut) that.ev("cover");
this.$nextTick(async () => {
//等图片铺上网格后判断是否超过网格
const {
isImageBiggerThanGrid,
hasOutsideValidPixel,
} = await checkImageOutsideGrid();
if (isImageBiggerThanGrid && hasOutsideValidPixel) {
//图大于台版且超过台版有素材
this.isOver = hasOutsideValidPixel;
} else if (!isImageBiggerThanGrid) {
//图小于台版
this.isOver = isImageBiggerThanGrid;
} else if (isImageBiggerThanGrid && !hasOutsideValidPixel) {
//图大于台版且超过台版没有有素材
this.isOver = hasOutsideValidPixel;
}
});
if (i === files.length - 1) { if (rate > 1) {
callback && callback(); height_px = bh * (7.5 / 10);
width_px = height_px / rate;
x = w;
y = height_px / 2;
} else {
width_px = bw * (2 / 3);
height_px = width_px * rate;
x = width_px / 2;
y = height_px / 2;
} }
}
this.currentImgData = { ...data };
that.imgList = [];
that.imgList.push({
url: files[i].url,
fileName: files[i].fileName,
rate,
w: width_px,
zIndex: that.imgList.length,
x,
y,
h: height_px,
r: 0,
}); });
that.selectIndex = that.imgList.length - 1;
that.showImgSetting = true;
isCp ? this.ev("x_center") : this.ev("cover");
if (!size || isCut) this.ev("cover");
await this.$nextTick();
const { hasOutsideValidPixel } = await checkImageOutsideGrid();
this.isOver = hasOutsideValidPixel;
// this.$nextTick(async () => {
// //等图片铺上网格后判断是否超过网格
// // if (isImageBiggerThanGrid && hasOutsideValidPixel) {
// // //图大于台版且超过台版有素材
// // this.isOver = hasOutsideValidPixel;
// // } else if (!isImageBiggerThanGrid) {
// // //图小于台版
// // this.isOver = isImageBiggerThanGrid;
// // } else if (isImageBiggerThanGrid && !hasOutsideValidPixel) {
// // //图大于台版且超过台版没有有素材
// // this.isOver = hasOutsideValidPixel;
// // }
// });
if (i === files.length - 1) {
callback && callback();
}
} }
}, },
addFile(file, callback) { addFile(file, callback) {
......
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