From 1d0c14d09894dd4949b1fca2184604a872c74b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Wed, 16 Oct 2024 11:56:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/custom.vue | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/components/diy/custom.vue b/components/diy/custom.vue index 4eb83b51..ab2dc2a7 100644 --- a/components/diy/custom.vue +++ b/components/diy/custom.vue @@ -32,6 +32,8 @@ import modelLines from '@/components/diy/modules/custom/model-lines.vue'; import modelImage from '@/components/diy/modules/custom/model-image.vue'; import modelIcon from '@/components/diy/modules/custom/model-icon.vue'; import modelPanel from '@/components/diy/modules/custom/model-panel.vue'; +var system = app.globalData.get_system_info(null, null, true); +var sys_width = app.globalData.window_width_handle(system.windowWidth); export default { components: { @@ -86,23 +88,12 @@ export default { init() { const new_form = this.propValue.content; const new_style = this.propValue.style; - this.$nextTick(() => { - const query = uni.createSelectorQuery().in(this); - query - .select('.custom-container') - .boundingClientRect((res) => { - if ((res || null) != null) { - this.setData({ - div_width: res.width, - scale: res.width / 390, - }); - } - }) - .exec(); - }); + const width = sys_width - new_style.common_style.margin_left - new_style.common_style.margin_right; this.setData({ form: new_form, new_style: new_style, + div_width: width, + scale: width / 390, custom_list_length: new_form.custom_list.length - 1, style_container: common_styles_computer(new_style.common_style) + 'box-sizing: border-box;', // 用于样式显示 style_img_container: common_img_computer(new_style.common_style),