Files
rlz/coupon/custom-tab-bar/index.js
renjianbo 805ed0298b feat: 新增多角色系统(派单/分润/推广/区域)
- 后端:RlzDispatch/Profit/Promotion/Region 控制器、服务、Mapper、领域模型
- 权限:MethodSecurityConfig + PermissionInterceptor
- 管理后台:派单/分润/推广/区域 页面与 API
- Android 陪护端:派单/运营/退款 Fragment 及布局
- 小程序:推广员子包、派单/运营/退款/检索子包、自定义 tabBar
- 文档:多角色系统方案、角色权限矩阵、用户操作手册等

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-10-12 00:09:45 +08:00

40 lines
894 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var app = getApp();
Component({
data: {
selected: 0,
tabs: []
},
lifetimes: {
attached() {
this._lastRole = '';
this.updateTabs();
}
},
pageLifetimes: {
show() {
this.updateTabs();
}
},
methods: {
// 仅当角色实际变化时才更新 tabs,避免无意义重渲染
updateTabs() {
var userType = app.globalData.userType || 'C';
if (this._lastRole === userType) return;
this._lastRole = userType;
var tabs = app.globalData.ROLE_TABS[userType] || app.globalData.ROLE_TABS['C'];
this.setData({ tabs: tabs });
},
switchTab(e) {
var index = e.currentTarget.dataset.index;
var pages = ['/pages/index/index', '/pages/service/service', '/pages/order/order', '/pages/my/my'];
if (this.data.selected === index) return;
wx.switchTab({ url: pages[index] });
}
}
});