diff --git a/pages/index/index.vue b/pages/index/index.vue index 320cedc..a4d93a1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -440,8 +440,9 @@ - 拒绝接单 + {{rejectOrderSubmittingMap[item.id] ? '拒绝中...' : '拒绝接单'}} @@ -672,6 +673,7 @@ autoplay: true, mallAds: [], deliveryItem: [], + rejectOrderSubmittingMap: {}, interval: 4000, onlineWorkerInterval: 4000, duration: 1000, @@ -1355,9 +1357,12 @@ }).catch((res) => {}); }, rejectOrder(item, index) { + const deliveryId = item && item.id + if (this.rejectOrderSubmittingMap[deliveryId]) return + this.$set(this.rejectOrderSubmittingMap, deliveryId, true) let that = this this.tui.request("/mall/delivery/reject", "POST", { - deliveryId: item.id + deliveryId: deliveryId }, false, true).then((res) => { if (res.code == 200) { that.deliveryItem.splice(index, 1) @@ -1379,7 +1384,9 @@ return; } uni.hideLoading(); - }).catch((res) => {}); + }).catch((res) => {}).finally(() => { + that.$delete(that.rejectOrderSubmittingMap, deliveryId) + }); }, normalizeAdImageUrl(url) { if (!url) return '' @@ -3692,6 +3699,10 @@ } } + .reject-order-btn--disabled { + opacity: 0.65; + } + .paotui-title { display: flex; flex: 1;