From b45a01a8bee4a9bff5f9c248ead301b8675d1099 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 28 十月 2022 17:22:35 +0800
Subject: [PATCH] 2022.10.28

---
 pages/home/home.js |   44 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/pages/home/home.js b/pages/home/home.js
index 84fd0bc..42c3a83 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -55,6 +55,13 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad: function (options) {
+    //鍒ゆ柇鐢ㄦ埛鏄惁涓洪娆$櫥褰曪紝鍐冲畾鏄惁寮哄埗淇敼榛樿瀵嗙爜
+    if (app.globalData.userInfo.remark == null || app.globalData.userInfo.remark == '') {
+      wx.navigateTo({
+        url: '/pages/m_user/p_changepw/p_changepw',
+      })
+    }
+
     wx.getStorage({
       key: 'accessToken',
       success: (result) => {
@@ -71,6 +78,12 @@
     this.getNews()
     this.getCommitment()
     this.getLedgerType()
+  },
+
+  onShow(){
+    if (app.globalData.isLogin) {
+      
+    }
   },
 
   onPullDownRefresh(){
@@ -199,18 +212,28 @@
     let monthInfo = {
       totalMust: 0,
       finishedMust: 0,
+      totalSelf: 0,
+      finishedSelf: 0
     }
     subtypes.forEach(s => {
       //鏈堝害缁熻
       if (s.needUpdate) {
         monthInfo.totalMust++
+        //缁熻鑷贰鏌ョ被鍨嬬殑鍙拌处锛岀被鍒负-1锛堟殏瀹氾級
+        if (s.ledgerTypeId == -1) {
+          monthInfo.totalSelf++
+        }
         if (s.upLoad) {
           monthInfo.finishedMust++
+          if (s.ledgerTypeId == -1) {
+            monthInfo.finishedSelf++
+          }
         }
       }
     });
 
-    monthInfo.percent = Math.round(monthInfo.finishedMust / monthInfo.totalMust * 100)
+    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})
   },
@@ -224,29 +247,29 @@
     switch (index) {
       case "0":
         //娴嬭瘎鍘嗗彶璁板綍
-        url = `/pages/gradereport/gradereport?period=${this.data.historyPoint.period}`
+        url = `/pages/m_assessment/gradereport/gradereport?period=${this.data.historyPoint.period}`
         break;
       case "5":
         wx.switchTab({
-          url: '/pages/module_ledger/ledgerhome/ledgerhome',
+          url: '/pages/m_ledger/ledgerhome/ledgerhome',
         })
         return;
       case "6":
         wx.switchTab({
-          url: '/pages/promise/promise',
+          url: '/pages/m_promise/promisehome/promise',
         })
         break;
       case "1":
         //宸ヤ綔鎻愰啋
-        url = "/pages/notice/notice"
+        url = "/pages/m_notice/notice/notice"
         break;
       case "2":
         //鏅鸿兘鍦ㄧ嚎鍜ㄨ
-        url = "/pages/module_consult/consulthome/consulthome"
+        url = "/pages/m_consult/consulthome/consulthome"
         break;
       case "3":
         //鍦ㄧ嚎瀹堟硶瀛︿範
-        url = `/pages/learn/learn`
+        url = `/pages/m_learn/learn/learn`
         break;
       case "4":
         //瀹堟硶鍔ㄦ��
@@ -279,6 +302,13 @@
       wx.navigateTo({
         url: url
       })
+    } else {
+      wx.showToast({
+        title: '鍔熻兘鏁鏈熷緟',
+        duration: 1000,
+        icon: 'none',
+        mask: true,
+      })
     }
   }
 })
\ No newline at end of file

--
Gitblit v1.9.3