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/consulthome/consulthome.js | 200 ++++++++------------------------------------------
1 files changed, 32 insertions(+), 168 deletions(-)
diff --git a/pages/m_consult/consulthome/consulthome.js b/pages/m_consult/consulthome/consulthome.js
index 471e6c8..2bdaf5e 100644
--- a/pages/m_consult/consulthome/consulthome.js
+++ b/pages/m_consult/consulthome/consulthome.js
@@ -1,25 +1,14 @@
// pages/m_consult/consulthome/consulthome.js
-const consultservice = require("../../../service/consultservice")
-const moment = require('../../../utils/moment.min')
-const app = getApp()
Page({
-
+ // behaviors: [behavior],
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
*/
data: {
searchTips: '璇疯緭鍏ュ叧閿瓧鎼滅储',
- hotTopics: [],
-
tabList: [{
name: '鐑棬',
- tag: 0
- }, {
- name: '鏂囦欢',
- tag: 0
- }, {
- name: '鏉$洰',
tag: 0
}, {
name: '闂瓟',
@@ -27,39 +16,35 @@
}, {
name: '妗堜緥',
tag: 0
- }],
-
- pageList: [
- [],
- [],
- [],
- [],
- [],
- ],
-
- //妗堜緥鎵�娑夊強鐨勮鐐�
- caseTag: []
+ }, {
+ name: '鏉$洰',
+ tag: 0
+ }, {
+ name: '鏂囦欢',
+ tag: 0
+ }, ],
+ refresh: false,
+ // 鐑棬鍐呭鏌ヨ鏉′欢
+ keyAll: {keyword: '', type: undefined},
+ key1: {keyword: '', type: 1},
+ key2: {keyword: '', type: 2},
+ key3: {keyword: '', type: 3},
+ key4: {keyword: '', type: 4},
+ reachBottom: [false, false, false, false, false],
+ tabIndex: 0
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
onLoad: function (options) {
- this.getHotTopic()
+ // this.getHotTopic()
},
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
- onReady: function () {
-
- },
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
- */
- onShow: function () {
-
+ onReachBottom() {
+ let reachBottom = [false, false, false, false, false]
+ reachBottom[this.data.tabIndex] = true
+ this.setData({reachBottom})
},
// 鎼滅储
@@ -98,140 +83,19 @@
}
},
- /**
- * 鑾峰彇鐑棬鎼滅储鍐呭
- */
- 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.formatTime(r.mfReleaseDate)
- r.mfEffectiveDate = that.formatTime(r.mfEffectiveDate)
- r.mfClosingDate = that.formatTime(r.mfClosingDate)
- });
- that.setData({
- 'pageList[0]': res,
- 'pageList[1]': res
- })
- }
+ loadingDone(e){
+ this.setData({
+ refresh: false
})
- // 2. 鐑棬娉曞緥娉曡鏉$洰
- consultservice.getTopicItem(app.globalData.accessToken.userId, {
- success(res) {
- res.forEach(r => {
- 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);
- }
+ this.setData({
+ refresh: true
})
},
-
- // 鍘诲線鏂囦欢璇︽儏
- gotoFile(e) {
- const iList = e.currentTarget.dataset.index.split(',')
- const i1 = iList[0]
- const i2 = iList[1]
- var fileId = this.data.pageList[i1][i2].mfGuid
- wx.navigateTo({
- url: '/pages/m_consult/consultdetail/consultdetail',
- success: (res) => {
- // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- fileId: fileId
- })
- },
+ onTabChange(e) {
+ // console.log(e.detail);
+ this.setData({
+ tabIndex: e.detail
})
- },
-
- // 鍘诲線鏉$洰璇︽儏
- gotoItem(e) {
- const iList = e.currentTarget.dataset.index.split(',')
- const i1 = iList[0]
- const i2 = iList[1]
- var itemId = this.data.pageList[i1][i2].miGuid
- wx.navigateTo({
- url: '/pages/m_consult/consultdetailitem/consultdetailitem',
- success: (res) => {
- // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- itemId: itemId
- })
- },
- })
- },
-
- // 鍘诲線闂瓟璇︽儏
- 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/m_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/m_consult/consultdetailcase/consultdetailcase',
- success: (res) => {
- // 閫氳繃 eventChannel 鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- caseId: caseId
- })
- },
- })
- },
-
- formatTime(t) {
- if (t) {
- return moment(t).format("YYYY.MM.DD")
- } else {
- return undefined
- }
- },
+ }
})
\ No newline at end of file
--
Gitblit v1.9.3