chore:优化表单风格逻辑,支持显式和隐式判定,确保兼容性

This commit is contained in:
2026-09-02 11:14:52 +08:00
parent e7ad9a3cb5
commit 2787e73126
2 changed files with 18 additions and 2 deletions

View File

@@ -263,9 +263,16 @@ export default {
containerStyle() {
return 'padding-left:' + this.containerInset + 'rpx;padding-right:' + this.containerInset + 'rpx;';
},
// 图条模式下隐藏 diy-form 卡片顶部的 banner,避免与图条重复
// 表单风格(与 diy-form.vue hasBannerMode 对齐):优先读显式 form_style,未设置时回退到原 bgImage 隐式判定
// - card :顶部图条替代内联 banner → 隐藏内联 banner
// - classic:保留内联 banner(与原行为一致),仅当后台显式配 bgImage 才隐藏
// 老表单无 form_style 字段时 → undefined → 走原隐式判定,零迁移风险
// 如需保留卡片内 banner:把下面这行改成 `return false;` 即可
hideInnerBanner() {
const fc = (this.detail && this.detail.form_config) || {};
const style = fc.formStyle !== undefined ? fc.formStyle : fc.form_style;
if (style === 'card') return true;
if (style === 'classic') return !!this.bgImage;
return !!this.bgImage;
},
// 行为设置:提交验证码开启时 diy-form 隐藏内置提交按钮,本页渲染验证码 + 自有提交按钮