riku
2022-08-26 c765c26eee1249b0a8d72d2b203b2ed124c2bbf6
2022.8.26(2)
已修改4个文件
已删除4个文件
607 ■■■■ 文件已修改
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 5 ●●●●● 补丁 | 查看 | 原始文档 | 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,5 +1,8 @@
<!--pages/module_consult/consultresult/consultresult.wxml-->
<import src="/template/nodata.wxml"></import>
<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>
@@ -50,5 +53,7 @@
      <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