From effd058f9d1a908c12d6fa9e2cfc22333a35c970 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Tue, 23 Sep 2025 18:44:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/form-input/form-input.vue | 37 +++++++++++++++++-- pages/form-input/form-input.vue | 2 +- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/pages/form-input/components/form-input/form-input.vue b/pages/form-input/components/form-input/form-input.vue index 840f0ea3..8adb1409 100644 --- a/pages/form-input/components/form-input/form-input.vue +++ b/pages/form-input/components/form-input/form-input.vue @@ -44,7 +44,7 @@ {{ overall_config.save_draft_title }} - + @@ -82,6 +82,14 @@ export default { type: Boolean, default: false, }, + propSuccessJumpUrl: { + type: String, + default: '', + }, + propIsDebug: { + type: Boolean, + default: false, + }, }, data() { return { @@ -161,22 +169,43 @@ export default { forminput_id: this.propDataFormId, ...submit_data } - this.is_submit_disable = true; + this.setData({ + is_submit_disable: true + }); uni.request({ url: app.globalData.get_request_url('save', 'forminputdata'), method: 'POST', data: params, dataType: 'json', success: (res) => { - this.is_submit_disable = false; + this.setData({ + is_submit_disable: false + }); if (res.data.code == 0) { app.globalData.showToast('提交成功', 'success'); + if(!this.propIsDebug) { + var pages = app.globalData.prev_page(); + if (pages) { + setTimeout(function () { + uni.navigateBack(); + }, 1000); + } else { + if((this.propSuccessJumpUrl || null) != null) { + var url = this.propSuccessJumpUrl; + setTimeout(function () { + app.globalData.url_open(url); + }, 1000); + } + } + } } else { app.globalData.showToast('提交失败'); } }, fail: (res) => { - this.is_submit_disable = false; + this.setData({ + is_submit_disable: false + }); app.globalData.showToast('提交失败'); } }); diff --git a/pages/form-input/form-input.vue b/pages/form-input/form-input.vue index af353a97..b9eb017e 100644 --- a/pages/form-input/form-input.vue +++ b/pages/form-input/form-input.vue @@ -2,7 +2,7 @@ - +