- 新增 tabbar 配置,改为独立页面路由 - 替换所有 reLaunch 为 switchTab 跳转 tab 页面 - 新增未读消息角标同步逻辑 - 移除旧的多 tab 组件化实现 - 新增 tabbar 图标资源文件
58 行
1.2 KiB
Vue
58 行
1.2 KiB
Vue
<template>
|
|
<view class="master-hall-page">
|
|
<MasterHallView ref="hallRef" />
|
|
<YjyfPrivacyPopup />
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue';
|
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
|
import MasterHallView from '@/components/master/MasterHallView.vue';
|
|
import YjyfPrivacyPopup from '@/components/YjyfPrivacyPopup.vue';
|
|
import { useShare } from '@/utils/share.js';
|
|
|
|
const hallRef = ref(null);
|
|
let initialShown = false;
|
|
|
|
const LEGACY_TAB_ROUTES = {
|
|
1: '/pages/master/orders',
|
|
2: '/pages/message/message',
|
|
3: '/pages/master/workbench'
|
|
};
|
|
|
|
useShare(() => ({
|
|
title: '优匠优服 · 师傅接单大厅,海量同城好单实时派发',
|
|
path: '/pages/master/hall',
|
|
query: ''
|
|
}));
|
|
|
|
onLoad((query) => {
|
|
if (query && query.tab !== undefined) {
|
|
const targetUrl = LEGACY_TAB_ROUTES[parseInt(query.tab)];
|
|
if (targetUrl) {
|
|
uni.switchTab({ url: targetUrl });
|
|
}
|
|
}
|
|
});
|
|
|
|
onShow(() => {
|
|
if (!initialShown) {
|
|
initialShown = true;
|
|
return;
|
|
}
|
|
if (hallRef.value?.load) {
|
|
hallRef.value.load();
|
|
}
|
|
uni.$emit('yjyf:refreshUnread');
|
|
});
|
|
</script>
|
|
|
|
<style scoped>
|
|
.master-hall-page {
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
background: #F5F6F8;
|
|
}
|
|
</style>
|