''
liukangdong
2024-07-25 8ab86de45b9ddf1ebde415f262f4b40727f53989
wechat_staff/pages/consult/detail.js
@@ -1,12 +1,15 @@
// pages/consult/detail.js
import { shareContent, getProductNewsInfo } from '../../api/index'
Page({
  /**
   * 页面的初始数据
   */
  data: {
    navTitle: '详情',
    bottomLift: 0
    bottomLift: 0,
    info: {},
    detail: {},
    showShare: false
  },
  /**
@@ -17,25 +20,38 @@
    this.setData({
      bottomLift: app.bottomLift
    })
    this.getDetail(options.id)
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  handleDesign() {
    wx.navigateTo({
      url: '/pages/design/design',
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  getDetail(id) {
    getProductNewsInfo({ id }).then(res => {
      this.setData({ info: res.data })
      wx.setNavigationBarTitle({
        title: res.data.title
      })
    })
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  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() {
  },