From 4b48bacef8646cee8b66f5e10b0ed7124534e93e Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期五, 12 五月 2023 17:10:47 +0800
Subject: [PATCH] 首页修改

---
 miniprogram/pages/user/loginInfo/index.ts |   44 +++++++++++++++++++++++++-------------------
 1 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/miniprogram/pages/user/loginInfo/index.ts b/miniprogram/pages/user/loginInfo/index.ts
index 4719350..c0534c1 100644
--- a/miniprogram/pages/user/loginInfo/index.ts
+++ b/miniprogram/pages/user/loginInfo/index.ts
@@ -33,6 +33,10 @@
       }
     this.data.user.userIdcard=e.detail.value
   },
+  getPhoneNumber:function(e){
+      console.log(e);
+      
+  },
   submit(){
       if(!/^[\u4e00-\u9fa5]{2,4}$/.test(this.data.user.realName)){
         // Toast.fail('璇疯緭鍏ユ纭殑濮撳悕'); 
@@ -56,36 +60,38 @@
         return
     }
     wx.request({
+        
                     url: loginInfo.globalData.url+"/wx/login",
                     data: {
-                        "code": wx.getStorageSync('uesrCode'),
-                        "phoneNumberCode": wx.getStorageSync('userPhoneNumberCode')
+                        "phone": wx.getStorageSync('phone'),
                     },
                     method: "GET",
                     success: (res) => {
-                        console.log(res);
                         wx.setStorageSync('token', res.data.data.token)
                         wx.setStorageSync('role', res.data.data.role)
                         wx.setStorageSync('id', res.data.data.id)
                         wx.setStorageSync('card',res.data.data.time)
                         console.log(res.data.data.id)
+                        this.data.user.id= res.data.data.id
+                        wx.setStorageSync('id',res.data.data.id)
+                        wx.request({
+                            url:loginInfo.globalData.url+"/wx/user/add",
+                            method:"POST",
+                            data:this.data.user,
+                            header:{
+                                'token':wx.getStorageSync('token')
+                            },
+                            success:(res)=>{
+                                wx.setStorageSync('info',true)
+                                wx.reLaunch({
+                                    url:'../../user/index'
+                                })
+                            }
+                        })
                     }
 
                 })
-   wx.request({
-       url:loginInfo.globalData.url+"/wx/user/add",
-       method:"POST",
-       data:this.data.user,
-       header:{
-           'token':wx.getStorageSync('token')
-       },
-       success:(res)=>{
-           wx.setStorageSync('info',true)
-           wx.reLaunch({
-               url:'../../user/index'
-           })
-       }
-   })
+ 
   },
 face(){
     wx.chooseMedia({
@@ -103,13 +109,13 @@
                     'content-type': 'application/json'
                 },
                 success:(res)=>{
-                    // 鎴愬姛閫氱煡
-                    Notify({ type: 'primary', message: '閲囬泦鎴愬姛' });
                     const result = JSON.parse(res.data)
                     this.setData({
                         pic:result.data,
                         isShow:true
                     })
+                      // 鎴愬姛閫氱煡
+                    Notify({ type: 'primary', message: '閲囬泦鎴愬姛' });
                 }
             })
         }

--
Gitblit v1.8.0