riku
2022-09-15 bd3a9d7086f5a428b385599ba2cb08299b22c0df
pages/m_consult/c_result-item-search/c_result-item-search.js
@@ -21,18 +21,21 @@
    reachBottom: {
      type: Boolean,
      value: false
    },
    scrollable: {
      type: Boolean,
      value: true
    },
    sPerPage: {
      type: Number,
      value: 10
    }
  },
  observers: {
    'keyobj': function(keyobj) {
      this.search(keyobj)
      this.search(keyobj, 1, this.data.sPerPage)
    },
    // 'reachBottom': function(reachBottom) {
    //   if (reachBottom) {
    //     this._onReachBottom()
    //   }
    // }
  },
  /**
@@ -46,13 +49,19 @@
   * 组件的方法列表
   */
  methods: {
    // _onReachBottom() {
    //   console.log('_onReachBottom');
    //   let {cPage, tPage} = this.data
    //   console.log(this.data);
    //   if (cPage < tPage) {
    //     this.search(this.data.keyobj, ++cPage)
    //   }
    // }
    gotoMore() {
      this.triggerEvent('gotoMore')
      const {keyword, type} = this.data.keyobj
      wx.navigateTo({
        url: '/pages/m_consult/consultresultmore/consultresultmore',
        success: (res) => {
          // 通过 eventChannel 向被打开页面传送数据
          res.eventChannel.emit('acceptDataFromOpenerPage', {
            typeId: type,
            keyword: keyword
          })
        },
      })
    }
  }
})