diff --git a/components/tab-bar/delivery.vue b/components/tab-bar/delivery.vue index fcbc2a2..ae4e9c3 100644 --- a/components/tab-bar/delivery.vue +++ b/components/tab-bar/delivery.vue @@ -382,8 +382,8 @@ - - + + 输入取餐码 请输入4位取餐码 { - setTimeout(() => { + if (this.pickupCodeFocusTimer) { + clearTimeout(this.pickupCodeFocusTimer) + } + this.pickupCodeFocusTimer = setTimeout(() => { + if (!this.pickupCodeContext || !this.pickupCodePopupOpening) return this.pickupCodeInputFocus = true + this.pickupCodePopupOpening = false + this.pickupCodeFocusTimer = null }, 300) }) }, + handlePickupCodePopupChange(e) { + const show = e && e.show + this.pickupCodePopupVisible = !!show + if (!show) { + this.pickupCodePopupOpening = false + this.pickupCodeInputFocus = false + if (this.pickupCodeFocusTimer) { + clearTimeout(this.pickupCodeFocusTimer) + this.pickupCodeFocusTimer = null + } + } + }, closePickupCodePopup() { if (this.pickupCodeSubmitting) return this.$refs.pickupCodePopup.close() this.pickupCode = '' this.pickupCodeContext = null this.pickupCodeInputFocus = false + this.pickupCodePopupOpening = false + if (this.pickupCodeFocusTimer) { + clearTimeout(this.pickupCodeFocusTimer) + this.pickupCodeFocusTimer = null + } }, handlePickupCodeInput(e) { const value = String(e.detail.value || '').replace(/\D/g, '').slice(0, 4) @@ -1123,6 +1156,7 @@ let url = '' if (status == 2) { if (item.transferDelivery == 1) { + if (this.pickupCodePopupVisible || this.pickupCodePopupOpening) return this.openPickupCodePopup(index, item, regionId) return } diff --git a/components/tab-bar/myCenter.vue b/components/tab-bar/myCenter.vue index 47740ed..e86f5b1 100644 --- a/components/tab-bar/myCenter.vue +++ b/components/tab-bar/myCenter.vue @@ -1,14 +1,140 @@