Browse Source

feature:修改跳转回调新的首页

zeng.chen 1 year ago
parent
commit
fb7a4bd741

+ 0 - 1
app.js

@@ -92,7 +92,6 @@ App({
   changeUserRight() {
     const i = wx.getStorageSync('rightId') || 0
     const id = i === 0 ? 1 : 0
-    console.log("切换" + id);
     wx.setStorageSync('rightId', id)
     getApp().eventBus.emit('rightChange', id)
   },

+ 0 - 1
custom-tab-bar/index.js

@@ -70,7 +70,6 @@ Component({
     switchTab(e) {
       const data = e.currentTarget.dataset
       const url = data.path
-      console.log("点击切换"+ url);
       wx.switchTab({
         url: url,
         fail:function(e){

+ 2 - 2
pages/deviceConnect0/deviceConnect0.js

@@ -36,7 +36,7 @@ Page({
           title: '连接配网',
           callback: ()=> {
             wx.switchTab({
-              url: "./../index/index"
+              url: "./../home/home"
             })
           }
         },
@@ -130,7 +130,7 @@ Page({
   notRoter(){
     getCurrentPages()[0].onLoad();
     wx.switchTab({
-      url: "./../index/index"
+      url: "./../home/home"
     });
   },
   /**

+ 1 - 1
pages/deviceConnect3/deviceConnect3.js

@@ -218,7 +218,7 @@ Page({
     //  BLUFI_7cdfa1fd3cfc
     app.globalData.newDeviceId = this.data.name;
     wx.switchTab({
-      url: `./../index/index`
+      url: `./../home/home`
     });
   }
 })

+ 8 - 6
pages/me/me.js

@@ -1,3 +1,5 @@
+
+
 // pages/me/me.ts
 const app = getApp();
 
@@ -26,12 +28,13 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad() {
+
     // wx.getStorage("userInfo")
     const _this = this;
     wx.getStorage({
       key: "userInfo",
       success(res) {
-        if (!res.data.phone) {
+        if(!res.data.phone){
           return;
         };
         _this.setData({
@@ -50,18 +53,18 @@ Page({
   gologin() {
     // 
     const _this = this;
-    if (this.data.islogin) {
+    if(this.data.islogin){
       // 退出登录
       wx.removeStorage({
         key: 'userInfo',
-        success(res) {
+        success (res) {
           _this.setData({
             islogin: false,
             userName: "未登录",
             userPic: "./../../img/head_pic.png",
           });
           wx.switchTab({
-            url: `./../index/index`
+            url: `./../home/home`
           });
         }
       });
@@ -74,7 +77,7 @@ Page({
         url: './../login/login',
       });
     }
-
+    
   },
   /**
    * 生命周期函数--监听页面初次渲染完成
@@ -87,7 +90,6 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    // 当前的index
     let num = this.data.rightId === 1 ? 2 : 1
     if (typeof this.getTabBar === 'function' &&
       this.getTabBar()) {