110 lines
2.2 KiB
JavaScript
110 lines
2.2 KiB
JavaScript
import _ from '../../commons/js/commons'
|
|
const app = getApp()
|
|
Page({
|
|
data: {
|
|
imgUrl:_.config.imgUrl,
|
|
isShowAddStaff:false,
|
|
name:'',
|
|
mobile:'',
|
|
},
|
|
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/lichebao/mine/icon-zichan.png',
|
|
title:'我的资产',
|
|
url:'',
|
|
},
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sezhi.png',
|
|
title:'账户设置',
|
|
url:'/pages/mine/install/index',
|
|
},
|
|
|
|
]
|
|
}else if(this.data.source=='shop'){
|
|
list = [
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-zichan.png',
|
|
title:'我的资产',
|
|
url:'',
|
|
},
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sucai.png',
|
|
title:'我的素材',
|
|
url:'/pages/distribute/index',
|
|
},
|
|
{
|
|
icon:'https://qs.haodian.cn/wechat_app/lichebao/mine/icon-sezhi.png',
|
|
title:'账户设置',
|
|
url:'/pages/mine/install/index',
|
|
},
|
|
|
|
]
|
|
}
|
|
|
|
this.setData({
|
|
list:list,
|
|
})
|
|
|
|
this.getUserInfo()
|
|
|
|
wx.getSystemInfo({
|
|
success (res) {
|
|
if(res.system.indexOf('Android')>-1){
|
|
wx.setBackgroundColor({
|
|
backgroundColor: '#34ac9f',
|
|
})
|
|
}
|
|
}
|
|
})
|
|
},
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
//获取用户信息
|
|
getUserInfo(){
|
|
_.apiQuery.getUserInfo().then(res => {
|
|
this.setData({
|
|
userInfo: res
|
|
})
|
|
});
|
|
},
|
|
|
|
//退出登录
|
|
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"
|
|
});
|
|
}
|
|
},
|
|
|
|
}) |