mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-04 23:09:48 +08:00
uniapp【修复】: 优化订单列表下单方式和修复个人中心修改资料选择生日
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
</uv-input>
|
</uv-input>
|
||||||
</view>
|
</view>
|
||||||
<view class="store-box" v-if="state.storeList.length > 0">
|
<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">
|
<view class="img-box">
|
||||||
<image class="img" :src="item.logoImage"></image>
|
<image class="img" :src="item.logoImage"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<view class="lab">距离:</view>
|
<view class="lab">距离:</view>
|
||||||
<view class="val">
|
<view class="val">
|
||||||
<text>{{ item.distanceStr }}</text>
|
<text>{{ item.distanceStr }}</text>
|
||||||
<uv-tags text="选择" @click="handleSelectStore(item)" size="mini"
|
<uv-tags text="选择" size="mini"
|
||||||
type="success"></uv-tags>
|
type="success"></uv-tags>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -99,8 +99,8 @@
|
|||||||
min-width: 40rpx;
|
min-width: 40rpx;
|
||||||
}
|
}
|
||||||
.no-store {
|
.no-store {
|
||||||
margin: auto;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
color: #aaaaaa;
|
||||||
}
|
}
|
||||||
.store-address-box {
|
.store-address-box {
|
||||||
.store-address {
|
.store-address {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
请添加收货地址
|
请添加收货地址
|
||||||
</view>
|
</view>
|
||||||
<view class="icon">
|
<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>
|
</view>
|
||||||
<view class="address-line"></view>
|
<view class="address-line"></view>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<!-- 门店自提 -->
|
<!-- 门店自提 -->
|
||||||
<view class="store-pickup-box" v-if="state.tabSelectType === OrderDistributionEnum.selfDelivery">
|
<view class="store-pickup-box" v-if="state.tabSelectType === OrderDistributionEnum.selfDelivery">
|
||||||
<view class="pickup-box" @click="handleRouteNavigateTo(`/pages/order/storeList/storeList`)">
|
<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-box">
|
||||||
<view class="store-address">
|
<view class="store-address">
|
||||||
<text class="name">{{ state.store?.storeName }}</text>
|
<text class="name">{{ state.store?.storeName }}</text>
|
||||||
@@ -50,11 +50,12 @@
|
|||||||
<view class="street">{{ state.store?.address }}</view>
|
<view class="street">{{ state.store?.address }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="icon">
|
<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>
|
</view>
|
||||||
<view class="store-box" v-else>
|
<view class="store-box" v-else>
|
||||||
<view class="no-store">请选择门店</view>
|
<view class="no-store">请选择门店</view>
|
||||||
|
<uv-icon name="arrow-right" color="#aaaaaa" size="18"></uv-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="address-line"></view>
|
<view class="address-line"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -260,13 +261,13 @@
|
|||||||
success : Function,
|
success : Function,
|
||||||
file : Function,
|
file : Function,
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TabList {
|
interface TabList {
|
||||||
name : string,
|
name : string,
|
||||||
type : OrderDistributionEnum;
|
type : OrderDistributionEnum;
|
||||||
show : boolean;
|
show : boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取项目配置 */
|
/** 获取项目配置 */
|
||||||
const shopConfigStore : ShopConfigStoreType = useShopConfigStore();
|
const shopConfigStore : ShopConfigStoreType = useShopConfigStore();
|
||||||
const state = reactive<{
|
const state = reactive<{
|
||||||
@@ -292,9 +293,9 @@
|
|||||||
}>({
|
}>({
|
||||||
orderType: PaymentTypeEnum.common,
|
orderType: PaymentTypeEnum.common,
|
||||||
tabList: [
|
tabList: [
|
||||||
{ name: '快递物流', type: OrderDistributionEnum.mailing, show: true, },
|
{ name: '快递物流', type: OrderDistributionEnum.mailing, show: false, },
|
||||||
{ name: '同城配送', type: OrderDistributionEnum.homeDelivery, show: true, },
|
{ name: '同城配送', type: OrderDistributionEnum.homeDelivery, show: false, },
|
||||||
{ name: '门店自提', type: OrderDistributionEnum.selfDelivery, show: true, }
|
{ name: '门店自提', type: OrderDistributionEnum.selfDelivery, show: false , }
|
||||||
],
|
],
|
||||||
tabSelectType: OrderDistributionEnum.mailing,
|
tabSelectType: OrderDistributionEnum.mailing,
|
||||||
userDefaultShip: {},
|
userDefaultShip: {},
|
||||||
@@ -319,7 +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 &&
|
||||||
@@ -465,14 +466,25 @@
|
|||||||
const orderDistribution : Response<any> = await queryOrderDistributionModel({
|
const orderDistribution : Response<any> = await queryOrderDistributionModel({
|
||||||
id: state.orderType,
|
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.tabList[2].show = isOpenSelfDelivery;
|
||||||
|
|
||||||
state.tabSelectType = (state.tabList.find((item:TabList)=> item.show)).type || OrderDistributionEnum.mailing ;
|
state.tabSelectType = (state.tabList.find((item : TabList) => item.show))?.type || OrderDistributionEnum.mailing;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取用户默认地址 */
|
/** 获取用户默认地址 */
|
||||||
@@ -543,8 +555,6 @@
|
|||||||
const defaultStore : Response<StoreListType> = await queryDefaultStore();
|
const defaultStore : Response<StoreListType> = await queryDefaultStore();
|
||||||
if (defaultStore.status && defaultStore.data) {
|
if (defaultStore.status && defaultStore.data) {
|
||||||
state.store = defaultStore.data;
|
state.store = defaultStore.data;
|
||||||
} else {
|
|
||||||
handleShowToast('商家未配置默认自提店铺!');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
nickname : string;
|
nickname : string;
|
||||||
radiolist : Array<{ [key : string] : any }>;
|
radiolist : Array<{ [key : string] : any }>;
|
||||||
sex : string;
|
sex : string;
|
||||||
birthdayTemporary : string;
|
birthdayTemporary : number;
|
||||||
birthday : string;
|
birthday : string;
|
||||||
avatar : string;
|
avatar : string;
|
||||||
userInfo : UserInfoType,
|
userInfo : UserInfoType,
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
avatar: "",
|
avatar: "",
|
||||||
nickname: "",
|
nickname: "",
|
||||||
sex: "",
|
sex: "",
|
||||||
birthdayTemporary: "",
|
birthdayTemporary: null,
|
||||||
birthday: "",
|
birthday: "",
|
||||||
submitStatus: true,
|
submitStatus: true,
|
||||||
radiolist: [{
|
radiolist: [{
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
state.userInfo = userInfo?.data;
|
state.userInfo = userInfo?.data;
|
||||||
if (userInfo?.data?.birthday) {
|
if (userInfo?.data?.birthday) {
|
||||||
state.percentage += 25;
|
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');
|
state.birthday = timeFormat(userInfo?.data?.birthday, 'yyyy-mm-dd');
|
||||||
}
|
}
|
||||||
if (userInfo?.data?.nickName) {
|
if (userInfo?.data?.nickName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user