| | |
| | | grid: { |
| | | x: 30, |
| | | y: 30, |
| | | x2: 35, |
| | | y2: 53 |
| | | x2: 37, |
| | | y2: 60 |
| | | }, |
| | | |
| | | series: [{ |
| | | name: '评分', |
| | | type: 'line', |
| | | smooth: true, |
| | | areaStyle: { |
| | | color: { |
| | | type: 'linear', |
| | | x: 0.5, |
| | | y: 0, |
| | | x2: 0.5, |
| | | y2: 1, |
| | | colorStops: [{ |
| | | offset: 0, color: '#28db74' // 0% 处的颜色 |
| | | }, { |
| | | offset: 1, color: '#dcfeea79' // 100% 处的颜色 |
| | | }], |
| | | opacity: 0.1, |
| | | global: false // 缺省为 false |
| | | } |
| | | }, |
| | | data: data, |
| | | }] |
| | | }; |
| | |
| | | planYear: "2000", |
| | | maxYear: "2000", |
| | | //当前的评分周期 |
| | | thisPeiod: '2000/1-1', |
| | | thisPeriod: '2000/1-1', |
| | | //评估历史 |
| | | historys: [] |
| | | }, |
| | |
| | | this.ecComponent = this.selectComponent('#mychart-dom-line'); |
| | | this.initChart() |
| | | // }, 1000); |
| | | |
| | | wx.startPullDownRefresh({ |
| | | success: (res) => {}, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onShow: function () { |
| | | var that = this |
| | | }, |
| | | |
| | | onPullDownRefresh(){ |
| | | this.getHistoryPoint() |
| | | |
| | | }, |
| | | |
| | | initChart: function () { |
| | |
| | | this.setData({ |
| | | planYear: `${year}年`, |
| | | maxYear: year, |
| | | thisPeiod: period, |
| | | thisPeriod: period, |
| | | deadline: deadline |
| | | }) |
| | | }, |
| | |
| | | let lastOne = data[0] |
| | | let date = moment(lastOne.updateDate) |
| | | let period = `${date.year()}/${date.month()+1}-${date.month()+1}` |
| | | if (period == that.data.thisPeiod) { |
| | | if (period == that.data.thisPeriod) { |
| | | that.setData({ |
| | | score: lastOne.totalPoint, |
| | | text1: "很棒!", |
| | | text1: "", |
| | | text2: "本次测评已完成", |
| | | text3: "查看详情", |
| | | }) |
| | | } else { |
| | | that.setData({ |
| | | text1: "测评已开始!", |
| | | text2: "请尽快完成测评", |
| | | text3: "去测评", |
| | | score: undefined, |
| | | }) |
| | | } |
| | | |
| | |
| | | color: d.color, |
| | | rank: d.rank, |
| | | level: d.level, |
| | | time: d.period, |
| | | time: d.period.replace('/', '年').replace(/\-[0-9]+/, '月'), |
| | | scoreId: d.tPGuid |
| | | }) |
| | | |
| | | //折线图数据 |
| | | let key = d.period.split('/')[0] + '年' |
| | | let y = d.period.split('/')[0] |
| | | let key = y + '年' |
| | | if (!that.chartData.hasOwnProperty(key)) { |
| | | that.chartData[key] = ['-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'] |
| | | that.chartData[key] = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'] |
| | | if (y == date.year() + '') { |
| | | let m = date.month() |
| | | for (let i = m; i <= 11; i++) { |
| | | that.chartData[key][i] = '-' |
| | | } |
| | | } |
| | | } |
| | | let monthGap = d.period.split('/')[1] |
| | | let startMonth = parseInt(monthGap.split('-')[0]) |
| | |
| | | setTimeout(() => { |
| | | setOption(that.chart, that.chartData[that.data.planYear]); |
| | | }, 500); |
| | | }, |
| | | complete(res) { |
| | | wx.stopPullDownRefresh({ |
| | | success: (res) => {}, |
| | | fail: (res) => {}, |
| | | complete: (res) => {}, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | case "0": |
| | | //去测评或者查看详情 |
| | | if (this.data.score) { |
| | | url = `/pages/gradereport/gradereport?period=${this.data.thisPeiod}` |
| | | url = `/pages/gradereport/gradereport?period=${this.data.thisPeriod}` |
| | | } else { |
| | | url = `/pages/grade/grade?record=false` |
| | | } |