From d41f1f707dc643b726a42b9d2a63b186dd9e4f28 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 06 八月 2024 16:12:38 +0800
Subject: [PATCH] ll

---
 wechat_staff/pages/login/index.js |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/wechat_staff/pages/login/index.js b/wechat_staff/pages/login/index.js
index 98dbf50..8ec8fb0 100644
--- a/wechat_staff/pages/login/index.js
+++ b/wechat_staff/pages/login/index.js
@@ -56,6 +56,9 @@
       }, 1000)
     })
   },
+  onShow(){
+    wx.hideHomeButton()
+  },
   handleJudge(e) {
     const flag = e.currentTarget.dataset.flag
     console.log(e);
@@ -154,6 +157,7 @@
             that.setData({openid:res.data.openid})
             if (res && res.data !=null && res.data.token!=null) { 
               console.log(res)
+              wx.hideLoading()
               wx.setStorageSync('member', res.data.users || '')
               wx.setStorageSync('token', res.data.token || '')
               wx.switchTab({
@@ -162,13 +166,15 @@
             } 
           })
         } else {
-          wx.navigateTo({
+          wx.redirectTo({
             url: '/pages/login/index',
           })
+          wx.hideLoading()
           console.log('鐧诲綍澶辫触锛�' + res)
         }
       },
       fail(err) {
+        wx.hideLoading()
         console.log(err)
       }
     })
@@ -180,17 +186,10 @@
     getWxMiniPhone({
       encryptedData: data.encryptedData,
       iv: data.iv,
+      openid:this.data.openid,
       sessionKey: wx.getStorageSync('sessionKey'),
     }).then(res => {
-      if (res.data && res.data.token) {
-        wx.login({
-          timeout: 5000,
-          success: (loginRes) =>  {
-            if (loginRes.code) {
-              this.bindingOpenid(loginRes.code, res.data.token)
-            }
-          }
-        })
+      if (res.data && res.data.token) { 
         if(res.data.phone){
           res.data.users.phone = res.data.phone || res.data.users.phone
         }
@@ -262,13 +261,6 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
    */
   onReady() {
-
-  },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  onShow() {
 
   },
 

--
Gitblit v1.9.3