From 89e7ed902461f28d6a7dd3e6c927eaf40b154f5e Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 15 八月 2024 10:12:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

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

diff --git a/wechat_staff/pages/consult/detail.js b/wechat_staff/pages/consult/detail.js
index 0042f46..41e3ccb 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, actionDo } from '../../api/index'
 Page({
 
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-    navTitle: '璇︽儏',
-    bottomLift: 0
+    bottomLift: 0,
+    info: {},
+    detail: {},
+
+    showShare: false
   },
 
   /**
@@ -17,25 +20,44 @@
     this.setData({
       bottomLift: app.bottomLift
     })
+    this.getDetail(options.id)
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
-   */
-  onReady() {
-
+  handleDesign() {
+    actionDo({
+      actionType: 'share',
+      id: this.data.info.id
+    })
+    wx.navigateToMiniProgram({
+      appId: 'wx208dd1edc0be24ee',
+      path: `/pages/consult/detail?id=${this.data.info.id}&origin=b&userId=${wx.getStorageSync('member').id}`,
+      envVersion: 'release'
+    })
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  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