mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:03:27 +08:00
uniapp【修复】: 优化订单列表下单方式和修复个人中心修改资料选择生日
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
</uv-input>
|
||||
</view>
|
||||
<view class="store-box" v-if="state.storeList.length > 0">
|
||||
<view class="item-box" v-for="item in state.storeList" :key="item.id">
|
||||
<view class="item-box" v-for="item in state.storeList" :key="item.id" @click="handleSelectStore(item)">
|
||||
<view class="img-box">
|
||||
<image class="img" :src="item.logoImage"></image>
|
||||
</view>
|
||||
@@ -32,7 +32,7 @@
|
||||
<view class="lab">距离:</view>
|
||||
<view class="val">
|
||||
<text>{{ item.distanceStr }}</text>
|
||||
<uv-tags text="选择" @click="handleSelectStore(item)" size="mini"
|
||||
<uv-tags text="选择" size="mini"
|
||||
type="success"></uv-tags>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -99,8 +99,8 @@
|
||||
min-width: 40rpx;
|
||||
}
|
||||
.no-store {
|
||||
margin: auto;
|
||||
font-size: 28rpx;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
.store-address-box {
|
||||
.store-address {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
nickname : string;
|
||||
radiolist : Array<{ [key : string] : any }>;
|
||||
sex : string;
|
||||
birthdayTemporary : string;
|
||||
birthdayTemporary : number;
|
||||
birthday : string;
|
||||
avatar : string;
|
||||
userInfo : UserInfoType,
|
||||
@@ -86,7 +86,7 @@
|
||||
avatar: "",
|
||||
nickname: "",
|
||||
sex: "",
|
||||
birthdayTemporary: "",
|
||||
birthdayTemporary: null,
|
||||
birthday: "",
|
||||
submitStatus: true,
|
||||
radiolist: [{
|
||||
@@ -152,7 +152,7 @@
|
||||
state.userInfo = userInfo?.data;
|
||||
if (userInfo?.data?.birthday) {
|
||||
state.percentage += 25;
|
||||
state.birthdayTemporary = String(new Date(userInfo?.data?.birthday).getTime());
|
||||
state.birthdayTemporary =new Date(userInfo.data.birthday).getTime();
|
||||
state.birthday = timeFormat(userInfo?.data?.birthday, 'yyyy-mm-dd');
|
||||
}
|
||||
if (userInfo?.data?.nickName) {
|
||||
|
||||
Reference in New Issue
Block a user