riku
2022-09-14 2206df0da6499846c78a358cf95ca33c218a5c5d
2022.9.13

1. 智能咨询模块抽象出查询结果组件以及查询函数,调试完成;
2. 在线守法学习抽象出对应的查询结果组件及查询函数,调试完成;
3. 新增环保日程功能模块,完成初步页面UI及逻辑;
已修改41个文件
已添加37个文件
已重命名1个文件
2870 ■■■■■ 文件已修改
app.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.json 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
base/ListPage.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
base/behaviors/b_loadingStatus.js 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/loadingstatus/loadingstatus.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/loadingstatus/loadingstatus.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/loadingstatus/loadingstatus.wxml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/loadingstatus/loadingstatus.wxss 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/switchtab/switchtab.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/switchtab/switchtab.wxml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/switchtab/switchtab.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_common/pagevideo/pagevideo.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_common/pagevideo/pagevideo.wxss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/base_c/c_result-item/c_result-item.js 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/base_c/c_result-item/c_result-item.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/base_c/c_result-item/c_result-item.wxml 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/base_c/c_result-item/c_result-item.wxss 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/behaviors/b_elementTypes.js 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/behaviors/b_questions.js 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/behaviors/b_search.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/c_result-item-search/c_result-item-search.js 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/c_result-item-search/c_result-item-search.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/c_result-item-search/c_result-item-search.wxml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/c_result-item-search/c_result-item-search.wxss 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultdetail/consultdetail.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultdetailcase/consultdetailcase.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultdetailitem/consultdetailitem.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultdetailqa/consultdetailqa.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consulthome/consulthome.js 206 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consulthome/consulthome.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consulthome/consulthome.wxml 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consulthome/consulthome.wxss 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultonline/consultonline.js 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultonline/consultonline.wxml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultproblem/consultproblem.js 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultproblem/consultproblem.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultproblem/consultproblem.wxml 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultproblem/consultproblem.wxss 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultresult/consultresult.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_consult/consultsearch/consultsearch.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/base_c/c_learn-item/c_learn-item.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/base_c/c_learn-item/c_learn-item.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/base_c/c_learn-item/c_learn-item.wxml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/base_c/c_learn-item/c_learn-item.wxss 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/behaviors/b_fetch.js 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/behaviors/b_openFile.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learfile/learnfile.js 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learfile/learnfile.json 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learfile/learnfile.wxml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learn/learn.js 128 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learn/learn.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learn/learn.wxml 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learn/learn.wxss 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learncase/learncase.js 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learncase/learncase.json 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_learn/learncase/learncase.wxml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/c_schedule/c_schedule.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/c_schedule/c_schedule.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/c_schedule/c_schedule.wxml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/c_schedule/c_schedule.wxss 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_schedule/p_schedule.js 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_schedule/p_schedule.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_schedule/p_schedule.wxml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_schedule/p_schedule.wxss 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_scheduledetail/p_scheduledetail.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_scheduledetail/p_scheduledetail.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_scheduledetail/p_scheduledetail.wxml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/m_service/p_scheduledetail/p_scheduledetail.wxss 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/test2/test2.js 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
project.config.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
res/icons/schedule_1.png 补丁 | 查看 | 原始文档 | blame | 历史
res/icons/schedule_2.png 补丁 | 查看 | 原始文档 | blame | 历史
res/icons/text_star.png 补丁 | 查看 | 原始文档 | blame | 历史
service/baserequest.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/consultservice.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.js
@@ -15,6 +15,7 @@
    console.log('onLaunch');
  },
  globalData: {
    perPage: 5,
    userInfo: null,
    accessToken: null,
    isLogin: false
app.json
@@ -2,14 +2,11 @@
  "entryPagePath": "pages/m_user/userlogin/userlogin",
  "pages": [
    "pages/home/home",
    "pages/m_assessment/assessment/assessment",
    "pages/m_assessment/grade/grade",
    "pages/m_assessment/gradedetail/gradedetail",
    "pages/m_assessment/gradereport/gradereport",
    "pages/m_common/pagevideo/pagevideo",
    "pages/m_consult/consulthome/consulthome",
    "pages/m_consult/consultsearch/consultsearch",
    "pages/m_consult/consultresult/consultresult",
@@ -20,36 +17,31 @@
    "pages/m_consult/consultdetailitem/consultdetailitem",
    "pages/m_consult/consultdetailqa/consultdetailqa",
    "pages/m_consult/consultdetailcase/consultdetailcase",
    "pages/m_learn/learn/learn",
    "pages/m_learn/learfile/learnfile",
    "pages/m_learn/learncase/learncase",
    "pages/m_ledger/ledgerhome/ledgerhome",
    "pages/m_ledger/ledgerupload/ledgerupload",
    "pages/m_ledger/ledgerhistory/ledgerhistory",
    "pages/m_notice/notice/notice",
    "pages/m_promise/promiseinfo/promiseinfo",
    "pages/m_promise/promisehome/promise",
    "pages/m_promise/promisefile/promisefile",
    "pages/m_promise/promiseresult/promiseresult",
    "pages/m_promise/promisesign/promisesign",
    "pages/m_service/p_servicehome/servicehome",
    "pages/m_user/userloginpw/userloginpw",
    "pages/m_user/userregistertype/userregistertype",
    "pages/m_user/userregistergov/userregistergov",
    "pages/m_user/userregistercompany/userregistercompany",
    "pages/m_user/mine/mine",
    "pages/m_user/userlogin/userlogin",
    "pages/icons/icons",
    "pages/text/text",
    "pages/test/test",
    "pages/test2/test2"
    "pages/test2/test2",
    "pages/m_service/p_schedule/p_schedule",
    "pages/m_service/p_scheduledetail/p_scheduledetail"
  ],
  "window": {
    "backgroundTextStyle": "light",
app.wxss
@@ -87,7 +87,7 @@
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  height: 50vh;
}
.no-data image {
base/ListPage.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
//列表页面基类,定义下拉刷新与上滑加载动作
const ListPage = function (options) {
  return Page(
    Object.assign({}, options, {
      onPullDownRefresh() {
        this.setData({
          pullDown: true
        })
      },
      onReachBottom() {
        this.setData({
          reachBottom: true
        })
      }
    })
  )
}
export default ListPage
base/behaviors/b_loadingStatus.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
/**
 * æ•°æ®åŠ è½½ç›‘å¬
 */
module.exports = Behavior({
  data: {
    cPage: 1,
    tPage: 1,
    totalCount: 0,
    loading: false,
    needLoadMore: false
  },
  observers: {
    'loading': function (loading) {
      if (loading) {
        this._loadStart()
        this._loading()
      } else {
        this._loadComplete()
      }
    },
    'cPage, tPage': function (cPage, tPage) {
      this.setData({
        needLoadMore: cPage < tPage
      })
    },
    'reachBottom': function(reachBottom) {
      if (reachBottom) {
        this._onReachBottom()
      }
    },
  },
  methods: {
    _onReachBottom() {
      console.log('_onReachBottom');
      let {cPage, tPage, loading} = this.data
      if (!loading && cPage < tPage) {
        if (typeof this.loadmore === 'function') {
          this.loadmore(cPage)
        }
      }
    },
    // åŠ è½½å¼€å§‹é€šçŸ¥
    _loadStart() {
      this.triggerEvent('loadStart')
      if (typeof this.loadStart === 'function') {
        this.loadStart()
      }
    },
    // åŠ è½½ä¸­é€šçŸ¥
    _loading() {
      this.triggerEvent('loading')
      if (typeof this.loading === 'function') {
        this.loading()
      }
    },
    // åŠ è½½å®Œæˆé€šçŸ¥
    _loadComplete() {
      this.triggerEvent('loadComplete')
      if (typeof this.loadComplete === 'function') {
        this.loadComplete()
      }
    }
  }
})
component/loadingstatus/loadingstatus.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
// component/loadingstatus/loadingstatus.js
Component({
  options: {
    addGlobalClass: true
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    loading: {
      type: Boolean,
      value: false
    },
    needLoadMore: {
      type: Boolean,
      value: false
    },
    nodata: {
      type: Boolean,
      value: false
    },
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
  }
})
component/loadingstatus/loadingstatus.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
{
  "component": true,
  "usingComponents": {
    "mp-loading": "/component/loading/loading"
  }
}
component/loadingstatus/loadingstatus.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
<!--component/loadingstatus/loadingstatus.wxml-->
<import src="/template/nodata.wxml"></import>
<template wx:if="{{!loading && nodata}}" is="nodataPage"></template>
<block wx:else="">
  <view wx:if="{{!loading}}" class="load-more">
    <text wx:if="{{needLoadMore}}">上滑加载</text>
    <text wx:else="">——到底了——</text>
  </view>
  <view wx:else class="load-more">
    <mp-loading duration="{{900}}" type="dot-gray" show="{{true}}" animated="{{true}}"></mp-loading>
  </view>
</block>
component/loadingstatus/loadingstatus.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
/* component/loadingstatus/loadingstatus.wxss */
.load-more {
  text-align: center;
  font-size: 12px;
  color: var(--fyui-text-color_3);
  padding: 8px;
}
component/switchtab/switchtab.js
@@ -12,9 +12,11 @@
      type: Array,
      value: []
    },
    pageList: {
      type: Array,
      value: []
    //通知组件刷新高度
    refresh: {
      type: Boolean,
      value: false,
      observer: 'refreshHeight'
    },
  },
@@ -27,34 +29,24 @@
    // pageheight: '600px',
  },
  observers: {
    'pageList': function() {
      this.tabsHeight('.page0');
    }
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    refreshHeight: function(e) {
      // console.log(`refreshHeight: ${e}`);
      if (e) {
        setTimeout(() => {
          const p = `.page${this.data.currentTab}`
          this.tabsHeight(p);
        }, 50);
      }
    },
    //计算swiper高度方法(在切换的时候调用)
    tabsHeight(element) {
      let that = this;
      let query = this.createSelectorQuery(); //必须要先创建一个查询
      query.select(element).boundingClientRect(function (rect) {
        // if (that.data.pageheight) {
        //   let pageheight = that.data.pageheight.split('px')[0]
        //   pageheight = parseInt(pageheight)
        //   if (rect.height > pageheight) {
        //     that.setData({
        //       pageheight: rect.height + 'px'
        //     });
        //   }
        // } else {
        //   that.setData({
        //     pageheight: rect.height + 'px'
        //   });
        // }
        that.setData({
          pageheight: rect.height + 'px'
        });
@@ -67,18 +59,16 @@
      } else {
        that.setData({
          currentTab: e.target.dataset.current,
          navScrollLeft: e.target.dataset.current >= 3 ? ((e.target.dataset.current) * 60) : 0 //判断当前选中的个数是否是第5个
        })
        // that.tabsHeight('.page' + e.target.dataset.current); //查询哪一个元素
      }
    },
    bindChange: function (e) {
      var that = this;
      that.setData({
        currentTab: e.detail.current,
        navScrollLeft: e.detail.current >= 3 ? ((e.detail.current) * 60) : 0 //判断当前选中的个数是否是第5个
      });
      that.tabsHeight('.page' + e.detail.current); //查询哪一个元素        
      this.triggerEvent('tabchange', this.data.currentTab)
    },
  }
})
component/switchtab/switchtab.wxml
@@ -1,8 +1,8 @@
<!--component/switchtab/switchtab.wxml-->
<view class="swiper-tab">
  <scroll-view class="swiper-tab_view" scroll-left="{{navScrollLeft}}" scroll-x="true" show-scrollbar="true" scroll-with-animation="true">
  <scroll-view class="swiper-tab_view" scroll-into-view="item{{currentTab}}" scroll-x="true" show-scrollbar="true" scroll-with-animation="true">
    <block wx:for="{{tabList}}" wx:key="i">
      <view class="swiper-tab-list {{currentTab==index ? 'on' : ''}}" data-current="{{index}}" bindtap="swichNav">
      <view id="item{{index}}" class="swiper-tab-list {{currentTab==index ? 'on' : ''}}" data-current="{{index}}" bindtap="swichNav">
        {{item.name}}
        <text wx:if="{{item.tag > 0}}" class="swiper-tab-list__tag">{{item.tag}}</text>
      </view>
