feat: 新增多角色系统(派单/分润/推广/区域)
- 后端:RlzDispatch/Profit/Promotion/Region 控制器、服务、Mapper、领域模型 - 权限:MethodSecurityConfig + PermissionInterceptor - 管理后台:派单/分润/推广/区域 页面与 API - Android 陪护端:派单/运营/退款 Fragment 及布局 - 小程序:推广员子包、派单/运营/退款/检索子包、自定义 tabBar - 文档:多角色系统方案、角色权限矩阵、用户操作手册等 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
39
coupon/custom-tab-bar/index.js
Normal file
39
coupon/custom-tab-bar/index.js
Normal file
@@ -0,0 +1,39 @@
|
||||
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] });
|
||||
}
|
||||
}
|
||||
});
|
||||
4
coupon/custom-tab-bar/index.json
Normal file
4
coupon/custom-tab-bar/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
15
coupon/custom-tab-bar/index.wxml
Normal file
15
coupon/custom-tab-bar/index.wxml
Normal file
@@ -0,0 +1,15 @@
|
||||
<view class="tab-bar">
|
||||
<view
|
||||
wx:for="{{tabs}}"
|
||||
wx:key="index"
|
||||
class="tab-item"
|
||||
data-index="{{index}}"
|
||||
bindtap="switchTab"
|
||||
>
|
||||
<image
|
||||
class="tab-icon"
|
||||
src="{{index === selected ? item.selIcon : item.icon}}"
|
||||
></image>
|
||||
<text class="tab-text {{index === selected ? 'active' : ''}}">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
35
coupon/custom-tab-bar/index.wxss
Normal file
35
coupon/custom-tab-bar/index.wxss
Normal file
@@ -0,0 +1,35 @@
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 98rpx;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-top: 1rpx solid #eee;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 20rpx;
|
||||
color: #C1C1C1;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.tab-text.active {
|
||||
color: #606060;
|
||||
}
|
||||
Reference in New Issue
Block a user