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/consultresult/consultresult.js |   45 ++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/pages/module_consult/consultresult/consultresult.js b/pages/module_consult/consultresult/consultresult.js
index 971e185..05c2a12 100644
--- a/pages/module_consult/consultresult/consultresult.js
+++ b/pages/module_consult/consultresult/consultresult.js
@@ -8,7 +8,8 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-    keyword: ''
+    keyword: 'asdad',
+    result: []
   },
 
   /**
@@ -18,11 +19,49 @@
     var that = this
     this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
       console.log(data);
-      that.data.keyword = data.keyword
+      that.setData({
+        keyword: data.keyword
+      })
+
+      that.search()
     })
   },
 
   search () {
-    consultservice.search(app)
+    var that = this
+    wx.showLoading({
+      title: '鎼滅储涓�',
+      mask: true,
+      success: (res) => {},
+      fail: (res) => {},
+      complete: (res) => {},
+    })
+    setTimeout(() => {
+      wx.hideLoading()
+    }, 20000);
+    consultservice.searchLaw(app.globalData.accessToken.userId, this.data.keyword, {
+      success (res) {
+        that.setData({
+          result: res
+        })
+      },
+      complete (res) {
+        wx.hideLoading()
+      }
+    })
+  },
+
+  gotoDetail (e) {
+    var i = e.currentTarget.dataset.index
+    var fileId = this.data.result[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