|
@@ -1,9 +1,16 @@
|
|
|
// pages/setWifi/setWifi.js
|
|
|
-const { BtHelper } = require("../../devices/bt_helper");
|
|
|
-import EventManager from '../../utils/event_bus'
|
|
|
-import { EnumCmdEvent, CmdEvent } from '../../devices/cmd_key_event';
|
|
|
+const {
|
|
|
+ BtHelper
|
|
|
+} = require("../../devices/bt_helper");
|
|
|
+import eventBus from '../../utils/eventBus'
|
|
|
+import {
|
|
|
+ EnumCmdEvent,
|
|
|
+ CmdEvent
|
|
|
+} from '../../devices/cmd_key_event';
|
|
|
import store from '../../utils/store';
|
|
|
-import { BtCmd } from '../../devices/bluetooth/bt_cmd';
|
|
|
+import {
|
|
|
+ BtCmd
|
|
|
+} from '../../devices/bluetooth/bt_cmd';
|
|
|
Page({
|
|
|
data: {
|
|
|
navbarData: {
|
|
@@ -144,7 +151,10 @@ Page({
|
|
|
},
|
|
|
|
|
|
onConfirm: function () {
|
|
|
- const { wifiName, wifiPassword } = this.data;
|
|
|
+ const {
|
|
|
+ wifiName,
|
|
|
+ wifiPassword
|
|
|
+ } = this.data;
|
|
|
if (!wifiName) {
|
|
|
wx.showToast({
|
|
|
title: '请输入完整的Wi-Fi信息',
|
|
@@ -157,7 +167,7 @@ Page({
|
|
|
},
|
|
|
addNotification() {
|
|
|
let _this = this;
|
|
|
- EventManager.addNotification(CmdEvent.eventName, function (event) {
|
|
|
+ eventBus.addNotification(CmdEvent.eventName, function (event) {
|
|
|
let name = event.cmdEvent;
|
|
|
let otaCmd = event.otaCmd
|
|
|
console.log("设置wifi0:", event)
|
|
@@ -199,6 +209,6 @@ Page({
|
|
|
if (!this.data._onNavigateBack) {
|
|
|
BtHelper.getInstance().otaCmd(2)
|
|
|
}
|
|
|
- EventManager.removeNotification(CmdEvent.eventName)
|
|
|
+ eventBus.removeNotification(CmdEvent.eventName)
|
|
|
},
|
|
|
});
|