@@ -11,7 +11,7 @@
</view>
<swiper current="{{currentTab}}" class="swiper-box" duration="300" bindchange="bindChange" style="height: {{pageheight}};">
  <block wx:for="{{pageList}}" wx:for-item="item" wx:key="index" wx:for-index="index">
  <block wx:for="{{tabList}}" wx:key="index">
    <swiper-item>
      <view class="page{{index}}">
        <slot name="slot{{index}}"></slot>
component/switchtab/switchtab.wxss
@@ -48,5 +48,5 @@
  width: 100%;
  /* height: 70px; */
  margin-top: 1px;
  background-color: white;
  /* background-color: white; */
}
pages/home/home.json
@@ -2,6 +2,7 @@
  "navigationBarBackgroundColor": "#EAFFF1",
  "enablePullDownRefresh":true,
  "usingComponents": {
    "cp-notice": "/component/notice/notice"
    "cp-notice": "/component/notice/notice",
    "c-schedule": "../m_service/c_schedule/c_schedule"
  }
}
pages/home/home.wxml
@@ -22,7 +22,7 @@
        </view>
      </view>
    </view> -->
    <view class="flex-h">
    <view class="flex-h" style="margin-top: 4px;">
      <view class="flex-h_block">
        <view class="top-card" bindtap="goto" data-index="0">
          <view>
@@ -101,6 +101,8 @@
      </view>
    </view>
    <c-schedule></c-schedule>
    <view class="fyui-panel">
      <view class="fyui-cell fyui-cell_select title">
        <view class="fyui-cell__hd">
pages/home/home.wxss
@@ -9,6 +9,9 @@
  font-size: 18px;
  color: var(--fyui-text-color_1);
  /* font-weight: 600; */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flex-h_block{
pages/m_common/pagevideo/pagevideo.wxml
@@ -23,7 +23,7 @@
  <view class="page__ft">
    <view class="title">相关视频</view>
    <view wx:for="{{resources}}" wx:key="index" wx:item="item">
      <view class="fyui-box fyui-panel" bindtap="gotoResource" data-index="{{index}}">
      <view class="fyui-box" bindtap="gotoResource" data-index="{{index}}">
        <view class="fyui-box__hd">
          <image src="{{item.lrPicurl}}" class="" mode="aspectFill"/>
        </view>
pages/m_common/pagevideo/pagevideo.wxss
@@ -12,3 +12,7 @@
  font-weight: 600;
  font-size: 16px;
}
.fyui-box__content {
  text-align: start;
}
pages/m_consult/base_c/c_result-item/c_result-item.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
/**
 * æ™ºèƒ½å’¨è¯¢æŸ¥è¯¢ç»“果列表组件
 */
Component({
  options: {
    addGlobalClass: true,
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    //查询结果
    results: {
      type: Array,
      value: []
    },
    loading: {
      type: Boolean,
      value: false
    },
    needLoadMore: {
      type: Boolean,
      value: false
    },
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    /**
     * è·³è½¬æ³•规文件、条目、案例、问答的详情界面
     */
    gotoDetail(e) {
      const {index, type} = e.currentTarget.dataset
      const id = this.data.results[index].id
      let url = ''
      switch (type) {
        case 1:
          url = '/pages/m_consult/consultdetail/consultdetail'
          break;
        case 2:
          url = '/pages/m_consult/consultdetailitem/consultdetailitem'
          break;
        case 3:
          url = '/pages/m_consult/consultdetailcase/consultdetailcase'
          break;
        case 4:
          url = '/pages/m_consult/consultdetailqa/consultdetailqa'
          break;
        default:
          break;
      }
      if (url != '') {
        wx.navigateTo({
          url: url,
          success: (res) => {
            res.eventChannel.emit('acceptDataFromOpenerPage', {
              id: id
            })
          },
        })
      } else {
        console.log('b_search: gotoDetail, url为空');
      }
    },
  }
})
pages/m_consult/base_c/c_result-item/c_result-item.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
{
  "component": true,
  "usingComponents": {
    "mp-loadingstatus": "/component/loadingstatus/loadingstatus"
  }
}
pages/m_consult/base_c/c_result-item/c_result-item.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,113 @@
<import src="/template/nodata.wxml"></import>
<view>
  <block wx:if="{{results.length > 0}}">
    <view wx:for="{{results}}" wx:key="index" data-index="{{index}}" data-type="{{item.typeId}}" bindtap="gotoDetail">
      <block wx:if="{{item.typeId == 1}}">
        <view class="fyui-box  fyui-box__text">
          <view class="fyui-box__hd">
            {{item.name}}
          </view>
          <view class="fyui-box__bd">
            <view class="fyui-box__content tag">
              <view>文件类别:{{item.fileType}}</view>
              <view>生效时间:{{item.effectiveDate}}</view>
              <view wx:if="{{item.referenceNumber}}">文号:{{item.referenceNumber}}</view>
              <view>相关行业 -> {{item.fileIndustry}}</view>
            </view>
            <view class="fyui-box__content des">{{item.des}}</view>
          </view>
          <view class="fyui-box__ft">
            <text class="keyword">关键词:</text>
            <view class="keyword-item">
              <text wx:for="{{item.keywords}}" wx:for-index="i" wx:for-item="word" wx:key="i">{{word}}</text>
            </view>
          </view>
        </view>
      </block>
      <block wx:elif="{{item.typeId == 2}}">
        <view class="fyui-box  fyui-box__text">
          <view class="fyui-box__hd">
            <rich-text nodes="{{item.des}}" class="fyui-box__content des subtitle"></rich-text>
          </view>
          <view class="fyui-box__bd">
            <!-- <view class="fyui-box__content tag">相关行业 -> {{item.fileIndustry}}</view> -->
            <text class="tag2">所属章节:{{item.chapterName}} {{item.name ? ' ' + item.name : ''}}</text>
            <text class="tag2">所属文件:《{{item.fileName}}》</text>
            <text class="tag2" wx:if="{{item.referenceNumber}}">所属文号:{{item.referenceNumber}}</text>
          </view>
          <view class="fyui-box__ft_2">
            <text class="tag3 {{item.effective? '' : 'tag3_disable'}}">{{item.effective ? '生效中':'已失效' }}</text>
            <text class="tag3 {{item.relatedItems? '' : 'tag3_disable'}}">{{item.relatedItems ? '关联条目' + item.relatedItems + '个 >':'无关联条目' }}</text>
            <text class="tag3 {{item.relatedCases? '' : 'tag3_disable'}}">{{item.relatedCases ? '关联案例' + item.relatedCases + '个 >':'无关联案例' }}</text>
          </view>
        </view>
      </block>
      <block wx:elif="{{item.typeId == 3}}">
        <view class="fyui-box fyui-box__text">
          <view class="fyui-box__hd">
            <text class="fyui-box__content des subtitle">{{item.name}}</text>
          </view>
          <view class="fyui-box__bd">
            <view class="case-bd">
              <rich-text class="tag2 des" nodes="{{item.des}}"></rich-text>
              <image wx:if="{{item.imgUrl}}" src="{{item.imgUrl}}" mode="aspectFill"></image>
            </view>
          </view>
          <view class="fyui-box__ft">
            <text>案发地址:{{item.provinceName + item.cityName}}</text>
            <text>案发时间:{{item.occurDate}}</text>
          </view>
          <view class="fyui-box__ft_2">
            <view style="white-space: nowrap;">涉及:</view>
            <view class="case-tag-group">
              <view class="case-tag" wx:if="{{item.punish}}">
                <image src="/res/icons/cq_punish.png"></image>
                <text>行政处罚</text>
              </view>
              <view class="case-tag" wx:if="{{item.detained}}">
                <image src="/res/icons/cq_detained.png"></image>
                <text>行政拘留</text>
              </view>
              <view class="case-tag" wx:if="{{item.illegal}}">
                <image src="/res/icons/cq_illegal.png"></image>
                <text>刑事责任</text>
              </view>
              <view class="case-tag" wx:if="{{item.shotSpot}}">
                <image src="/res/icons/cq_shotspot.png"></image>
                <text>环保热点</text>
              </view>
              <view class="case-tag" wx:if="{{item.supervise}}">
                <image src="/res/icons/cq_supervise.png"></image>
                <text>督察要点</text>
              </view>
              <view class="case-tag" wx:if="{{item.minor}}">
                <image src="/res/icons/cq_minor.png"></image>
                <text>轻微违法</text>
              </view>
            </view>
          </view>
        </view>
      </block>
      <block wx:elif="{{item.typeId == 4}}">
        <view class="fyui-box  fyui-box__text">
          <view class="fyui-box__hd">
            <text class="fyui-box__content des subtitle">{{item.name}}</text>
          </view>
          <view class="fyui-box__bd answer">
            <view class="tag2">答:</view>
            <rich-text class="tag2 des" nodes="{{item.des}}"></rich-text>
          </view>
          <view class="fyui-box__ft">
            <text>提问时间:{{item.time}}</text>
            <text>回复时间:{{item.time}}</text>
          </view>
        </view>
      </block>
    </view>
  </block>
  <mp-loadingstatus loading="{{loading}}" needLoadMore="{{needLoadMore}}" nodata="{{results.length == 0}}"></mp-loadingstatus>
