64 lines
1.3 KiB
JavaScript
64 lines
1.3 KiB
JavaScript
import _ from '../../../commons/js/commons'
|
|
const app = getApp()
|
|
Page({
|
|
data: {
|
|
imgUrl:_.config.imgUrl,
|
|
list:[],
|
|
isShowProfile:true,//是否显示授权用户信息按钮
|
|
},
|
|
onLoad: function (options) {
|
|
|
|
for (let key in options) {
|
|
this.setData({
|
|
[key]: options[key]
|
|
})
|
|
}
|
|
|
|
this.getUserInfo()
|
|
|
|
//消息通讯 是否显示授权用户信息按钮
|
|
_.eventBus.on("isShowProfile", this, function(res){
|
|
this.setData({
|
|
isShowProfile:res,
|
|
})
|
|
})
|
|
},
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
//生命周期函数--监听页面卸载
|
|
onUnload: function () {
|
|
//卸载消息通讯 是否显示授权用户信息
|
|
_.eventBus.remove('isShowProfile',this);
|
|
},
|
|
|
|
//获取用户信息
|
|
getUserInfo(){
|
|
_.apiQuery.getUserInfo().then(res => {
|
|
this.setData({
|
|
userInfo: res
|
|
})
|
|
if(this.data.source=='shop'&&(res.group_id == 2 || res.group_id == 3 || res.group_id == 4)){
|
|
let list=[
|
|
{
|
|
icon:'icon-renyuanguanli',
|
|
title:'人员管理',
|
|
url:'/pages/mine/install/staff/index',
|
|
}
|
|
]
|
|
this.setData({
|
|
list:list
|
|
})
|
|
}
|
|
});
|
|
},
|
|
|
|
//推送链接
|
|
pushLink(e) {
|
|
if(e.currentTarget.dataset.url){
|
|
_.$router.openUrlScheme(e.currentTarget.dataset.url)
|
|
}
|
|
},
|
|
|
|
}) |