Parcourir la source

feature: 唤醒数据处理

332777428@qq.com il y a 6 mois
Parent
commit
ec3dd6af63

+ 1 - 1
pages/pageC/deviceWake/deviceWake.wxss

@@ -1,4 +1,4 @@
-/* pages/deviceWake/deviceWake.wxss */
+
 .content .waskList{
   padding-left: 32rpx;
 }

+ 2 - 1
pages/pageC/wakeList/wakeList.js

@@ -1,4 +1,5 @@
 const app = getApp();
+import route_constant from '../../../utils/route_constant.js';
 let PreselectionIndex = null; // 记录选中的频道
 const {
   deviceWakeList,
@@ -128,7 +129,7 @@ Page({
       // 刷新页面
       that.init();
       getCurrentPages().map((v) => {
-        if (v.route === "pages/deviceWake/deviceWake") {
+        if (v.route === route_constant.deviceWakeRoot) {
           v.setdeviceWakedetail();
         };
       })

+ 34 - 17
pages/pageD/repeat/repeat.js

@@ -1,33 +1,50 @@
-// pages/repeat/repeat.js
-Page({
+import route_constant from '../../../utils/route_constant.js';
 
-  /**
-   * 页面的初始数据
-   */
+Page({
   data: {
     nvabarData: {
       showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
       title: '设置重复', //导航栏 中间的标题
 
     },
-    items: [
-      {value: '0', name: '周日'},
-      {value: '1', name: '周一'},
-      {value: '2', name: '周二'},
-      {value: '3', name: '周三'},
-      {value: '4', name: '周四'},
-      {value: '5', name: '周五'},
-      {value: '6', name: '周六'}
+    items: [{
+        value: '0',
+        name: '周日'
+      },
+      {
+        value: '1',
+        name: '周一'
+      },
+      {
+        value: '2',
+        name: '周二'
+      },
+      {
+        value: '3',
+        name: '周三'
+      },
+      {
+        value: '4',
+        name: '周四'
+      },
+      {
+        value: '5',
+        name: '周五'
+      },
+      {
+        value: '6',
+        name: '周六'
+      }
     ],
-    week_actives: [0,0,0,0,0,0,0],
+    week_actives: [0, 0, 0, 0, 0, 0, 0],
   },
   action(e) {
     this.data.week_actives[e.currentTarget.dataset.index] = this.data.week_actives[e.currentTarget.dataset.index] === 0 ? 1 : 0;
     this.setData({
       week_actives: this.data.week_actives
     });
-    getCurrentPages().map((v)=> {
-      if(v.route === "pages/deviceWake/deviceWake") {
+    getCurrentPages().map((v) => {
+      if (v.route === route_constant.deviceWakeRoot) {
         v.setRepeat(this.data.week_actives);
       };
     })
@@ -37,7 +54,7 @@ Page({
    */
   onLoad(options) {
     const week_actives = [];
-    options.week_actives.split(",").map((v)=>{
+    options.week_actives.split(",").map((v) => {
       week_actives.push(parseInt(v, 10));
     });
     this.setData({

+ 5 - 0
utils/route_constant.js

@@ -6,6 +6,10 @@ const loginRoot = "pages/pageA/login/login";
 ///****************** pageB ********************/
 const connectBleRoot = "pages/pageB/connectBle/connectBle";
 
+///****************** pageC ********************/
+const deviceWakeRoot = "pages/pageC/deviceWake/deviceWake";
+
+
 ///跳转路径
 ///****************** pageA ********************/
 const deviceList = "../deviceList/deviceList";
@@ -43,6 +47,7 @@ module.exports = {
   indexRoot: indexRoot,
   loginRoot: loginRoot,
   connectBleRoot: connectBleRoot,
+  deviceWakeRoot: deviceWakeRoot,
 
   ///跳转路径
   deviceList: deviceList,