From 8fbd6b8d09e70494d920cc0b77812e9643be3196 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 23 八月 2022 17:37:31 +0800
Subject: [PATCH] 2022.8.23

---
 pages/assessment/assessment.js |   67 ++++++++++++++++++++++++++++-----
 1 files changed, 57 insertions(+), 10 deletions(-)

diff --git a/pages/assessment/assessment.js b/pages/assessment/assessment.js
index 938a09d..bf6226a 100644
--- a/pages/assessment/assessment.js
+++ b/pages/assessment/assessment.js
@@ -46,14 +46,30 @@
     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,
     }]
   };
@@ -80,7 +96,7 @@
     planYear: "2000",
     maxYear: "2000",
     //褰撳墠鐨勮瘎鍒嗗懆鏈�
-    thisPeiod: '2000/1-1',
+    thisPeriod: '2000/1-1',
     //璇勪及鍘嗗彶
     historys: []
   },
@@ -105,6 +121,12 @@
     this.ecComponent = this.selectComponent('#mychart-dom-line');
     this.initChart()
     // }, 1000);
+
+    wx.startPullDownRefresh({
+      success: (res) => {},
+      fail: (res) => {},
+      complete: (res) => {},
+    })
   },
 
   /**
@@ -112,7 +134,11 @@
    */
   onShow: function () {
     var that = this
+  },
+
+  onPullDownRefresh(){
     this.getHistoryPoint()
+
   },
 
   initChart: function () {
@@ -149,7 +175,7 @@
     this.setData({
       planYear: `${year}骞碻,
       maxYear: year,
-      thisPeiod: period,
+      thisPeriod: period,
       deadline: deadline
     })
   },
@@ -174,12 +200,19 @@
         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,
           })
         }
 
@@ -193,14 +226,21 @@
             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])
@@ -215,6 +255,13 @@
         setTimeout(() => {
           setOption(that.chart, that.chartData[that.data.planYear]);
         }, 500);
+      },
+      complete(res) {
+        wx.stopPullDownRefresh({
+          success: (res) => {},
+          fail: (res) => {},
+          complete: (res) => {},
+        })
       }
     })
   },
@@ -240,7 +287,7 @@
       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`
         }

--
Gitblit v1.9.3