Commit e4af5316 by linjinhong

fix:修改问题

parent 205e3d15
......@@ -2,7 +2,7 @@
"name": "JomallProductionAssistant",
"productName": "JomallProductionAssistant",
"description": "",
"version": "1.0.27",
"version": "1.0.30",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
......
......@@ -749,7 +749,7 @@ export default {
);
return img?.productionFile;
},
getBackFile({ files, size }, callback) {
async getBackFile({ files, size }, callback) {
const isCp = this.productMark == "custom_part" ? true : false;
let that = this;
let bw = document.getElementById("line");
......@@ -760,93 +760,90 @@ export default {
for (let i = 0; i < files.length; i++) {
files[i].url = files[i]?.productionFile || files[i].url;
that.$nextTick(async () => {
let w = bw / 2;
let h = bh / 2;
let width_px, height_px, rate, x, y;
let data = await that.getImageSize(files[i].url);
const isCut = files[i].isCut;
if (size && !isCut) {
//带黄点模判断是否是cp类,cp类按照newMmToPxFn方法重新计算宽高
if (isCp) {
width_px = newMmToPxFn(size.width);
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;
}
await that.$nextTick();
let w = bw / 2;
let h = bh / 2;
let width_px, height_px, rate, x, y;
let data = await that.getImageSize(files[i].url);
const isCut = files[i].isCut;
if (size && !isCut) {
//带黄点模判断是否是cp类,cp类按照newMmToPxFn方法重新计算宽高
if (isCp) {
width_px = newMmToPxFn(size.width);
height_px = newMmToPxFn(size.height);
} else {
rate = data.height / data.width;
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;
}
width_px = mmToPx(size.width);
height_px = mmToPx(size.height);
}
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 ? 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;
}
});
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 {
rate = data.height / data.width;
if (i === files.length - 1) {
callback && callback();
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 };
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) {
......
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