aa
jiangping
2024-08-02 7dc29ed74ebaa8a0e66f68264d9a13f95dc3af21
wechat_jiaxuan/pages/detailDis/product.js
@@ -1,7 +1,9 @@
import {
  getProductInfo,
  actionDo
  actionDo,
  getMemberInfo
} from '../../api/index'
import { eventBus } from '../../utils/eventBus'
Page({
  /**
   * 页面的初始数据
@@ -14,7 +16,10 @@
    isFold: false,
    info: {},
    member: {},
    showShare: false
    showShare: false,
    options: {
      empty: '无参数'
    }
  },
  changeFold() {
    this.setData({ isFold: !this.data.isFold })
@@ -25,11 +30,12 @@
      actionType: 'view',
      id: options.id
    })
    getMemberInfo().then(res => {
      this.setData({
        member: res.data
      })
    })
  },
  onUnload() {
    console.log('详情进行了销毁');
    setTimeout(() => {
      eventBus.emit('productDeBack', this.data.info)
    }, 500)
  },
  onLoad(options) {
    var app = getApp().globalData
@@ -86,6 +92,7 @@
      })
      wx.showToast({
        title: actionType == 'collect' ? '收藏成功' : '取消收藏',
        icon: "none"
      })
    })
  },
@@ -99,6 +106,9 @@
      })
      wx.setNavigationBarTitle({
        title: res.data.title
      })
      getMemberInfo().then(res => {
        this.setData({ member: res.data })
      })
    })
  },
@@ -191,9 +201,6 @@
    })
  },
  onHide() {
  },
  onUnload() {
  },
  onPullDownRefresh() {