| | |
| | | moreMenu, |
| | | moreMenu1, |
| | | visible: false, |
| | | baseRefresh: { |
| | | value: false |
| | | } |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | |
| | | url: "/pages/testLogin/index", |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | onShow() { |
| | | |
| | | if (typeof this.getTabBar === 'function' && this.getTabBar()) { |
| | | this.getTabBar().setData({ |
| | | active: 4 |
| | | }) |
| | | } |
| | | }, |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | this.setData({ |
| | | 'baseRefresh.value': true, |
| | | }) |
| | | this.getUserInfo() |
| | | }, |
| | | /** |
| | |
| | | type = '-' |
| | | } |
| | | let defaultUser = {}; |
| | | let nickNameData = res.infoList.find((item) => item.type == 'nickName') |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') |
| | |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | fullName: teacherInfos.fullName, |
| | | icon: teacherInfos.icon, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | fullName: WeChatInfo.name, |
| | | icon: WeChatInfo.icon, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | userType: type |
| | | userType: type, |
| | | role: 'Student', |
| | | } |
| | | this.setData({ |
| | | currAuthStep: 3, |
| | | }); |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | fullName: secretData.credential, |
| | | icon: "", |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : "", |
| | | userId: res.userId, |
| | | userType: type |
| | | userType: type, |
| | | role: 'Student', |
| | | } |
| | | } |
| | | this.setData({ |
| | |
| | | }) |
| | | this.getTeacherInfo() |
| | | wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo)); |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | 'baseRefresh.value': false, |
| | | }) |
| | | }, 500); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | }); |
| | | }, |
| | | tabUserTypeClick(e) { |
| | | console.log(e) |
| | | let { info } = e.currentTarget.dataset; |
| | | this.setData({ |
| | | userTypeActive: info.value, |
| | |
| | | |
| | | //点击目录 |
| | | toPages(item) { |
| | | console.log(item) |
| | | let info = item.currentTarget.dataset.info |
| | | if (info.url) { |
| | | wx.navigateTo({ |
| | |
| | | } |
| | | }, |
| | | |
| | | onScroll(e) { |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 10 ? true : false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |