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/index/index.ts |   70 +++++++++++++++++++++++++++--------
 1 files changed, 54 insertions(+), 16 deletions(-)

diff --git a/miniprogram/pages/index/index.ts b/miniprogram/pages/index/index.ts
index 9a63059..8483b15 100644
--- a/miniprogram/pages/index/index.ts
+++ b/miniprogram/pages/index/index.ts
@@ -32,23 +32,31 @@
                 var info = wx.getStorageSync('info')
                 console.log("鑾峰彇缂撳瓨锛�" + role)
                 if (role == 0) {
-                        wx.redirectTo(
-                            {
-                                url: '../user/index'
-                            }
-                        )
+                    wx.switchTab({
+                        url: '../user/index'
+                    })
+                        // wx.redirectTo(
+                        //     {
+                        //         url: '../user/index'
+                        //     }
+                        // )
                 }
                 if (role == 1) {
-                    wx.redirectTo(
-                        {
-                            url: '../manager/index'
-                        }
-                    )
+                    wx.switchTab({
+                        url: '../user/index'
+                    })
+                    // wx.redirectTo(
+                    //     {
+                    //         url: '../user/index'
+                    //     }
+                    // )
                 }
-
-                wx.navigateTo({
-                    url: '../' + value
+                wx.switchTab({
+                    url: '../user/index'
                 })
+                // wx.navigateTo({
+                //     url: '../user/index'
+                // })
             } else {// 鏈櫥褰� 鏄剧ず 寰俊鎺堟潈椤甸潰
                 this.setData({
                     isShow: true
@@ -71,6 +79,9 @@
         wx.login({
             success: (res) => {
                 console.log("code", res.code)
+                wx.setStorageSync('uesrCode', res.code)
+                wx.setStorageSync('userPhoneNumberCode',e.detail.code)
+              
                 wx.request({
                     url:app.globalData.url+"/wx/checkIdentity",
                     data: {
@@ -79,8 +90,36 @@
                     },
                     method: "GET",
                     success:(res)=>{
-                        console.log(res);
-                        
+                        wx.setStorageSync('phone', res.data.msg)
+                        if (res.data.data==2) {
+                            wx.switchTab({
+                                url: '../user/index'
+                            })
+                            // wx.redirectTo(
+                            //                         {    url: '../user/index'
+                            //                             //   url: '../user/pubulicty/index'
+                            //                             // url: '../user/loginInfo/index'
+                            //                         }
+                            //                     )
+                        }else if(res.data.data==0){
+                            wx.switchTab({
+                                url: '../user/index'
+                            })
+                            // wx.redirectTo(
+                            //     {
+                            //         url: '../user/index'
+                            //     }
+                            // )
+                        }else{
+                            wx.switchTab({
+                                url: '../user/index'
+                            })
+                            // wx.redirectTo(
+                            //     {url: '../user/index'
+                            //         // url: '../manager/index'
+                            //     }
+                            // ) 
+                        }
                     }
                 })
                 // wx.request({
@@ -91,7 +130,6 @@
                 //     },
                 //     method: "GET",
                 //     success: (res) => {
-                //         console.log(res);
                 //         //  濡傛灉鐢ㄦ埛宸茬粡娉ㄥ唽鐩存帴杩涘叆  鏈敞鍐岃繘鍏ュ浼�   role == 0鐢ㄦ埛  1璀﹀憳
                 //         wx.setStorageSync('token', res.data.data.token)
                 //         wx.setStorageSync('role', res.data.data.role)

--
Gitblit v1.8.0