</view>
pages/m_consult/base_c/c_result-item/c_result-item.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
/* --fyui-box */
.keyword {
  white-space: nowrap;
}
.keyword-item {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.keyword-item>text {
  white-space: nowrap;
  margin-right: 8px;
  padding: 0px 6px;
  color: #2c7064;
}
.des {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  width: 100%;
  overflow: hidden;
  /* text-overflow: ellipsis; */
}
.fyui-box__text .fyui-box__bd .tag {
  margin-bottom: 8px;
  font-size: 14px;
}
.fyui-box .answer {
  display: flex;
  flex-direction: row;
  /* justify-content: space-between; */
  /* background-color: red; */
}
.subtitle{
  font-size: 15px;
}
.tag2{
  line-height: 18px;
  font-size: 12px;
  color: var(--fyui-text-color_3);
}
.fyui-box__text .fyui-box__ft {
  font-size: 12px;
}
.case-bd{
  display: flex;
}
.case-bd>image{
  width: 60%;
  height: 54px;
  border-radius: 4px;
  margin-left: 4px;
}
.fyui-box__ft_2 {
  display: flex;
  font-size: 12px;
  color: var(--fyui-text-color_3);
  margin-top: 16px;
}
.case-tag-group {
  display: flex;
  flex-wrap: wrap;
}
.case-tag {
  display: flex;
  align-items: center;
}
.case-tag>image {
  width: 14px;
  height: 14px;
}
.case-tag>text {
  white-space: nowrap;
  margin-left: 4px;
  margin-right: 4px;
}
.tag3{
  font-size: 10px;
  background-color: var(--fyui-primary-color);
  color: white;
  border-radius: 2px;
  padding: 2px 4px;
  white-space: nowrap;
  margin-right: 10px;
}
.tag3_disable{
  background-color: var(--fyui-text-color_3);
}
pages/m_consult/behaviors/b_elementTypes.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,151 @@
const consultservice = require("../../../service/consultservice")
const app = getApp()
/**
 * èŽ·å–çŽ¯ä¿è¦ç´ åˆ†ç±»
 */
module.exports = Behavior({
  data: {
    menus: [
      { name: '大气', value: 1 },
      { name: 'æ°´', value: 2 },
      { name: '海洋', value: 3 },
      { name: '土壤', value: 4 },
      { name: '噪声', value: 5 },
      { name: '光', value: 6 },
      { name: '辐射', value: 7 },
      { name: 'æ ¸', value: 8 },
      { name: '固体废物', value: 9 },
      { name: '化学品', value: 10 },
      { name: '台账', value: 21 },
      { name: '执法', value: 31 },
      { name: '督察', value: 41 },
      { name: '监测', value: 51 },
      { name: '服务', value: 61 },
      { name: '其他', value: 99 }
    ],
    items: [
      [
        { name: 'PM', value: 1  },
        { name: 'NOX', value: 2  },
        { name: 'O3', value: 3  },
        { name: 'VOCs', value: 4  },
        { name: '工业废气', value: 5  },
        { name: '机动车尾气', value: 6  },
        { name: '扬尘', value: 7  },
        { name: '餐饮油烟', value: 8  },
        { name: '恶臭', value: 9  },
        { name: '其他', value: 99 },
      ],
      [
        { name: '地表水', value: 1  },
        { name: '地下水', value: 2  },
        { name: '饮用水', value: 3  },
        { name: '工业废水', value: 4  },
        { name: '生活污水', value: 5  },
        { name: '商业污水', value: 6  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '石油及其产品', value: 1  },
        { name: '重金属和酸碱', value: 2  },
        { name: '农药', value: 3  },
        { name: '有机物质和营养盐类', value: 4  },
        { name: '放射性核素', value: 5  },
        { name: '固体废物', value: 6  },
        { name: '废热', value: 7  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '农田耕地', value: 1  },
        { name: '工业企业用地', value: 2  },
        { name: '石油开采用地', value: 3  },
        { name: '矿山开采用地', value: 4  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '工业生产噪声', value: 1  },
        { name: '交通运输噪声', value: 2  },
        { name: '建筑施工噪声', value: 3  },
        { name: '社会生活噪声', value: 4  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '白亮污染', value: 1  },
        { name: '人工白昼污染', value: 2  },
        { name: '彩光污染', value: 3  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '电磁辐射', value: 1  },
        { name: '放射性辐射', value: 2  },
        { name: '其他', value: 99  },
      ],
      [],
      [],
      [],
      [],
      [],
      [],
      [],
      [],
    ],
  },
  methods: {
    /**
     * è¦ç´ å¤§ç±»
     */
    getEnElementTypes() {
      var that = this
      consultservice.getEnElementTypes(app.globalData.accessToken.userId, {
        success(res) {
          const menus = [{
            name: '全部',
            value: null,
          }]
          res.forEach(r => {
            menus.push({
              name: r.first,
              value: r.second,
            })
          });
          that.setData({menus})
        }
      })
    },
    /**
     * è¦ç´ å­ç±»
     */
    getEnElementSubTypes() {
      var that = this
      consultservice.getEnElementSubTypes(app.globalData.accessToken.userId, {
        success(res) {
          const items = [
            [{
              name: '全部',
              value: null,
            }]
          ]
          res.forEach(r => {
            const l = []
            r.forEach(s => {
              l.push({
                name: s.first,
                value: s.second,
              })
            });
            items.push(l)
          });
          that.setData({items})
        }
      })
    },
  },
  lifetimes: {
    attached: function() {
      this.getEnElementTypes()
      this.getEnElementSubTypes()
    }
  }
})
pages/m_consult/behaviors/b_questions.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
const b_loadingStatus = require("../../../base/behaviors/b_loadingStatus")
const consultservice = require("../../../service/consultservice")
const util = require("../../../utils/util")
const app = getApp()
/**
 * é€šè¿‡åˆ†ç±»èŽ·å–é—®é¢˜
 */
module.exports = Behavior({
  behaviors: [b_loadingStatus],
  data: {
    //搜索结果
    questions: [],
  },
  methods: {
    loadmore(cPage) {
      this.getQuestionsByType(++cPage, this.selectedValues)
    },
    /**
     * æ ¹æ®è¦ç´ ç±»åž‹èŽ·å–å¯¹åº”çš„é—®é¢˜
     * @see "./b_element-types.js"
     * @param page åˆ†é¡µ
     * @param selectedValues [i, j],选中的分类编号i和子类编号j,i、j为null表示全部
     */
    getQuestionsByType(page = 1, selectedValues) {
      this.selectedValues = selectedValues
      this.setData({loading: true})
      const t = setTimeout(() => {
        this.setData({loading: false})
      }, 10000);
      var that = this
      consultservice.getQuestionsByType(app.globalData.accessToken.userId, selectedValues[0], selectedValues[1], page, app.globalData.perPage, {
          onPage(head) {
            that.setData({
              cPage: head.page,
              tPage: head.totalPage,
              totalCount: head.totalCount
            })
          },
          success(res) {
            res.forEach(r => {
              r.time = util.formatTime(r.time)
              r.des = r.des.replaceAll('\\n', '<br/>')
            });
            let questions = that.data.questions
            if (page == 1) {
              questions = []
            }
            questions = questions.concat(res)
            that.setData({questions})
          },
          complete(e) {
            that.setData({loading: false})
            clearTimeout(t)
          }
        })
    },
  }
})
pages/m_consult/behaviors/b_search.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,52 @@
const b_loadingStatus = require("../../../base/behaviors/b_loadingStatus")
const consultservice = require("../../../service/consultservice")
const app = getApp()
/**
 * æ™ºèƒ½åœ¨çº¿å’¨è¯¢çš„æœç´¢é€»è¾‘
 */
module.exports = Behavior({
  behaviors: [b_loadingStatus],
  data: {
    //搜索结果
    results: []
  },
  methods: {
    loadmore(cPage) {
      this.search(this.obj, ++cPage)
    },
    /**
     * æ ¹æ®å…³é”®å­—及查询类型搜索
     * @param keyword å…³é”®å­—,若关键字为空白,则按照热门的逻辑搜索
     * @param type æŸ¥è¯¢ç±»åž‹ï¼ŒåŒ…括[1:法规文件,2:法规条目,3:执法案例,4:环保问题],不填写时表示查询所有类型的前5条
     */
    search(obj, cPage = 1) {
      this.obj = obj
      this.setData({loading: true})
      const t = setTimeout(() => { this.setData({loading: false}) }, 10000);
      var that = this
      const {keyword, type} = obj
      consultservice.searchLaw(app.globalData.accessToken.userId, keyword, cPage, app.globalData.perPage, {
        onPage(head) {
          that.setData({
            cPage: head.page,
            tPage: head.totalPage,
          })
        },
        success(res) {
          let results = that.data.results
          //当分页为第一页时,代表数据全部刷新,删去上一次获取的记录,否则为获取更多数据,保留前一次获取的记录
          if (that.data.cPage == 1) results = []
          results = results.concat(res)
          that.setData({
            results
          })
        },
        complete() {
          that.setData({loading: false})
          clearTimeout(t)
        }
      }, type)
    },
  }
})
pages/m_consult/c_result-item-search/c_result-item-search.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
const b_search = require("../behaviors/b_search")
/**
 * æ™ºèƒ½å’¨è¯¢æŸ¥è¯¢ç»“果列表组件
 */
Component({
  behaviors: [b_search],
  /**
   * ç»„件的属性列表
   */
  properties: {
    //查询条件
    keyobj: {
      type: Object,
      value: {
        keyword: '',
        type: undefined
      },
    },
    reachBottom: {
      type: Boolean,
      value: false
    }
  },
  observers: {
    'keyobj': function(keyobj) {
      this.search(keyobj)
    },
    // 'reachBottom': function(reachBottom) {
    //   if (reachBottom) {
    //     this._onReachBottom()
    //   }
    // }
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    // _onReachBottom() {
    //   console.log('_onReachBottom');
    //   let {cPage, tPage} = this.data
    //   console.log(this.data);
    //   if (cPage < tPage) {
    //     this.search(this.data.keyobj, ++cPage)
    //   }
    // }
  }
})
pages/m_consult/c_result-item-search/c_result-item-search.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
{
  "component": true,
  "usingComponents": {
    "c-result-item": "../base_c/c_result-item/c_result-item"
  }
}
pages/m_consult/c_result-item-search/c_result-item-search.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1 @@
<c-result-item results="{{results}}" loading="{{loading}}" needLoadMore="{{needLoadMore}}"></c-result-item>
pages/m_consult/c_result-item-search/c_result-item-search.wxss
pages/m_consult/consultdetail/consultdetail.js
@@ -9,7 +9,7 @@
   * é¡µé¢çš„初始数据
   */
  data: {
    fileId: 'Zi5EEhijAKugYeHe',
    id: 'Zi5EEhijAKugYeHe',
    content: {}
  },
@@ -20,7 +20,7 @@
    var that = this
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
      that.setData({
        fileId: data.fileId
        id: data.id
      })
      that.getFile()
@@ -54,7 +54,7 @@
    setTimeout(() => {
      wx.hideLoading()
    }, 20000);
    consultservice.getMgtFile(app.globalData.accessToken.userId, this.data.fileId, {
    consultservice.getMgtFile(app.globalData.accessToken.userId, this.data.id, {
      success (res) {
        res.mfReleaseDate = that.formateTime(res.mfReleaseDate)
        res.mfEffectiveDate = that.formateTime(res.mfEffectiveDate)
pages/m_consult/consultdetailcase/consultdetailcase.js
@@ -26,7 +26,7 @@
    var that = this
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
      that.setData({
        caseId: data.caseId
        id: data.id
      })
      that.getCase()
    })
@@ -37,7 +37,7 @@
      showloading: true
    })
    var that = this
    consultservice.getCase(app.globalData.accessToken.userId, this.data.caseId, {
    consultservice.getCase(app.globalData.accessToken.userId, this.data.id, {
      success(res) {
        let caseTag = []
        if (res.ecIsPunish) caseTag.push({icon: '/res/icons/cq_punish.png', name: '涉及行政处罚'})
pages/m_consult/consultdetailitem/consultdetailitem.js
@@ -20,7 +20,7 @@
    var that = this
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
      that.setData({
        itemId: data.itemId
        id: data.id
      })
      that.getItem()
@@ -90,7 +90,7 @@
    setTimeout(() => {
      wx.hideLoading()
    }, 20000);
    consultservice.getMgtItem(app.globalData.accessToken.userId, this.data.itemId, {
    consultservice.getMgtItem(app.globalData.accessToken.userId, this.data.id, {
      success (res) {
        res.miItemContent = res.miItemContent.replaceAll('\\n', '<br/>')
        that.setData({
pages/m_consult/consultdetailqa/consultdetailqa.js
@@ -33,7 +33,7 @@
    var that = this
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
      that.setData({
        qId: data.qId
        id: data.id
      })
      that.getQuestion()
@@ -46,7 +46,7 @@
      showloading: true
    })
    var that = this
    consultservice.getQuestion(app.globalData.accessToken.userId, this.data.qId, {
    consultservice.getQuestion(app.globalData.accessToken.userId, this.data.id, {
      success(res) {
        let questionTag = []
        if (res.cqIsPunish) questionTag.push({icon: '/res/icons/cq_punish.png', name: '涉及行政处罚'})
@@ -72,7 +72,7 @@
      showloading: true
    })
    var that = this
    consultservice.getAnswers(app.globalData.accessToken.userId, this.data.qId, {
    consultservice.getAnswers(app.globalData.accessToken.userId, this.data.id, {
      success(res) {
        res.forEach(r => {
          r.saContent = r.saContent.replaceAll('\\n', '<br/>')
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
    })
    this.setData({
      refresh: true
    })
  },
  onTabChange(e) {
    console.log(e.detail);
    this.setData({
      tabIndex: e.detail
        })
      }
    })
    // 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);
      }
    })
  },
  // åŽ»å¾€æ–‡ä»¶è¯¦æƒ…
  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
        })
      },
    })
  },
  // åŽ»å¾€æ¡ç›®è¯¦æƒ…
  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
    }
  },
})
pages/m_consult/consulthome/consulthome.json
@@ -5,6 +5,7 @@
  "usingComponents": {
    "mp-icon": "/component/icon/icon",
    "switch-tab": "/component/switchtab/switchtab",
    "mp-loading": "/component/loading/loading"
    "mp-loading": "/component/loading/loading",
    "c-result-item-search": "../c_result-item-search/c_result-item-search"
  }
}
pages/m_consult/consulthome/consulthome.wxml
@@ -5,8 +5,6 @@
      <mp-icon icon="search" size="15" color="black"></mp-icon>
      <text>{{searchTips}}</text>
    </view>
  </view>
  <view class="page__bd">
    <view class="flex-h">
      <view class="card" bindtap="goto" data-index="0">
        <image src="/res/icons/con_pro_bg.png" class="card-bg" mode="scaleToFill" />
@@ -29,145 +27,15 @@
        <image src="/res/icons/con_qa.png" mode="aspectFit" class="icon"></image>
      </view>
    </view>
    <switch-tab tabList="{{tabList}}" pageList="{{pageList}}">
      <view slot="slot{{i1}}" wx:for="{{pageList}}" wx:for-item="page" wx:key="i1" wx:for-index="i1">
        <block wx:if="{{page.length > 0}}">
          <block wx:if="{{i1 == 0 || i1 == 1}}">
            <view wx:for="{{page}}" wx:key="i2" wx:for-index="i2" data-index="{{i1}},{{i2}}" bindtap="gotoFile">
              <view class="fyui-box  fyui-box__text">
                <view class="fyui-box__hd">
                  {{item.mfName}}
                </view>
                <view class="fyui-box__bd">
                  <view class="fyui-box__content tag">
                    <view>文件类别:{{item.mfFileType}}</view>
                    <view>生效时间:{{item.mfEffectiveDate}}</view>
                    <view>文号:{{item.mfReferenceNumber}}</view>
                    <view>相关行业 -> {{item.mfFileIndustry}}</view>
                  </view>
                  <view class="fyui-box__content des">{{item.mfSummary}}</view>
                </view>
                <view class="fyui-box__ft">
                  <text class="keyword">关键词:</text>
                  <view class="keyword-item">
                    <text wx:for="{{item.mfKeywordLv1}}" wx:for-index="i" wx:for-item="word" wx:key="i">{{word}}</text>
                  </view>
                </view>
              </view>
            </view>
          </block>
          <block wx:elif="{{i1 == 2}}">
            <view wx:for="{{page}}" wx:key="i2" wx:for-index="i2" data-index="{{i1}},{{i2}}" bindtap="gotoItem">
              <view class="fyui-box  fyui-box__text">
                <view class="fyui-box__hd">
                  <rich-text nodes="{{item.miItemContent}}" class="fyui-box__content des subtitle"></rich-text>
                </view>
                <view class="fyui-box__bd">
                  <!-- <view class="fyui-box__content tag">相关行业 -> {{item.fileIndustry}}</view> -->
                  <text class="tag2">所属章节:{{item.miChapterName}} {{item.miItemName ? ' ' + item.miItemName : ''}}</text>
                  <text class="tag2">所属文件:《{{item.mfName}}》</text>
                  <text class="tag2" wx:if="{{item.miReferenceNumber}}">所属文号:{{item.miReferenceNumber}}</text>
                </view>
                <view class="fyui-box__ft">
                  <!-- <text class="tag3 {{item.effective? '' : 'tag3_disable'}}">{{item.effective ? '生效中':'已失效' }}</text>
                  <text class="tag3 {{item.relatedItems? '' : 'tag3_disable'}}">{{item.relatedItems ? '关联条目' + item.relatedItems + '个 >':'无关联条目' }}</text>
                  <text class="tag3 {{item.relatedCases? '' : 'tag3_disable'}}">{{item.relatedCases ? '关联案例' + item.relatedCases + '个 >':'无关联案例' }}</text> -->
                  <!-- <text class="keyword">关键词:</text>
                <view class="keyword-item"><text wx:for="{{item.keywords}}" wx:for-index="i" wx:for-item="word" wx:key="i">{{word}}</text></view> -->
                </view>
              </view>
            </view>
          </block>
          <block wx:elif="{{i1 == 3}}">
            <view wx:for="{{page}}" wx:key="i2" wx:for-index="i2" data-index="{{i1}},{{i2}}" bindtap="gotoQA">
              <view class="fyui-box  fyui-box__text">
                <view class="fyui-box__hd">
                  <text class="fyui-box__content des subtitle">{{item.cqContent}}</text>
                </view>
                <view class="fyui-box__bd answer">
                  <!-- <view class="fyui-box__content tag">相关行业 -> {{item.fileIndustry}}</view> -->
                  <view class="tag2">答:</view>
                  <rich-text class="tag2 des" nodes="{{item.answer}}"></rich-text>
                </view>
                <view class="fyui-box__ft">
                  <text class="tag3">提问时间:{{item.cqCreateTime}}</text>
                  <text class="tag3">回复时间:{{item.cqCreateTime}}</text>
                  <!-- <text class="keyword">关键词:</text>
                <view class="keyword-item"><text wx:for="{{item.keywords}}" wx:for-index="i" wx:for-item="word" wx:key="i">{{word}}</text></view> -->
                </view>
              </view>
            </view>
          </block>
          <block wx:elif="{{i1 == 4}}">
            <view wx:for="{{page}}" wx:key="i2" wx:for-index="i2" data-index="{{i1}},{{i2}}" bindtap="gotoCase">
              <view class="fyui-box fyui-box__text">
                <view class="fyui-box__hd">
                  <text class="fyui-box__content des subtitle">{{item.ecTitle}}</text>
                </view>
                <view class="fyui-box__bd">
                  <view class="case-bd">
                    <rich-text class="tag2 des" nodes="{{item.ecSummary}}"></rich-text>
                    <image wx:if="{{item.ecAppendixUrl.length > 0}}" src="{{item.ecAppendixUrl[0]}}" mode="aspectFill"></image>
                  </view>
                </view>
                <view class="fyui-box__ft">
                  <text class="tag3">案发地址:{{item.ecProvinceName + item.ecCityName}}</text>
                  <text class="tag3">案发时间:{{item.ecOccurDate}}</text>
                </view>
                <view class="fyui-box__ft_2">
                  <view style="white-space: nowrap;">涉及:</view>
                  <view class="case-tag-group">
                    <view class="case-tag" wx:if="{{item.ecIsPunish}}">
                      <image src="/res/icons/cq_punish.png"></image>
                      <text>行政处罚</text>
                    </view>
                    <view class="case-tag" wx:if="{{item.ecIsDetained}}">
                      <image src="/res/icons/cq_detained.png"></image>
                      <text>行政拘留</text>
                    </view>
                    <view class="case-tag" wx:if="{{item.ecIsIllegal}}">
                      <image src="/res/icons/cq_illegal.png"></image>
                      <text>刑事责任</text>
                    </view>
                    <view class="case-tag" wx:if="{{item.ecIsShotspot}}">
                      <image src="/res/icons/cq_shotspot.png"></image>
                      <text>环保热点</text>
                    </view>
                    <view class="case-tag" wx:if="{{item.ecIsSupervise}}">
                      <image src="/res/icons/cq_supervise.png"></image>
                      <text>督察要点</text>
                    </view>
                    <view class="case-tag" wx:if="{{item.ecIsMinor}}">
                      <image src="/res/icons/cq_minor.png"></image>
                      <text>轻微违法</text>
                    </view>
                  </view>
                </view>
              </view>
            </view>
          </block>
        </block>
        <view wx:else class="page__ft">
          <mp-loading duration="{{900}}" type="dot-gray" show="{{true}}" animated="{{true}}"></mp-loading>
        </view>
      </view>
  <view class="page__bd">
    <switch-tab tabList="{{tabList}}" refresh="{{refresh}}" bindtabchange="onTabChange">
      <c-result-item-search slot="slot0" reachBottom="{{reachBottom[0]}}" keyobj="{{keyAll}}" data-index="0" bindloadComplete="loadingDone"></c-result-item-search>
      <c-result-item-search slot="slot1" reachBottom="{{reachBottom[1]}}" keyobj="{{key4}}" data-index="1" bindloadComplete="loadingDone"></c-result-item-search>
      <c-result-item-search slot="slot2" reachBottom="{{reachBottom[2]}}" keyobj="{{key3}}" data-index="2" bindloadComplete="loadingDone"></c-result-item-search>
      <c-result-item-search slot="slot3" reachBottom="{{reachBottom[3]}}" keyobj="{{key2}}" data-index="3" bindloadComplete="loadingDone"></c-result-item-search>
      <c-result-item-search slot="slot4" reachBottom="{{reachBottom[4]}}" keyobj="{{key1}}" data-index="4" bindloadComplete="loadingDone"></c-result-item-search>
    </switch-tab>
    <!-- <view class="fyui-cell fyui-cell_select">
      <view class="fyui-cell__bd">热门</view>
      <view class="fyui-cell__ft">更多</view>
    </view> -->
  </view>
  <view class="page__ft">
  </view>
  <view class="page__ft"></view>
</view>
pages/m_consult/consulthome/consulthome.wxss
@@ -1,6 +1,6 @@
/* pages/m_consult/consulthome/consulthome.wxss */
.page__bd {
  padding: 10px;
  /* padding: 10px; */
}
.search-bar {
@@ -12,6 +12,7 @@
  text-align: left;
  background-color: white;
  border-radius: 10px;
  margin-bottom: 8px;
}
.card {
@@ -50,99 +51,4 @@
.card .icon {
  height: 56px;
  width: 60px;
}
/* --fyui-box */
.fyui-box__tag {
  justify-content: space-evenly;
}
.keyword {
  white-space: nowrap;
}
.keyword-item {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.keyword-item>text {
  white-space: nowrap;
  margin-right: 8px;
  padding: 0px 6px;
  color: #2c7064;
}
.des {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  width: 100%;
  overflow: hidden;
  /* text-overflow: ellipsis; */
}
.fyui-box__text .fyui-box__bd .tag {
  margin-bottom: 8px;
  font-size: 14px;
}
.fyui-box .answer {
  display: flex;
  flex-direction: row;
  /* justify-content: space-between; */
  /* background-color: red; */
}
.subtitle{
  font-size: 15px;
}
.tag2{
  line-height: 18px;
  font-size: 12px;
  color: var(--fyui-text-color_3);
}
.fyui-box__text .fyui-box__ft {
  font-size: 12px;
}
.case-bd{
  display: flex;
}
.case-bd>image{
  width: 60%;
  height: 54px;
  border-radius: 4px;
  margin-left: 4px;
}
.fyui-box__ft_2 {
  display: flex;
  font-size: 12px;
  color: var(--fyui-text-color_3);
  margin-top: 16px;
}
.case-tag-group {
  display: flex;
  flex-wrap: wrap;
}
.case-tag {
  display: flex;
  align-items: center;
}
.case-tag>image {
  width: 14px;
  height: 14px;
}
.case-tag>text {
  white-space: nowrap;
  margin-left: 4px;
  margin-right: 4px;
}
pages/m_consult/consultonline/consultonline.js
@@ -1,8 +1,9 @@
// pages/m_consult/consultonline/consultonline.js
const b_search = require("../behaviors/b_search")
const app = getApp()
Page({
  behaviors: [b_search],
  /**
   * é¡µé¢çš„初始数据
   */
@@ -13,6 +14,7 @@
        time: '',
        userId: 'system',
        userName: '智能客服',
        type: 0,
        text: '用户您好,很高兴为你服务',
      },
      {
@@ -20,6 +22,7 @@
        time: '',
        userId: 'system',
        userName: '智能客服',
        type: 0,
        text: '用户您好,很高兴为您服务,本月信用自评结果较 å¥½ï¼Œç»§ç»­ä¿æŒå“¦.用户您好,很高兴为您服务,本月信用自评结果较 å¥½ï¼Œç»§ç»­ä¿æŒå“¦.用户您好,很高兴为您服务,本月信用自评结果较 å¥½ï¼Œç»§ç»­ä¿æŒå“¦.用户您好,很高兴为您服务,本月信用自评结果较 å¥½ï¼Œç»§ç»­ä¿æŒå“¦.用户您好,很高兴为您服务,本月信用自评结果较 å¥½ï¼Œç»§ç»­ä¿æŒå“¦.',
      },
@@ -27,41 +30,13 @@
    focus: false,
    value: '',
    placeholder: '请输入关键字'
    placeholder: '请输入想要提问的内容'
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
@@ -87,25 +62,38 @@
      userName: app.globalData.userInfo.acountname,
      text: this.data.value,
    })
    this.getAnswer(this.data.value)
    const keyword = this.data.value
    this.setData({
      record,
      value: ''
    })
    this.getAnswer(keyword)
  },
  getAnswer(q) {
    let record = this.data.record
    this.search({
      keyword: q,
      type: undefined
    })
  },
    setTimeout(() => {
  loadComplete() {
    const results = this.data.results
    console.log(results);
    let record = this.data.record
    results.forEach(r => {
      record.push({
        id: 'system',
        time: '',
        userId: 'system',
        userName: '智能客服',
        text: '用户您好,很高兴为你服务',
        type: r.typeId,
        text: r,
      })
    });
      this.setData({record})
    }, 1000);
  }
})
pages/m_consult/consultonline/consultonline.wxml
@@ -1,12 +1,18 @@
<!--pages/m_consult/consultonline/consultonline.wxml-->
<view class="consult-record">
  <block wx:for="{{record}}">
    <view wx:if="{{userId == item.userId}}" wx:key="index" class="consult-record_item_user">
  <block wx:for="{{record}}" wx:key="index">
    <view wx:if="{{userId == item.userId}}" class="consult-record_item_user">
      <view class="consult-text_user">{{item.text}}</view>
    </view>
    <view wx:else class="consult-record_item">
      <image src="/res/icons/avator_sys.png" class="consult-avator"></image>
      <view class="consult-text">{{item.text}}</view>
      <view wx:if="{{item.type == 0}}" class="consult-text">{{item.text}}</view>
      <view wx:elif="{{item.type == 1}}" class="consult-text">
        {{item.text.name}}
      </view>
      <view wx:elif="{{item.type == 2}}" class="consult-text">{{item.text.name}}</view>
      <view wx:elif="{{item.type == 3}}" class="consult-text">{{item.text.name}}</view>
      <view wx:elif="{{item.type == 4}}" class="consult-text">{{item.text.name}}</view>
    </view>
  </block>
