Commit b31a792f authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 393197d2 77b659b2
...@@ -392,10 +392,15 @@ export default { ...@@ -392,10 +392,15 @@ export default {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
let conponentsId = document.getElementById("conponentsId"); let conponentsId = document.getElementById("conponentsId");
let info = conponentsId.getBoundingClientRect();
let width = info.width;
let height = info.height;
html2canvas(conponentsId, { html2canvas(conponentsId, {
backgroundColor: null, backgroundColor: null,
useCORS: true, useCORS: true,
dpi: window.devicePixelRatio * 4, //设备像素比 dpi: window.devicePixelRatio * 4, //设备像素比
width: width,
height: height,
scale: 0.9, scale: 0.9,
}) })
.then(async (canvas) => { .then(async (canvas) => {
...@@ -414,20 +419,24 @@ export default { ...@@ -414,20 +419,24 @@ export default {
let { code } = res.data; let { code } = res.data;
if (code === 1) { if (code === 1) {
this.formData.previewImagePath = res.data.url; this.formData.previewImagePath = res.data.url;
let result = await skinSave({
...this.facilityInfo,
...this.formData,
});
let { code, msg } = result.data;
if (code === 1) {
this.$message.success(msg);
this.$emit("addSkinSuccess");
this.backOne();
}
} }
}) })
.then(async () => { .catch((err) => {
let res = await skinSave({ this.$message.error("图片生成失败,请刷新重试");
...this.facilityInfo, console.log("err", err);
...this.formData, })
}); .finally(() => {
this.loading = false; this.loading = false;
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.$emit("addSkinSuccess");
this.backOne();
}
}); });
} }
}); });
......
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.window-skin-across { .window-skin-across {
width: 1000px; width: 1000px;
height: 562.5px; height: 562px;
padding: 20px; padding: 20px;
background-image: linear-gradient(#26c5ff, #2c66ff); background-image: linear-gradient(#26c5ff, #2c66ff);
background-repeat: no-repeat !important; background-repeat: no-repeat !important;
......
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