feat: 多网点展示
This commit is contained in:
@@ -13,7 +13,18 @@
|
|||||||
const userStore = sheep.$store('user');
|
const userStore = sheep.$store('user');
|
||||||
|
|
||||||
const label = computed(() => (appStore.bizMode === 'merchant' ? '商户' : '用户'));
|
const label = computed(() => (appStore.bizMode === 'merchant' ? '商户' : '用户'));
|
||||||
const showSwitch = computed(() => Number(userStore?.userInfo?.storeId || 0) > 0);
|
const hasStoreAccess = (value) => {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return value.some((item) => String(item ?? '').trim() !== '');
|
||||||
|
}
|
||||||
|
return String(value ?? '')
|
||||||
|
.split(',')
|
||||||
|
.some((item) => item.trim() !== '');
|
||||||
|
};
|
||||||
|
const showSwitch = computed(() => {
|
||||||
|
const info = userStore?.userInfo || {};
|
||||||
|
return hasStoreAccess(info.storeIds) || hasStoreAccess(info.storeId);
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!userStore?.isLogin) return;
|
if (!userStore?.isLogin) return;
|
||||||
|
|||||||
+11
-2
@@ -265,9 +265,18 @@
|
|||||||
state.orderInfo = res.data;
|
state.orderInfo = res.data;
|
||||||
handleOrderButtons(state.orderInfo);
|
handleOrderButtons(state.orderInfo);
|
||||||
// 配送方式:门店自提
|
// 配送方式:门店自提
|
||||||
if (res.data.pickUpStoreId) {
|
const isPickUp = Number(res.data?.deliveryType) === 2;
|
||||||
const { data } = await StoreApi.getStoreById(res.data.pickUpStoreId);
|
const pickUpStoreId = Number(
|
||||||
|
res.data?.pickUpStoreId ||
|
||||||
|
res.data?.pickUpStore?.id ||
|
||||||
|
res.data?.pickUpStore?.storeId ||
|
||||||
|
res.data?.storeId,
|
||||||
|
);
|
||||||
|
if (isPickUp && pickUpStoreId > 0) {
|
||||||
|
const { data } = await StoreApi.getStoreById(pickUpStoreId);
|
||||||
systemStore.value = data || {};
|
systemStore.value = data || {};
|
||||||
|
} else {
|
||||||
|
systemStore.value = {};
|
||||||
}
|
}
|
||||||
if (state.orderInfo.deliveryType === 2 && state.orderInfo.payStatus) {
|
if (state.orderInfo.deliveryType === 2 && state.orderInfo.payStatus) {
|
||||||
pickUpVerifyRef.value && pickUpVerifyRef.value.markCode(res.data.pickUpVerifyCode);
|
pickUpVerifyRef.value && pickUpVerifyRef.value.markCode(res.data.pickUpVerifyCode);
|
||||||
|
|||||||
Reference in New Issue
Block a user