diff --git a/components-diy/diy-form.vue b/components-diy/diy-form.vue index b6b8f3f..cc60d59 100644 --- a/components-diy/diy-form.vue +++ b/components-diy/diy-form.vue @@ -95,8 +95,8 @@ export default { const cfg = this.mergedFormConfig || {}; const style = { padding: `${this._num(cfg.rowPaddingY, 4)}rpx ${this._num(cfg.tipPaddingX, 14)}rpx`, - 'font-size': `${this._num(cfg.tipFontSize, 24)}rpx`, - 'color': cfg.tipColor || '#666666', + 'font-size': `${this._num(cfg.tipFontSize, 32)}rpx`, + 'color': cfg.tipColor || '#000000', 'background-color': cfg.tipBgColor || 'transparent' }; // 仅在配置了 tipBorderColor 时添加底线,避免 transparent 占位仍增加 2rpx 高度 @@ -105,10 +105,11 @@ export default { } return this.$util.objToStyle(style); }, - // 提交按钮外层:与后端 .form-preview-submit 对齐(padding: row-padding-y form-padding-x;background: form-bg-color) + // 提交按钮外层:与后端 .form-preview-submit 对齐(margin-top + padding: row-padding-y form-padding-x;background: form-bg-color) submitWrapStyle() { const cfg = this.mergedFormConfig || {}; return this.$util.objToStyle({ + marginTop: `${this._num(cfg.submitMarginTop, 0)}rpx`, padding: `${this._num(cfg.rowPaddingY, 4)}rpx ${this._num(cfg.formPaddingX, 14)}rpx`, 'background-color': cfg.formBgColor || '#ffffff' }); @@ -187,6 +188,7 @@ export default { // 提交按钮尺寸:宽度百分比 + 尺寸预设(与后端 design.js 对齐) submitWidthPercent: pick('submitWidthPercent', 'submit_width_percent'), submitSize: pick('submitSize', 'submit_size'), + submitMarginTop: pick('submitMarginTop', 'submit_margin_top'), // 提示语 tipFontSize: pick('tipFontSize', 'tip_font_size'), tipColor: pick('tipColor', 'tip_color'), @@ -347,8 +349,8 @@ export default { } .form-submit-wrap { - // 外层:与后端 .form-preview-submit 对齐(padding-y + form-padding-x + form-bg-color + flex 居中) - // padding/background 由 submitWrapStyle 内联写入 + // 外层:与后端 .form-preview-submit 对齐(margin-top + padding-y + form-padding-x + form-bg-color + flex 居中) + // margin-top/padding/background 由 submitWrapStyle 内联写入 // display: flex + justify-content: center 是让宽度小于 100% 的按钮水平居中的关键 box-sizing: border-box; width: 100%; diff --git a/components/ns-newform/ns-newform.vue b/components/ns-newform/ns-newform.vue index 47cd5ad..7b348bc 100644 --- a/components/ns-newform/ns-newform.vue +++ b/components/ns-newform/ns-newform.vue @@ -427,10 +427,11 @@ export default { // 提交按钮 submitColor: '#ffffff', submitBgColor: '#ff4544', + submitMarginTop: 0, // 提交按钮顶部外边距(rpx):调整表单与按钮之间的距离 // 提示语 - tipFontSize: 24, - tipColor: '#666666', - tipBgColor: '#ffffff' + tipFontSize: 32, + tipColor: '#000000', + tipBgColor: 'transparent' }; // 全局配置(中间优先级) const globalCfg = this.formConfig || {}; @@ -492,6 +493,7 @@ export default { '--checked-color': cfg.checkedColor, '--submit-color': cfg.submitColor, '--submit-bg-color': cfg.submitBgColor, + '--submit-margin-top': `${cfg.submitMarginTop || 0}rpx`, // 分割线显隐 '--show-row-divider': cfg.showRowDivider === false ? '0' : '1' });