</view>
pages/m_consult/consultproblem/consultproblem.js
@@ -1,99 +1,13 @@
// pages/m_consult/consultproblem/consultproblem.js
const consultservice = require("../../../service/consultservice")
const util = require("../../../utils/util")
const app = getApp()
import ListPage from '../../../base/ListPage'
const b_questions = require('../behaviors/b_questions')
const b_elementTypes = require('../behaviors/b_elementTypes')
Page({
ListPage({
  behaviors: [b_questions, b_elementTypes],
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    loading: false,
    menus: [
      { name: '大气', value: 1 },
      { name: 'æ°´', value: 2 },
      { name: '海洋', value: 3 },
      { name: '土壤', value: 4 },
      { name: '噪声', value: 5 },
      { name: '光', value: 6 },
      { name: '辐射', value: 7 },
      { name: 'æ ¸', value: 8 },
      { name: '固体废物', value: 9 },
      { name: '化学品', value: 10 },
      { name: '台账', value: 21 },
      { name: '执法', value: 31 },
      { name: '督察', value: 41 },
      { name: '监测', value: 51 },
      { name: '服务', value: 61 },
      { name: '其他', value: 99 }
    ],
    items: [
      [
        { name: 'PM', value: 1  },
        { name: 'NOX', value: 2  },
        { name: 'O3', value: 3  },
        { name: 'VOCs', value: 4  },
        { name: '工业废气', value: 5  },
        { name: '机动车尾气', value: 6  },
        { name: '扬尘', value: 7  },
        { name: '餐饮油烟', value: 8  },
        { name: '恶臭', value: 9  },
        { name: '其他', value: 99 },
      ],
      [
        { name: '地表水', value: 1  },
        { name: '地下水', value: 2  },
        { name: '饮用水', value: 3  },
        { name: '工业废水', value: 4  },
        { name: '生活污水', value: 5  },
        { name: '商业污水', value: 6  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '石油及其产品', value: 1  },
        { name: '重金属和酸碱', value: 2  },
        { name: '农药', value: 3  },
        { name: '有机物质和营养盐类', value: 4  },
        { name: '放射性核素', value: 5  },
        { name: '固体废物', value: 6  },
        { name: '废热', value: 7  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '农田耕地', value: 1  },
        { name: '工业企业用地', value: 2  },
        { name: '石油开采用地', value: 3  },
        { name: '矿山开采用地', value: 4  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '工业生产噪声', value: 1  },
        { name: '交通运输噪声', value: 2  },
        { name: '建筑施工噪声', value: 3  },
        { name: '社会生活噪声', value: 4  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '白亮污染', value: 1  },
        { name: '人工白昼污染', value: 2  },
        { name: '彩光污染', value: 3  },
        { name: '其他', value: 99  },
      ],
      [
        { name: '电磁辐射', value: 1  },
        { name: '放射性辐射', value: 2  },
        { name: '其他', value: 99  },
      ],
      [],
      [],
      [],
      [],
      [],
      [],
      [],
      [],
    ],
    selected: [{
      name: '全部',
      value: null
@@ -101,96 +15,16 @@
      name: '全部',
      value: null
    }],
    questions: []
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    this.getQuestionsByType(1)
    this.getEnElementTypes()
    this.getEnElementSubTypes()
  },
  getQuestionsByType(page = 1) {
    this.setData({loading: true})
    setTimeout(() => {
      this.setData({loading: false})
    }, 100000);
    var that = this
    consultservice.getQuestionsByType(
      app.globalData.accessToken.userId,
      this.data.selected[0].value, this.data.selected[1].value,
      page, 10, {
        onPage(head) {
          that.cPage = head.page
          that.tPage = head.totalPage
          that.setData({
            totalCount: head.totalCount
    const selectedValues = this.data.selected.map((obj, index) => {
      return obj.value
          })
        },
        success(res) {
          res.forEach(r => {
            r.cqCreateTime = util.formatTime(r.cqCreateTime)
            r.answer = r.answer.replaceAll('\\n', '<br/>')
          });
          let questions = that.data.questions
          if (page == 1) {
            questions = []
          }
          questions = questions.concat(res)
          that.setData({questions})
        },
        complete(e) {
          that.setData({loading: false})
        }
      })
  },
  getEnElementTypes() {
    var that = this
    consultservice.getEnElementTypes(app.globalData.accessToken.userId, {
      success(res) {
        const menus = [{
          name: '全部',
          value: null,
        }]
        res.forEach(r => {
          menus.push({
            name: r.first,
            value: r.second,
          })
        });
        that.setData({menus})
      }
    })
  },
  getEnElementSubTypes() {
    var that = this
    consultservice.getEnElementSubTypes(app.globalData.accessToken.userId, {
      success(res) {
        const items = [
          [{
            name: '全部',
            value: null,
          }]
        ]
        res.forEach(r => {
          const l = []
          r.forEach(s => {
            l.push({
              name: s.first,
              value: s.second,
            })
          });
          items.push(l)
        });
        that.setData({items})
      }
    })
    this.getQuestionsByType(1, selectedValues)
  },
  openChooseType() {
@@ -200,29 +34,12 @@
  },
  chooseMenu(e) {
    console.log('chooseMenu');
    console.log(e);
    const i = e.detail
    const menu = this.data.menus[i[0]]
    const item = this.data.items[i[0]][i[1]]
    this.setData({
      selected: [menu, item]
    })
    this.getQuestionsByType()
  },
  // åŽ»å¾€é—®ç­”è¯¦æƒ…
  gotoQA(e) {
    const index = e.currentTarget.dataset.index
    var qId = this.data.questions[index].cqGuid
    wx.navigateTo({
      url: '/pages/m_consult/consultdetailqa/consultdetailqa',
      success: (res) => {
        // é€šè¿‡ eventChannel å‘被打开页面传送数据
        res.eventChannel.emit('acceptDataFromOpenerPage', {
          qId: qId
        })
      },
    })
    this.getQuestionsByType(1, [menu.value, item.value])
  },
})
pages/m_consult/consultproblem/consultproblem.json
@@ -3,7 +3,7 @@
  "navigationBarBackgroundColor": "#57E4CB",
  "navigationBarTextStyle": "white",
  "usingComponents": {
    "mp-loading": "/component/loading/loading",
    "c-result-item": "../base_c/c_result-item/c_result-item",
    "mp-sidebar": "/component/sidebar/sidebar"
  }
}
pages/m_consult/consultproblem/consultproblem.wxml
@@ -3,36 +3,18 @@
<view class="page">
  <view class="page__hd">
  <view class="flex-h">
    <text style="color: #57E4CB;">{{selected[0].name}} > {{selected[1].name}}</text>
    <view class="filter" bindtap="openChooseType">
      <image src="/res/icons/filter.png" class="image-16"></image>
      ç­›é€‰
    </view>
  </view>
  <view class="more">共{{totalCount}}个问题</view>
  </view>
  <view class="page__bd">
    <block wx:if="{{!loading}}">
      <block wx:if="{{questions.length > 0}}">
        <block wx:for="{{questions}}" wx:key="index">
          <view class="fyui-box  fyui-box__text" bindtap="gotoQA" data-index="{{index}}">
            <view class="fyui-box__hd">
              <text class="fyui-box__content des subtitle">{{item.cqContent}}</text>
    <c-result-item results="{{questions}}" loading="{{loading}}" needLoadMore="{{needLoadMore}}"></c-result-item>
            </view>
            <view class="fyui-box__bd answer">
              <view>答:</view>
              <rich-text class="des" nodes="{{item.answer}}"></rich-text>
            </view>
            <view class="fyui-box__ft">
              <text class="tag3">提问时间:{{item.cqCreateTime}}</text>
              <text class="tag3">回复时间:{{item.cqCreateTime}}</text>
            </view>
          </view>
          <view wx:if="{{index == questions.length - 1}}" class="next-answer">——到底了——</view>
        </block>
      </block>
      <template wx:else is="nodataPage"></template>
    </block>
    <mp-loading duration="{{900}}" type="dot-gray" show="{{loading}}" animated="{{true}}"></mp-loading>
  </view>
  <view class="page__ft"></view>
  <mp-sidebar show="{{showMenu}}" menus="{{menus}}" items="{{items}}" bindsubmit="chooseMenu"></mp-sidebar>
</view>
pages/m_consult/consultproblem/consultproblem.wxss
@@ -1,69 +1,7 @@
/* pages/m_consult/consultproblem/consultproblem.wxss */
.page__hd {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  background-color: white;
  padding: 16px;
}
.switch-tab {
  border-radius: 8px;
  color: var(--fyui-text-color_1);
  width: 20vw;
  background-color: white;
  padding: 1vw;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
}
.switch-tab_selected {
  background: linear-gradient(to bottom right, #65EAD2, #2BDEDC);
  color: white;
}
.fyui-box__content {
  padding: 0 8px;
}
.fyui-box__tag {
  display: flex;
  /* background-color: red; */
  width: 100%;
  justify-content: flex-end;
}
.fyui-box__tag .flex-h{
  margin-right: 16px;
}
.fyui-box .answer {
  display: flex;
  flex-direction: row;
  line-height: 18px;
  font-size: 12px;
  color: var(--fyui-text-color_3);
}
.des {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  width: 100%;
  overflow: hidden;
  /* text-overflow: ellipsis; */
}
.subtitle{
  font-size: 15px;
}
.next-answer {
  text-align: center;
  font-size: 12px;
  color: var(--fyui-text-color_3);
  padding: 8px;
}
.filter {
pages/m_consult/consultresult/consultresult.wxml
@@ -27,7 +27,7 @@
            </view>
          </block>
          <block wx:else="{{catagory.typeId === 2}}">
          <block wx:elif="{{catagory.typeId === 2}}">
            <view wx:for="{{catagory.contents}}" wx:key="i2" wx:for-index="i2" data-index="{{i1}},{{i2}}" bindtap="gotoDetail">
              <view class="fyui-box  fyui-box__text">
                <view class="fyui-box__hd">
pages/m_consult/consultsearch/consultsearch.json
@@ -1,5 +1,5 @@
{
  "navigationBarTitleText": "环保知识库一键查询",
  "navigationBarTitleText": "环保知识库",
  "navigationBarBackgroundColor": "#57E4CB",
  "navigationBarTextStyle": "white",
  "usingComponents": {
pages/m_learn/base_c/c_learn-item/c_learn-item.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
// pages/m_learn/base_c/c_learn-item/c_learn-item.js
import b_openFile from '../../behaviors/b_openFile'
Component({
  behaviors: [b_openFile],
  options: {
    addGlobalClass: true,
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    results: {
      type: Array,
      value: []
    },
    loading: {
      type: Boolean,
      value: false
    },
    needLoadMore: {
      type: Boolean,
      value: false
    },
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
  }
})
pages/m_learn/base_c/c_learn-item/c_learn-item.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
{
  "component": true,
  "usingComponents": {
    "mp-icon": "/component/icon/icon",
    "mp-loadingstatus": "/component/loadingstatus/loadingstatus"
  }
}
pages/m_learn/base_c/c_learn-item/c_learn-item.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
<view>
  <view wx:for="{{results}}" wx:key="index" wx:item="item" bindtap="openFile" data-index="{{index}}">
    <view wx:if="{{item.lrResourcefiletype != 4}}" class="fyui-box fyui-panel">
      <view class="fyui-box__hd">
        <image src="{{item.lrPicurl}}" class="" mode="aspectFill" />
      </view>
      <view class="fyui-box__bd">
        <view class="fyui-box__content">{{item.lrResourcetitle}}</view>
        <view class="fyui-box__tag">
          <view>{{item.lrPublishdate}}</view>
          <view class="flex-h">
            <image src="/res/icons/view.png" class="icon"></image>{{item.views}}
          </view>
        </view>
      </view>
    </view>
    <view wx:else class="fyui-panel fyui-panel_video">
      <view style="position: relative;">
        <image src="{{item.lrPicurl}}" class="video-poster" mode="aspectFit" />
        <mp-icon class="video-play" icon="play" color="white" size="50" type="filled"></mp-icon>
      </view>
      <view class="video-title">{{item.lrResourcetitle}}</view>
      <view class="tag">
        <view>{{item.lrPublishdate}}</view>
        <view class="flex-h">
          <image src="/res/icons/view.png" class="icon"></image>{{item.views}}
        </view>
      </view>
    </view>
  </view>
  <mp-loadingstatus loading="{{loading}}" needLoadMore="{{needLoadMore}}" nodata="{{results.length == 0}}"></mp-loadingstatus>
</view>
pages/m_learn/base_c/c_learn-item/c_learn-item.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
/* pages/m_learn/base_c/c_learn-item/c_learn-item.wxss */
.fyui-panel_video .video-poster {
  width: 100%;
  background-color: black;
}
.fyui-panel_video .video-title{
  padding: 2px 16px;
  font-size: 16px;
}
.fyui-panel_video .video-play {
  position: absolute;
  top: calc(50% - 25px);
  left: calc(50% - 25px);
  z-index: 10;
  background-color: rgba(138, 138, 138, 0.712);
  border-radius: 50%;
}
.fyui-panel_video .tag{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fyui-text-color_2);
  padding: 4px 16px;
}
pages/m_learn/behaviors/b_fetch.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
const b_loadingStatus = require("../../../base/behaviors/b_loadingStatus")
const lawservice = require("../../../service/lawservice")
const moment = require('../../../utils/moment.min')
const app = getApp()
/**
 * èŽ·å–å®ˆæ³•åŸ¹è®­ææ–™
 */
module.exports = Behavior({
  behaviors: [b_loadingStatus],
  data: {
    //搜索结果
    results: []
  },
  methods: {
    loadmore(cPage) {
      this.getResources(++cPage)
    },
    /**
     * æ ¹æ®ç­›é€‰æ¡ä»¶èŽ·å–å®ˆæ³•å­¦ä¹ ææ–™
     * @param fileType æ–‡ä»¶ç±»åž‹ï¼ŒåŒ…括[1:office文档,2:网址,3:音频,4:视频],不填写时表示查询所有类型
     */
    getResources(cPage = 1, fileType) {
      this.setData({loading: true})
      const t = setTimeout(() => { this.setData({loading: false}) }, 10000);
      var that = this
      const user = app.globalData.userInfo
      const condition = {
        sceneTypeId: user.extension2
      }
      if (fileType) {
        condition.fileType = fileType
      }
      lawservice.getLawRegulations(user.guid, cPage, condition, {
        onHead(header) {
          that.setData({
            cPage: parseInt(header.currentPage),
            tPage: parseInt(header.totalPage)
          })
        },
        success(data) {
          let results = that.data.results
          data.forEach(d => {
            d.views = parseInt(Math.random() * 1000 + 10)
            d.lrPublishdate = moment(d.lrPublishdate).format('YYYYå¹´MM月DD日')
          });
          results = results.concat(data)
          that.setData({
            results
          })
        },
        complete() {
          that.setData({loading: false})
          clearTimeout(t)
        }
      }, app.globalData.perPage)
    },
  }
})
pages/m_learn/behaviors/b_openFile.js
ÎļþÃû´Ó pages/m_learn/behaviors/beLearn.js ÐÞ¸Ä
@@ -1,17 +1,16 @@
const app = getApp()
/**
 * å®ˆæ³•学习材料的获取和打开
 */
module.exports = Behavior({
  data: {
    resources: [],
  },
  methods: {
    /**
     * å®ˆæ³•学习材料内容跳转
     */
    behaviorOpenFile: function (f) {
    openFile(e) {
      var index = e.currentTarget.dataset.index
      let f = this.data.results[index]
      var url = ""
      switch (f.lrResourcefiletype) {
        //文档
@@ -55,11 +54,10 @@
        wx.navigateTo({
          url: url,
          success: (res) => {
            // é€šè¿‡ eventChannel å‘被打开页面传送数据
            res.eventChannel.emit('acceptDataFromOpenerPage', f)
          },
        })
      }
    }
    },
  }
})
pages/m_learn/learfile/learnfile.js
@@ -1,66 +1,20 @@
// pages/m_learn/learfile/learnfile.js
Page({
import ListPage from '../../../base/ListPage'
import b_fetch from '../behaviors/b_fetch'
ListPage({
  behaviors: [b_fetch],
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    //视频类型的文件
    fileType: 4
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    this.getResources(1, this.data.fileType)
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  }
})
pages/m_learn/learfile/learnfile.json
@@ -1,3 +1,8 @@
{
  "usingComponents": {}
  "navigationBarTitleText": "守法视频",
  "navigationBarBackgroundColor": "#65EAD2",
  "navigationBarTextStyle": "white",
  "usingComponents": {
    "c-learn-item": "../base_c/c_learn-item/c_learn-item"
  }
}
pages/m_learn/learfile/learnfile.wxml
@@ -1,34 +1,6 @@
<!--pages/m_learn/learfile/learnfile.wxml-->
<view class="page ">
<view class="page__bd ">
  <view wx:for="{{resources}}" wx:key="index" wx:item="item" bindtap="openFile" data-index="{{index}}">
    <view wx:if="{{item.lrResourcefiletype != 4}}" class="fyui-box fyui-panel">
      <view class="fyui-box__hd">
        <image src="{{item.lrPicurl}}" class="" mode="aspectFill" />
    <c-learn-item results="{{results}}" loading="{{loading}}" needLoadMore="{{needLoadMore}}"></c-learn-item>
      </view>
      <view class="fyui-box__bd">
        <view class="fyui-box__content">{{item.lrResourcetitle}}</view>
        <view class="fyui-box__tag">
          <view>{{item.lrPublishdate}}</view>
          <view class="flex-h">
            <image src="/res/icons/view.png" class="icon"></image>{{item.views}}
          </view>
        </view>
      </view>
    </view>
    <view wx:else class="fyui-panel fyui-panel_video">
      <view style="position: relative;">
        <image src="{{item.lrPicurl}}" class="video-poster" mode="aspectFit" />
        <mp-icon class="video-play" icon="play" color="white" size="50" type="filled"></mp-icon>
      </view>
      <view class="video-title">{{item.lrResourcetitle}}</view>
      <view class="tag">
        <view>{{item.lrPublishdate}}</view>
        <view class="flex-h">
          <image src="/res/icons/view.png" class="icon"></image>{{item.views}}
        </view>
      </view>
    </view>
  </view>
</view>
<view class="page__ft"></view>
</view>
pages/m_learn/learn/learn.js
@@ -1,11 +1,10 @@
// pages/learn/learn.js
const lawservice = require("../../../service/lawservice")
const moment = require('../../../utils/moment.min')
const beLearn = require('../behaviors/beLearn')
const app = getApp()
import ListPage from '../../../base/ListPage'
import b_fetch from '../behaviors/b_fetch'
import b_openFile from '../behaviors/b_openFile'
Page({
  behaviors: [beLearn],
ListPage({
  behaviors: [b_fetch, b_openFile],
  /**
   * é¡µé¢çš„初始数据
   */
@@ -24,9 +23,6 @@
        "name": "在线监测设备"
      }
    ],
    pageList: [
    ],
    banners: [
      {
        pic: '',
@@ -34,89 +30,26 @@
        fileType: ''
      },
    ],
    resources: [],
    text2: [{
      title: "因违章建筑导致执法",
      content: "执法描述:环保主管部门可调阅并作为执法溯源依据之一环保主管部门可调阅并作为执法溯源依据之一",
      tags: ['违法搭建', '依法拆除'],
      views: 123,
      time: '2021å¹´3月2日',
      likes: 233
    }, {
      title: "因违章建筑导致执法",
      content: "执法描述:环保主管部门可调阅并作为执法溯源依据之一环保主管部门可调阅并作为执法溯源依据之一",
      tags: ['违法搭建', '依法拆除'],
      views: 123,
      time: '2021å¹´3月2日',
      likes: 233
    }, {
      title: "因违章建筑导致执法",
      content: "执法描述:环保主管部门可调阅并作为执法溯源依据之一环保主管部门可调阅并作为执法溯源依据之一",
      tags: ['违法搭建', '依法拆除'],
      views: 123,
      time: '2021å¹´3月2日',
      likes: 233
    }, {
      title: "因违章建筑导致执法",
      content: "执法描述:环保主管部门可调阅并作为执法溯源依据之一环保主管部门可调阅并作为执法溯源依据之一",
      tags: ['违法搭建', '依法拆除'],
      views: 123,
      time: '2021å¹´3月2日',
      likes: 233
    }]
  },
  //计算swiper高度方法(在切换的时候调用)
  tabsHeight(element) {
    let that = this;
    let query = wx.createSelectorQuery(); //必须要先创建一个查询
    query.select(element).boundingClientRect(function (rect) {
      that.setData({
        pageheight: rect.height + 'px'
      });
    }).exec();
  },
  swichNav: function (e) {
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current,
        navScrollLeft: e.target.dataset.current >= 4 ? ((e.target.dataset.current) * 60) : 0 //判断当前选中的个数是否是第5个
      })
      that.tabsHeight('.page' + e.target.dataset.current); //查询哪一个元素
    }
  },
  bindChange: function (e) {
    var that = this;
    that.setData({
      currentTab: e.detail.current,
      navScrollLeft: e.detail.current >= 4 ? ((e.detail.current) * 60) : 0 //判断当前选中的个数是否是第5个
    });
    // that.tabsHeight('.page'+e.target.dataset.current);    //查询哪一个元素
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad: function (options) {
    // this.tabsHeight('.page0');
    this.getResources()
    this.getResources(1)
  },
  onReachBottom () {
    console.log('onReachBottom');
    if (this.cPage && this.tPage) {
      if (this.cPage < this.tPage) {
        this.getResources(this.cPage + 1)
      }
    }
  loadComplete() {
    this.getBanner()
  },
  getBanner() {
    let banners = []
    for (let i = 0; i < 6; i++) {
      const d = this.data.resources[i]
    const results = this.data.results
    const max = results.length > 5 ? 5 : results.length
    for (let i = 0; i < max; i++) {
      const d = this.data.results[i]
      banners.push({
        pic: d.lrPicurl,
        url: d.lrBodyurl,
@@ -128,46 +61,15 @@
    })
  },
  getResources(cPage = 1) {
    var that = this
    let user = app.globalData.userInfo
    lawservice.getLawRegulations(user.guid, cPage, {sceneTypeId: user.extension2}, {
      onHead(header) {
        that.cPage = parseInt(header.currentPage)
        that.tPage = parseInt(header.totalPage)
        console.log(`cPage:${that.cPage}, tPage:${that.tPage}`);
      },
      success(data) {
        let resources = that.data.resources
        data.forEach(d => {
          d.views = parseInt(Math.random() * 1000 + 10)
          d.lrPublishdate = moment(d.lrPublishdate).format('YYYYå¹´MM月DD日')
        });
        resources = resources.concat(data)
        that.setData({
          resources
        })
        if (that.cPage == 1) {
          that.getBanner()
        }
      }
    }, 10)
  },
  openFile(e) {
    var index = e.currentTarget.dataset.index
    let f = this.data.resources[index]
    this.behaviorOpenFile(f)
  },
  goto: function (e) {
    var url = ""
    var index = e.currentTarget.dataset.index
    switch (index) {
      case '0':
        url = '/pages'
        url = '/pages/m_learn/learfile/learnfile'
        break;
      case '1':
        url = ""
        url = "/pages/m_learn/learncase/learncase"
        break;
    }
    if (url != "") {
pages/m_learn/learn/learn.json
@@ -3,6 +3,7 @@
  "navigationBarBackgroundColor": "#65EAD2",
  "navigationBarTextStyle": "white",
  "usingComponents": {
    "mp-icon": "/component/icon/icon"
    "mp-icon": "/component/icon/icon",
    "c-learn-item": "../base_c/c_learn-item/c_learn-item"
  }
}
pages/m_learn/learn/learn.wxml
@@ -35,8 +35,8 @@
      <view class="image-btn" bindtap="goto" data-index="0">
        <image src="/res/icons/learn_1.png" class="image-btn__2" mode="aspectFit" />
        <view class="image-btn_title">
          <view class="image-btn_title_t">环保守法</view>
          <view>视频、文档材料</view>
          <view class="image-btn_title_t">守法视频</view>
          <view>守法培训材料</view>
          <mp-icon class="image-btn_goto" icon="arrow" color="#7F7F7F" size="8" type="filled"></mp-icon>
        </view>
@@ -46,7 +46,7 @@
          <image src="/res/icons/learn_2.png" class="image-btn__2" mode="aspectFit" />
          <view class="image-btn_title">
            <view class="image-btn_title_t">执法案例</view>
            <view>相关执法案例</view>
            <view>执法督察案例</view>
            <mp-icon class="image-btn_goto" icon="arrow" color="#7F7F7F" size="8" type="filled"></mp-icon>
          </view>
        </view>
@@ -57,62 +57,8 @@
      <view class="fyui-cell__bd">环保守法</view>
      <view class="fyui-cell__ft">更多</view>
    </view> -->
    <view wx:for="{{resources}}" wx:key="index" wx:item="item" bindtap="openFile" data-index="{{index}}">
      <view wx:if="{{item.lrResourcefiletype != 4}}" class="fyui-box fyui-panel">
        <view class="fyui-box__hd">
          <image src="{{item.lrPicurl}}" class="" mode="aspectFill" />
        </view>
        <view class="fyui-box__bd">
          <view class="fyui-box__content">{{item.lrResourcetitle}}</view>
          <view class="fyui-box__tag">
            <view>{{item.lrPublishdate}}</view>
            <view class="flex-h">
              <image src="/res/icons/view.png" class="icon"></image>{{item.views}}
            </view>
          </view>
        </view>
      </view>
      <view wx:else class="fyui-panel fyui-panel_video">
        <view style="position: relative;">
          <image src="{{item.lrPicurl}}" class="video-poster" mode="aspectFit" />
          <mp-icon class="video-play" icon="play" color="white" size="50" type="filled"></mp-icon>
        </view>
        <view class="video-title">{{item.lrResourcetitle}}</view>
        <view class="tag">
          <view>{{item.lrPublishdate}}</view>
          <view class="flex-h">
            <image src="/res/icons/view.png" class="icon"></image>{{item.views}}
          </view>
        </view>
      </view>
    </view>
    <!-- <view class="fyui-cell fyui-cell_select title">
      <view class="fyui-cell__bd">执法案例</view>
      <view class="fyui-cell__ft">更多</view>
    </view>
    <view wx:for="{{text2}}" wx:key="index" data-index="index" wx:for-item="item">
      <view class="fyui-box fyui-panel fyui-box__text">
        <view class="fyui-box__hd">
          {{item.title}}
        </view>
        <view class="fyui-box__bd">
          <view class="fyui-box__content">{{item.content}}</view>
          <view class="fyui-box__tag">
            <view wx:for="{{item.tags}}" wx:key="i" data-index="i" wx:for-item="tag">{{tag}}</view>
          </view>
        </view>
        <view class="fyui-box__ft">
          <view class="flex-h">
            <image src="/res/icons/view.png" class="icon"></image>{{item.views}}
          </view>
          <view class="flex-h">
            <image src="/res/icons/like.png" class="icon"></image>{{item.likes}}
          </view>
          <view>{{item.time}}</view>
        </view>
      </view>
    </view> -->
    <c-learn-item results="{{results}}" loading="{{loading}}" needLoadMore="{{needLoadMore}}"></c-learn-item>
  </view>
pages/m_learn/learn/learn.wxss
@@ -99,30 +99,3 @@
  text-align: center;
  border-radius: 50%;
}
.fyui-panel_video .video-poster {
  width: 100%;
  background-color: black;
}
.fyui-panel_video .video-title{
  padding: 2px 16px;
  font-size: 16px;
}
.fyui-panel_video .video-play {
  position: absolute;
  top: calc(50% - 25px);
  left: calc(50% - 25px);
  z-index: 10;
  background-color: rgba(138, 138, 138, 0.712);
  border-radius: 50%;
}
.fyui-panel_video .tag{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fyui-text-color_2);
  padding: 4px 16px;
}
pages/m_learn/learncase/learncase.js
@@ -5,7 +5,10 @@
   * é¡µé¢çš„初始数据
   */
  data: {
    //按照热门推荐机制获取执法案例
    keyobj: {keyword: '', type: 3},
    //上滑触底加载
    reachBottom: false
  },
  /**
@@ -16,51 +19,11 @@
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
    this.setData({
      reachBottom: true
    })
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  }
})
pages/m_learn/learncase/learncase.json
@@ -1,3 +1,8 @@
{
  "usingComponents": {}
  "navigationBarTitleText": "执法案例",
  "navigationBarBackgroundColor": "#57E4CB",
  "navigationBarTextStyle": "white",
  "usingComponents": {
    "c-result-item-search": "../../m_consult/c_result-item-search/c_result-item-search"
  }
}
pages/m_learn/learncase/learncase.wxml
@@ -1,2 +1,8 @@
<!--pages/m_learn/learncase/learncase.wxml-->
<text>pages/m_learn/learncase/learncase.wxml</text>
<view class="page">
  <view class="page__hd"></view>
  <view class="page__bd">
    <c-result-item-search reachBottom="{{reachBottom}}" keyobj="{{keyobj}}"></c-result-item-search>
  </view>
  <view class="page__ft"></view>
</view>
pages/m_service/c_schedule/c_schedule.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
// pages/m_service/c_schedule/c_schedule.js
const moment = require('../../../utils/moment.min')
Component({
  options: {
    addGlobalClass: true
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    title: {
      type: String,
      value: '营业执照续期'
    },
    time: {
      type: String,
      value: '2022-9-10 æ˜ŸæœŸå…­'
    },
    leftDays: {
      type: Number,
      value: 2
    },
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  lifetimes: {
    attached: function () {
      this._init()
    }
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    _init() {
      moment.updateLocale('en', {
        weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_')
      });
      // console.log(moment.locales());
      // moment.locale('ch')
      const now = moment().hour(0).minute(0).second(0).millisecond(0)
      const s = moment(now).add(3, 'days')
      let leftDays = now.diff(s, 'days')
      const time = s.format('YYYY-MM-DD dddd')
      this.setData({
        time,
        leftDays
      })
    },
    goto() {
      wx.navigateTo({
        url: '/pages/m_service/p_scheduledetail/p_scheduledetail',
        success: (result) => {},
      })
    }
  }
})
pages/m_service/c_schedule/c_schedule.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
{
  "component": true,
  "usingComponents": {}
}
pages/m_service/c_schedule/c_schedule.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
<!--pages/m_service/c_schedule/c_schedule.wxml-->
<view class="schedule-card {{leftDays < 0 ? 'schedule-card__2' : ''}}" bindtap="goto">
  <view class="schedule-tag">{{leftDays < 0 ? 'FUTURE' : 'TODAY'}}</view>
  <view class="schedule-category">
    <image class="image-16" src="/res/icons/schedule_1.png"></image>
    <text>环保日程</text>
  </view>
  <view class="schedule-title">{{title}}</view>
  <view class="schedule-time">
    <text>{{time}}</text>
    <text wx:if="{{leftDays > 0}}">过去{{leftDays}}天</text>
    <text wx:elif="{{leftDays == 0}}">今天</text>
    <text wx:else>还有{{-leftDays}}天</text>
  </view>
</view>
pages/m_service/c_schedule/c_schedule.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
/* pages/m_service/c_schedule/c_schedule.wxss */
.schedule-card {
  position: relative;
  background: linear-gradient(0deg, #e9c07f, #F8BD6B, #FFAC38);
  /* background-color: aqua; */
  margin: 0 10px;
  padding: 8px;
  color: rgb(255, 255, 255);
  border-radius: 6px;
}
.schedule-card__2 {
  background: linear-gradient(0deg, #7bc8fc, #72c4fc, #64BEFB);
}
.schedule-tag {
  font-size: 14px;
  position: absolute;
  top: 0;
  right: 4px;
  color: rgba(255, 255, 255, 0.15);
  font-size: 30px;
}
.schedule-category {
  display: flex;
  align-items: center;
  font-size: 14px;
}
.schedule-category>text {
  margin-left: 4px;
}
.schedule-title {
  font-size: 20px;
  margin: 12px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-time {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
pages/m_service/p_schedule/p_schedule.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,110 @@
// pages/m_service/p_schedule/p_schedule.js
const moment = require('../../../utils/moment.min')
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    totals: 0,
    schedules: [{
      category: '2022å¹´9月环保工作日程',
      details: [{
        time: '9月10日',
        name: '环保日程',
        left: 3,
      }]
    }]
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    const now = moment()
    const year = moment().year()
    const schedules = []
    let totals = 0
    for (let m = 1; m <= 12; m++) {
      const s = {
        category: `${year}å¹´${m}月环保工作日程`,
        details: []
      }
      //10,15,20
      let t1 = moment(`${year}-${m}-10`)
      let d1 = t1.diff(now, 'days')
      s.details.push({
        time: t1.format('MM月DD日'),
        name: '环保日程环保日程环保日程环保日程环保日程环保日程',
        left: d1,
      })
      let t2 = moment(`${year}-${m}-15`)
      let d2 = t2.diff(now, 'days')
      s.details.push({
        time: t2.format('MM月DD日'),
        name: '环保日程',
        left: d2,
      })
      let t3 = moment(`${year}-${m}-20`)
      let d3 = t3.diff(now, 'days')
      s.details.push({
        time: t3.format('MM月DD日'),
        name: '环保日程',
        left: d3,
      })
      schedules.push(s)
      totals += 3
    }
    this.setData({schedules, totals})
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  }
})
pages/m_service/p_schedule/p_schedule.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
{
  "navigationBarTitleText": "全部日程",
  "navigationBarBackgroundColor": "#EAFFF1",
  "usingComponents": {}
}
pages/m_service/p_schedule/p_schedule.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
<view class="page">
  <view class="page__hd">
    <view>共有{{totals}}条日程记录</view>
  </view>
  <view class="page__bd">
    <block wx:for="{{schedules}}" wx:key="index">
      <view class="sm-title">{{item.category}}</view>
      <view wx:for="{{item.details}}" wx:key="i" wx:for-item="d" class="sm-card">
        <view class="sm-time">{{d.time}}</view>
        <view class="history_icon">
          <view class="history_icon_1">
            <view></view>
          </view>
          <view class="history_icon_2">d</view>
        </view>
        <view class="{{d.left < 0 ? 'sm-content__past' : ''}} sm-content">
          <view class="sm-content__left">{{d.name}}</view>
          <view class="sm-content__right">{{d.left >= 0 ? '剩' : '过去'}}<text>{{d.left < 0 ? -d.left : d.left}}</text>天</view>
        </view>
      </view>
    </block>
  </view>
  <view class="page__ft">
  </view>
</view>
pages/m_service/p_schedule/p_schedule.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
/* pages/m_service/p_schedule/p_schedule.wxss */
.page__bd {
  padding: 10px;
  background-color: white;
}
.sm-title {
  font-size: 14px;
  margin-top: 16px;
  margin-bottom: 8px;
}
.sm-card {
  display: flex;
  border-radius: 6px;
  margin-bottom: 8px;
}
.sm-time {
  font-size: 12px;
}
.history_icon {
  width: 10vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}
.history_icon .history_icon_1 {
  width: 22px;
  height: 22px;
  background-color: #cce9f8;
  border-radius: 50%;
  opacity: 0.2;
  display: flex;
  justify-content: center;
  align-items: center;
}
.history_icon .history_icon_1>view {
  width: 11px;
  height: 11px;
  background: #1addbd;
  border-radius: 50%;
  z-index: 10;
}
.history_icon .history_icon_2 {
  width: 0px;
  height: 100%;
  /* padding: 10px 0px; */
  border: 1px dashed #EBF8FF;
  color: transparent;
}
.sm-content {
  background-color: #EBF8FF;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 10px;
  width: 50%;
  flex: 1;
  font-size: 14px;
}
.sm-content__left{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 50%;
}
.sm-content__right {
  background-color: #64BEFB;
  padding: 10px 16px;
  color: white;
  white-space: nowrap;
  width: 30%;
  text-align: center;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}
.sm-content__right>text {
  font-size: 20px;
}
.sm-content__past {
  background: #F5F5F5;
  color: #ADADAD;
}
.sm-content__past .sm-content__left {
}
.sm-content__past .sm-content__right {
  background-color: #E4E4E4;
  color: #ADADAD;
}
pages/m_service/p_scheduledetail/p_scheduledetail.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
// pages/m_service/p_scheduledetail/p_scheduledetail.js
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    steps:[{
      index: '01',
      title: ['前往环', '保部门'],
      content: '前往相关环保部门提供相关证件,可进行营业执照续期。'
    },{
      index: '02',
      title: ['营业执', '照续期'],
      content: '前往相关环保部门提供相关证件,可进行营业执照续期。'
    },{
      index: '03',
      title: ['营业执', '照续期'],
      content: '前往相关环保部门提供相关证件,可进行营业执照续期。'
    }]
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
  },
  onSubmit() {
    wx.navigateTo({
      url: '/pages/m_service/p_schedule/p_schedule',
      success: (result) => {},
    })
  }
})
pages/m_service/p_scheduledetail/p_scheduledetail.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
{
  "navigationBarTitleText": "日程详情",
  "navigationBarBackgroundColor": "#EAFFF1",
  "usingComponents": {}
}
pages/m_service/p_scheduledetail/p_scheduledetail.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
<!--pages/m_service/p_scheduledetail/p_scheduledetail.wxml-->
<view class="page">
  <view class="page__hd">
    <view class="sd-card">
      <view class="sd-card__title">今日</view>
      <view class="sd-card__content">营业执照续期</view>
    </view>
    <view class="sd-item">
      <view>日程类别</view>
      <view>环保日程</view>
    </view>
    <view class="sd-item">
      <view>开始时间</view>
      <view class="sd-item__time">2022å¹´9月01日</view>
    </view>
    <view class="sd-item">
      <view>结束时间</view>
      <view class="sd-item__time">2022å¹´9月10日</view>
    </view>
  </view>
  <view class="page__bd">
    <view class="sd-divider"> <text>* * *</text> æ—¥ç¨‹æ“ä½œæµç¨‹æç¤º <text>* * *</text> </view>
    <view class="sd-step" wx:for="{{steps}}" wx:key="index">
      <text class="sd-step__index">{{item.index}}</text>
      <view class="sd-step__title">{{item.title[0]}}<text>{{item.title[1]}}</text></view>
      <view class="sd-step__content">{{item.content}}</view>
    </view>
  </view>
  <view class="page__ft">
    <view class="submit" bindtap="onSubmit">查看全部日程</view>
  </view>
</view>
pages/m_service/p_scheduledetail/p_scheduledetail.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
/* pages/m_service/p_scheduledetail/p_scheduledetail.wxss */
.page__hd {
  padding: 10px 16px 10px 16px;
}
.sd-card {
  background-color: #FEB145;
  border-radius: 6px;
  color: white;
}
.sd-card__title {
  text-align: center;
  font-size: 16px;
  padding: 8px;
}
.sd-card__content {
  font-size: 20px;
  text-align: center;
  background-color: #FFF5E8;
  color: #FFAD3A;
  padding: 8px 8px 20px 8px;
}
.sd-item {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  /* background-color: white; */
  margin-top: 16px;
  align-items: center;
}
.sd-item__time {
  background-color: #FFAC38;
  border-radius: 6px;
  color: white;
  padding: 4px 14px;
}
.sd-divider {
  font-size: 20px;
  text-align: center;
  margin-top: 30px;
}
.sd-divider>text {
  vertical-align: middle;
  color: #FFAC38;
}
.sd-step {
  position: relative;
  padding: 4px 16px;
}
.sd-step__index{
  position: absolute;
  font-size: 32px;
  color: #ffe3bc;
  z-index: -1;
}
.sd-step__title {
  margin-top: 26px;
  font-size: 18px;
}
.sd-step__title>text {
  color: #FEB34C;
}
.sd-step__content {
  font-size: 14px;
}
.submit{
  background: linear-gradient(270deg, #FEB145 0%, #FFBF6C 100%);
}
pages/test2/test2.js
@@ -50,4 +50,64 @@
      showPreview: true
    });
  },
    /**
   * èŽ·å–çƒ­é—¨æœç´¢å†…å®¹
   */
  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[4]': res
        })
      }
    })
    // 2. çƒ­é—¨æ³•律法规条目
    consultservice.getTopicItem(app.globalData.accessToken.userId, {
      success(res) {
        res.forEach(r => {
          r.miItemContent = r.miItemContent.replaceAll('\\n', '<br/>')
        });
        that.setData({
          'pageList[3]': res
        })
      }
    })
    // 3. çƒ­é—¨é—®ç­”
    consultservice.getTopicQA(app.globalData.accessToken.userId, {
      success(res) {
        res.forEach(r => {
          r.cqCreateTime = that.formatTime(r.cqCreateTime)
        });
        that.setData({
          'pageList[1]': 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[2]': res
        })
        console.log(that.data.pageList);
      }
    })
  },
})
project.config.json
@@ -45,10 +45,11 @@
    "useCompilerPlugins": false,
    "ignoreUploadUnusedFiles": false,
    "useStaticServer": true,
    "minifyWXML": true
    "minifyWXML": true,
    "ignoreDevUnusedFiles": false
  },
  "compileType": "miniprogram",
  "libVersion": "2.25.2",
  "libVersion": "2.26.0",
  "appid": "wxffd1438dd373fcf6",
  "projectname": "ep-law-abiding",
  "editorSetting": {
res/icons/schedule_1.png
res/icons/schedule_2.png
res/icons/text_star.png
service/baserequest.js
@@ -11,8 +11,8 @@
const originProperties = ['url', 'data', 'header', 'method', 'success', 'fail', 'complete'];
// const baseUrl = "http://127.0.0.1:8080"
// const baseUrl = "http://192.168.1.106:8080"
const baseUrl = "https://fyami.com.cn:447"
const baseUrl = "http://192.168.0.106:8080"
// const baseUrl = "https://fyami.com.cn:447"
// const basePicUrl = baseUrl + "/images/"
const basePicUrl = "https://fyami.com.cn:447/images/"
const baseIconUrl = "https://fyami.com.cn:447/images/weixin/eplaw/"
service/consultservice.js
@@ -21,14 +21,23 @@
    let fun1 = util.deepCopy(cb)
    fun1.success = function (res) {
      if (res.success) {
        res.data.forEach(r => {
          if (r.imgUrl && r.imgUrl != '' && r.imgUrl != null) {
            r.imgUrl = $f.basePicUrl + r.imgUrl
          }
          r.time = util.formatTime(r.time)
          r.des = r.des.replaceAll('\\n', '<br/>')
        });
        if (cb.onPage) {
          cb.onPage(res.head)
        }
        cb.success(res.data)
      } else {
        if (cb.fail) {
        cb.fail(res.message)
      }
    }
    }
    $f.get(fun1)
  },