riku
2022-08-26 c765c26eee1249b0a8d72d2b203b2ed124c2bbf6
2022.8.26(2)
已修改4个文件
已删除4个文件
699 ■■■■ 文件已修改
pages/learn/learn.js 219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/learn/learn.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/learn/learn.wxml 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/learn/learn.wxss 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/module_consult/behaviors/behConsultItem.js 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/module_consult/consultdetailitem/consultdetailitem.js 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/module_consult/consultresult/consultresult.wxml 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/module_consult/consultresultmore/consultresultmore.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/learn/learn.js
ÎļþÒÑɾ³ý
pages/learn/learn.json
ÎļþÒÑɾ³ý
pages/learn/learn.wxml
ÎļþÒÑɾ³ý
pages/learn/learn.wxss
ÎļþÒÑɾ³ý
pages/module_consult/behaviors/behConsultItem.js
@@ -9,55 +9,55 @@
    result: []
  },
  methods:{
    onReachBottom () {
      console.log('onReachBottom');
      if (this.cPage && this.tPage) {
        if (this.cPage < this.tPage) {
          this.searchMore(this.cPage + 1)
        }
      }
    },
    searchMore (cPage = 1) {
      var that = this
      wx.showLoading({
        title: '搜索中',
        mask: true,
        success: (res) => {},
        fail: (res) => {},
        complete: (res) => {},
      })
      setTimeout(() => {
        wx.hideLoading()
      }, 20000);
      consultservice.searchLaw(app.globalData.accessToken.userId, '大气污染', cPage, 5, {
        onPage(head){
          that.cPage = head.page
          that.tPage = head.totalPage
        },
        success (res) {
          let result = that.data.result
          res.forEach(r => {
            r.des = r.des.replace('\\n', '<br/>')
            if (result.length === 0) {
              result.push({
                typeId: r.typeId,
                typeName: r.typeName,
                contents: [r]
              })
            } else {
              result[0].contents.push(r)
            }
          });
          that.setData({
            result
          })
          console.log(result);
        },
        complete (res) {
          wx.hideLoading()
        }
      }, 2)
    },
    // onReachBottom () {
    //   console.log('onReachBottom');
    //   if (this.cPage && this.tPage) {
    //     if (this.cPage < this.tPage) {
    //       this.searchMore(this.cPage + 1)
    //     }
    //   }
    // },
    // searchMore (cPage = 1) {
    //   var that = this
    //   wx.showLoading({
    //     title: '搜索中',
    //     mask: true,
    //     success: (res) => {},
    //     fail: (res) => {},
    //     complete: (res) => {},
    //   })
    //   setTimeout(() => {
    //     wx.hideLoading()
    //   }, 20000);
    //   consultservice.searchLaw(app.globalData.accessToken.userId, '大气污染', cPage, 5, {
    //     onPage(head){
    //       that.cPage = head.page
    //       that.tPage = head.totalPage
    //     },
    //     success (res) {
    //       let result = that.data.result
    //       res.forEach(r => {
    //         r.des = r.des.replace('\\n', '<br/>')
    //         if (result.length === 0) {
    //           result.push({
    //             typeId: r.typeId,
    //             typeName: r.typeName,
    //             contents: [r]
    //           })
    //         } else {
    //           result[0].contents.push(r)
    //         }
    //       });
    //       that.setData({
    //         result
    //       })
    //       console.log(result);
    //     },
    //     complete (res) {
    //       wx.hideLoading()
    //     }
    //   }, 2)
    // },
    /**
     * æŸ¥çœ‹æŸ¥è¯¢ç»“果详情
     */
pages/module_consult/consultdetailitem/consultdetailitem.js
@@ -28,6 +28,56 @@
    this.searchMore(1)
  },
  onReachBottom () {
    console.log('onReachBottom');
    if (this.cPage && this.tPage) {
      if (this.cPage < this.tPage) {
        this.searchMore(this.cPage + 1)
      }
    }
  },
  searchMore (cPage = 1) {
    var that = this
    wx.showLoading({
      title: '搜索中',
      mask: true,
      success: (res) => {},
      fail: (res) => {},
      complete: (res) => {},
    })
    setTimeout(() => {
      wx.hideLoading()
    }, 20000);
    consultservice.searchLaw(app.globalData.accessToken.userId, '大气污染', cPage, 5, {
      onPage(head){
        that.cPage = head.page
        that.tPage = head.totalPage
      },
      success (res) {
        let result = that.data.result
        res.forEach(r => {
          r.des = r.des.replace('\\n', '<br/>')
          if (result.length === 0) {
            result.push({
              typeId: r.typeId,
              typeName: r.typeName,
              contents: [r]
            })
          } else {
            result[0].contents.push(r)
          }
        });
        that.setData({
          result
        })
        console.log(result);
      },
      complete (res) {
        wx.hideLoading()
      }
    }, 2)
  },
  getItem () {
    var that = this
    wx.showLoading({
pages/module_consult/consultresult/consultresult.wxml
@@ -1,54 +1,59 @@
<!--pages/module_consult/consultresult/consultresult.wxml-->
<view class="page">
  <block wx:for="{{result}}" wx:key="i1" wx:for-item="catagory" wx:for-index="i1">
    <view class="page__hd">
      <view><text style="color: #57E4CB;">{{keyword}}</text>的{{catagory.typeName}} ></view>
    </view>
    <view class="page__bd">
      <view class="fyui-panel">
        <block wx:if="{{catagory.typeId === 1}}">
          <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">
                {{item.name}}
              </view>
              <view class="fyui-box__bd">
                <view class="fyui-box__content tag">相关行业 -> {{item.fileIndustry}}</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>
          </view>
<import src="/template/nodata.wxml"></import>
        </block>
        <block wx:else="{{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">
                <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">
                <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 class="page">
  <block wx:if="{{result.length > 0}}">
    <block wx:for="{{result}}" wx:key="i1" wx:for-item="catagory" wx:for-index="i1">
      <view class="page__hd">
        <view><text style="color: #57E4CB;">{{keyword}}</text>的{{catagory.typeName}} ></view>
      </view>
      <view class="page__bd">
        <view class="fyui-panel">
          <block wx:if="{{catagory.typeId === 1}}">
            <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">
                  {{item.name}}
                </view>
                <view class="fyui-box__bd">
                  <view class="fyui-box__content tag">相关行业 -> {{item.fileIndustry}}</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>
            </view>
          </view>
        </block>
          </block>
          <block wx:else="{{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">
                  <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">
                  <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>
        </view>
        <view class="btn-more" data-typeid="{{catagory.typeId}}" bindtap="gotoMore">查看更多</view>
      </view>
      <view class="btn-more" data-typeid="{{catagory.typeId}}" bindtap="gotoMore">查看更多</view>
    </view>
    </block>
  </block>
  <template wx:else is="nodataPage"></template>
  <view class="page__ft"></view>
</view>
pages/module_consult/consultresultmore/consultresultmore.js
@@ -18,6 +18,8 @@
  onLoad(options) {
    var that = this
    this.getOpenerEventChannel().on('acceptDataFromOpenerPage', function (data) {
      console.log('getOpenerEventChannel:');
      console.log(data);
      that.setData({
        keyword: data.keyword,
        typeId: data.typeId,
@@ -27,14 +29,14 @@
    })
  },
  // onReachBottom () {
  //   console.log('onReachBottom');
  //   if (this.cPage && this.tPage) {
  //     if (this.cPage < this.tPage) {
  //       this.search(this.cPage + 1)
  //     }
  //   }
  // },
  onReachBottom () {
    console.log('onReachBottom');
    if (this.cPage && this.tPage) {
      if (this.cPage < this.tPage) {
        this.search(this.cPage + 1)
      }
    }
  },
  search (cPage = 1) {
    var that = this