jiangping
2024-07-26 2faa6546a9f9ddb29f81cbc9770fc25b95703695
wechat_jiaxuan/components/disProduct/index.js
@@ -28,11 +28,10 @@
  attached() {
    this.getCatelist()
    var app = getApp()
    console.log('globalData', app.globalData);
    if(app.globalData.catalogCode){
      this.setData({ catalogCode: app.globalData.catalogCode })
      setTimeout(() => {
        console.log('catalogCode', this.data.catalogCode);
        console.log('catalogCode', this.data.catalogCode)
        getApp().globalData.catalogCode = ''
      }, 2000)
    }
@@ -81,7 +80,7 @@
      })
    },
    scrolltolower() {
      console.log('触底事件');
      console.log('触底事件')
      const { total, datalist, pageNum } = this.data
      if(total > datalist.length){
        this.setData({ pageNum: pageNum + 1 })
@@ -121,8 +120,8 @@
      const paramIndex = e.currentTarget.dataset.index
      const { secondCateList, tagCodes, activeParam, activeIndex } = this.data
      const index = tagCodes.indexOf(code)
      console.log('code', code);
      console.log('tagCodes', tagCodes);
      console.log('code', code)
      console.log('tagCodes', tagCodes)
      if(index === -1){
        // 同param里code重复
        if(activeParam && activeParam.length > 0){
@@ -146,8 +145,8 @@
    changeShowParams(e){
      const { secondCateList } = this.data
      const activeIndex = e.currentTarget.dataset.index
      console.log('activeIndex', activeIndex);
      console.log('secondCateList', secondCateList);
      console.log('activeIndex', activeIndex)
      console.log('secondCateList', secondCateList)
      if(activeIndex === this.data.activeIndex){
        this.setData({ activeIndex: -1, activeParam: [] })
      }else{
@@ -162,13 +161,13 @@
      const { secondCateList } = this.data
      secondCateList.forEach(item => {
        item.paramIndex = -1
        item.paramName = ''
        item.paramName = item.paramName || ''
      })
      this.setData({ tagCodes: [],activeParam: [],secondCateList,activeIndex: -1 })
    },
    subParam() {
      this.setData({ activeParam: [] })
      this.setData({ pageNum: 1,datalist: [],total: 0})
      this.setData({ pageNum: 1, activeIndex: -1, datalist: [], total: 0 })
      this.getList()
    },
  }