| | |
| | | userRealName: '', |
| | | |
| | | //历史评分详情 |
| | | assessmentCompleted: false, |
| | | historyPoint: { |
| | | time: '测评周期----年--月', |
| | | score: '--', |
| | |
| | | period: '' |
| | | }, |
| | | //台账完成情况 |
| | | ledgerInfo: { |
| | | ledgerCompleted: false, |
| | | monthInfo: { |
| | | //必填项总数 |
| | | totalMust: 0, |
| | | //必填项提交数 |
| | |
| | | //判断用户是否为首次登录,决定是否强制修改默认密码 |
| | | if (app.globalData.userInfo.remark == null || app.globalData.userInfo.remark == '') { |
| | | wx.navigateTo({ |
| | | url: '/pages/m_user/p_changepw/p_changepw', |
| | | url: '/pages/mUser/pChangepw/pChangepw', |
| | | }) |
| | | } |
| | | |
| | |
| | | this.getLedgerType() |
| | | }, |
| | | |
| | | onShow(){ |
| | | onShow() { |
| | | if (app.globalData.isLogin) { |
| | | |
| | | |
| | | } |
| | | }, |
| | | |
| | | onPullDownRefresh(){ |
| | | onPullDownRefresh() { |
| | | console.log('onPullDownRefresh'); |
| | | wx.stopPullDownRefresh({ |
| | | success: (res) => {}, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | }) |
| | | this.getNextEvaluationTime() |
| | | this.getNotice() |
| | | this.getHistoryPoint() |
| | | this.getNews() |
| | | this.getCommitment() |
| | | this.getLedgerType() |
| | | }, |
| | | |
| | | getNextEvaluationTime() { |
| | |
| | | let lastOne = data[0] |
| | | let year = lastOne.updateDate.substring(0, 4) |
| | | let month = lastOne.updateDate.substring(5, 7) |
| | | const now = moment() |
| | | if (now.year() == year && now.month() + 1 == month) { |
| | | that.setData({ |
| | | assessmentCompleted: true |
| | | }) |
| | | } |
| | | that.setData({ |
| | | historyPoint: { |
| | | time: `测评周期${year}年${month}月`, |
| | | time: `最新一期 ${year}年${month}月`, |
| | | score: lastOne.totalPoint, |
| | | rank: lastOne.rank, |
| | | legalIndex: lastOne.level, |
| | |
| | | ledgerservice.getLedgerSummary(app.globalData.accessToken.userId, app.globalData.userInfo.extension2, time, { |
| | | success(res) { |
| | | that.parseLedgerType(res) |
| | | }, |
| | | complete() { |
| | | wx.stopPullDownRefresh({ |
| | | success: (res) => {}, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | monthInfo.percent = monthInfo.totalMust == 0 ? 0 : Math.round(monthInfo.finishedMust / monthInfo.totalMust * 100) |
| | | monthInfo.percent2 = monthInfo.totalSelf == 0 ? 0 : Math.round(monthInfo.finishedSelf / monthInfo.totalSelf * 100) |
| | | |
| | | this.setData({monthInfo}) |
| | | this.setData({ |
| | | monthInfo, |
| | | ledgerCompleted: monthInfo.percent >= 100 && monthInfo.percent2 >= 100, |
| | | // ledgerCompleted: true |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | switch (index) { |
| | | case "0": |
| | | //测评历史记录 |
| | | url = `/pages/m_assessment/gradereport/gradereport?period=${this.data.historyPoint.period}` |
| | | if (this.data.historyPoint.period == '') { |
| | | url = `/pages/mAssessment/grade/grade` |
| | | } else { |
| | | url = `/pages/mAssessment/gradereport/gradereport?period=${this.data.historyPoint.period}` |
| | | } |
| | | break; |
| | | case "5": |
| | | wx.switchTab({ |
| | | url: '/pages/m_ledger/ledgerhome/ledgerhome', |
| | | url: '/pages/mLedger/ledgerhome/ledgerhome', |
| | | }) |
| | | return; |
| | | case "6": |
| | | wx.switchTab({ |
| | | url: '/pages/m_promise/promisehome/promise', |
| | | url: '/pages/mPromise/promisehome/promise', |
| | | }) |
| | | break; |
| | | return; |
| | | case "1": |
| | | //工作提醒 |
| | | url = "/pages/m_notice/notice/notice" |
| | | url = "/pages/mNotice/notice/notice" |
| | | break; |
| | | case "2": |
| | | //智能在线咨询 |
| | | url = "/pages/m_consult/consulthome/consulthome" |
| | | url = "/pages/mConsult/consulthome/consulthome" |
| | | break; |
| | | case "3": |
| | | //在线守法学习 |
| | | url = `/pages/m_learn/learn/learn` |
| | | url = `/pages/mLearn/learn/learn` |
| | | break; |
| | | case "4": |
| | | //守法动态 |
| | |
| | | let bodyUrl = e.currentTarget.dataset.url |
| | | let fileType = e.currentTarget.dataset.filetype |
| | | wx.showLoading({ |
| | | title: ' 文件下载中', |
| | | title: ' 加载中', |
| | | mask: true, |
| | | }) |
| | | wx.downloadFile({ |
| | |
| | | }) |
| | | } |
| | | }) |
| | | break; |
| | | return; |
| | | } |
| | | if (url != "") { |
| | | wx.navigateTo({ |
| | | url: url |
| | | }) |
| | | } else { |
| | | wx.showToast({ |
| | | title: '功能敬请期待', |
| | | duration: 1000, |
| | | icon: 'none', |
| | | mask: true, |
| | | }) |
| | | } |
| | | } |