|
@@ -190,12 +190,6 @@ Page({
|
|
var pubResponse = lexin_util.getResponseByDeviceMacId(deviceMacId);
|
|
var pubResponse = lexin_util.getResponseByDeviceMacId(deviceMacId);
|
|
app.unsubscribe(pubResponse);
|
|
app.unsubscribe(pubResponse);
|
|
};
|
|
};
|
|
-
|
|
|
|
- var deviceId = device.deviceId;
|
|
|
|
- deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
|
|
- that.setData({
|
|
|
|
- deviceMacId: deviceMacId,
|
|
|
|
- });
|
|
|
|
that.subscribeCurrDevice(device);
|
|
that.subscribeCurrDevice(device);
|
|
},
|
|
},
|
|
|
|
|
|
@@ -213,13 +207,18 @@ Page({
|
|
|
|
|
|
var deviceId = device.deviceId;
|
|
var deviceId = device.deviceId;
|
|
var deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
var deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
- const obj = {
|
|
|
|
- DstDeviceName: deviceMacId
|
|
|
|
- };
|
|
|
|
|
|
+ that.setData({
|
|
|
|
+ deviceMacId: deviceMacId,
|
|
|
|
+ });
|
|
|
|
|
|
- /// /AIrSMArT_7cdfa1fd3af0/user/pub_response
|
|
|
|
|
|
+ /// 订阅设备
|
|
var pubResponse = lexin_util.getResponseByDeviceMacId(deviceMacId);
|
|
var pubResponse = lexin_util.getResponseByDeviceMacId(deviceMacId);
|
|
app.subscribe(pubResponse);
|
|
app.subscribe(pubResponse);
|
|
|
|
+
|
|
|
|
+ /// 获取设备信息
|
|
|
|
+ const obj = {
|
|
|
|
+ DstDeviceName: deviceMacId
|
|
|
|
+ };
|
|
app.PubMsg({
|
|
app.PubMsg({
|
|
type: "get_dev_info",
|
|
type: "get_dev_info",
|
|
...obj
|
|
...obj
|
|
@@ -239,22 +238,23 @@ Page({
|
|
|
|
|
|
getchannelData(clientType) {
|
|
getchannelData(clientType) {
|
|
var that = this;
|
|
var that = this;
|
|
- var deviceList = that.getDeviceList();
|
|
|
|
- var deviceListSelect = that.getDeviceListSelect();
|
|
|
|
- if (deviceListSelect === null || deviceList.length <= deviceListSelect) {
|
|
|
|
- return;
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- var deviceId = deviceList[deviceListSelect].deviceId;
|
|
|
|
listByDevice({
|
|
listByDevice({
|
|
clientType: clientType,
|
|
clientType: clientType,
|
|
unShowLoad: true,
|
|
unShowLoad: true,
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
|
+ store.setStore("channelData", res);
|
|
that.setData({
|
|
that.setData({
|
|
- channelData: res
|
|
|
|
|
|
+ channelData: res,
|
|
});
|
|
});
|
|
|
|
|
|
// 接收设备当前播放状态
|
|
// 接收设备当前播放状态
|
|
|
|
+ var deviceList = that.getDeviceList();
|
|
|
|
+ var deviceListSelect = that.getDeviceListSelect();
|
|
|
|
+ if (deviceListSelect === null || deviceList.length <= deviceListSelect) {
|
|
|
|
+ return;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ var deviceId = deviceList[deviceListSelect].deviceId;
|
|
var deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
var deviceMacId = lexin_util.getDeviceMacId(deviceId);
|
|
const obj = {
|
|
const obj = {
|
|
DstDeviceName: deviceMacId
|
|
DstDeviceName: deviceMacId
|
|
@@ -263,7 +263,6 @@ Page({
|
|
type: "get_position",
|
|
type: "get_position",
|
|
...obj
|
|
...obj
|
|
});
|
|
});
|
|
- wx.setStorageSync("channelData", res);
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -276,7 +275,7 @@ Page({
|
|
}
|
|
}
|
|
var channelData = that.getChannelData();
|
|
var channelData = that.getChannelData();
|
|
if (channelData.length > actionIndex) {
|
|
if (channelData.length > actionIndex) {
|
|
- wx.setStorageSync("channelDeta", channelData[actionIndex]);
|
|
|
|
|
|
+ store.setStore("channelDeta", channelData[actionIndex]);
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: './../channelDetails/channelDetails'
|
|
url: './../channelDetails/channelDetails'
|
|
});
|
|
});
|
|
@@ -332,6 +331,7 @@ Page({
|
|
var pubResponse = lexin_util.getResponseByDeviceMacId(deviceMacId);
|
|
var pubResponse = lexin_util.getResponseByDeviceMacId(deviceMacId);
|
|
app.unsubscribe(pubResponse);
|
|
app.unsubscribe(pubResponse);
|
|
that.setData({
|
|
that.setData({
|
|
|
|
+ deviceMacId: null,
|
|
actionIndex: null,
|
|
actionIndex: null,
|
|
deviceListSelect: null,
|
|
deviceListSelect: null,
|
|
});
|
|
});
|
|
@@ -434,7 +434,7 @@ Page({
|
|
},
|
|
},
|
|
|
|
|
|
///断开当前的
|
|
///断开当前的
|
|
- async cancelCurrent() {
|
|
|
|
|
|
+ cancelCurrent() {
|
|
var that = this;
|
|
var that = this;
|
|
var deviceList = that.getDeviceList();
|
|
var deviceList = that.getDeviceList();
|
|
var deviceListSelect = that.getDeviceListSelect();
|
|
var deviceListSelect = that.getDeviceListSelect();
|
|
@@ -443,14 +443,14 @@ Page({
|
|
};
|
|
};
|
|
|
|
|
|
if (deviceList[deviceListSelect].connectType == 3) {
|
|
if (deviceList[deviceListSelect].connectType == 3) {
|
|
- await that.cancelWifi(deviceListSelect, true);
|
|
|
|
|
|
+ that.cancelWifi(deviceListSelect, true);
|
|
} else {
|
|
} else {
|
|
- await that.cancelBlue(deviceListSelect, true);
|
|
|
|
|
|
+ that.cancelBlue(deviceListSelect, true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
/// 断开蓝牙连接
|
|
/// 断开蓝牙连接
|
|
- async cancelBlue(index, onlyCancel) {
|
|
|
|
|
|
+ cancelBlue(index, onlyCancel) {
|
|
var that = this;
|
|
var that = this;
|
|
if (onlyCancel) {
|
|
if (onlyCancel) {
|
|
return;
|
|
return;
|
|
@@ -471,7 +471,7 @@ Page({
|
|
},
|
|
},
|
|
|
|
|
|
/// 断开连接wifi
|
|
/// 断开连接wifi
|
|
- async cancelWifi(index, onlyCancel) {
|
|
|
|
|
|
+ cancelWifi(index, onlyCancel) {
|
|
var that = this;
|
|
var that = this;
|
|
var deviceList = that.getDeviceList();
|
|
var deviceList = that.getDeviceList();
|
|
if (index === null || deviceList.length <= index) {
|
|
if (index === null || deviceList.length <= index) {
|
|
@@ -729,7 +729,7 @@ Page({
|
|
// that.setData({
|
|
// that.setData({
|
|
// bannerList: res
|
|
// bannerList: res
|
|
// });
|
|
// });
|
|
- // wx.setStorageSync("homeBanner", res);
|
|
|
|
|
|
+ // store.setStore("homeBanner", res);
|
|
// })
|
|
// })
|
|
},
|
|
},
|
|
|
|
|