From 5656daeb79c6d4d3f9fc78f981c7faf96582d2f1 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 11 八月 2022 14:24:29 +0800
Subject: [PATCH] 登录注册模块、

---
 pages/module_consult/consulthome/consulthome.js |  115 ++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 65 insertions(+), 50 deletions(-)

diff --git a/pages/module_consult/consulthome/consulthome.js b/pages/module_consult/consulthome/consulthome.js
index 1601e1a..0495b25 100644
--- a/pages/module_consult/consulthome/consulthome.js
+++ b/pages/module_consult/consulthome/consulthome.js
@@ -1,4 +1,7 @@
 // pages/module_consult/consulthome/consulthome.js
+const consultservice = require("../../../service/consultservice")
+const app = getApp()
+
 Page({
 
   /**
@@ -7,29 +10,14 @@
   data: {
     searchTips: '璇疯緭鍏ュ叧閿瓧鎼滅储',
     hotTopics: [{
-      pic: '',
-      title: '鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇',
-      abstract: '鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌�',
-      time: '2022-02-04',
-      author: '浣滆��',
-      itemCount: '5',
-      tags: ['tag1', 'tag2']
-    },{
-      pic: '',
-      title: '鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇',
-      abstract: '鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌�',
-      time: '2022-02-04',
-      author: '浣滆��',
-      itemCount: '5',
-      tags: ['tag1', 'tag2']
-    },{
-      pic: '',
-      title: '鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇',
-      abstract: '鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌愭煇鏌�',
-      time: '2022-02-04',
-      author: '浣滆��',
-      itemCount: '5',
-      tags: ['tag1', 'tag2']
+      id: '',
+      name: '娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡',
+      des: '娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡娉曞緥娉曡',
+      fileIndustry: '鐢熸�佺幆澧�',
+      itemType: '澶ф皵',
+      fileUrl: '',
+      keywords: ['鐢熸�佺幆澧�', '澶ф皵', '鐢熸�佺幆澧�', '澶ф皵澶�', '澶ф皵', '澶ф皵', '澶ф皵澶ф皵澶ф皵澶ф皵澶ф皵澶ф皵'],
+      time: ''
     }]
   },
 
@@ -37,7 +25,7 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad: function (options) {
-
+    this.getHotTopic()
   },
 
   /**
@@ -54,38 +42,65 @@
 
   },
 
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
-   */
-  onHide: function () {
-
+  gotoSearch () {
+    wx.navigateTo({
+      url: "/pages/module_consult/consultsearch/consultsearch"
+    })
   },
 
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
-   */
-  onUnload: function () {
-
+  goto (e) {
+    var url = ""
+    var index = e.currentTarget.dataset.index
+    switch (index) {
+      case "0":
+        url = ""
+        break;
+      case "1":
+        url = "/pages/module_consult/consultsearch/consultsearch"
+        break;
+      case "2":
+        url = ""
+        break;
+    }
+    if (url != "") {
+      wx.navigateTo({
+        url: url
+      })
+    } else {
+      wx.showToast({
+        title: '鍔熻兘鏁鏈熷緟',
+        duration: 1000,
+        icon: 'none',
+        mask: true,
+      })
+    }
   },
 
-  /**
-   * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
+    /**
+   * 鑾峰彇鐑棬鎼滅储鍐呭
    */
-  onPullDownRefresh: function () {
-
+  getHotTopic() {
+    var that = this
+    consultservice.getTopicLaw(app.globalData.accessToken.userId, {
+      success (res) {
+        that.setData({
+          hotTopics: res
+        })
+      }
+    })
   },
 
-  /**
-   * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
-   */
-  onShareAppMessage: function () {
-
+  gotoDetail (e) {
+    var i = e.currentTarget.dataset.index
+    var fileId = this.data.hotTopics[i].id
+    wx.navigateTo({
+      url: '/pages/module_consult/consultdetail/consultdetail',
+      success: (res) => {
+        // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+        res.eventChannel.emit('acceptDataFromOpenerPage', {
+          fileId: fileId
+        })
+      },
+    })
   }
 })
\ No newline at end of file

--
Gitblit v1.9.3