update:新增店铺开业筹备预订单,以及正常休息的店铺不在营业时间可以下第二天之后的预订单
This commit is contained in:
parent
f716e5641e
commit
27d2d0b231
@ -4,7 +4,7 @@
|
||||
<view @tap="Modal" :class="{ mask: model }"></view>
|
||||
<!-- 弹窗主体 -->
|
||||
<view
|
||||
:style="{ height: barHidth + 'rpx' }"
|
||||
|
||||
class="active"
|
||||
:class="{ add: model }"
|
||||
>
|
||||
@ -214,6 +214,7 @@ export default {
|
||||
}
|
||||
|
||||
.add {
|
||||
height: 380px;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
|
||||
@ -136,6 +136,7 @@
|
||||
<view class="distribution" v-if="(true)" style="display: flex;flex-direction: column;">
|
||||
<view class="check" style="width: 100%;">
|
||||
<view style="width:100%;height: 40px;display: flex; border: 1px gray solid;border-radius: 5px;padding-left: 6px;margin: 3px 0px;align-items: center;"
|
||||
v-if="!shouldHideImmediateDelivery"
|
||||
:class="{ active: activeTab === 'immediate' }"
|
||||
@click="setActiveTab('immediate')">
|
||||
<text style="width: 30%;">立即配送</text>
|
||||
@ -810,6 +811,7 @@ export default {
|
||||
items: [],
|
||||
UserMembership: {},
|
||||
},
|
||||
store_ids_time:0,
|
||||
selectedTime:"",
|
||||
dateTitle:"",
|
||||
activeTab: "immediate",
|
||||
@ -908,7 +910,8 @@ export default {
|
||||
loginPopup,
|
||||
deliveryTimeOp
|
||||
},
|
||||
computed: mapState([
|
||||
computed: {
|
||||
...mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
@ -917,6 +920,14 @@ export default {
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
shouldHideImmediateDelivery() {
|
||||
const forbidStates = [3, 12];
|
||||
// 检查所有店铺的items中是否有store_biz_state为12的
|
||||
return this.submitinfo.items.some(store_item =>
|
||||
forbidStates.includes(store_item.store_biz_state)
|
||||
);
|
||||
}
|
||||
},
|
||||
onLoad: async function (options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("订单提交"),
|
||||
@ -1074,6 +1085,10 @@ export default {
|
||||
});
|
||||
},
|
||||
setActiveTab(tab) {
|
||||
// 如果需要隐藏立即配送且用户点击了立即配送,则直接返回
|
||||
if (tab === 'immediate' && this.shouldHideImmediateDelivery) {
|
||||
return;
|
||||
}
|
||||
this.activeTab = tab;
|
||||
if (tab === 'immediate') {
|
||||
this.selectedTime = "";
|
||||
@ -1241,7 +1256,7 @@ export default {
|
||||
url: this.Config.URL.cart.getTimeSlots, // 替换为实际的接口地址
|
||||
method: 'GET',
|
||||
data: {
|
||||
store_ids: 80
|
||||
store_ids: this.store_ids_time||''
|
||||
}
|
||||
});
|
||||
|
||||
@ -1375,6 +1390,12 @@ export default {
|
||||
data: params,
|
||||
success: function (data, status, msg, code) {
|
||||
if (200 == status) {
|
||||
// 提取所有店铺ID并拼接成字符串
|
||||
const storeIds = data.items.map(store => store.store_id).join(',');
|
||||
that.setData({ store_ids_time: storeIds });
|
||||
|
||||
// 立即获取时间槽
|
||||
that.getTimeSlots();
|
||||
for (var i = 0; i <= data.transportIds.length; i++) {
|
||||
if (data.transportIds[i] == 10) {
|
||||
that.delivery = true;
|
||||
@ -1437,7 +1458,13 @@ export default {
|
||||
that.setData({
|
||||
order_amount: data.orderSelMoneyAmount,
|
||||
});
|
||||
|
||||
// 检查是否需要自动切换到预约配送
|
||||
if (that.shouldHideImmediateDelivery) {
|
||||
that.setData({
|
||||
activeTab: 'scheduled',
|
||||
booking_state: 2
|
||||
});
|
||||
}
|
||||
//地址信息监测
|
||||
if (ud_id > 0) {
|
||||
//that.checkDelivery(ud_id);
|
||||
@ -2320,6 +2347,11 @@ submitorder: function (e) {
|
||||
},
|
||||
mounted() {
|
||||
this.calculateImmediateDeliveryTime();
|
||||
// 检查是否需要自动切换到预约配送
|
||||
if (this.shouldHideImmediateDelivery) {
|
||||
this.activeTab = 'scheduled';
|
||||
this.booking_state = 2;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -878,7 +878,7 @@
|
||||
|
||||
<view class="is-rest" v-if="store_info.store_biz_state == 2"></view>
|
||||
|
||||
<view class="m-footer-btn bottom-safearea" :class="ProductInfo.is_virtual ? 'm-fg-btn' : ''" v-if="(ProductInfo.activityType!='GROUPBOOKING') && store_info.store_biz_state == 1">
|
||||
<view class="m-footer-btn bottom-safearea" :class="ProductInfo.is_virtual ? 'm-fg-btn' : ''" v-if="(ProductInfo.activityType!='GROUPBOOKING') && store_info.store_biz_state != 2">
|
||||
|
||||
<block v-if="(ProductInfo.is_virtual)">
|
||||
<view class="m-footer-btn-list">
|
||||
@ -1028,7 +1028,7 @@
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="m-footer-btn m-fg-btn bottom-safearea" v-if="(ProductInfo.activityType=='GROUPBOOKING') && store_info.store_biz_state == 1">
|
||||
<view class="m-footer-btn m-fg-btn bottom-safearea" v-if="(ProductInfo.activityType=='GROUPBOOKING')">
|
||||
<view class="m-footer-btn-list">
|
||||
<view class="m-footer-btn-item" style="width: 50%;" :data-id="(proId)" :data-name="(store_info.store_name)" :data-keyword="(ProductInfo.keyWord)" :data-appid="(AppId)" :data-appurl="(chatUrl)" v-if="(Config.MULTISHOP_ENABLE && !if_saas_status && !isStoreFlag)">
|
||||
<navigator redirect="true" :url="'/pagesub/index/store?store_id=' + (ProductInfo.store_id)" class="u-go-home1">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user