liukangdong
2024-07-30 1a6905045d38bb50b0c6554c3440bdfd339c8d23
wechat_jiaxuan/pages/detailDis/product.js
@@ -1,6 +1,7 @@
import {
  getProductInfo,
  actionDo
  actionDo,
  getMemberInfo
} from '../../api/index'
Page({
  /**
@@ -11,15 +12,24 @@
    current: 0,
    id: '',
    origin: '',
    isFold: false,
    info: {},
    member: {},
    showShare: false
  },
  onLoadLogin(options){
  changeFold() {
    this.setData({ isFold: !this.data.isFold })
  },
  onLoadLogin(options) {
    this.getDetail(options.id, options.userId || '')
    actionDo({
      actionType: 'view',
      id: options.id
    })
    getMemberInfo().then(res => {
      this.setData({
        member: res.data
      })
    })
  },
  onLoad(options) {
@@ -27,13 +37,11 @@
    this.setData({
      bottomLift: app.bottomLift
    })
    if(options.origin && options.origin == 'b'){
    if (options.origin && options.origin == 'b') {
      this.setData({ origin: 'b' })
    }
    const member = wx.getStorageSync('member')
    this.setData({
      id: options.id,
      member
      id: options.id
    })
  },
  bindchange(e) {
@@ -45,7 +53,7 @@
      info
    } = this.data
    wx.previewImage({
      urls: info.imageurlList,
      urls: info.bannerImgList,
      current: url
    })
  },
@@ -55,16 +63,15 @@
      info
    } = this.data
    wx.previewImage({
      urls: info.imageurlList,
      urls: info.spaceList.map(i => i.spaceImg),
      current: url
    })
  },
  handleAction(e) {
    const actionType = e.currentTarget.dataset.code
    const {
      info
      info, member
    } = this.data
    const member = wx.getStorageSync('member')
    if (member.authStatus == '0') {
      return wx.navigateTo({
        url: '/pages/auth/auth',
@@ -125,7 +132,6 @@
    })
  },
  handleShare() {
    console.log('点击了分享');
    actionDo({
      actionType: 'share',
      id: this.data.info.id
@@ -134,13 +140,13 @@
    //   this.setData({showShare: false})
    // })
  },
  // onShareAppMessage: function () {
  //   // let { productDetail, userInfo } = this.data
  //   return {
  //     title: productDetail.title,
  //     path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
  //   }
  // },
  onShareAppMessage: function () {
    let { info } = this.data
    console.log('点击了分享')
    return {
      path: '/pages/detailDis/product?id=' + info.id + '&userId=' + info.users.id
    }
  },
  onClose() {
    this.setData({
      showShare: false
@@ -198,10 +204,4 @@
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})