From 2da083225417ef7007842b84e7276242faeb0e35 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 05 八月 2024 16:18:58 +0800
Subject: [PATCH] lll

---
 wechat_jiaxuan/pages/consult/detail.js |   49 +++++++++++++++++++++++++++++--------------------
 1 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/wechat_jiaxuan/pages/consult/detail.js b/wechat_jiaxuan/pages/consult/detail.js
index c1b46f0..0f8df05 100644
--- a/wechat_jiaxuan/pages/consult/detail.js
+++ b/wechat_jiaxuan/pages/consult/detail.js
@@ -1,4 +1,4 @@
-import { shareContent, getProductNewsInfo } from '../../api/index'
+import { actionDo, getProductNewsInfo } from '../../api/index'
 Page({
 
   /**
@@ -7,7 +7,9 @@
   data: {
     bottomLift: 0,
     info: {},
+    detail: {},
 
+    origin: '',
     showShare: false
   },
 
@@ -19,11 +21,29 @@
     this.setData({
       bottomLift: app.bottomLift
     })
-    this.getDetail(options.id)
+    if(options.origin && options.origin == 'b'){
+      this.setData({ origin: 'b' })
+    }
+    this.getDetail(options.id, options.userId || '')
   },
-  getDetail(id) {
-    getProductNewsInfo({ id }).then(res => {
-      this.setData({ detail: res.data })
+  handleDesign() {
+    wx.navigateTo({
+      url: '/pages/design/design',
+    })
+  },
+  onShareAppMessage() {
+    let { info } = this.data
+    console.log('鐐瑰嚮浜嗗垎浜�')
+    return {
+      path: '/pages/consult/detail?id=' + info.id + '&userId=' + info.users.id
+    }
+  },
+  getDetail(id, userId) {
+    getProductNewsInfo({ id, salesId: userId || null }).then(res => {
+      this.setData({ info: res.data })
+      wx.setNavigationBarTitle({
+        title: res.data.title
+      })
     })
   },
   openShare() {
@@ -31,15 +51,11 @@
   },
   handleShare() {
     console.log('鐐瑰嚮浜嗗垎浜�');
-    shareContent(this.data.info.id)
+    actionDo({
+      actionType: 'share',
+      id: 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})
   },
@@ -65,13 +81,6 @@
    * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
    */
   onReachBottom() {
-
-  },
-
-  /**
-   * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
-   */
-  onShareAppMessage() {
 
   }
 })
\ No newline at end of file

--
Gitblit v1.9.3