lll
liukangdong
2024-07-21 4eaf6d8835d4e9b204f13d012f13bbd8a94a21cc
wechat_jiaxuan/components/disProduct/index.js
@@ -1,9 +1,10 @@
import { getCatalogList, getZhongTaiProductPage } from '../../api/index'
import { getCatalogList,getCataLogTagList, getZhongTaiProductPage } from '../../api/index'
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    menuButtonInfo: Object
  },
  /**
@@ -17,6 +18,7 @@
    datalist: [],
    pageNum: 1,
    pageSize: 10,
    total: 0,
    query: '',
    sortType: 'NORMAL',
    catalogCode: ""
@@ -52,7 +54,7 @@
    },
    getTag() {
      const catalogCode = this.data.catalogCode
      getCatalogList({
      getCataLogTagList({
        catalogCode
      })
    },
@@ -70,14 +72,30 @@
        })
      })
    },
    scrolltolower() {
      console.log('触底事件');
      const { total, datalist, pageNum } = this.data
      if(total > datalist.length){
        this.setData({ pageNum: pageNum + 1 })
        this.getList()
      }else{
        wx.showToast({
          title: '暂无更多数据',
          icon: 'none'
        })
      }
    },
    cateClick(e) {
      const catalogCode = e.currentTarget.dataset.code
      this.setData({ catalogCode })
      this.setData({ pageNum: 1,datalist: [],total: 0})
      this.getTag()
      this.getList()
    },
    statusChange(e) {
      const sortType = e.currentTarget.dataset.status
      this.setData({sortType})
      this.setData({ pageNum: 1,datalist: [],total: 0})
      this.getList()
    },
    handleDetail(e) {