From 240fdfc3f37116d8ea4a8ff43a7b091e53cab735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Sat, 12 Oct 2024 18:06:29 +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 --- common/js/common/common.js | 17 +++++++++++++---- components/diy/modules/custom/model-icon.vue | 6 +++--- components/diy/modules/custom/model-image.vue | 4 ++-- components/diy/modules/custom/model-lines.vue | 4 ++-- components/diy/modules/custom/model-panel.vue | 4 ++-- components/diy/modules/custom/model-text.vue | 6 +++--- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/common/js/common/common.js b/common/js/common/common.js index c187e371..f2a16ca0 100644 --- a/common/js/common/common.js +++ b/common/js/common/common.js @@ -107,8 +107,12 @@ export function gradient_handle (color_list, direction, is_return_all = true) { * @param {string[], string} path * @returns {string} */ -export function padding_computer (new_style, scale = 1) { - return `padding: ${new_style.padding_top * scale * 2 || 0}rpx ${new_style.padding_right * scale * 2 || 0}rpx ${new_style.padding_bottom * scale * 2 || 0}rpx ${new_style.padding_left * scale * 2 || 0}rpx;`; +export function padding_computer (new_style, scale = 1, is_custom = false) { + if (!is_custom) { + return `padding: ${new_style.padding_top * 2 || 0}rpx ${new_style.padding_right * 2 || 0}rpx ${new_style.padding_bottom * 2 || 0}rpx ${new_style.padding_left * 2 || 0}rpx;`; + } else { + return `padding: ${new_style.padding_top * scale || 0}px ${new_style.padding_right * scale || 0}px ${new_style.padding_bottom * scale || 0}px ${new_style.padding_left * scale || 0}px;`; + } } /** * 设置外边距的方法 @@ -125,8 +129,13 @@ export function margin_computer (new_style) { * @param {string[], string} path * @returns {string} */ -export function radius_computer (new_style, scale = 1) { - return `border-radius: ${new_style.radius_top_left * scale * 2 || 0}rpx ${new_style.radius_top_right * scale * 2 || 0}rpx ${new_style.radius_bottom_right * scale * 2 || 0}rpx ${new_style.radius_bottom_left * scale * 2 || 0}rpx;`; +export function radius_computer (new_style, scale = 1, is_custom = false) { + if (!is_custom) { + return `border-radius: ${new_style.radius_top_left * 2 || 0}rpx ${new_style.radius_top_right * 2 || 0}rpx ${new_style.radius_bottom_right * 2 || 0}rpx ${new_style.radius_bottom_left * 2 || 0}rpx;`; + } else { + return `border-radius: ${new_style.radius_top_left * scale || 0}px ${new_style.radius_top_right * scale || 0}px ${new_style.radius_bottom_right * scale || 0}px ${new_style.radius_bottom_left * scale || 0}px;`; + } + } /** * 设置阴影样式 diff --git a/components/diy/modules/custom/model-icon.vue b/components/diy/modules/custom/model-icon.vue index b7d8c184..34b36dcf 100644 --- a/components/diy/modules/custom/model-icon.vue +++ b/components/diy/modules/custom/model-icon.vue @@ -1,6 +1,6 @@