| | |
| | | // pages/module_consult/consulthome/consulthome.js |
| | | const consultservice = require("../../../service/consultservice") |
| | | const moment = require('../../../utils/moment.min') |
| | | const app = getApp() |
| | | |
| | | Page({ |
| | |
| | | */ |
| | | data: { |
| | | searchTips: '请输入关键字搜索', |
| | | hotTopics: [{ |
| | | id: '', |
| | | name: '法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规', |
| | | des: '法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规法律法规', |
| | | fileIndustry: '生态环境', |
| | | itemType: '大气', |
| | | fileUrl: '', |
| | | keywords: ['生态环境', '大气', '生态环境', '大气大', '大气', '大气', '大气大气大气大气大气大气'], |
| | | time: '' |
| | | }] |
| | | hotTopics: [], |
| | | |
| | | tabList: [{ |
| | | name: '热门', |
| | | tag: 0 |
| | | }, { |
| | | name: '文件', |
| | | tag: 0 |
| | | }, { |
| | | name: '条目', |
| | | tag: 0 |
| | | }, { |
| | | name: '案例', |
| | | tag: 0 |
| | | }], |
| | | |
| | | pageList: [ |
| | | [], |
| | | [], |
| | | [], |
| | | [], |
| | | ] |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | }, |
| | | |
| | | gotoSearch () { |
| | | gotoSearch() { |
| | | wx.navigateTo({ |
| | | url: "/pages/module_consult/consultsearch/consultsearch" |
| | | }) |
| | | }, |
| | | |
| | | goto (e) { |
| | | goto(e) { |
| | | var url = "" |
| | | var index = e.currentTarget.dataset.index |
| | | switch (index) { |
| | | case "0": |
| | | url = "" |
| | | url = "/pages/module_consult/consultproblem/consultproblem" |
| | | break; |
| | | case "1": |
| | | url = "/pages/module_consult/consultsearch/consultsearch" |
| | | break; |
| | | case "2": |
| | | url = "" |
| | | url = "/pages/module_consult/consultonline/consultonline" |
| | | break; |
| | | } |
| | | if (url != "") { |
| | |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | /** |
| | | * 获取热门搜索内容 |
| | | */ |
| | | getHotTopic() { |
| | | var that = this |
| | | consultservice.getTopicLaw(app.globalData.accessToken.userId, { |
| | | success (res) { |
| | | 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) |
| | | }); |
| | | that.setData({ |
| | | hotTopics: res |
| | | 'pageList[0]': res, |
| | | 'pageList[1]': res |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | gotoDetail (e) { |
| | | gotoDetail(e) { |
| | | var i = e.currentTarget.dataset.index |
| | | var fileId = this.data.hotTopics[i].id |
| | | var fileId = this.data.pageList[0][i].mfGuid |
| | | wx.navigateTo({ |
| | | url: '/pages/module_consult/consultdetail/consultdetail', |
| | | success: (res) => { |
| | |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | formateTime(t) { |
| | | if (t) { |
| | | return moment(t).format("YYYY年MM月DD日") |
| | | } else { |
| | | return undefined |
| | | } |
| | | }, |
| | | }) |