岗位发布开发

This commit is contained in:
冯辉
2025-10-23 17:16:16 +08:00
parent 20f2038f8c
commit b72b7dd7d6
25 changed files with 3402 additions and 327 deletions

45
utils/tabbarManager.js Normal file
View File

@@ -0,0 +1,45 @@
// 自定义tabbar管理器
export const tabbarManager = {
// 显示tabbar
showTabBar() {
if (typeof getTabBar === 'function' && getTabBar()) {
getTabBar().setData({
selected: 0
});
}
},
// 更新tabbar选中状态
updateSelected(index) {
if (typeof getTabBar === 'function' && getTabBar()) {
getTabBar().setData({
selected: index
});
}
},
// 根据用户类型更新tabbar
updateTabBarByUserType() {
if (typeof getTabBar === 'function' && getTabBar()) {
const userInfo = uni.getStorageSync('userInfo') || {};
const userType = userInfo.isCompanyUser !== undefined ? userInfo.isCompanyUser : 1;
getTabBar().generateTabbarList(userType);
}
},
// 初始化tabbar
initTabBar() {
// 延迟初始化自定义tabbar
setTimeout(() => {
this.updateTabBarByUserType();
}, 200);
},
// 强制刷新tabbar登录后调用
refreshTabBar() {
// 延迟刷新,确保用户信息已更新
setTimeout(() => {
this.updateTabBarByUserType();
}, 100);
}
};