New file |
| | |
| | | const app = getApp() |
| | | const menuData = [ |
| | | { |
| | | title: '我的订单', |
| | | icon: '/static/images/personal/order.png', |
| | | url: '/pages/personalCenter/myOrder/index', |
| | | type: 'order', |
| | | }, |
| | | { |
| | | title: '激活商品', |
| | | icon: '/static/images/personal/jihuo.png', |
| | | url: '/pages/personalCenter/activateProduct/index', |
| | | type: 'activateProduct', |
| | | }, |
| | | { |
| | | title: '我的证书', |
| | | icon: '/static/images/personal/certificate.png', |
| | | url: '/pages/personalCenter/certificate/index', |
| | | type: 'certificate', |
| | | }, |
| | | { |
| | | title: '我的收藏', |
| | | icon: '/static/images/personal/wodeshoucang.png', |
| | | url: '/pages/personalCenter/myCollection/index', |
| | | type: 'collection', |
| | | }, |
| | | { |
| | | title: '我的下载', |
| | | icon: '/static/images/personal/download.png', |
| | | url: '/pages/personalCenter/downloads/index', |
| | | type: 'download', |
| | | }, |
| | | { |
| | | title: '样书申请', |
| | | icon: '/static/images/personal/yangshushenqing.png', |
| | | url: '/pages/personalCenter/sampleBooks/index', |
| | | type: 'sampleBook', |
| | | }, |
| | | { |
| | | title: '出书申请', |
| | | icon: '/static/images/personal/chushu.png', |
| | | url: '/pages/personalCenter/publishBooks/index', |
| | | type: 'publishBooks', |
| | | }, |
| | | { |
| | | title: '我的上传', |
| | | icon: '/static/images/personal/upload.png', |
| | | url: '', |
| | | type: 'upload', |
| | | } |
| | | ]; |
| | | const moreMenu = [ |
| | | { |
| | | title: '我的消息', |
| | | icon: '/static/images/personal/notification.png', |
| | | url: '/pages/personalCenter/myMassage/index', |
| | | type: 'message', |
| | | }, |
| | | { |
| | | title: '建议与反馈', |
| | | icon: '/static/images/personal/feedback.png', |
| | | url: '/pages/personalCenter/feedback/index', |
| | | type: 'feedback', |
| | | } |
| | | ]; |
| | | const moreMenu1 = [ |
| | | { |
| | | title: '关于我们', |
| | | icon: '/static/images/personal/about.png', |
| | | url: '', |
| | | type: 'aboutUs', |
| | | }, |
| | | { |
| | | title: '联系我们', |
| | | icon: '/static/images/personal/contact.png', |
| | | url: '', |
| | | type: 'contact', |
| | | } |
| | | ]; |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isWhite: false, |
| | | show: false, |
| | | userInfo: { |
| | | avatarUrl: |
| | | 'https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/avatar/avatar-1.jpg', |
| | | nickName: 'TDesign', |
| | | phoneNumber: '13438358888', |
| | | }, |
| | | currAuthStep: 1, |
| | | teacherState: { |
| | | state: '', |
| | | reasonTxt: '', |
| | | }, |
| | | integral: 0, |
| | | menuData, |
| | | moreMenu, |
| | | moreMenu1 |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | | show: true, |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | |
| | | if (typeof this.getTabBar === 'function' && this.getTabBar()) { |
| | | this.getTabBar().setData({ |
| | | selected: 4 //这个数字是当前页面在tabBar中list数组的索引 |
| | | }) |
| | | } |
| | | this.getTeacherInfo() |
| | | } else { |
| | | wx.navigateTo({ |
| | | url: "/pages/testLogin/index", |
| | | }); |
| | | } |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | this.setData({ |
| | | show: false |
| | | }) |
| | | }, |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | this.init(); |
| | | }, |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | }, |
| | | //教师信息 |
| | | getTeacherInfo() { |
| | | const data = { |
| | | start: 0, |
| | | size: 10, |
| | | topicIdOrRefCode: 'teacherRoleApproval', |
| | | appRefCode: app.config.appRefCode, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | } |
| | | } |
| | | app.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | console.log(this.data.userInfo, "userInfo") |
| | | const resData = res.datas.find((i) => i.appUserCreator.userId == this.data.userInfo.userId) |
| | | if (resData) { |
| | | this.setData({ |
| | | teacherState: { |
| | | state: resData.state, |
| | | reasonTxt: resData.feedBack != null ? JSON.parse(resData.feedBack).reason : '' |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //点击目录 |
| | | toPages(item) { |
| | | console.log(item) |
| | | let info = item.target.dataset.info |
| | | if (info.url) { |
| | | wx.navigateTo({ |
| | | url: info.url |
| | | }) |
| | | } else { |
| | | wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | |
| | | onPageScroll(e) { |
| | | this.setData({ |
| | | isWhite: e.scrollTop > 50 ? true : false |
| | | }) |
| | | |
| | | } |
| | | }) |