|
@@ -48,7 +48,6 @@ Page({
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
var that = this;
|
|
var that = this;
|
|
that.onUserInfoLoad();
|
|
that.onUserInfoLoad();
|
|
- that.onHomeLoad();
|
|
|
|
that.onBannerLoad();
|
|
that.onBannerLoad();
|
|
},
|
|
},
|
|
|
|
|
|
@@ -58,39 +57,25 @@ Page({
|
|
that.onBannerShow();
|
|
that.onBannerShow();
|
|
},
|
|
},
|
|
|
|
|
|
- onHomeLoad() {
|
|
|
|
- var that = this;
|
|
|
|
- const str = setTimeout(() => {
|
|
|
|
- clearTimeout(str);
|
|
|
|
- if (that.data.isOneLoading) {
|
|
|
|
- that.setData({
|
|
|
|
- isOneLoading: false,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }, 500);
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
onHomeShow() {
|
|
onHomeShow() {
|
|
var that = this;
|
|
var that = this;
|
|
- if ((!that.data.isOneLoading)) {
|
|
|
|
- var userInfo = wx.getStorageSync("userInfo") || "";
|
|
|
|
- if (!strings.isEmpty(userInfo)) {
|
|
|
|
- // 获取设备本地数据
|
|
|
|
- if (app.globalData.newDeviceId) {
|
|
|
|
- that.getDeviceData();
|
|
|
|
- }
|
|
|
|
- // 更新
|
|
|
|
- else if (that.data.deviceListIndex !== null) {
|
|
|
|
- that.actionDevice(that.data.deviceListIndex);
|
|
|
|
- }
|
|
|
|
|
|
+ var userInfo = wx.getStorageSync("userInfo") || "";
|
|
|
|
+ if (!strings.isEmpty(userInfo)) {
|
|
|
|
+ // 获取设备本地数据
|
|
|
|
+ if (app.globalData.newDeviceId) {
|
|
|
|
+ that.getDeviceData();
|
|
}
|
|
}
|
|
- // 取消订阅
|
|
|
|
- else {
|
|
|
|
- if (that.data.thisDeviceMac !== null) {
|
|
|
|
- app.unsubscribe(`/${that.data.thisDeviceMac}/user/pub_response`);
|
|
|
|
- };
|
|
|
|
|
|
+ // 更新
|
|
|
|
+ else if (that.data.deviceListIndex !== null) {
|
|
|
|
+ that.actionDevice(that.data.deviceListIndex);
|
|
}
|
|
}
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
+ // 取消订阅
|
|
|
|
+ else {
|
|
|
|
+ if (that.data.thisDeviceMac !== null) {
|
|
|
|
+ app.unsubscribe(`/${that.data.thisDeviceMac}/user/pub_response`);
|
|
|
|
+ };
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
///开始时home的
|
|
///开始时home的
|
|
@@ -376,8 +361,7 @@ Page({
|
|
},
|
|
},
|
|
|
|
|
|
getchannelData(clientType) {
|
|
getchannelData(clientType) {
|
|
- var that = this;
|
|
|
|
- console.log("gadfadsfqwwerqewrqr==000=" + clientType);
|
|
|
|
|
|
+ var that = this;Ï
|
|
if (that.data.deviceListIndex === null) {
|
|
if (that.data.deviceListIndex === null) {
|
|
return;
|
|
return;
|
|
};
|
|
};
|