|
|
|
@ -382,8 +382,8 @@ |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
<uni-popup ref="pickupCodePopup" background-color="transparent"> |
|
|
|
<view class="pickup-code-popup"> |
|
|
|
<uni-popup ref="pickupCodePopup" background-color="transparent" :mask-click="false" @change="handlePickupCodePopupChange"> |
|
|
|
<view class="pickup-code-popup" @tap.stop @touchmove.stop.prevent> |
|
|
|
<view class="pickup-code-title">输入取餐码</view> |
|
|
|
<view class="pickup-code-desc">请输入4位取餐码</view> |
|
|
|
<input class="pickup-code-input" v-model="pickupCode" type="number" maxlength="4" |
|
|
|
@ -492,6 +492,9 @@ |
|
|
|
pickupCodeContext: null, |
|
|
|
pickupCodeSubmitting: false, |
|
|
|
pickupCodeInputFocus: false, |
|
|
|
pickupCodePopupVisible: false, |
|
|
|
pickupCodePopupOpening: false, |
|
|
|
pickupCodeFocusTimer: null, |
|
|
|
completingDeliveryIds: {}, |
|
|
|
lineStatus: [{ |
|
|
|
title: '上线', |
|
|
|
@ -527,6 +530,10 @@ |
|
|
|
this.refreshLoading = false |
|
|
|
uni.hideLoading() |
|
|
|
} |
|
|
|
if (this.pickupCodeFocusTimer) { |
|
|
|
clearTimeout(this.pickupCodeFocusTimer) |
|
|
|
this.pickupCodeFocusTimer = null |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
totalRuleCount() { |
|
|
|
@ -1045,6 +1052,9 @@ |
|
|
|
this.isArea = !this.isArea |
|
|
|
}, |
|
|
|
openPickupCodePopup(index, item, regionId) { |
|
|
|
if (this.pickupCodePopupVisible || this.pickupCodePopupOpening) return |
|
|
|
this.pickupCodePopupOpening = true |
|
|
|
this.pickupCodePopupVisible = true |
|
|
|
this.pickupCode = '' |
|
|
|
this.pickupCodeInputFocus = false |
|
|
|
this.pickupCodeContext = { |
|
|
|
@ -1054,17 +1064,40 @@ |
|
|
|
} |
|
|
|
this.$refs.pickupCodePopup.open() |
|
|
|
this.$nextTick(() => { |
|
|
|
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 |
|
|
|
} |
|
|
|
|