修正用户名显示逻辑进入服务列表页面自动刷新
This commit is contained in:
@@ -34,13 +34,6 @@ export default {
|
||||
roles: [],
|
||||
currentPath: '',
|
||||
allTabs: [
|
||||
{
|
||||
key: 'furniture_reception',
|
||||
text: '接待',
|
||||
pagePath: '/pages/furniture_reception/furniture_reception',
|
||||
iconPath: '/static/tabbar/reception.png',
|
||||
selectedIconPath: '/static/tabbar/reception_active.png',
|
||||
},
|
||||
{
|
||||
key: 'furniture_customer',
|
||||
text: '客户',
|
||||
@@ -77,6 +70,13 @@ export default {
|
||||
iconPath: '/static/tabbar/me.png',
|
||||
selectedIconPath: '/static/tabbar/me_active.png',
|
||||
},
|
||||
{
|
||||
key: 'workbench',
|
||||
text: '工作台',
|
||||
pagePath: '/pages/workbench/workbench',
|
||||
iconPath: '/static/tabbar/team.png',
|
||||
selectedIconPath: '/static/tabbar/team_active.png',
|
||||
},
|
||||
{
|
||||
key: 'ai_analysis',
|
||||
text: 'AI分析',
|
||||
@@ -96,36 +96,29 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
furnitureTabs() {
|
||||
// 强制返回所有家具角色的tab,使用与pages.json相同的路径格式
|
||||
// 与 pages.json 的 tabBar 一致:AI分析、工作台、我的
|
||||
return [
|
||||
{
|
||||
key: 'furniture_reception',
|
||||
text: '接待',
|
||||
pagePath: 'pages/furniture_reception/furniture_reception', // 移除开头的/
|
||||
iconPath: '/static/tabbar/reception.png',
|
||||
selectedIconPath: '/static/tabbar/reception_active.png',
|
||||
},
|
||||
{
|
||||
key: 'furniture_customer',
|
||||
text: '客户',
|
||||
pagePath: 'pages-subpackage/furniture_customer/furniture_customer', // 移除开头的/
|
||||
iconPath: '/static/tabbar/customer.png',
|
||||
selectedIconPath: '/static/tabbar/customer_active.png',
|
||||
},
|
||||
{
|
||||
key: 'ai_analysis',
|
||||
text: 'AI分析',
|
||||
pagePath: 'pages/ai_analysis/ai_analysis',
|
||||
pagePath: '/pages/ai_analysis/ai_analysis',
|
||||
iconPath: '/static/tabbar/ai_analysis.png',
|
||||
selectedIconPath: '/static/tabbar/ai_analysis_active.png',
|
||||
},
|
||||
{
|
||||
key: 'workbench',
|
||||
text: '工作台',
|
||||
pagePath: '/pages/workbench/workbench',
|
||||
iconPath: '/static/tabbar/team.png',
|
||||
selectedIconPath: '/static/tabbar/team_active.png',
|
||||
},
|
||||
{
|
||||
key: 'ucenter',
|
||||
text: '我的',
|
||||
pagePath: 'pages/ucenter/ucenter', // 移除开头的/
|
||||
pagePath: '/pages/ucenter/ucenter',
|
||||
iconPath: '/static/tabbar/me.png',
|
||||
selectedIconPath: '/static/tabbar/me_active.png',
|
||||
}
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
@@ -134,7 +127,7 @@ export default {
|
||||
console.log('VISIBLE TABS CALC - THIS MUST SHOW IN H5');
|
||||
|
||||
// 简化逻辑:直接返回家具相关的tabs,跳过权限检查
|
||||
const furnitureKeys = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter'];
|
||||
const furnitureKeys = ['ai_analysis', 'workbench', 'ucenter'];
|
||||
const result = furnitureKeys.map(key => {
|
||||
return this.allTabs.find(tab => tab.key === key);
|
||||
}).filter(Boolean);
|
||||
@@ -289,15 +282,15 @@ export default {
|
||||
console.log('GET ALLOWED KEYS - 简化版本,总是返回家具相关tabs');
|
||||
|
||||
// 简化逻辑:总是返回家具相关的tabs
|
||||
const furnitureTabs = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter'];
|
||||
const furnitureTabs = ['ai_analysis', 'workbench', 'ucenter'];
|
||||
console.log('[TabBar][allowed] 简化逻辑 ->', furnitureTabs);
|
||||
return furnitureTabs;
|
||||
},
|
||||
// #ifdef H5
|
||||
toggleNativeTabs() {
|
||||
// H5 平台自定义 tabbar 不生效,直接根据角色显隐原生 tabbar 项
|
||||
// 当前位置顺序(根据 pages.json 中的 tabBar.list 顺序):接待、客户、AI分析、我的、团队、总结和统计…
|
||||
const ORDER = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter', 'reception', 'customer', 'team', 'meeting_summary', 'common_begin_reception'];
|
||||
// 当前位置顺序(与 pages.json 的 tabBar.list 一致):AI分析、工作台、我的…
|
||||
const ORDER = ['ai_analysis', 'workbench', 'ucenter', 'reception', 'customer', 'team', 'meeting_summary', 'common_begin_reception'];
|
||||
const allowed = this.getAllowedKeys();
|
||||
// 限制重试次数,防止渲染时机未就绪
|
||||
this._h5TabRetries = (this._h5TabRetries || 0) + 1;
|
||||
@@ -326,10 +319,9 @@ export default {
|
||||
isInTabBar(pagePath) {
|
||||
// 检查页面路径是否在原生tabBar配置中
|
||||
const tabBarList = [
|
||||
'pages/furniture_reception/furniture_reception',
|
||||
'pages-subpackage/furniture_customer/furniture_customer',
|
||||
'pages/ai_analysis/ai_analysis',
|
||||
'pages/ucenter/ucenter'
|
||||
'pages/workbench/workbench',
|
||||
'pages/ucenter/ucenter',
|
||||
];
|
||||
const normalizedPath = pagePath.startsWith('/') ? pagePath.substring(1) : pagePath;
|
||||
const result = tabBarList.includes(normalizedPath);
|
||||
@@ -367,9 +359,8 @@ export default {
|
||||
const allElements = document.querySelectorAll('*');
|
||||
const tabElements = Array.from(allElements).filter(el =>
|
||||
el.textContent && (
|
||||
el.textContent.includes('接待') ||
|
||||
el.textContent.includes('客户') ||
|
||||
el.textContent.includes('AI分析') ||
|
||||
el.textContent.includes('工作台') ||
|
||||
el.textContent.includes('我的')
|
||||
)
|
||||
);
|
||||
@@ -406,9 +397,9 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
// 按文本内容排序:接待、客户、AI分析、我的
|
||||
// 按文本内容排序:AI分析、工作台、我的
|
||||
const sortedElements = tabElements.sort((a, b) => {
|
||||
const order = ['接待', '客户', 'AI分析', '我的'];
|
||||
const order = ['AI分析', '工作台', '我的'];
|
||||
const aIndex = order.findIndex(text => a.textContent.includes(text));
|
||||
const bIndex = order.findIndex(text => b.textContent.includes(text));
|
||||
return aIndex - bIndex;
|
||||
@@ -418,7 +409,7 @@ export default {
|
||||
|
||||
// 处理每个元素
|
||||
sortedElements.forEach((element, index) => {
|
||||
const keyMap = ['furniture_reception', 'furniture_customer', 'ai_analysis', 'ucenter'];
|
||||
const keyMap = ['ai_analysis', 'workbench', 'ucenter'];
|
||||
const key = keyMap[index];
|
||||
const shouldShow = allowed.includes(key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user