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

feature: 构建乐鑫跳转相关帮助类

Damon 7 месяцев назад
Родитель
Сommit
83e21bfaf3
5 измененных файлов с 22 добавлено и 14 удалено
  1. 6 7
      pages/index/index.js
  2. 1 1
      pages/index/index.wxml
  3. 9 0
      utils/lexin/jump.js
  4. 4 5
      utils/lexin/util.js
  5. 2 1
      utils/route_constant.js

+ 6 - 7
pages/index/index.js

@@ -10,6 +10,7 @@ import store from '../../utils/store.js';
 import route_constant from '../../utils/route_constant.js';
 import route_util from '../../utils/route_util.js';
 import lexinUtil from '../../utils/lexin/util.js';
+import lexinJump from '../../utils/lexin/jump.js';
 import {
   BtHelper
 } from '../../devices/bt_helper.js';
@@ -570,13 +571,6 @@ Page({
     }
   },
 
-  // 关于我们
-  goMeAbout() {
-    wx.navigateTo({
-      url: './../about/about',
-    })
-  },
-
   onTapLogin() {
     var that = this;
     ///退出登录
@@ -998,6 +992,11 @@ Page({
     });
   },
 
+  // 关于我们
+  jumpToAboutUs() {
+    lexinJump.toAboutUs();
+  },
+
   ///******************************* 可折叠 ********************************************///
   onUserInfoLoad() {
     var that = this;

+ 1 - 1
pages/index/index.wxml

@@ -146,7 +146,7 @@
             <view class="icon">
               <image mode="widthFix" src="./../../img/q.png"></image>
             </view>
-            <view class="button" bindtap="goMeAbout">
+            <view class="button" bindtap="jumpToAboutUs">
               <text>关于我们</text>
               <image class="j" mode="heightFix" src="./../../img/b.png"></image>
             </view>

+ 9 - 0
utils/lexin/jump.js

@@ -0,0 +1,9 @@
+module.exports = {
+  toAboutUs: toAboutUs,
+}
+
+function toAboutUs() {
+  const route_util = require('../route_util');
+  const route_constant = require('../route_constant');
+  route_util.jump(route_constant.about);
+};

+ 4 - 5
utils/lexin/util.js

@@ -4,19 +4,18 @@ module.exports = {
   getResponseByDeviceMacId: getResponseByDeviceMacId,
 }
 
+///获取设备mac地址
 function getDeviceMacId(deviceId) {
   return `AIrSMArT_${deviceId.split("BLUFI_")[1]}`
 };
 
+///通过设备id获取mac地址
 function getResponseByDeviceId(deviceId) {
   var deviceMacId = `AIrSMArT_${deviceId.split("BLUFI_")[1]}`
   return `/${deviceMacId}/user/pub_response`;
 };
 
+///通过mac地址过去请求
 function getResponseByDeviceMacId(deviceMacId) {
   return `/${deviceMacId}/user/pub_response`;
-};
-
-
-
-getResponseByDeviceId
+};

+ 2 - 1
utils/route_constant.js

@@ -4,8 +4,8 @@ const loginRoot = "pages/login/login";
 const connectBleRoot = "pages/connectBle/connectBle";
 
 const index = "../index/index";
-///登录界面
 const login = "../login/login";
+const about = "../about/about";
 /// 抽奖记录
 const deviceList = "../deviceList/deviceList";
 // 连接模式
@@ -21,6 +21,7 @@ module.exports = {
   ///跳转路径
   index: index,
   login: login,
+  about: about,
   deviceList: deviceList,
   connectMode: connectMode,
   connectBle: connectBle,