新增表单返回按钮

master
于肖磊 2025-10-15 11:29:19 +08:00
parent bb3fd4737c
commit 2b486b3759
1 changed files with 25 additions and 5 deletions

View File

@ -40,10 +40,13 @@
</template> </template>
<view class="bottom-line-exclude"> <view class="bottom-line-exclude">
<view class="form-footer flex-row align-c"> <view class="form-footer flex-row align-c">
<view v-if="overall_config.is_show_save_draft == '1'" class="save_draft_title flex-col jc-c align-c"> <view class="save_draft_title flex-col jc-c align-c" @tap="top_nav_left_back_event">
<iconfont name="icon-detail" size="30rpx" color="#666" propContainerDisplay="flex" ></iconfont> <iconfont :name="'icon-' + back_icon" size="30rpx" color="#666" propContainerDisplay="flex" ></iconfont>
{{ overall_config.save_draft_title }} {{ back_icon == 'back' ? $t('common.return') : $t('common.home') }}
</view> </view>
<!-- <view class="bottom-line-back" @tap.stop="bottom_line_back">
<iconfont :name="'icon-' + back_icon" size="46rpx" color="#666" propContainerDisplay="flex" ></iconfont>
</view> -->
<button v-if="overall_config.is_show_submit == '1'" class="flex-1 submit_title flex-row align-c jc-c" :style="'background:' + submit_bg_color" type="default" :disabled="is_submit_disable" @tap="on_submit_event">{{ overall_config.submit_title }}</button> <button v-if="overall_config.is_show_submit == '1'" class="flex-1 submit_title flex-row align-c jc-c" :style="'background:' + submit_bg_color" type="default" :disabled="is_submit_disable" @tap="on_submit_event">{{ overall_config.submit_title }}</button>
</view> </view>
</view> </view>
@ -93,6 +96,7 @@ export default {
}, },
data() { data() {
return { return {
back_icon: 'home',
data_list: [], data_list: [],
form_name: '', form_name: '',
img_url: '', img_url: '',
@ -129,6 +133,14 @@ export default {
methods: { methods: {
isEmpty, isEmpty,
init() { init() {
// icon
let pages = getCurrentPages();
let length = pages.length;
if (length > 1) {
this.back_icon = 'back';
} else {
this.back_icon = 'back';
}
const data = this.propValue; const data = this.propValue;
// //
const overall_config = data.config?.overall_config || {}; const overall_config = data.config?.overall_config || {};
@ -151,6 +163,10 @@ export default {
}) })
}, 500); }, 500);
}, },
//
top_nav_left_back_event(e) {
app.globalData.page_back_prev_event();
},
/* /*
* 点击提交按钮触发方法 * 点击提交按钮触发方法
*/ */
@ -236,9 +252,9 @@ export default {
width: 100%; width: 100%;
border-top: 2rpx solid #eee; border-top: 2rpx solid #eee;
.save_draft_title { .save_draft_title {
min-width: 180rpx; min-width: 120rpx;
font-size: 24rpx; font-size: 24rpx;
margin: 0 20rpx 0 0; // margin: 0 20rpx 0 0;
} }
.submit_title { .submit_title {
text-align: center; text-align: center;
@ -276,4 +292,8 @@ export default {
background: transparent; background: transparent;
z-index: 999; z-index: 999;
} }
//
.bottom-line-back {
margin-right: 20rpx;
}
</style> </style>