aa
jiangping
2024-08-02 7dc29ed74ebaa8a0e66f68264d9a13f95dc3af21
wechat_staff/pages/kefu/fond.js
@@ -8,7 +8,9 @@
  data: {
    bottomLift: 0,
    checkAll: false,
    enjoyList: []
    enjoyList: [],
    leftIcon: '<<',
    rightIcon: '>>',
  },
  /**
@@ -24,6 +26,7 @@
      item.checked = false
    })
    wx.setStorageSync('enjoyList', enjoyList)
    console.log(this.data.enjoyList)
    this.initData()
  },
@@ -65,11 +68,51 @@
      }
    })
    wx.setStorageSync('enjoyList', enjoyList)
    this.initData()
  },
  itemClick(e) {
    let map = [
      '/pages/detailDis/product',
      '/pages/detailDis/case',
      '/pages/detailDis/realpic',
      '/pages/consult/detail',
    ]
    const { id, type } = e.currentTarget.dataset
    wx.navigateTo({
      url: map[type] + '?id=' + id,
    })
  },
  bind() {
    const enjoyList = wx.getStorageSync('enjoyList') || []
    const temp = enjoyList.filter(i => i.checked)
    if(temp.length == 0) return wx.showToast({
      title: '请先选择要关联的商品',icon:'none'
    })
    wx.navigateTo({
      url: '/pages/kefu/select',
    })
  },
  handleShare() {
    const { enjoyList } = this.data
    let info = {}
    enjoyList.forEach(item => {
      item.list.forEach(ite => {
        if(ite.checked){
          info = ite
        }
      })
    })
    let map = [
      '/pages/detailDis/product',
      '/pages/detailDis/case',
      '/pages/detailDis/realpic'
    ]
    console.log(info.id)
    wx.navigateToMiniProgram({
      appId: 'wxcd2b89fd2ff065f8',
      path: `${map[info.joinType]}?origin=b&id=${info.id}&userId=${wx.getStorageSync('member').id}`,
      envVersion: 'trial'
    })
  },
  handleDown() {
@@ -85,8 +128,8 @@
    console.log('obj', obj);
    let that = this
    getContentShareImg({
      articleId: obj.id + '&' + obj.joinType,
      type: '1',
      articleId: obj.id + '_' + obj.joinType,
      type: '0',
      // pageUrl: path,
      imgurl: obj.coverImage,
    }).then(res => {
@@ -161,6 +204,7 @@
            }
          })
          wx.setStorageSync('enjoyList', enjoyListTemp)
          that.initData()
        }
      }
@@ -168,11 +212,13 @@
    
  },
  checkAll() {
    this.setData({checkAll:!this.data.checkAll})
    let enjoyList = wx.getStorageSync('enjoyList') || []
    enjoyList.forEach(item => {
      item.checked = !item.checked
      item.checked = this.data.checkAll
    })
    wx.setStorageSync('enjoyList', enjoyList)
    this.initData()
  },
  openShare() {