| | |
| | | import { shareContent, getProductNewsInfo } from '../../api/index' |
| | | import { actionDo, getProductNewsInfo, getMemberInfo } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoadLogin(options) { |
| | | this.getDetail(options.id, options.userId || '') |
| | | }, |
| | | onShow(){ |
| | | this.setData({ member: wx.getStorageSync('member') }) |
| | | }, |
| | | onLoad(options) { |
| | | var app = getApp().globalData |
| | | this.setData({ |
| | |
| | | if(options.origin && options.origin == 'b'){ |
| | | this.setData({ origin: 'b' }) |
| | | } |
| | | this.getDetail(options.id, options.userId || '') |
| | | // this.getDetail(options.id, options.userId || '') |
| | | }, |
| | | handleDesign() { |
| | | const { member, origin, info } = this.data |
| | | let path = '/pages/design/design' |
| | | if(origin != 'b' && info.users && info.users.id){ |
| | | path = `/pages/design/design?name=${info.users.iamUsername}` |
| | | } |
| | | if (!member.phone) { |
| | | wx.setStorageSync('tempPath', path) |
| | | return wx.navigateTo({ |
| | | url: '/pages/auth/auth', |
| | | }) |
| | | } |
| | | wx.navigateTo({ |
| | | url: '/pages/design/design', |
| | | url: path, |
| | | }) |
| | | }, |
| | | onShareAppMessage() { |
| | |
| | | wx.setNavigationBarTitle({ |
| | | title: res.data.title |
| | | }) |
| | | if (userId) { |
| | | getMemberInfo().then(res => { |
| | | this.setData({ |
| | | member: res.data |
| | | }) |
| | | wx.setStorageSync('member', res.data) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | openShare() { |
| | |
| | | }, |
| | | handleShare() { |
| | | console.log('点击了分享'); |
| | | shareContent(this.data.info.id) |
| | | actionDo({ |
| | | actionType: 'share', |
| | | id: this.data.info.id |
| | | }) |
| | | }, |
| | | // onShareAppMessage: function () { |
| | | // // let { productDetail, userInfo } = this.data |
| | | // return { |
| | | // title: productDetail.title, |
| | | // path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0' |
| | | // } |
| | | // }, |
| | | onClose() { |
| | | this.setData({showShare: false}) |
| | | }, |