| | |
| | | actionDo, |
| | | getMemberInfo |
| | | } from '../../api/index' |
| | | import { eventBus } from '../../utils/eventBus' |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | actionType: 'view', |
| | | id: options.id |
| | | }) |
| | | const member = wx.getStorageSync('member') || {} |
| | | if(!member.id){ |
| | | getMemberInfo().then(res => { |
| | | this.setData({ |
| | | member: res.data |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | onShow() { |
| | | const member = wx.getStorageSync('member') || {} |
| | | if(member && member.id){ |
| | | this.setData({ |
| | | member |
| | | }) |
| | | } |
| | | }, |
| | | onUnload() { |
| | | console.log('详情进行了销毁'); |
| | | setTimeout(() => { |
| | | eventBus.emit('productDeBack', this.data.info) |
| | | }, 500) |
| | | }, |
| | | onLoad(options) { |
| | | var app = getApp().globalData |
| | |
| | | }) |
| | | wx.showToast({ |
| | | title: actionType == 'collect' ? '收藏成功' : '取消收藏', |
| | | icon: "none" |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | }) |
| | | }, |
| | | onHide() { |
| | | |
| | | }, |
| | | onUnload() { |
| | | |
| | | }, |
| | | onPullDownRefresh() { |