style: 订单详情nav展示问题
This commit is contained in:
@@ -51,6 +51,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||||
import * as IndexApi from '@/sheep/api/index/index'
|
import * as IndexApi from '@/sheep/api/index/index'
|
||||||
|
import sheep from '@/sheep'
|
||||||
|
|
||||||
const USE_STATIC_START_PAGE = false
|
const USE_STATIC_START_PAGE = false
|
||||||
|
|
||||||
@@ -73,6 +74,8 @@ let nativeSkipViewId = ''
|
|||||||
let plusReadyListenerBound = false
|
let plusReadyListenerBound = false
|
||||||
let lastVideoTime = 0
|
let lastVideoTime = 0
|
||||||
|
|
||||||
|
const appStore = sheep.$store('app')
|
||||||
|
|
||||||
const normalizeAppFileUrl = (path) => {
|
const normalizeAppFileUrl = (path) => {
|
||||||
const p = String(path || '')
|
const p = String(path || '')
|
||||||
if (!p) return ''
|
if (!p) return ''
|
||||||
@@ -387,9 +390,8 @@ onUnmounted(() => {
|
|||||||
function toHome() {
|
function toHome() {
|
||||||
clearTimers()
|
clearTimers()
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
uni.reLaunch({
|
const url = appStore?.bizMode === 'merchant' ? '/pages/merchant/pickupList' : '/pages/index/index'
|
||||||
url: '/pages/index/index',
|
uni.reLaunch({ url })
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMediaClick() {
|
function onMediaClick() {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="detail-goods"
|
class="detail-goods"
|
||||||
:style="[{ marginTop: state.orderInfo.receiverAreaId > 0 ? '0' : '-40rpx' }]"
|
:style="[{ marginTop: state.orderInfo.receiverAreaId > 0 ? '0' : '0' }]"
|
||||||
>
|
>
|
||||||
<card_order
|
<card_order
|
||||||
class="order-goods"
|
class="order-goods"
|
||||||
|
|||||||
@@ -227,6 +227,33 @@
|
|||||||
return p.startsWith('/') ? p : `/${p}`;
|
return p.startsWith('/') ? p : `/${p}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const USER_ROOT_PAGES = [
|
||||||
|
'/pages/index/index',
|
||||||
|
'/pages/index/aiStore',
|
||||||
|
'/pages/home/seed',
|
||||||
|
'/pages/cart/cart',
|
||||||
|
'/pages/index/user',
|
||||||
|
];
|
||||||
|
const MERCHANT_ROOT_PAGES = [
|
||||||
|
'/pages/merchant/pickupList',
|
||||||
|
'/pages/merchant/scanVerify',
|
||||||
|
'/pages/merchant/storeManage',
|
||||||
|
];
|
||||||
|
|
||||||
|
const enforceBizModeRoute = () => {
|
||||||
|
const pages = getCurrentPages?.() || [];
|
||||||
|
const current = pages[pages.length - 1];
|
||||||
|
const currentPath = normalizePath(current?.route || '');
|
||||||
|
if (!currentPath) return;
|
||||||
|
if (isMerchantMode.value && USER_ROOT_PAGES.includes(currentPath)) {
|
||||||
|
uni.reLaunch({ url: '/pages/merchant/pickupList' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!isMerchantMode.value && MERCHANT_ROOT_PAGES.includes(currentPath)) {
|
||||||
|
uni.reLaunch({ url: '/pages/index/index' });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const updateTabbarPath = () => {
|
const updateTabbarPath = () => {
|
||||||
if (typeof props.tabbar === 'string' && props.tabbar) {
|
if (typeof props.tabbar === 'string' && props.tabbar) {
|
||||||
tabbarPath.value = normalizePath(props.tabbar);
|
tabbarPath.value = normalizePath(props.tabbar);
|
||||||
@@ -237,7 +264,10 @@
|
|||||||
tabbarPath.value = normalizePath(current?.route || '');
|
tabbarPath.value = normalizePath(current?.route || '');
|
||||||
};
|
};
|
||||||
|
|
||||||
onShow(() => updateTabbarPath());
|
onShow(() => {
|
||||||
|
enforceBizModeRoute();
|
||||||
|
updateTabbarPath();
|
||||||
|
});
|
||||||
watch(() => props.tabbar, () => updateTabbarPath(), { immediate: true });
|
watch(() => props.tabbar, () => updateTabbarPath(), { immediate: true });
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user