ll
liukangdong
2024-08-27 2c08a98f7e85ec7c9376f27a7933e75e44d672f7
wechat_staff/components/detailFooter/index.js
@@ -1,8 +1,7 @@
import {
  getContentShareImg
  getContentShareImg,
  actionDo
} from '../../api/index'
const { HYEventBus } = require('hy-event-store')
const eventBus = new HYEventBus()
Component({
  /**
   * 组件的属性列表
@@ -28,9 +27,27 @@
    var app = getApp().globalData
    this.setData({
      bottomLift: app.bottomLift
    })
    })
  },
  methods: {
    handleShare() {
      let map = [
        '/pages/detailDis/product',//产品详情
        '/pages/detailDis/case',//案例详情
        '/pages/detailDis/realpic',//实景详情
        '/pages/consult/detail',//资讯详情
      ]
      const { info,  path} = this.data
      actionDo({
        actionType: 'share',
        id: info.id
      })
      wx.navigateToMiniProgram({
        appId: 'wx208dd1edc0be24ee',
        path: `${map[path]}?origin=b&id=${info.id}&userId=${wx.getStorageSync('member').id}`,
        envVersion: 'release'
      })
    },
    handleEnjoy() {
      const {
        info
@@ -40,7 +57,7 @@
        flag: !info.isEnjoy
      })
    },
    handleCollec() {
    handleCollec() {
      const {
        info
      } = this.data
@@ -48,16 +65,17 @@
        type: 'collec',
        flag: !info.isCollection
      })
    },
    handleDown() {
      const {
        info,
        path
      } = this.data
      let that = this
      getContentShareImg({
        articleId: path + '&' + info.id,
        type: '1',
        articleId: `${info.id}_${path}`,
        type: '0',
        // pageUrl: path,
        imgurl: info.coverImage,
      }).then(res => {
@@ -65,8 +83,7 @@
          isShowPoster: true,
          showShare: false,
          posterUrl: res.data
        })
        })
      })
    },
    saveCard() {
@@ -83,11 +100,27 @@
              that.setData({
                isShowPoster: false
              })
              wx.showToast({
                title: '保存成功',
                icon: 'success',
                duration: 2000
              wx.setClipboardData({
                data:  '          >>精品案例<<\n'
                      +'  🥇精益求精,品质生活🥇\n'
                      +'汇集全国优秀设计师获奖案例\n'
                      +'👉各种风格灵感案例上万套👈\n'
                      +'  总有一套能打动您,适合您',
                success: function (res) {
                  wx.getClipboardData({
                    success: function (res) {
                      wx.showToast({
                        title: '文案已复制成功,去分享吧'
                      })
                    }
                  })
                }
              })
              // wx.showToast({
              //   title: '保存成功',
              //   icon: 'success',
              //   duration: 2000
              // })
            }
          })
@@ -95,16 +128,18 @@
      })
    },
    batchDown() {
      console.log('点解了下载');
      this.triggerEvent('down')
      setTimeout(() => {
        eventBus.emit('batchDown', [1,2,3])
      }, 1000)
      setTimeout(() => {
        wx.navigateTo({
          url: '/pages/download/index',
        }, 1000)
      const downloadList = this.data.info.imageurlList || []
      wx.setStorageSync('downloadList', downloadList)
      wx.setStorageSync('downloadConfig', {
        path: this.data.path,id: this.data.info.id
      })
      actionDo({
        actionType: 'download',
        id: this.data.info.id
      })
      wx.navigateTo({
        url: '/pages/download/index',
      }, 1000)
    },
    closeCard() {
      this.setData({ isShowPoster: false })