riku
2022-10-12 741d1f7b2e2ac1c3f89d80dfac7625e3427e2367
pages/m_consult/c_result-item-search/c_result-item-search.js
@@ -14,45 +14,56 @@
    keyobj: {
      type: Object,
      value: {
        keyword: '',
        keyword: null,
        type: undefined
      },
    },
    reachBottom: {
      type: Boolean,
      value: false
    },
    scrollable: {
      type: Boolean,
      value: true
    },
    sPerPage: {
      type: Number,
      value: 10
    }
  },
  observers: {
    'keyobj': function(keyobj) {
      this.search(keyobj)
    'keyobj': function (keyobj) {
      if (keyobj != null && keyobj.keyword != null) {
        this.search(keyobj, 1, this.data.sPerPage)
      }
    },
    // '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)
    //   }
    // }
    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
          })
        },
      })
    }
  }
})