From bf580d5477d65f5eefb70a8fb9a6b37eaf0ae9bb Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 06 九月 2022 09:16:25 +0800
Subject: [PATCH] 2022.9.6

---
 pages/module_consult/consulthome/consulthome.js |   97 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 81 insertions(+), 16 deletions(-)

diff --git a/pages/module_consult/consulthome/consulthome.js b/pages/module_consult/consulthome/consulthome.js
index 855cdbc..f292fcd 100644
--- a/pages/module_consult/consulthome/consulthome.js
+++ b/pages/module_consult/consulthome/consulthome.js
@@ -22,6 +22,9 @@
       name: '鏉$洰',
       tag: 0
     }, {
+      name: '闂瓟',
+      tag: 0
+    }, {
       name: '妗堜緥',
       tag: 0
     }],
@@ -31,7 +34,11 @@
       [],
       [],
       [],
-    ]
+      [],
+    ],
+
+    //妗堜緥鎵�娑夊強鐨勮鐐�
+    caseTag: []
   },
 
   /**
@@ -39,7 +46,6 @@
    */
   onLoad: function (options) {
     this.getHotTopic()
-    this.getTopicItem()
   },
 
   /**
@@ -56,12 +62,14 @@
 
   },
 
+  // 鎼滅储
   gotoSearch() {
     wx.navigateTo({
       url: "/pages/module_consult/consultsearch/consultsearch"
     })
   },
 
+  // 鍔熻兘鎸夐挳
   goto(e) {
     var url = ""
     var index = e.currentTarget.dataset.index
@@ -95,13 +103,14 @@
    */
   getHotTopic() {
     var that = this
+    // 1. 鐑棬娉曞緥娉曡
     consultservice.getTopicLaw(app.globalData.accessToken.userId, {
       success(res) {
         res.forEach(r => {
           r.mfKeywordLv1 = r.mfKeywordLv1.split('銆�').slice(0, 5)
-          r.mfReleaseDate = that.formateTime(r.mfReleaseDate)
-          r.mfEffectiveDate = that.formateTime(r.mfEffectiveDate)
-          r.mfClosingDate = that.formateTime(r.mfClosingDate)
+          r.mfReleaseDate = that.formatTime(r.mfReleaseDate)
+          r.mfEffectiveDate = that.formatTime(r.mfEffectiveDate)
+          r.mfClosingDate = that.formatTime(r.mfClosingDate)
         });
         that.setData({
           'pageList[0]': res,
@@ -109,27 +118,48 @@
         })
       }
     })
-  },
-
-  getTopicItem() {
-    var that = this
+    // 2. 鐑棬娉曞緥娉曡鏉$洰
     consultservice.getTopicItem(app.globalData.accessToken.userId, {
       success(res) {
         res.forEach(r => {
-          r.miItemContent = r.miItemContent.replace('\\n', '<br/>')
-          // r.mfKeywordLv1 = r.mfKeywordLv1.split('銆�').slice(0, 5)
-          // r.mfReleaseDate = that.formateTime(r.mfReleaseDate)
-          // r.mfEffectiveDate = that.formateTime(r.mfEffectiveDate)
-          // r.mfClosingDate = that.formateTime(r.mfClosingDate)
+          r.miItemContent = r.miItemContent.replaceAll('\\n', '<br/>')
         });
         that.setData({
           'pageList[2]': res
+        })
+      }
+    })
+    // 3. 鐑棬闂瓟
+    consultservice.getTopicQA(app.globalData.accessToken.userId, {
+      success(res) {
+        res.forEach(r => {
+          r.cqCreateTime = that.formatTime(r.cqCreateTime)
+        });
+        that.setData({
+          'pageList[3]': res
+        })
+      }
+    })
+    // 4. 鐑棬妗堜緥
+    consultservice.getTopicCase(app.globalData.accessToken.userId, {
+      success(res) {
+        res.forEach(r => {
+          r.ecSummary = r.ecSummary.replaceAll('\\n', '<br/>')
+          r.ecMeaning = r.ecMeaning.replaceAll('\\n', '<br/>')
+          r.ecExamined = r.ecExamined.replaceAll('\\n', '<br/>')
+          r.ecEnlightenment = r.ecEnlightenment.replaceAll('\\n', '<br/>')
+          r.ecOccurDate = that.formatTime(r.ecOccurDate)
+        });
+        that.setData({
+          'pageList[4]': res
         })
         console.log(that.data.pageList);
       }
     })
   },
 
+
+  // 鍘诲線鏂囦欢璇︽儏
   gotoFile(e) {
     const iList = e.currentTarget.dataset.index.split(',')
     const i1 = iList[0]
@@ -146,6 +176,7 @@
     })
   },
 
+  // 鍘诲線鏉$洰璇︽儏
   gotoItem(e) {
     const iList = e.currentTarget.dataset.index.split(',')
     const i1 = iList[0]
@@ -162,9 +193,43 @@
     })
   },
 
-  formateTime(t) {
+  // 鍘诲線闂瓟璇︽儏
+  gotoQA(e) {
+    const iList = e.currentTarget.dataset.index.split(',')
+    const i1 = iList[0]
+    const i2 = iList[1]
+    var qId = this.data.pageList[i1][i2].cqGuid
+    wx.navigateTo({
+      url: '/pages/module_consult/consultdetailqa/consultdetailqa',
+      success: (res) => {
+        // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+        res.eventChannel.emit('acceptDataFromOpenerPage', {
+          qId: qId
+        })
+      },
+    })
+  },
+
+  // 鍘诲線妗堜緥璇︽儏
+  gotoCase(e) {
+    const iList = e.currentTarget.dataset.index.split(',')
+    const i1 = iList[0]
+    const i2 = iList[1]
+    var caseId = this.data.pageList[i1][i2].ecGuid
+    wx.navigateTo({
+      url: '/pages/module_consult/consultdetailcase/consultdetailcase',
+      success: (res) => {
+        // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+        res.eventChannel.emit('acceptDataFromOpenerPage', {
+          caseId: caseId
+        })
+      },
+    })
+  },
+
+  formatTime(t) {
     if (t) {
-      return moment(t).format("YYYY骞碝M鏈圖D鏃�")
+      return moment(t).format("YYYY.MM.DD")
     } else {
       return undefined
     }

--
Gitblit v1.9.3