wip: tiered deliver price
This commit is contained in:
1 parent
8423007350
commit
a0c13b91da
23 files changed
+426
-39
No files matched your search
@@ -366,12 +366,12 @@ const getCartGoodsPrice = computed(() =>{ //计算购物车总价
|
||||
return parseFloat(price).toFixed(2);
|
||||
})
|
||||
const disabledPay = computed(() => { //是否达到起送价
|
||||
return orderType.value == 'takeout' && (getCartGoodsPrice < parseFloat(store.value.min_price)) ? true :
|
||||
return orderType.value == 'takeout' && (getCartGoodsPrice < parseFloat(store.value.minPrice)) ? true :
|
||||
false
|
||||
})
|
||||
const spread = computed(() => { //差多少元起送
|
||||
if (orderType.value != 'takeout') return
|
||||
return parseFloat((store.value.min_price - getCartGoodsPrice).toFixed(2))
|
||||
return parseFloat((store.value.minPrice - getCartGoodsPrice).toFixed(2))
|
||||
})
|
||||
|
||||
// 监听自定义事件
|
||||
@@ -750,8 +750,8 @@ const toPay = () => {
|
||||
uToast.value.show({message:'本店不支持外卖',type: 'error'});
|
||||
return;
|
||||
}
|
||||
// 判断当前是否在配送范围内
|
||||
if (orderType.value == 'takeout' && store.value.distance < store.value.far) {
|
||||
// 判断当前是否在配送范围内(基于用户定位距离粗略判断,最终以下单时收货地址校验为准)
|
||||
if (orderType.value == 'takeout' && store.value.dis && store.value.distance < (store.value.dis / 1000)) {
|
||||
uToast.value.show({message:'选中的地址不在配送范围',type: 'error'});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user