uniapp【修复】: 关于下单模式非快递物流的情况

This commit is contained in:
15093570141
2024-11-08 11:43:12 +08:00
parent e725950fe0
commit 1f332bc06f

View File

@@ -262,15 +262,17 @@
file : Function, file : Function,
} }
interface TabList {
name : string,
type : OrderDistributionEnum;
show : boolean;
}
/** 获取项目配置 */ /** 获取项目配置 */
const shopConfigStore : ShopConfigStoreType = useShopConfigStore(); const shopConfigStore : ShopConfigStoreType = useShopConfigStore();
const state = reactive<{ const state = reactive<{
orderType : PaymentTypeEnum; // 订单类型 orderType : PaymentTypeEnum; // 订单类型
tabList : Array<{ // 送达方式 tabList : Array<TabList>; // 送达方式
name : string,
type : number;
show : boolean;
}>;
tabSelectType : OrderDistributionEnum; // 送达方式类型 tabSelectType : OrderDistributionEnum; // 送达方式类型
userDefaultShip : AddressType; // 默认地址数据 userDefaultShip : AddressType; // 默认地址数据
leaveMsg : string; // 卖家留言 leaveMsg : string; // 卖家留言
@@ -291,9 +293,9 @@
}>({ }>({
orderType: PaymentTypeEnum.common, orderType: PaymentTypeEnum.common,
tabList: [ tabList: [
{ name: '快递物流', type: 1, show: true, }, { name: '快递物流', type: OrderDistributionEnum.mailing, show: true, },
{ name: '同城配送', type: 2, show: true, }, { name: '同城配送', type: OrderDistributionEnum.homeDelivery, show: true, },
{ name: '门店自提', type: 3, show: true, } { name: '门店自提', type: OrderDistributionEnum.selfDelivery, show: true, }
], ],
tabSelectType: OrderDistributionEnum.mailing, tabSelectType: OrderDistributionEnum.mailing,
userDefaultShip: {}, userDefaultShip: {},
@@ -318,6 +320,7 @@
const loadingPage = ref(true); const loadingPage = ref(true);
const handleSubmit = useLoadingFn(onSubmit, loading); const handleSubmit = useLoadingFn(onSubmit, loading);
const handleGetOrderDetail = useLoadingFn(getOrderDetail, loadingPage); const handleGetOrderDetail = useLoadingFn(getOrderDetail, loadingPage);
/** 是否显示积分兑换价合计 */ /** 是否显示积分兑换价合计 */
const isShowPointRedemptionPrice = computed(() => { const isShowPointRedemptionPrice = computed(() => {
return shopConfigStore.config.pointSwitch == OpenPointEnum.yes && return shopConfigStore.config.pointSwitch == OpenPointEnum.yes &&
@@ -469,6 +472,8 @@
state.tabList[1].show = orderDistribution?.data?.isOpenHomeDelivery; state.tabList[1].show = orderDistribution?.data?.isOpenHomeDelivery;
/** 门店自提 */ /** 门店自提 */
state.tabList[2].show = orderDistribution?.data?.isOpenSelfDelivery; state.tabList[2].show = orderDistribution?.data?.isOpenSelfDelivery;
state.tabSelectType = (state.tabList.find((item:TabList)=> item.show)).type || OrderDistributionEnum.mailing ;
} }
/** 获取用户默认地址 */ /** 获取用户默认地址 */