liukangdong
2024-07-24 a63f26976652d1fc99de766a324c151501573d78
wechat_staff/components/detailFooter/index.js
@@ -1,10 +1,11 @@
// components/detailFooter/index.js
import { getContentShareImg } from '../../api/index'
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    info: Object,
    path: String,
  },
  /**
@@ -21,6 +22,28 @@
    })
  },
  methods: {
    handleEnjoy() {
      const { info } = this.data
      this.triggerEvent('enjoy', {
        type: 'enjoy', flag: !info.isEnjoy
      })
    },
    handleCollec() {
      const { info } = this.data
      this.triggerEvent('enjoy', {
        type: 'collec', flag: !info.isCollection
      })
    },
    handleDown() {
      const { info, path } = this.data
      getContentShareImg({
        articleId: info.id,
        type: '1',
        pageUrl: path,
        imgurl: info.coverImage,
      })
    },
    openShare() {
      console.log('点击打开');
      this.setData({ showShare: true })