| | |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | } |
| | | |
| | | } |
| | | wx.setStorageSync(app.config.userInfoKey, JSON.stringify(defaultUser)); |
| | | } |
| | |
| | | app.MG.resource.getCmsTypeByRefCode({ |
| | | refCodes: ['jsek_teacherCertification'] |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.setData({ |
| | | worksInfo: res[0].cmsTypeLinks[0].children, |
| | | }) |
| | | this.newGetTeacherInfo() |
| | | }) |
| | | |
| | | }, |
| | | //获取教师状态 |
| | | newGetTeacherInfo() { |
| | | let that = this; |
| | | const data = { |
| | | start: 0, |
| | | size: 10, |
| | |
| | | } |
| | | app.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | try { |
| | | this.setData({ |
| | | that.setData({ |
| | | imgPics: [], |
| | | }) |
| | | const resData = res.datas.find((i) => i.appUserCreator.userId === this.data.userId) |
| | | const resData = res.datas.find((i) => i.appUserCreator.userId === that.data.userId) |
| | | if (resData) { |
| | | if (resData.state == 'WaitAudit') { |
| | | this.setData({ |
| | | that.setData({ |
| | | editState: false, |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | that.setData({ |
| | | editState: true, |
| | | }) |
| | | } |
| | | let info = getTopicMsgCmsItemFile(this.data.worksInfo, resData.cmsItemDataList) |
| | | this.setData({ |
| | | let info = getTopicMsgCmsItemFile(that.data.worksInfo, resData.cmsItemDataList) |
| | | that.setData({ |
| | | 'teacherInfo.fullName': info.fullName, |
| | | 'teacherInfo.schoolName': info.schoolName, |
| | | 'teacherInfo.positionalTitle': info.positionalTitle, |
| | |
| | | teachText: info.positionalTitle, |
| | | }) |
| | | if (resData.feedBack != null) { |
| | | this.setData({ |
| | | that.setData({ |
| | | reasonTxt: JSON.parse(resData.feedBack).reason, |
| | | }) |
| | | } |
| | | if (this.data.teacherInfo.relevantCertificates.length > 0) { |
| | | if (that.data.teacherInfo.relevantCertificates.length > 0) { |
| | | let arr = []; |
| | | if (typeof this.data.teacherInfo.relevantCertificates == 'object') { |
| | | this.data.teacherInfo.relevantCertificates.forEach((ele) => { |
| | | if (typeof that.data.teacherInfo.relevantCertificates == 'object') { |
| | | that.data.teacherInfo.relevantCertificates.forEach((ele) => { |
| | | let imgObj = { |
| | | md5: ele.file.md5, |
| | | linkType: 'LinkFile', |
| | |
| | | imgUrl: ele.file.imgUrl |
| | | } |
| | | arr.push(imgObj); |
| | | this.setData({ |
| | | that.setData({ |
| | | imgPics: arr, |
| | | }); |
| | | }) |
| | | } else { |
| | | let imgObj = { |
| | | md5: this.data.teacherInfo.relevantCertificates, |
| | | md5: that.data.teacherInfo.relevantCertificates, |
| | | linkType: 'LinkFile', |
| | | linkProtectType: 'Public', |
| | | url: app.config.requestCtx + `/file/GetPreViewImage?md5=` + this.data.teacherInfo.relevantCertificates, |
| | | imgUrl: app.config.requestCtx + `/file/GetPreViewImage?md5=` + this.data.teacherInfo.relevantCertificates, |
| | | url: app.config.requestCtx + `/file/GetPreViewImage?md5=` + that.data.teacherInfo.relevantCertificates, |
| | | imgUrl: app.config.requestCtx + `/file/GetPreViewImage?md5=` + that.data.teacherInfo.relevantCertificates, |
| | | } |
| | | arr.push(imgObj); |
| | | this.setData({ |
| | | that.setData({ |
| | | imgPics: arr, |
| | | }); |
| | | } |