liukangdong
2024-07-29 26fb0b3e76f52212a2cef49a0bc0b94e7425880c
wechat_jiaxuan/pages/consult/consult.js
@@ -1,4 +1,4 @@
import { getZhongTaiProductNewsPage, getCatalogList, getCataLogTagList } from '../../api/index'
import { getZhongTaiProductNewsPage, getCatalogList,actionDo } from '../../api/index'
Page({
  /**
@@ -35,6 +35,11 @@
      })
    }
  },
  onPullDownRefresh: function () {
    console.log('下拉刷新');
    this.setData({ dataList: [], pageNum: 1, total: 0 })
    this.getList()
  },
  getCate() {
    getCatalogList({catalogCode: 'product_info'}).then(res => {
      this.setData({ category: res.data })
@@ -57,12 +62,13 @@
  },
  itemClick(e) {
    const item = e.currentTarget.dataset.item
    actionDo({actionType: 'view',id: item.id})
    if(item.contentType == 'link'){
      wx.navigateTo({
        url: '/pages/webView/index?link=' + item.content,
        url: '/pages/webView/index',
        success: function(res) {
          // 通过eventChannel向被打开页面传送数据
          res.eventChannel.emit('acceptDataFromOpenerPage', { link: item.openContent, title: item.title })
          res.eventChannel.emit('acceptDataFromOpenerPage', { link: item.content, title: item.title })
        }
      })
    }else{
@@ -71,6 +77,10 @@
      })
    }    
  },
  searchList() {
    this.setData({ dataList: [], total: 0, pageNum: 1 })
    this.getList()
  },
  getList() {
    const { pageNum, pageSize, catalogCode, tagCode, query } = this.data
    getZhongTaiProductNewsPage({