From ebc6e7ee67f13e7aa311e737dfcb4c5caed112ee Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 15 八月 2024 18:23:57 +0800
Subject: [PATCH] ll

---
 wechat_jiaxuan/pages/detailDis/product.js |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index 4c4970b..be08b05 100644
--- a/wechat_jiaxuan/pages/detailDis/product.js
+++ b/wechat_jiaxuan/pages/detailDis/product.js
@@ -31,6 +31,9 @@
       id: options.id
     })
   },
+  onShow(){
+    this.setData({ member: wx.getStorageSync('member') })
+  },
   onUnload() {
     console.log('璇︽儏杩涜浜嗛攢姣�');
     setTimeout(() => {
@@ -77,7 +80,7 @@
     const {
       info, member
     } = this.data
-    if (member.authStatus == '0') {
+    if (!member.phone) {
       return wx.navigateTo({
         url: '/pages/auth/auth',
       })
@@ -107,9 +110,14 @@
       wx.setNavigationBarTitle({
         title: res.data.title
       })
-      getMemberInfo().then(res => {
-        this.setData({ member: res.data })
-      })
+      if(userId){
+        getMemberInfo().then(res => {
+          this.setData({ member: res.data })
+          wx.setStorageSync('member', res.data)
+        })
+      }else{
+        this.setData({ member: wx.getStorageSync('member') })
+      }
     })
   },
   playVideo() {
@@ -131,6 +139,13 @@
     })
   },
   handleDesign() {
+    const { member } = this.data
+    if (!member.phone) {
+      wx.setStorageSync('tempPath', '/pages/design/design')
+      return wx.navigateTo({
+        url: '/pages/auth/auth',
+      })
+    }
     wx.navigateTo({
       url: '/pages/design/design',
     })
@@ -152,8 +167,14 @@
   onShareAppMessage: function () {
     let { info } = this.data
     console.log('鐐瑰嚮浜嗗垎浜�')
-    return {
-      path: '/pages/detailDis/product?id=' + info.id + '&userId=' + info.users.id
+    if(info.users && info.users.id){
+      return {
+        path: '/pages/detailDis/product?id=' + info.id + '&userId=' + info.users.id
+      }
+    }else{
+      return {
+        path: '/pages/detailDis/product?id=' + info.id 
+      }
     }
   },
   onClose() {

--
Gitblit v1.9.3