| | |
| | | // pages/consult/detail.js |
| | | import { shareContent, getProductNewsInfo } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | navTitle: '详情', |
| | | bottomLift: 0 |
| | | bottomLift: 0, |
| | | info: {}, |
| | | |
| | | showShare: false |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.setData({ |
| | | bottomLift: app.bottomLift |
| | | }) |
| | | this.getDetail(options.id) |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | getDetail(id) { |
| | | getProductNewsInfo({ id }).then(res => { |
| | | this.setData({ detail: res.data }) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | openShare() { |
| | | this.setData({showShare: true}) |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | handleShare() { |
| | | console.log('点击了分享'); |
| | | shareContent(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}) |
| | | }, |
| | | onHide() { |
| | | |
| | | }, |