|
|
|
@@ -33,7 +33,7 @@
|
|
|
|
|
请添加收货地址
|
|
|
|
|
</view>
|
|
|
|
|
<view class="icon">
|
|
|
|
|
<uv-icon name="arrow-right" color="#2C2C2B" size="20"></uv-icon>
|
|
|
|
|
<uv-icon name="arrow-right" color="#aaaaaa" size="20"></uv-icon>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="address-line"></view>
|
|
|
|
@@ -41,7 +41,7 @@
|
|
|
|
|
<!-- 门店自提 -->
|
|
|
|
|
<view class="store-pickup-box" v-if="state.tabSelectType === OrderDistributionEnum.selfDelivery">
|
|
|
|
|
<view class="pickup-box" @click="handleRouteNavigateTo(`/pages/order/storeList/storeList`)">
|
|
|
|
|
<view class="store-box" v-if="Object.keys(state.store).length > 0">
|
|
|
|
|
<view class="store-box" v-if=" state.store && Object.keys(state.store).length > 0">
|
|
|
|
|
<view class="store-address-box">
|
|
|
|
|
<view class="store-address">
|
|
|
|
|
<text class="name">{{ state.store?.storeName }}</text>
|
|
|
|
@@ -50,11 +50,12 @@
|
|
|
|
|
<view class="street">{{ state.store?.address }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="icon">
|
|
|
|
|
<uv-icon name="arrow-right" color="#2C2C2B" size="20"></uv-icon>
|
|
|
|
|
<uv-icon name="arrow-right" color="#aaaaaa" size="20"></uv-icon>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="store-box" v-else>
|
|
|
|
|
<view class="no-store">请选择门店</view>
|
|
|
|
|
<uv-icon name="arrow-right" color="#aaaaaa" size="18"></uv-icon>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="address-line"></view>
|
|
|
|
|
</view>
|
|
|
|
@@ -260,19 +261,19 @@
|
|
|
|
|
success : Function,
|
|
|
|
|
file : Function,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface TabList {
|
|
|
|
|
name : string,
|
|
|
|
|
type : OrderDistributionEnum;
|
|
|
|
|
show : boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 获取项目配置 */
|
|
|
|
|
const shopConfigStore : ShopConfigStoreType = useShopConfigStore();
|
|
|
|
|
const state = reactive<{
|
|
|
|
|
orderType : PaymentTypeEnum; // 订单类型
|
|
|
|
|
tabList : Array<TabList>; // 送达方式
|
|
|
|
|
tabSelectType : OrderDistributionEnum; // 送达方式类型
|
|
|
|
|
tabSelectType ?: OrderDistributionEnum; // 送达方式类型
|
|
|
|
|
userDefaultShip : AddressType; // 默认地址数据
|
|
|
|
|
leaveMsg : string; // 卖家留言
|
|
|
|
|
cartData : any; // 商品购物车数据
|
|
|
|
@@ -292,11 +293,11 @@
|
|
|
|
|
}>({
|
|
|
|
|
orderType: PaymentTypeEnum.common,
|
|
|
|
|
tabList: [
|
|
|
|
|
{ name: '快递物流', type: OrderDistributionEnum.mailing, show: true, },
|
|
|
|
|
{ name: '同城配送', type: OrderDistributionEnum.homeDelivery, show: true, },
|
|
|
|
|
{ name: '门店自提', type: OrderDistributionEnum.selfDelivery, show: true, }
|
|
|
|
|
{ name: '快递物流', type: OrderDistributionEnum.mailing, show: false, },
|
|
|
|
|
{ name: '同城配送', type: OrderDistributionEnum.homeDelivery, show: false, },
|
|
|
|
|
{ name: '门店自提', type: OrderDistributionEnum.selfDelivery, show: false, }
|
|
|
|
|
],
|
|
|
|
|
tabSelectType: OrderDistributionEnum.mailing,
|
|
|
|
|
tabSelectType: null,
|
|
|
|
|
userDefaultShip: {},
|
|
|
|
|
leaveMsg: "",
|
|
|
|
|
cartData: {},
|
|
|
|
@@ -319,7 +320,7 @@
|
|
|
|
|
const loadingPage = ref(true);
|
|
|
|
|
const handleSubmit = useLoadingFn(onSubmit, loading);
|
|
|
|
|
const handleGetOrderDetail = useLoadingFn(getOrderDetail, loadingPage);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 是否显示积分兑换价合计 */
|
|
|
|
|
const isShowPointRedemptionPrice = computed(() => {
|
|
|
|
|
return shopConfigStore.config.pointSwitch == OpenPointEnum.yes &&
|
|
|
|
@@ -465,14 +466,25 @@
|
|
|
|
|
const orderDistribution : Response<any> = await queryOrderDistributionModel({
|
|
|
|
|
id: state.orderType,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!orderDistribution?.data || Object.keys(orderDistribution?.data).length === 0) {
|
|
|
|
|
handleShowToast('暂无下单配送方式');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const { isOpenMailing, isOpenHomeDelivery, isOpenSelfDelivery } = orderDistribution?.data;
|
|
|
|
|
if (!isOpenMailing && !isOpenHomeDelivery && !isOpenSelfDelivery) {
|
|
|
|
|
handleShowToast('暂无下单配送方式');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 物流快递 */
|
|
|
|
|
state.tabList[0].show = orderDistribution?.data?.isOpenMailing;
|
|
|
|
|
state.tabList[0].show = isOpenMailing;
|
|
|
|
|
/** 同城配送 */
|
|
|
|
|
state.tabList[1].show = orderDistribution?.data?.isOpenHomeDelivery;
|
|
|
|
|
state.tabList[1].show = isOpenHomeDelivery;
|
|
|
|
|
/** 门店自提 */
|
|
|
|
|
state.tabList[2].show = orderDistribution?.data?.isOpenSelfDelivery;
|
|
|
|
|
|
|
|
|
|
state.tabSelectType = (state.tabList.find((item:TabList)=> item.show)).type || OrderDistributionEnum.mailing ;
|
|
|
|
|
state.tabList[2].show = isOpenSelfDelivery;
|
|
|
|
|
|
|
|
|
|
state.tabSelectType = (state.tabList.find((item : TabList) => item.show))?.type || OrderDistributionEnum.mailing;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 获取用户默认地址 */
|
|
|
|
@@ -543,8 +555,6 @@
|
|
|
|
|
const defaultStore : Response<StoreListType> = await queryDefaultStore();
|
|
|
|
|
if (defaultStore.status && defaultStore.data) {
|
|
|
|
|
state.store = defaultStore.data;
|
|
|
|
|
} else {
|
|
|
|
|
handleShowToast('商家未配置默认自提店铺!');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -576,6 +586,10 @@
|
|
|
|
|
/** 立即购买 */
|
|
|
|
|
async function onSubmit() {
|
|
|
|
|
let delivery : any = {};
|
|
|
|
|
if (!state.tabSelectType) {
|
|
|
|
|
handleShowToast('请选择下单配送方式');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/** 如果是快递物流 / 同城送货 */
|
|
|
|
|
if (state.tabSelectType === OrderDistributionEnum.mailing || state.tabSelectType == OrderDistributionEnum.homeDelivery) {
|
|
|
|
|
if (!state.userDefaultShip.id || !state.userDefaultShip.areaId) {
|
|
|
|
|