diff --git a/packages/order/order.vue b/packages/order/order.vue index f4f9733..9a829cb 100644 --- a/packages/order/order.vue +++ b/packages/order/order.vue @@ -246,7 +246,8 @@ datePicker }, data() { - return { + return { + isLocked:false, showinfo: false, showagree: false, isAgree: false, @@ -800,7 +801,11 @@ if (this.isAgree) { this.form.show = 0 if (this.type == 'edit') { - console.log("this.form", this.form) + console.log("this.form", this.form) + if(this.isLocked){ + return + } + this.isLocked = true this.$u.api.saveUserOrder(this.form).then(res => { uni.removeStorageSync('vuex_update_card') toast(res.msg, 1000, function() { @@ -810,13 +815,18 @@ }) - }).then(res => { + }).catch(res => { + this.isLocked = false console.log('res1', res) }) } else { console.log("this.form", this.form) - // return + // return + if(this.isLocked){ + return + } + this.isLocked = true this.$u.api.addUserOrder(this.form).then(res => { console.log("res", res) uni.removeStorageSync('vuex_card') @@ -827,7 +837,8 @@ }) - }).then(res => { + }).catch(res => { + this.isLocked = false console.log('res1', res) })