refactor(form): 优化表单横幅图片的加载逻辑
将硬编码的横幅图片路径改为动态读取配置项,无配置时使用默认图片
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<block v-if="detail">
|
||||
<view class="page">
|
||||
<view class="form-banner" v-if="detail.show_banner > 0">
|
||||
<image :src="$util.img('public/uniapp/form/banner.png')" mode="widthFix"></image>
|
||||
<image :src="$util.img(formBanner)" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="form-tip">
|
||||
<view class="system-form-tip" v-if="detail.show_tip > 0">{{ formTip }}</view>
|
||||
@@ -42,6 +42,10 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
formBanner() {
|
||||
const bannerImg = this.detail?.form_banner
|
||||
return bannerImg ? bannerImg : 'public/uniapp/form/banner.png'
|
||||
},
|
||||
formTip() {
|
||||
const tip = this.detail?.form_tip
|
||||
console.log('formTip computed, tip value:', tip, 'truthy:', !!tip)
|
||||
|
||||
Reference in New Issue
Block a user