import { getContentShareImg } from '../../api/index' Component({ /** * 组件的属性列表 */ properties: { info: Object, path: String, }, /** * 组件的初始数据 */ data: { bottomLift: 0, showShare: false }, attached() { var app = getApp().globalData this.setData({ bottomLift: app.bottomLift }) }, 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 }) }, onClose() { console.log('点击关闭'); this.setData({ showShare: false }) }, } })