ll
liukangdong
2024-08-06 d41f1f707dc643b726a42b9d2a63b186dd9e4f28
wechat_staff/pages/homeId/index.js
@@ -23,6 +23,11 @@
    this.getTabList()
    this.getList()
  },
  onPullDownRefresh() {
    this.setData({ dataList: [], pageNum: 1, total: 0 })
    wx.stopPullDownRefresh()
    this.getList()
  },
  onReachBottom() {
    console.log('触底事件');
    const { total, dataList, pageNum } = this.data
@@ -52,7 +57,13 @@
  },
  itemClick(e) {
    const item = e.currentTarget.dataset.item
    console.log('item', item);
    const { dataList } = this.data
    dataList.forEach(ite => {
      if(item.id === ite.id){
        ite.viewCount += 1
      }
    })
    this.setData({ dataList })
    if(item.contentType == 'video'){
      wx.previewMedia({
        sources: [{ url: item.content, type: 'video' }]
@@ -126,9 +137,6 @@
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数