From 28c725308aaf418e9032964ffcf5ca3b0d8a1208 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 25 七月 2024 17:13:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 wechat_staff/pages/consult/detail.js |   54 +++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/wechat_staff/pages/consult/detail.js b/wechat_staff/pages/consult/detail.js
index 0042f46..0419117 100644
--- a/wechat_staff/pages/consult/detail.js
+++ b/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() {
 
   },

--
Gitblit v1.9.3