From 3508c76f824c6632b47aff17b1ec2f2a11c504fc Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 01 八月 2024 14:31:12 +0800
Subject: [PATCH] lll

---
 wechat_jiaxuan/app.js |   38 +++++++++++++++++++++++---------------
 1 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/wechat_jiaxuan/app.js b/wechat_jiaxuan/app.js
index d52c340..55d4c10 100644
--- a/wechat_jiaxuan/app.js
+++ b/wechat_jiaxuan/app.js
@@ -4,21 +4,21 @@
 } from './api/index'
 import CustomHook from 'spa-custom-hooks';
 let globalData = {
-  token: '',
+  token: wx.getStorageSync('token'),
   primary: '#B08771',
   bottomLift: ''
 }
+let pathMap = [
+  '/pages/detailDis/product',
+  '/pages/detailDis/case',
+  '/pages/detailDis/realpic',
+  '/pages/consult/detail',
+  '/pages/productVideo/index',
+]
 App({
   globalData,
   onLaunch: function (op) {
     console.log('options', op.query)
-    let pathMap = [
-      '/pages/detailDis/product',
-      '/pages/detailDis/case',
-      '/pages/detailDis/realpic',
-      '/pages/consult/detail',
-      '/pages/productVideo/index',
-    ]
     //鑾峰彇褰撳墠璁惧淇℃伅
     const WindowInfo = wx.getWindowInfo()
     if (WindowInfo.safeArea.top > 20) {
@@ -85,12 +85,12 @@
             }
           })
         } else {
-          if (op.query.scene) {
-            let temp = op.query.scene.split('_')
-            wx.navigateTo({
-              url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`,
-            })
-          }
+          // if (op.query.scene) {
+          //   let temp = op.query.scene.split('_')
+          //   wx.navigateTo({
+          //     url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`,
+          //   })
+          // }
         }
       })
     } else {
@@ -136,7 +136,15 @@
     }
   },
   onShow(options) {
-    console.log('options', options);
+    const token = wx.getStorageSync('token') || ''
+    if(token){
+      if (options.query.scene) {
+        let temp = options.query.scene.split('_')
+        wx.navigateTo({
+          url: `${pathMap[temp[1]]}?id=${temp[0]}&userId=${temp[2]}`,
+        })
+      }
+    }
   }
 })
 CustomHook.install({

--
Gitblit v1.9.3