From 2567d2ece9d2c1e380632be1f1d26b750e50753d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 7 Aug 2025 17:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/diy/components/diy/custom.vue | 2 +- pages/diy/components/diy/tabs-magic.vue | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pages/diy/components/diy/custom.vue b/pages/diy/components/diy/custom.vue index 353c583d..1ff04938 100644 --- a/pages/diy/components/diy/custom.vue +++ b/pages/diy/components/diy/custom.vue @@ -247,7 +247,7 @@ // 判断是平移还是整屏滚动 const { padding_top = 0, padding_bottom = 0, margin_bottom = 0, margin_top = 0 } = new_data_style; let swiper_height = 0; - const scale_number = width / 390; + const scale_number = width / (this.propMagicScale === 1 ? 390 : sys_width); const new_scale = scale_number > 0 ? scale_number : 0; // 间距 const space_between = new_form.data_source_direction == 'horizontal' ? new_style.column_gap : new_style.row_gap; diff --git a/pages/diy/components/diy/tabs-magic.vue b/pages/diy/components/diy/tabs-magic.vue index fb4abdb7..5c3c5810 100644 --- a/pages/diy/components/diy/tabs-magic.vue +++ b/pages/diy/components/diy/tabs-magic.vue @@ -245,10 +245,10 @@ if (!isEmpty(this.tabs_magic_value)) { // 获取公共样式的数据 const common_data = this.propValue.style.common_style; - const common_width = common_data.margin_left + common_data.margin_right + common_data.padding_left + common_data.padding_right + border_width(common_data); + const common_width = this.rpx_to_px_config(common_data.margin_left) + this.rpx_to_px_config(common_data.margin_right) + this.rpx_to_px_config(common_data.padding_left) + this.rpx_to_px_config(common_data.padding_right) + this.rpx_to_px_config(border_width(common_data)); const { margin_left, margin_right, padding_left, padding_right } = this.tabs_magic_value.style.magic_content; - const content_width = margin_left + margin_right + padding_left + padding_right + border_width(this.tabs_magic_value.style.magic_content); + const content_width = this.rpx_to_px_config(margin_left) + this.rpx_to_px_config(margin_right) + this.rpx_to_px_config(padding_left) + this.rpx_to_px_config(padding_right) + this.rpx_to_px_config(border_width(this.tabs_magic_value.style.magic_content)); // 根据容器宽度来计算内部大小 const typewidth = sys_width - content_width - common_width; // 获得对应宽度的比例 @@ -419,6 +419,12 @@ this.$refs.diy_goods_list.goods_cart_back_event(e); } }, + rpx_to_px_config(val) { + if (val == 0) { + return 0; + } + return app.globalData.rpx_to_px(val); + }, }, };