''
liukangdong
2024-07-19 73c3507d82c06066d592d626ccd1a9a0961e0c5f
wechat_jiaxuan/pages/detailDis/case.js
@@ -1,4 +1,4 @@
import { shareContent } from '../../api/index'
import { actionDo, getWholecaseInfo } from '../../api/index'
Page({
  /**
@@ -17,8 +17,24 @@
    this.setData({
      bottomLift: app.bottomLift
    })
    this.getDetail(options.id)
    // actionDo({
    //   actionType: 'view',
    //   id: options.id
    // })
    const member = wx.getStorageSync('member')
    this.setData({id: options.id, member})
  },
  priviewFull(){
    let { panorama: link, title } = this.data.info
    wx.navigateTo({
      url: '/pages/webView/index',
      success: function(res) {
        // 通过eventChannel向被打开页面传送数据
        res.eventChannel.emit('acceptDataFromOpenerPage', { link, title })
      }
    })
  },
  openShare() {
    this.setData({showShare: true})
  },
@@ -33,6 +49,35 @@
  //     path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
  //   }
  // },
  handleAction(e){
    const actionType = e.currentTarget.dataset.code
    const { info } = this.data
    actionDo({
      actionType,
      id: this.data.info.id
    }).then(res => {
      info.isCollection = !info.isCollection
      this.setData({info})
    })
  },
  getDetail(id) {
    getWholecaseInfo({id}).then(res => {
      this.setData({ info: res.data })
      wx.setNavigationBarTitle({
        title: res.data.title
     })
    })
  },
  handleDesign() {
    wx.navigateTo({
      url: '/pages/design/design',
    })
  },
  playVideo() {
    wx.previewMedia({
      sources: [{ url: this.data.info.video, type: 'video' }]
    })
  },
  onClose() {
    this.setData({showShare: false})
  },