|
@@ -120,7 +120,7 @@ Page({
|
|
// 回调
|
|
// 回调
|
|
mqttCallback(type, option) {
|
|
mqttCallback(type, option) {
|
|
// console.log("gadsfadsfadsfa==888===" + type);
|
|
// console.log("gadsfadsfadsfa==888===" + type);
|
|
- // console.log("weqrweqrwqwerqer====22==" + type);
|
|
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==aaa===" + type);
|
|
var that = this;
|
|
var that = this;
|
|
let payloads = null;
|
|
let payloads = null;
|
|
if (option && option.payload) {
|
|
if (option && option.payload) {
|
|
@@ -132,7 +132,6 @@ Page({
|
|
case "connect":
|
|
case "connect":
|
|
lexin_subscribe.subscribeAllDevice();
|
|
lexin_subscribe.subscribeAllDevice();
|
|
break;
|
|
break;
|
|
-
|
|
|
|
///再走有在线
|
|
///再走有在线
|
|
case "message_onoffline":
|
|
case "message_onoffline":
|
|
lexin_connect.searchOnlineDevice(payloads, function (list) {
|
|
lexin_connect.searchOnlineDevice(payloads, function (list) {
|
|
@@ -147,8 +146,10 @@ Page({
|
|
|
|
|
|
// PlayState: ///播放状态:0默认状态,1播放状态,2暂停状态, 3停止状态,4缓冲状态。
|
|
// PlayState: ///播放状态:0默认状态,1播放状态,2暂停状态, 3停止状态,4缓冲状态。
|
|
case "message":
|
|
case "message":
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==bbb===" + type);
|
|
if (payloads) {
|
|
if (payloads) {
|
|
var payloadType = payloads.type;
|
|
var payloadType = payloads.type;
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==ccc===" + payloadType);
|
|
var other = payloads.other;
|
|
var other = payloads.other;
|
|
|
|
|
|
///获取频道位置
|
|
///获取频道位置
|
|
@@ -168,15 +169,16 @@ Page({
|
|
|
|
|
|
///获取电量
|
|
///获取电量
|
|
else if (payloadType === "battery" && other) {
|
|
else if (payloadType === "battery" && other) {
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==xxxx===" + JSON.stringify(other));
|
|
var battery = lexin_message.getDeviceInfo(other.battery);
|
|
var battery = lexin_message.getDeviceInfo(other.battery);
|
|
that.setData({
|
|
that.setData({
|
|
battery: battery,
|
|
battery: battery,
|
|
- })
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
///获取播放状态
|
|
///获取播放状态
|
|
else if (payloadType === "play" || payloadType === "play_state") {
|
|
else if (payloadType === "play" || payloadType === "play_state") {
|
|
- that.getPlay();
|
|
|
|
|
|
+ lexin_message.getPlay();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -187,6 +189,7 @@ Page({
|
|
///去连接设备数据
|
|
///去连接设备数据
|
|
actionDevice(device) {
|
|
actionDevice(device) {
|
|
var that = this;
|
|
var that = this;
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==444===");
|
|
// 取消订阅
|
|
// 取消订阅
|
|
var deviceMacId = that.data.deviceMacId;
|
|
var deviceMacId = that.data.deviceMacId;
|
|
if (!strings.isEmpty(deviceMacId)) {
|
|
if (!strings.isEmpty(deviceMacId)) {
|
|
@@ -196,6 +199,7 @@ Page({
|
|
|
|
|
|
var deviceId = device.deviceId;
|
|
var deviceId = device.deviceId;
|
|
deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==555===");
|
|
that.setData({
|
|
that.setData({
|
|
deviceMacId: deviceMacId,
|
|
deviceMacId: deviceMacId,
|
|
});
|
|
});
|
|
@@ -206,6 +210,7 @@ Page({
|
|
subscribeCurrDevice(device) {
|
|
subscribeCurrDevice(device) {
|
|
var that = this;
|
|
var that = this;
|
|
var isOK = app.globalData.client && app.globalData.client.connected;
|
|
var isOK = app.globalData.client && app.globalData.client.connected;
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==666===");
|
|
if (!isOK) {
|
|
if (!isOK) {
|
|
app.connect();
|
|
app.connect();
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -214,7 +219,7 @@ Page({
|
|
return;
|
|
return;
|
|
};
|
|
};
|
|
|
|
|
|
- console.log("gadsfqwerqwerqr====22==");
|
|
|
|
|
|
+ console.log("呃呃呃呃呃呃呃==777===");
|
|
var deviceId = device.deviceId;
|
|
var deviceId = device.deviceId;
|
|
var deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
var deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
const obj = {
|
|
const obj = {
|
|
@@ -230,10 +235,10 @@ Page({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
- actionMusic(e) {
|
|
|
|
|
|
+ onTapActionMusic(e) {
|
|
var that = this;
|
|
var that = this;
|
|
var actionIndex = that.data.actionIndex;
|
|
var actionIndex = that.data.actionIndex;
|
|
- if (!strings.isEmpty(actionIndex)) {
|
|
|
|
|
|
+ if (strings.isEmpty(actionIndex)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -431,7 +436,6 @@ Page({
|
|
};
|
|
};
|
|
|
|
|
|
var device = deviceList[deviceListSelect];
|
|
var device = deviceList[deviceListSelect];
|
|
- console.log("gadsfadsfadsfa==999===" + JSON.stringify(device));
|
|
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: './../deviceWake/deviceWake?deviceId=' + device.deviceId + "&clientType=" + device.ProdModel,
|
|
url: './../deviceWake/deviceWake?deviceId=' + device.deviceId + "&clientType=" + device.ProdModel,
|
|
});
|
|
});
|