切换角色

This commit is contained in:
老叶
2023-05-19 15:44:23 +08:00
parent 251e2eafdb
commit ad6c7389c8
4 changed files with 67 additions and 4 deletions
+31
View File
@@ -7,6 +7,7 @@ Page({
name:'',
mobile:'',
isShowProfile:true,//是否显示授权用户信息按钮
isShowSwitchingRoles:false,
},
onLoad: function (options) {
@@ -136,4 +137,34 @@ Page({
}
},
//切换角色
putAppResetgroupid(e){
let params = {};
params['group_id'] = e.currentTarget.dataset.key;
_.apiQuery.putAppResetgroupid(params).then(res=>{
_.apiQuery.getUserInfo().then(res => {
if(res.biz_type==4){
wx.reLaunch({
url: '/pages/allot/index',
})
}else if(res.group_id==4){
wx.reLaunch({
url: '/pages/channel/index',
})
}else{
wx.reLaunch({
url: '/pages/index/index',
})
}
});
})
},
//显示切换角色
switchingRoles(){
this.setData({
isShowSwitchingRoles:!this.data.isShowSwitchingRoles,
})
},
})
+26 -3
View File
@@ -13,8 +13,14 @@
</view>
<view class="mt10 font-22 color-666">{{userInfo.biz_name}}</view>
</view>
<view class="absolute right-0 box-middle bg-f6 pt10 pb10 pl20 pr20 font-22 color-666 ulib-rl750" bindtap="logout">
<i class="iconfont icon-tuichu mr10"></i>退出
<view class="absolute right-0 box-middle pb40" >
<view class="bg-f6 mb25 pt10 pb10 pl20 pr15 font-22 color-666 ulib-rl750" bindtap="switchingRoles" wx:if="{{userInfo.group_name_arr.length>1}}">
<i class="iconfont icon-cheliangfenpei mr10"></i>切换角色
</view>
<view class="bg-f6 pt10 pb10 pl20 pr20 font-22 color-666 ulib-rl750" bindtap="logout">
<i class="iconfont icon-tuichu mr10"></i>退出
</view>
</view>
</view>
</view>
@@ -43,4 +49,21 @@
<!-- <lcb-footer></lcb-footer> -->
<lcb-backChannel isShow='{{source=="shop"?true:false}}'></lcb-backChannel>
<lcb-channelTabBarNav currentIndex='2' wx:if="{{source=='channel'}}"></lcb-channelTabBarNav>
<lcb-shopTabBarNav currentIndex='3' wx:if="{{source=='shop'}}"></lcb-shopTabBarNav>
<lcb-shopTabBarNav currentIndex='3' wx:if="{{source=='shop'}}"></lcb-shopTabBarNav>
<lcb-msg isShow="{{isShowSwitchingRoles}}" isHasClose="{{true}}">
<view slot="content">
<view class="pt50 font-28 text-center">
当前角色:
<!-- <block wx:for='{{userInfo.group_name_arr}}' wx:key='index' wx:if="{{item.group_id == userInfo.group_id}}">
{{item.geoup_name}}
</block> -->
{{userInfo.group_name}}
</view>
<view class="pb40 mt30 text-center font-32 color-666">
<button bindtap="putAppResetgroupid" data-key="{{item.group_id}}" class="inline-block wp80 btn-36afa2 pt5 pb5 font-28 color-fff ulib-r750" wx:for='{{userInfo.group_name_arr}}' wx:key='index' wx:if="{{item.group_id != userInfo.group_id}}">
{{item.geoup_name}}
</button>
</view>
</view>
</lcb-msg>