From d9a89d83c2048a964f16ca179feb2b7f21b9d33a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 29 七月 2024 16:28:47 +0800
Subject: [PATCH] 提交

---
 wechat_jiaxuan/pages/consult/detail.js |   58 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/wechat_jiaxuan/pages/consult/detail.js b/wechat_jiaxuan/pages/consult/detail.js
index 0042f46..fa9bcc2 100644
--- a/wechat_jiaxuan/pages/consult/detail.js
+++ b/wechat_jiaxuan/pages/consult/detail.js
@@ -1,12 +1,16 @@
-// pages/consult/detail.js
+import { shareContent, getProductNewsInfo } from '../../api/index'
 Page({
 
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-    navTitle: '璇︽儏',
-    bottomLift: 0
+    bottomLift: 0,
+    info: {},
+    detail: {},
+
+    origin: '',
+    showShare: false
   },
 
   /**
@@ -17,25 +21,41 @@
     this.setData({
       bottomLift: app.bottomLift
     })
+    if(options.origin && options.origin == 'b'){
+      this.setData({ origin: 'b' })
+    }
+    this.getDetail(options.id, options.userId || '')
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
-   */
-  onReady() {
-
+  handleDesign() {
+    wx.navigateTo({
+      url: '/pages/design/design',
+    })
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  onShow() {
-
+  getDetail(id, userId) {
+    getProductNewsInfo({ id, salesId: userId || null }).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