139 lines
3.1 KiB
JavaScript
139 lines
3.1 KiB
JavaScript
import _ from '../../commons/js/commons'
|
|
const app = getApp()
|
|
Page({
|
|
data: {
|
|
imgUrl:_.config.imgUrl,
|
|
isShowAddStaff:false,
|
|
name:'',
|
|
mobile:'',
|
|
isShowProfile:true,//是否显示授权用户信息按钮
|
|
},
|
|
onLoad: function (options) {
|
|
|
|
for (let key in options) {
|
|
this.setData({
|
|
[key]: options[key]
|
|
})
|
|
}
|
|
|
|
let list = []
|
|
if(this.data.source=='channel'){
|
|
list = [
|
|
// {
|
|
// icon:'https://qs.haodian.cn/wechat_app/dongfeng/mine/icon-zichan2.png',
|
|
// title:'我的资产',
|
|
// url:'',
|
|
// },
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/dongfeng/mine/icon-sezhi2.png',
|
|
title:'账户设置',
|
|
url:'/pages/mine/install/index',
|
|
},
|
|
]
|
|
}else if(this.data.source=='shop'){
|
|
list = [
|
|
// {
|
|
// icon:'https://qs.haodian.cn/wechat_app/dongfeng/mine/icon-zichan2.png',
|
|
// title:'我的资产',
|
|
// url:'',
|
|
// },
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/dongfeng/mine/icon-sucai2.png',
|
|
title:'我的素材',
|
|
url:'/pages/distribute/index',
|
|
},
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/dongfeng/mine/icon-sezhi2.png',
|
|
title:'账户设置',
|
|
url:'/pages/mine/install/index',
|
|
},
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/dongfeng/mine/icon-siyutong2.png',
|
|
title:'私域通',
|
|
url:'/pages/siyutong/index',
|
|
},
|
|
]
|
|
}
|
|
|
|
this.setData({
|
|
list:list,
|
|
})
|
|
|
|
this.getUserInfo()
|
|
|
|
wx.getSystemInfo({
|
|
success (res) {
|
|
if(res.system.indexOf('Android')>-1){
|
|
wx.setBackgroundColor({
|
|
backgroundColor: '#34ac9f',
|
|
})
|
|
}
|
|
}
|
|
})
|
|
|
|
//消息通讯 是否显示授权用户信息按钮
|
|
_.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(res.group_id==2||res.group_id==3){
|
|
let list = this.data.list
|
|
list.push({
|
|
icon:'https://qs.haodian.cn/wechat_app/dongfeng/mine/icon-jieshao2.png',
|
|
title:'转介绍',
|
|
url:'/pages/recommend/index',
|
|
})
|
|
this.setData({
|
|
list,
|
|
})
|
|
}
|
|
});
|
|
},
|
|
|
|
//退出登录
|
|
logout(){
|
|
wx.clearStorage()
|
|
wx.reLaunch({
|
|
url: '/pages/login/index'
|
|
})
|
|
},
|
|
|
|
//推送链接
|
|
pushLink(e) {
|
|
if(e.currentTarget.dataset.url){
|
|
_.$router.openUrlScheme(e.currentTarget.dataset.url)
|
|
}
|
|
},
|
|
|
|
//推送链接-敬请期待
|
|
pushLinkMsg(e) {
|
|
if (e.currentTarget.dataset.url) {
|
|
_.$router.openUrlScheme(e.currentTarget.dataset.url)
|
|
}else{
|
|
wx.showToast({
|
|
title:'开发中,敬请期待!',
|
|
icon: "none"
|
|
});
|
|
}
|
|
},
|
|
|
|
}) |