Commit 879eca7b by zhuzhequan

图片不是太大

parent eb17b0f3
...@@ -548,15 +548,19 @@ export default { ...@@ -548,15 +548,19 @@ export default {
files[i].url = files[i].productionFile || files[i].url; files[i].url = files[i].productionFile || files[i].url;
that.$nextTick(async () => { that.$nextTick(async () => {
let w = bw / 2; let w = bw / 2;
let width_px, height_px, rate; let width_px, height_px, rate, x ,y;
if (size) { if (size) {
width_px = mmToPx(size.width); width_px = that.WHproportion * mmToPx(size.width);
height_px = mmToPx(size.height); height_px = that.WHproportion * mmToPx(size.height);
x = w * that.WHproportion
y = (height_px / 2) * that.WHproportion
rate = height_px / width_px; rate = height_px / width_px;
} else { } else {
let data = await that.getImageSize(files[i].url); let data = await that.getImageSize(files[i].url);
rate = data.height / data.width; rate = data.height / data.width;
width_px = bw * (2 / 3); width_px = bw * (2 / 3);
x = w
y = (height_px / 2)
height_px = width_px * rate; height_px = width_px * rate;
} }
...@@ -565,11 +569,11 @@ export default { ...@@ -565,11 +569,11 @@ export default {
url: files[i].url, url: files[i].url,
fileName: files[i].fileName, fileName: files[i].fileName,
rate, rate,
w: width_px * that.WHproportion, w:width_px,
zIndex: that.imgList.length, zIndex: that.imgList.length,
x: w * that.WHproportion, x,
y: (height_px / 2) * that.WHproportion, y,
h: height_px * that.WHproportion, h:height_px,
r: 0, r: 0,
}); });
that.selectIndex = that.imgList.length - 1; that.selectIndex = that.imgList.length - 1;
......
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