''
liukangdong
2024-08-02 1cee3a660c5f8e5f4290ae894c2898c4966a834d
wechat_staff/pages/consult/consult.js
@@ -1,4 +1,5 @@
import { getZhongTaiProductNewsPage, getCatalogList,actionDo,refreshEnjoy } from '../../api/index'
let touchDot = 0
Page({
  /**
@@ -7,6 +8,7 @@
  data: {
    category: [],
    secondCategory: [],
    showCate: true,
    catalogCode: '',
    tagCode: '',
@@ -15,6 +17,7 @@
    total: 0,
    pageNum: 1,
    pageSize: 10,
    scrollTop: 0
    // height: 0,
    // top: 0,
@@ -22,12 +25,12 @@
  onLoad(options) {
    this.getCate()
  },
  onReachBottom() {
  bindscrolltolower() {
    console.log('触底事件');
    const { total, dataList, pageNum } = this.data
    if(total > dataList.length){
      this.setData({ pageNum: pageNum + 1 })
      this.getList()
      this.getList(false)
    }else{
      wx.showToast({
        title: '暂无更多数据',
@@ -80,7 +83,7 @@
      })
    }    
  },
  getList() {
  getList(showCate = true) {
    const { pageNum, pageSize, catalogCode, tagCode, query } = this.data
    getZhongTaiProductNewsPage({
      pageNum, pageSize, query, catalogCode: tagCode || catalogCode
@@ -88,7 +91,8 @@
      if(res.data){
        this.setData({ 
          dataList: [ ...this.data.dataList, ...res.data.records ],
          total: res.data.total
          total: res.data.total,
          showCate
        })
      }
      
@@ -119,10 +123,20 @@
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  touchstart(e){
    // touchDot = e.touches[0].pageY;
    console.log('开始', e);
  },
  touchmove(e) {
    // var touchMove = e.touches[0].pageY;
    console.log('touchMove', e);
    // if(touchDot - touchMove > 60){
    //   this.setData({ showCate: false })
    // }
    // if(touchMove - touchDot > 60){
    //   this.setData({ showCate: true })
    // }
  },
  onShow() {
    refreshEnjoy(this) 
  },