From 47e86f543415585ab1e1b2b1ed1d98830817a1be Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 19 九月 2022 09:41:07 +0800
Subject: [PATCH] 2022.9.16
---
pages/m_consult/consultresultmore/consultresultmore.js | 66 +++++---------------------------
1 files changed, 11 insertions(+), 55 deletions(-)
diff --git a/pages/m_consult/consultresultmore/consultresultmore.js b/pages/m_consult/consultresultmore/consultresultmore.js
index f6fa2a1..8b172c9 100644
--- a/pages/m_consult/consultresultmore/consultresultmore.js
+++ b/pages/m_consult/consultresultmore/consultresultmore.js
@@ -1,15 +1,15 @@
// pages/m_consult/consultresultmore/consultresultmore.js
-const consultservice = require("../../../service/consultservice")
const app = getApp()
-const behavior = require('../behaviors/behConsultItem')
Page({
- behaviors: [behavior],
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
- // result: []
+ keyobj: {keyword: null, type: undefined},
+ typeName: '',
+ //涓婃粦瑙﹀簳鍔犺浇
+ reachBottom: false
},
/**
@@ -18,65 +18,21 @@
onLoad(options) {
var that = this
this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
- console.log('getOpenerEventChannel:');
console.log(data);
that.setData({
- keyword: data.keyword,
- typeId: data.typeId,
+ keyobj: {
+ keyword: data.keyword,
+ type: data.typeId,
+ },
+ typeName: app.cosultTypeName(data.typeId)
})
- that.search(1)
})
},
onReachBottom () {
- console.log('onReachBottom');
- if (this.cPage && this.tPage) {
- if (this.cPage < this.tPage) {
- this.search(this.cPage + 1)
- }
- }
- },
-
- search (cPage = 1) {
- var that = this
- wx.showLoading({
- title: '鎼滅储涓�',
- mask: true,
- success: (res) => {},
- fail: (res) => {},
- complete: (res) => {},
+ this.setData({
+ reachBottom: true
})
- setTimeout(() => {
- wx.hideLoading()
- }, 20000);
- consultservice.searchLaw(app.globalData.accessToken.userId, this.data.keyword, cPage, 5, {
- onPage(head){
- that.cPage = head.page
- that.tPage = head.totalPage
- },
- success (res) {
- let result = that.data.result
- res.forEach(r => {
- r.des = r.des.replaceAll('\\n', '<br/>')
- if (result.length === 0) {
- result.push({
- typeId: r.typeId,
- typeName: r.typeName,
- contents: [r]
- })
- } else {
- result[0].contents.push(r)
- }
- });
- that.setData({
- result
- })
- console.log(result);
- },
- complete (res) {
- wx.hideLoading()
- }
- }, this.data.typeId)
},
})
\ No newline at end of file
--
Gitblit v1.9.3