|
|
@ -157,13 +157,21 @@ |
|
|
weekday: "" // 课程星期 |
|
|
weekday: "" // 课程星期 |
|
|
} |
|
|
} |
|
|
},//首页数据 |
|
|
},//首页数据 |
|
|
|
|
|
|
|
|
|
|
|
path_arr:{ |
|
|
|
|
|
'1':'/pages/coach/home/index',//教练 |
|
|
|
|
|
'2':'/pages/market/index/index',//销售 |
|
|
|
|
|
'3':'/pages/student/index/index',//学员 |
|
|
|
|
|
}, |
|
|
|
|
|
thisPath:'',//当前页面的路径(默认'') |
|
|
|
|
|
openPath:'',//正确的跳转路径(默认'') |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
onShow(){ |
|
|
onShow(){ |
|
|
this.init() |
|
|
this.openViewHome()//检测首页是否正确跳转-不正确则进行重定向 |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
//初始化 |
|
|
//初始化 |
|
|
@ -174,6 +182,35 @@ |
|
|
this.getJobAssignmentsInfo() |
|
|
this.getJobAssignmentsInfo() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//检测首页是否正确跳转-不正确则进行重定向 |
|
|
|
|
|
async openViewHome(){ |
|
|
|
|
|
//获取当前页面路径 |
|
|
|
|
|
let pages = getCurrentPages(); |
|
|
|
|
|
//当前页面路径 |
|
|
|
|
|
this.thisPath = '/' + pages[0].route |
|
|
|
|
|
//获取缓存用户登陆类型 |
|
|
|
|
|
let userType = String(uni.getStorageSync('userType')) |
|
|
|
|
|
|
|
|
|
|
|
this.openPath = this.path_arr[userType] |
|
|
|
|
|
|
|
|
|
|
|
if(this.thisPath != this.openPath){ |
|
|
|
|
|
//跳转tabBar首页-页面 |
|
|
|
|
|
uni.setStorageSync('tabBerIndex', 0) |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: this.openPath |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
//页面正确的情况下 |
|
|
|
|
|
this.init() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(123123123123,this.thisPath,userType,this.path_arr[userType]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
async getMemberIndex(){ |
|
|
async getMemberIndex(){ |
|
|
let res = await memberApi.memberIndex({}) |
|
|
let res = await memberApi.memberIndex({}) |
|
|
if(res.code != 1){ |
|
|
if(res.code != 1){ |
|
|
|