Просмотр исходного кода

feature: 对添加设备未登录,和直接登录方式不一样处理

332777428@qq.com 3 месяцев назад
Родитель
Сommit
6a403db716
4 измененных файлов с 16 добавлено и 4 удалено
  1. 1 1
      app.js
  2. 2 1
      pages/pageA/index/index.js
  3. 0 1
      pages/pageA/index/index.wxml
  4. 13 1
      pages/pageA/login/login.js

+ 1 - 1
app.js

@@ -16,7 +16,7 @@ const androidHost = 'wxs://mqtt.test.radio1964.com:8884'
 App({
   globalData: {
     isRelease: false,
-    is_debug: 1, // 1 测试环境 // 2正式环境
+    is_debug: 2, // 1 测试环境 // 2正式环境
     baseUrl: env.prod.baseUrl,
 
     userInfo: null,

+ 2 - 1
pages/pageA/index/index.js

@@ -1013,7 +1013,8 @@ Page({
     var that = this;
     var isLogin = that.getIsLogin();
     if (!isLogin) {
-      constant.routeUtil.jump(constant.routePath.login);
+      var param="?toDeviceList="+true;
+      constant.routeUtil.jumpParam(constant.routePath.login,param);
       return;
     }
     constant.routeUtil.jump(constant.routePath.deviceList);

+ 0 - 1
pages/pageA/index/index.wxml

@@ -1,4 +1,3 @@
-<!-- index.wxml -->
 <view class="container" style="flex-direction: column; display: flex;">
   <nav-bar bind:goBack="_goBack" nav-bgc-class="ex-nav-bgc-class" nav-title-class="ex-nav-title-class" ex-back-pre="ex-back-pre" navbar-data='{{nvabarData}}'></nav-bar>
 

+ 13 - 1
pages/pageA/login/login.js

@@ -9,6 +9,13 @@ Page({
     },
     isYs: false,
     isAgree: false,
+    toDeviceList: false,
+  },
+
+  onLoad(options) {
+    var that = this;
+    var toDeviceList = options.toDeviceList;
+    that.data.toDeviceList = toDeviceList;
   },
 
   egree() {
@@ -23,6 +30,7 @@ Page({
   },
 
   getPhoneNumber(e) {
+    var that = this;
     if (e.detail.errMsg != "getPhoneNumber:ok") {
       wx.showToast({
         title: "获取手机号失败",
@@ -58,7 +66,11 @@ Page({
                 });
               }, function () {
                 setTimeout(() => {
-                  constant.routeUtil.redirectTo(constant.routePath.deviceList);
+                  if (that.data.toDeviceList) {
+                    constant.routeUtil.redirectTo(constant.routePath.deviceList);
+                  } else {
+                    constant.routeUtil.goBack(1);
+                  }
                 }, 2000);
               }, function () {
                 wx.hideLoading();