diff --git a/pages/order/add.vue b/pages/order/add.vue index e0b27cb..af304b1 100644 --- a/pages/order/add.vue +++ b/pages/order/add.vue @@ -136,7 +136,7 @@ @@ -156,6 +156,7 @@ export default { components: { UTextarea, PopupPlatenumber, payee }, data() { return { + loading: false, showModal: '', content: '', carNumber: '', @@ -233,7 +234,6 @@ export default { if (trailer && trailer.input) { cliTrailer = trailer[0]; } - console.info(cliMobile, cliVehicle, cliTrailer); if (cliMobile || cliVehicle || cliTrailer) { this.form = { ...this.form, @@ -453,17 +453,22 @@ export default { }); }, submitAddFun() { + if (this.loading) return; + this.loading = true; let totalAmount = Number(this.form.paidAmount || 0) + Number(this.form.serviceAmount || 0) + Number(this.form.securityServiceAmount || 0); uni.$u.api.freightOrder .add({ ...this.form, totalAmount, payeeId: this.payeeModel.driverId }) .then(res => { if (res.success) { + this.form = {}; uni.showToast({ title: '下单成功', icon: 'none' }); this.getOpenerEventChannel().emit('refreshData'); setTimeout(() => uni.navigateBack(), 500); } + this.loading = false; }) .catch(e => { + this.loading = false; this.$refs.uToast.show({ type: 'default', message: e, -- libgit2 0.21.0