|
|
|
@ -2,7 +2,11 @@ |
|
|
|
<!-- 代买饭页 --> |
|
|
|
<page-meta :page-style="addressBookVisible ? 'overflow: hidden;' : 'overflow: visible;'"></page-meta> |
|
|
|
<view class="page1" :class="{'store-group-checkout': isStoreGroupOrder, 'page1--locked': addressBookVisible}"> |
|
|
|
<view class="checkout-fixed-header" :class="{'checkout-fixed-header--store': isStoreGroupOrder, 'checkout-fixed-header--paying': payPopupVisible || commissionPopupVisible}"> |
|
|
|
<view class="checkout-fixed-header" :class="{ |
|
|
|
'checkout-fixed-header--store': isStoreGroupOrder, |
|
|
|
'checkout-fixed-header--paying': payPopupVisible || commissionPopupVisible, |
|
|
|
'checkout-fixed-header--pintuan': pintuanPopupVisible |
|
|
|
}"> |
|
|
|
<view class="title"> |
|
|
|
<view class="title-sreach"> |
|
|
|
<view class="back-btn" @tap="back" :style="{'top': menuButtonInfo.top +'px'}"> |
|
|
|
@ -21,7 +25,7 @@ |
|
|
|
<view class="verify-icon">核</view> |
|
|
|
<view> |
|
|
|
<view class="verify-title">到店核销</view> |
|
|
|
<view class="verify-sub">同校热拼</view> |
|
|
|
<view class="verify-sub">好友热拼</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="store-float-tag tag-a">拼团价</view> |
|
|
|
@ -103,7 +107,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="delivery-card" v-if="isPaotui"> |
|
|
|
<view class="delivery-card" v-if="isPaotui && !isSocialArea"> |
|
|
|
<view class="delivery-head"> |
|
|
|
<view class="delivery-title"> |
|
|
|
配送员 |
|
|
|
@ -393,7 +397,7 @@ |
|
|
|
<view class="delivery-closed-icon"> |
|
|
|
<uni-icons type="info-filled" size="28" color="#0b9b73"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="delivery-closed-title">当前校区暂未开启配送</view> |
|
|
|
<view class="delivery-closed-title">当前区域暂未开启配送</view> |
|
|
|
<view class="delivery-closed-desc">本店目前只能选择到店消费,关闭提示后会为你自动切换到到店标签。</view> |
|
|
|
<view class="delivery-closed-btn" @tap="closeDeliveryClosedPopup">知道了</view> |
|
|
|
</view> |
|
|
|
@ -622,11 +626,13 @@ |
|
|
|
isSeckillOrder: false, |
|
|
|
payPopupVisible: false, |
|
|
|
commissionPopupVisible: false, |
|
|
|
pintuanPopupVisible: false, |
|
|
|
baseDeliveryFee: 0, |
|
|
|
deliveryEnabled: 1, |
|
|
|
deliverySwitchChecked: false, |
|
|
|
deliverySwitchLoading: false, |
|
|
|
deliveryClosedPopupVisible: false |
|
|
|
deliveryClosedPopupVisible: false, |
|
|
|
areaKind: 1 |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -646,6 +652,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
this.syncAreaKind(); |
|
|
|
this.orderScene = option.orderScene || ''; |
|
|
|
if (option.shopItem) { |
|
|
|
this.shopItem = JSON.parse(decodeURIComponent(option.shopItem)); |
|
|
|
@ -673,9 +680,13 @@ |
|
|
|
if (this.supportShopDelivery) { |
|
|
|
this.selected = 'shopDelivery'; |
|
|
|
} |
|
|
|
this.applySocialDeliveryDefaults(); |
|
|
|
this.fetchCoupons(); |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isSocialArea() { |
|
|
|
return Number(this.areaKind) === 2; |
|
|
|
}, |
|
|
|
goodsAmountCalc() { |
|
|
|
if (this.isGroupBuy && this.groupItem) { |
|
|
|
if(this.groupItem.item.moreBuyData){ |
|
|
|
@ -801,6 +812,7 @@ |
|
|
|
}, |
|
|
|
watch: {}, |
|
|
|
onShow() { |
|
|
|
this.syncAreaKind(); |
|
|
|
this.isNavigatingToWorkerList = false; |
|
|
|
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() |
|
|
|
const keepAddressBookOpen = uni.getStorageSync('keepAddressBookOpen') === '1'; |
|
|
|
@ -821,12 +833,19 @@ |
|
|
|
let pendingWorker = uni.getStorageSync('pendingAssignWorker'); |
|
|
|
if (pendingWorker) { |
|
|
|
uni.removeStorageSync('pendingAssignWorker'); |
|
|
|
this.assignedWorker = pendingWorker; |
|
|
|
this.selected = 'zhiding'; |
|
|
|
this.refreshDeliveryTimeByModeChange(); |
|
|
|
if (!this.isSocialArea) { |
|
|
|
this.assignedWorker = pendingWorker; |
|
|
|
this.selected = 'zhiding'; |
|
|
|
this.refreshDeliveryTimeByModeChange(); |
|
|
|
} |
|
|
|
} |
|
|
|
this.applySocialDeliveryDefaults(); |
|
|
|
|
|
|
|
uni.$on('updateDeliveryWorker', (worker) => { |
|
|
|
if (this.isSocialArea) { |
|
|
|
this.applySocialDeliveryDefaults(); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.assignedWorker = worker; |
|
|
|
this.selected = 'zhiding'; |
|
|
|
this.refreshDeliveryTimeByModeChange(); |
|
|
|
@ -926,6 +945,31 @@ |
|
|
|
if (isNaN(amount)) return '0'; |
|
|
|
return amount.toFixed(2).replace(/\.?0+$/, ''); |
|
|
|
}, |
|
|
|
syncAreaKind(areaObj) { |
|
|
|
let area = areaObj; |
|
|
|
if (!area) { |
|
|
|
try { |
|
|
|
const cached = uni.getStorageSync('area'); |
|
|
|
area = cached ? (typeof cached === 'string' ? JSON.parse(cached) : cached) : null; |
|
|
|
} catch (e) { |
|
|
|
area = null; |
|
|
|
} |
|
|
|
} |
|
|
|
const kind = area ? Number(area.areaKind) : 1; |
|
|
|
this.areaKind = kind === 2 ? 2 : 1; |
|
|
|
}, |
|
|
|
applySocialDeliveryDefaults() { |
|
|
|
if (!this.isSocialArea || !this.isPaotui) return; |
|
|
|
this.assignedWorker = null; |
|
|
|
// 商家自配送:沿用商家配送费,不改成不指定 |
|
|
|
if (this.supportShopDelivery) { |
|
|
|
this.selected = 'shopDelivery'; |
|
|
|
return; |
|
|
|
} |
|
|
|
this.selected = 'buzhiding'; |
|
|
|
const minFee = this.getMinimumCommissionAmount(); |
|
|
|
this.customCommission = this.formatCommissionValue(minFee); |
|
|
|
}, |
|
|
|
validateCustomCommission(commission) { |
|
|
|
const minAmount = this.getMinimumCommissionAmount(); |
|
|
|
if (isNaN(commission) || commission < minAmount) { |
|
|
|
@ -954,7 +998,10 @@ |
|
|
|
const fee = parseFloat(res.result); |
|
|
|
this.baseDeliveryFee = isNaN(fee) ? 0 : fee; |
|
|
|
} |
|
|
|
}).catch(() => {}); |
|
|
|
this.applySocialDeliveryDefaults(); |
|
|
|
}).catch(() => { |
|
|
|
this.applySocialDeliveryDefaults(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
shouldCheckDeliverySwitch() { |
|
|
|
return !this.isStoreGroupOrder; |
|
|
|
@ -1201,10 +1248,18 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.isSocialArea && this.isPaotui) { |
|
|
|
this.applySocialDeliveryDefaults(); |
|
|
|
} |
|
|
|
|
|
|
|
if (this.isPaotui && this.selected === 'buzhiding' && !isJoiningFaceToFace) { |
|
|
|
let comm = parseFloat(this.customCommission); |
|
|
|
//没有输入佣金,直接弹出输入框 |
|
|
|
if(isNaN(comm)){ |
|
|
|
if (this.isSocialArea) { |
|
|
|
this.tui.toast('配送费获取失败,请稍后重试'); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.openCommissionPopup(); |
|
|
|
return; |
|
|
|
} |
|
|
|
@ -1396,6 +1451,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onPintuanPopupChange(e) { |
|
|
|
this.pintuanPopupVisible = !!(e && e.show); |
|
|
|
if(!e.show){ |
|
|
|
this.goPayOrderConfirm(); |
|
|
|
} |
|
|
|
@ -1719,6 +1775,11 @@ |
|
|
|
z-index: 100; |
|
|
|
} |
|
|
|
|
|
|
|
/* uni-popup 默认 z-index:99,低于顶部固定头会挡住拼团弹窗顶部 */ |
|
|
|
.checkout-fixed-header--pintuan { |
|
|
|
z-index: 90; |
|
|
|
} |
|
|
|
|
|
|
|
.pay-popup-header-mask { |
|
|
|
position: absolute; |
|
|
|
left: 0; |
|
|
|
|