|
|
@@ -107,7 +107,7 @@ function updateChartCircularProgressBarOption(rscore_desc, rscore_value, that) {
|
|
|
console.log('view不存在');
|
|
|
}
|
|
|
}).exec(); // 执行查询
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -175,7 +175,7 @@ function setOption(chart) {
|
|
|
fontSize: "28px",
|
|
|
fontWeight: 'bolder',
|
|
|
formatter: function (value) {
|
|
|
- return `${value.toFixed(0) }` + '{units|%}'
|
|
|
+ return `${value.toFixed(0)}` + '{units|%}'
|
|
|
},
|
|
|
color: '#3E3D44',
|
|
|
rich: {
|
|
|
@@ -347,7 +347,7 @@ Page({
|
|
|
Light: 0,
|
|
|
LiquidLevel: 0,
|
|
|
//香薰机参数 开始
|
|
|
-
|
|
|
+ showAuthorizedDialog: false,
|
|
|
area: "请求中", //城区
|
|
|
city: "请求中", //城市
|
|
|
airText: "请求中", //空气优良
|
|
|
@@ -455,7 +455,7 @@ Page({
|
|
|
'加湿器', '空调', '音箱', '窗帘', '纱帘'
|
|
|
],
|
|
|
temperatureHumidifyName: '温度',
|
|
|
- temperatureValue:0,
|
|
|
+ temperatureValue: 0,
|
|
|
isButtonPressedHumidityUp: false,
|
|
|
isButtonPressedHumidityDown: false,
|
|
|
isButtonPressedClimateUp: false,
|
|
|
@@ -1391,7 +1391,7 @@ Page({
|
|
|
return chart;
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3458,7 +3458,7 @@ Page({
|
|
|
obj.isAromAtomization = obj.friendly_name.includes('香薰机雾化')
|
|
|
obj.isAromatherapy = obj.friendly_name.endsWith('香薰机') || obj.friendly_name.endsWith('香薰机开关')
|
|
|
if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain && obj.domain != 'automation' && obj.domain != 'automation' && !obj.isAromlight && !obj.isAromAtomization && !obj.isAromatherapy) {
|
|
|
-
|
|
|
+
|
|
|
if (!obj.friendly_name.endsWith("电视")) {
|
|
|
listSwitchTemp.push(obj)
|
|
|
}
|
|
|
@@ -3892,11 +3892,23 @@ Page({
|
|
|
return strR.slice(-6);
|
|
|
}
|
|
|
},
|
|
|
- onLoad(option) {
|
|
|
- console.log("index页面");
|
|
|
- // wx.clearStorage();
|
|
|
- // this.setTextBreathing(wx.createSelectorQuery(".header-title-fire"),this);
|
|
|
- //console.log('option.res='+JSON.stringify(wx.getStorageSync('res')));
|
|
|
+ onReady() {
|
|
|
+ console.log('页面渲染完成')
|
|
|
+ // 获取组件
|
|
|
+ // 确保页面渲染完成后查找节点
|
|
|
+ if (!wx.getStorageSync('hasAuth')) {
|
|
|
+ this.setData({ showAuthorizedDialog: true })
|
|
|
+ } else {
|
|
|
+ this.showData();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ authorizationSuccessful() {
|
|
|
+ console.log("授权成功");
|
|
|
+ this.setData({ showAuthorizedDialog: false })
|
|
|
+ this.showData();
|
|
|
+ },
|
|
|
+ showData() {
|
|
|
if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
@@ -3910,106 +3922,6 @@ Page({
|
|
|
})
|
|
|
}, 2000) // 设置延时时间,单位为毫秒
|
|
|
} else {
|
|
|
-
|
|
|
- var that = this;
|
|
|
- // wx.request({
|
|
|
- // url: `${aipushApi}`+'/getbigreport',
|
|
|
- // method: 'POST',
|
|
|
- // header: {
|
|
|
- // 'content-type': 'application/json', // 默认值
|
|
|
- // 'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
|
|
|
- // },
|
|
|
- // data:{
|
|
|
- // "sn":'',"tokens":token_push
|
|
|
- // },
|
|
|
- // success(ress) {
|
|
|
- // if(ress && ress.data){
|
|
|
- // wx.request({
|
|
|
- // url: `${homeApi_https}/states`, //获取空气数据
|
|
|
- // method: 'GET',
|
|
|
- // header: {
|
|
|
- // 'content-type': 'application/json', // 默认值
|
|
|
- // 'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
|
|
|
- // },
|
|
|
- // success(res) {
|
|
|
- // if(!res || !res.data){
|
|
|
- // wx.showModal({
|
|
|
- // title: '提示',
|
|
|
- // content: '请先连接房间wi-fi,再次扫描',
|
|
|
- // showCancel: false
|
|
|
- // });
|
|
|
-
|
|
|
- // setTimeout(function() {
|
|
|
- // wx.reLaunch({
|
|
|
- // url: '/pages/scan/scan',
|
|
|
- // })
|
|
|
- // }, 2000) // 设置延时时间,单位为毫秒
|
|
|
- // }else{
|
|
|
- // // console.log("res.data====="+JSON.stringify(res.data));
|
|
|
- // }
|
|
|
- // },
|
|
|
- // });
|
|
|
- // }else{
|
|
|
- // wx.showModal({
|
|
|
- // title: '提示',
|
|
|
- // content: '请先连接房间wi-fi,再次扫描',
|
|
|
- // showCancel: false
|
|
|
- // });
|
|
|
-
|
|
|
- // setTimeout(function() {
|
|
|
- // wx.reLaunch({
|
|
|
- // url: '/pages/scan/scan',
|
|
|
- // })
|
|
|
- // }, 2000) // 设置延时时间,单位为毫秒
|
|
|
- // }
|
|
|
- // },
|
|
|
- // });
|
|
|
-
|
|
|
- // const socketUrl = 'http://192.168.3.65:8123';
|
|
|
- // wx.connectSocket({
|
|
|
- // url: socketUrl,
|
|
|
- // success: function (res) {
|
|
|
- // console.log('WebSocket连接成功', res);
|
|
|
- // },
|
|
|
- // fail: function (error) {
|
|
|
- // console.error('WebSocket连接打开失败', error);
|
|
|
- // }
|
|
|
- // });
|
|
|
- //wi-fi判断
|
|
|
- // wx.startWifi({
|
|
|
- // fail(error) {
|
|
|
- // console.log('初始化wifi-失败', error)
|
|
|
- // },
|
|
|
- // success(res) {
|
|
|
- // console.log('初始化wifi-成功', res)
|
|
|
- // },
|
|
|
- // });
|
|
|
-
|
|
|
-
|
|
|
- // const expiresAt = wx.getStorageSync('scanResultExpiresAt');
|
|
|
- // const now = Date.now()
|
|
|
- // console.log('expiresAt='+expiresAt);
|
|
|
- // console.log('now='+now);
|
|
|
- // if (expiresAt || expiresAt < now) {
|
|
|
- // // 扫码结果已过期
|
|
|
- // wx.showToast({
|
|
|
- // title: '扫码结果失效或已过期,请重新扫码',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
- // // 清除过期的扫码结果
|
|
|
- // wx.removeStorageSync('scanResultExpiresAt');
|
|
|
- // setTimeout(function() {
|
|
|
- // wx.reLaunch({
|
|
|
- // url: '/pages/scan/scan',
|
|
|
- // })
|
|
|
- // }, 2000) // 设置延时时间,单位为毫秒
|
|
|
-
|
|
|
- // }else{
|
|
|
- // //续期
|
|
|
- // wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000)
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
let hotelcodeTemp = '';
|
|
|
let roomcodeTemp = '';
|
|
|
if (wx.getStorageSync('res').result.split('|').length != 2) {
|
|
|
@@ -4045,61 +3957,8 @@ Page({
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // else if(!this.data.home_room.includes(wx.getStorageSync('res').result)){
|
|
|
- // wx.showModal({
|
|
|
- // title: '提示',
|
|
|
- // content: '房间二维码不正确,请重新扫描',
|
|
|
- // showCancel: false
|
|
|
- // });
|
|
|
-
|
|
|
- // setTimeout(function() {
|
|
|
- // wx.reLaunch({
|
|
|
- // url: '/pages/scan/scan',
|
|
|
- // })
|
|
|
- // }, 2000) // 设置延时时间,单位为毫秒
|
|
|
- // }
|
|
|
-
|
|
|
- // this.showCanvasRing();
|
|
|
-
|
|
|
- // 创建音频上下文
|
|
|
- // this.innerAudioContext = wx.createInnerAudioContext();
|
|
|
-
|
|
|
- // // 设置音频源
|
|
|
- // this.innerAudioContext.src = '你的音频文件链接'; // 替换为你的音频文件链接
|
|
|
-
|
|
|
- // // 监听播放状态
|
|
|
- // this.innerAudioContext.onPlay(() => {
|
|
|
- // this.setData({ isPlaying: true });
|
|
|
- // });
|
|
|
- // this.innerAudioContext.onPause(() => {
|
|
|
- // this.setData({ isPlaying: false });
|
|
|
- // });
|
|
|
- // this.innerAudioContext.onStop(() => {
|
|
|
- // this.setData({ isPlaying: false });
|
|
|
- // });
|
|
|
- // this.innerAudioContext.onError((res) => {
|
|
|
- // console.log('res.errorCode='+res.errorCode);
|
|
|
- // console.log('res.errorMsg='+res.errorMsg);
|
|
|
- // });
|
|
|
-
|
|
|
- // // 监听播放进度
|
|
|
- // this.innerAudioContext.onTimeUpdate(() => {
|
|
|
- // this.setData({
|
|
|
- // currentTime: this.innerAudioContext.currentTime,
|
|
|
- // duration: this.innerAudioContext.duration
|
|
|
- // });
|
|
|
- // });
|
|
|
- // // 初始化歌曲列表
|
|
|
- // this.setData({
|
|
|
- // songs: [
|
|
|
- // { id: 1, title: '歌曲1', artist: '歌手1', url: 'song1.mp3' },
|
|
|
- // { id: 2, title: '歌曲2', artist: '歌手2', url: 'song2.mp3' },
|
|
|
- // { id: 3, title: '歌曲3', artist: '歌手3', url: 'song3.mp3' }
|
|
|
- // ]
|
|
|
- // });
|
|
|
+ },
|
|
|
+ onLoad(option) {
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -4131,13 +3990,6 @@ Page({
|
|
|
// if (this.data.observer) {
|
|
|
// this.data.observer.disconnect();
|
|
|
// }
|
|
|
- },
|
|
|
- onReady() {
|
|
|
- console.log('页面渲染完成')
|
|
|
- // 获取组件
|
|
|
- // 确保页面渲染完成后查找节点
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
showLoading: function () {
|
|
|
wx.showToast({
|
|
|
@@ -4346,7 +4198,7 @@ Page({
|
|
|
const {
|
|
|
now
|
|
|
} = res.data;
|
|
|
-
|
|
|
+
|
|
|
var weatherBg = "/subpages/images/weather/qing.png"
|
|
|
if (now.text.includes("晴")) {
|
|
|
weatherBg = "/subpages/images/weather/qing.png"
|