From d18c244339bc1da8db0a16ef343dd7dde7b8a385 Mon Sep 17 00:00:00 2001 From: yedejiamingshi <540057894@qq.com> Date: Thu, 16 Jan 2025 14:15:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=AE=BD=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/configure/uniTemplate/detail.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/views/configure/uniTemplate/detail.vue b/src/views/configure/uniTemplate/detail.vue index 654c3c2..35c126f 100644 --- a/src/views/configure/uniTemplate/detail.vue +++ b/src/views/configure/uniTemplate/detail.vue @@ -64,6 +64,8 @@ 扫码记录图标 + 背景图片高度: {{ form.bgHeight }}px
+ 背景图片宽度: {{ form.bgWidth }}px @@ -579,6 +581,16 @@ this.form.templateItemList[this.selectMaterialType.split(",")[1]].iconUrl = this.selectedMaterialUrl; } else { this.form[this.selectMaterialType] = this.selectedMaterialUrl; + if (this.selectMaterialType === 'bgUrl') { + const that = this; + const img = new Image(); + img.src = this.selectedMaterialUrl; + img.onload = function() { + // 获取图片宽高 + that.form.bgWidth = this.width; + that.form.bgHeight = this.height; + } + } } this.selectMaterialVisible = false; },