柒零 hai 1 ano
pai
achega
321edfb982
Modificáronse 61 ficheiros con 6232 adicións e 5879 borrados
  1. 1 1
      app.js
  2. 10 27
      app.json
  3. 0 58
      custom-tab-bar/index.js
  4. 0 3
      custom-tab-bar/index.json
  5. 0 33
      custom-tab-bar/index.wxml
  6. 0 94
      custom-tab-bar/index.wxss
  7. 273 4112
      pages/index/index.js
  8. 1 3
      pages/index/index.json
  9. 53 371
      pages/index/index.wxml
  10. 186 1077
      pages/index/index.wxss
  11. 0 66
      pages/main/main.js
  12. 0 7
      pages/main/main.json
  13. 0 4
      pages/main/main.wxml
  14. 0 1
      pages/main/main.wxss
  15. 1 2
      pages/shop/shop.wxml
  16. 1 4
      pages/shop/shop.wxss
  17. 34 1
      project.private.config.json
  18. BIN=BIN
      static/bg/index_bg.png
  19. BIN=BIN
      static/bg/mine-ad.png
  20. BIN=BIN
      static/images/ic_edit.png
  21. BIN=BIN
      static/index/bg/bg_fjkz.png
  22. BIN=BIN
      static/index/bg/bg_jrsmbg.png
  23. BIN=BIN
      static/index/bg/bg_lssmbg.png
  24. BIN=BIN
      static/index/bg/bg_sm.png
  25. BIN=BIN
      static/index/bg/bg_wdcd.png
  26. BIN=BIN
      static/index/bg/bg_zxsc.png
  27. BIN=BIN
      static/index/icon/ic_fjkz.png
  28. BIN=BIN
      static/index/icon/ic_jrsmbg.png
  29. BIN=BIN
      static/index/icon/ic_lssmbg.png
  30. BIN=BIN
      static/index/icon/ic_sm.png
  31. BIN=BIN
      static/index/icon/ic_wdcd.png
  32. BIN=BIN
      static/index/icon/ic_zwqx1.png
  33. BIN=BIN
      static/index/icon/ic_zwqx2.png
  34. BIN=BIN
      static/index/icon/ic_zxsc.png
  35. BIN=BIN
      static/tabs/home-active@2x.png
  36. BIN=BIN
      static/tabs/home@2x.png
  37. BIN=BIN
      static/tabs/mine-active@2x.png
  38. BIN=BIN
      static/tabs/mine@2x.png
  39. BIN=BIN
      static/tabs/report-active@2x.png
  40. BIN=BIN
      static/tabs/report@2x.png
  41. BIN=BIN
      static/tabs/scan.png
  42. BIN=BIN
      static/tabs/shop-active@2x.png
  43. BIN=BIN
      static/tabs/shop@2x.png
  44. BIN=BIN
      static/tabs/tab-bar-bg.png
  45. 4115 0
      subpages/main/main.js
  46. 10 0
      subpages/main/main.json
  47. 391 0
      subpages/main/main.wxml
  48. 1141 0
      subpages/main/main.wxss
  49. 5 5
      subpages/mine/mine.js
  50. 0 0
      subpages/mine/mine.json
  51. 0 0
      subpages/mine/mine.wxml
  52. 0 0
      subpages/mine/mine.wxss
  53. 5 5
      subpages/scan/scan.js
  54. 0 0
      subpages/scan/scan.json
  55. 0 0
      subpages/scan/scan.wxml
  56. 0 0
      subpages/scan/scan.wxss
  57. 0 0
      subpages/setTime/setTime.wxss
  58. 5 5
      subpages/sleepReport/sleepReport.js
  59. 0 0
      subpages/sleepReport/sleepReport.json
  60. 0 0
      subpages/sleepReport/sleepReport.wxml
  61. 0 0
      subpages/sleepReport/sleepReport.wxss

+ 1 - 1
app.js

@@ -35,7 +35,7 @@ App({
                 data: {
                   unionid: wx.getStorageSync('unionid'),
                   openid: wx.getStorageSync('openid'),
-                  token: wx.getStorageSync('token') || token_empower,
+                  token: wx.getStorageSync('token') ,
                 },
                 method: 'POST',
                 success: function (intervalRes) {

+ 10 - 27
app.json

@@ -1,16 +1,17 @@
 {
   "pages": [
     "pages/index/index",
-    "pages/scan/scan",
-    "pages/shop/shop",
-    "pages/mine/mine",
-    "pages/sleepReport/sleepReport"
+    "pages/shop/shop"
   ],
   "subpackages": [
     {
       "root": "subpages",
       "name": "subpages",
       "pages": [
+        "main/main",
+        "scan/scan",
+        "mine/mine",
+        "sleepReport/sleepReport",
         "data/data",
         "testSAS/testSAS",
         "sleepEvaluation/sleepEvaluation",
@@ -55,33 +56,15 @@
     "list": [
       {
         "pagePath": "pages/index/index",
-        "text": "控制主页",
-        "iconPath": "static/tabs/home@2x.png",
-        "selectedIconPath": "static/tabs/home-active@2x.png"
+        "text": "主页",
+        "iconPath": "static/images/logo.png",
+        "selectedIconPath": "static/images/logo.png"
       },
       {
         "pagePath": "pages/shop/shop",
         "text": "商城",
-        "iconPath": "static/tabs/report@2x.png",
-        "selectedIconPath": "static/tabs/report-active@2x.png"
-      },
-      {
-        "pagePath": "pages/scan/scan",
-        "text": "扫码",
-        "iconPath": "static/tabs/report@2x.png",
-        "selectedIconPath": "static/tabs/report-active@2x.png"
-      },
-      {
-        "pagePath": "pages/sleepReport/sleepReport",
-        "text": "睡眠报告",
-        "iconPath": "static/tabs/report@2x.png",
-        "selectedIconPath": "static/tabs/report-active@2x.png"
-      },
-      {
-        "pagePath": "pages/mine/mine",
-        "text": "我的",
-        "iconPath": "static/tabs/mine@2x.png",
-        "selectedIconPath": "static/tabs/mine-active@2x.png"
+        "iconPath": "static/images/logo.png",
+        "selectedIconPath": "static/images/logo.png"
       }
     ]
   },

+ 0 - 58
custom-tab-bar/index.js

@@ -1,58 +0,0 @@
-Component({
-  data: {
-    selected: 0,
-    "color": "#AAAFC4",
-    "selectedColor": "#0BC3AA",
-    list: [{
-      "pagePath": "/pages/index/index",
-      "text": "控制主页",
-      "iconPath": "/static/tabs/home@2x.png",
-      "selectedIconPath": "/static/tabs/home-active@2x.png"
-    },
-    {
-      "pagePath": "/pages/shop/shop",
-      "text": "商城",
-      "iconPath": "/static/tabs/report@2x.png",
-      "selectedIconPath": "/static/tabs/report-active@2x.png"
-    },
-    {
-      "pagePath": "/pages/sleepReport/sleepReport",
-      "text": "睡眠报告",
-      "iconPath": "/static/tabs/report@2x.png",
-      "selectedIconPath": "/static/tabs/report-active@2x.png"
-    },
-    {
-      "pagePath": "/pages/mine/mine",
-      "text": "我的",
-      "iconPath": "/static/tabs/mine@2x.png",
-      "selectedIconPath": "/static/tabs/mine-active@2x.png"
-    }]
-  },
-  attached() {
-    const app = getApp();
-    this.setData({
-      selected: app.globalData.selectedTabIndex || 0
-    })
-    console.log("da=>", app.globalData.selectedTabIndex);
-  },
-
-  methods: {
-    switchTab(e) {
-      const data = e.currentTarget.dataset
-      const url = data.path
-      if (url === "/pages/shop/shop") {
-        wx.showToast({
-          icon: "none",
-          title: '暂未开通',
-        })
-        return
-      }
-      console.log("data.index", data.index);
-      wx.switchTab({ url })
-
-      const app = getApp();
-      app.globalData.selectedTabIndex = data.index;
-
-    }
-  }
-})

+ 0 - 3
custom-tab-bar/index.json

@@ -1,3 +0,0 @@
-{
-  "component": true
-}

+ 0 - 33
custom-tab-bar/index.wxml

@@ -1,33 +0,0 @@
-<!--miniprogram/custom-tab-bar/index.wxml-->
-<view class="m-tab-bar">
-  <!-- <view class="tab-bar-border"></view> -->
-  <view class="bg-tab-bar">
-
-    <image src="/static/tabs/tab-bar-bg.png" style="width: 100vw;height: 52px;" />
-    <view class="bg-bottom"></view>
-  </view>
-
-  <view class="m-tab-list">
-    <view class="m-tab-box m-tab-box-l">
-      <view wx:for="{{list}}" wx:key="index" class="m-tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}"
-        bindtap="switchTab" wx:if="{{index < 2}}">
-        <image wx:if="{{selected === index}}" src="{{ item.selectedIconPath }}"></image>
-        <image wx:if="{{selected !== index}}" src="{{ item.iconPath }}"></image>
-        <view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
-      </view>
-
-    </view>
-    <view class="m-tab-box m-tab-box-r">
-      <view wx:for="{{list}}" wx:key="index" class="m-tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}"
-        bindtap="switchTab" wx:if="{{index >= 2}}">
-        <image wx:if="{{selected === index}}" src="{{ item.selectedIconPath }}"></image>
-        <image wx:if="{{selected !== index}}" src="{{ item.iconPath }}"></image>
-        <view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
-      </view>
-    </view>
-  </view>
-  <view class="scan-code-btn-view">
-    <image class="scan-code-btn" src="/static/tabs/scan.png" data-path="/pages/scan/scan" data-index="4"
-      bindtap="switchTab" />
-  </view>
-</view>

+ 0 - 94
custom-tab-bar/index.wxss

@@ -1,94 +0,0 @@
-.m-tab-bar {
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  height: 62px;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: flex-end;
-}
-
-.m-tab-list {
-  display: flex;
-  width: 100%;
-  flex-direction: row;
-}
-
-.bg-tab-bar {
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  flex-direction: column;
-  z-index: -1;
-  display: flex;
-}
-
-.bg-bottom {
-  background: white;
-  padding-bottom: env(safe-area-inset-bottom);
-
-}
-
-.m-tab-box {
-  display: flex;
-  padding-top: 26px;
-  padding-bottom: env(safe-area-inset-bottom);
-  flex: 1;
-}
-
-.m-tab-box-l {
-  padding-right: 40px;
-}
-
-
-.m-tab-box-r {
-  padding-left: 40px;
-}
-
-/* .tab-bar-border {
-  background-color: rgba(0, 0, 0, 0.33);
-  position: absolute;
-  left: 0;
-  top: 0;
-  width: 100%;
-  height: 1px;
-  transform: scaleY(0.5);
-} */
-
-.m-tab-bar-item {
-  flex: 1;
-  text-align: center;
-  display: flex;
-  padding: 13px 0 10px 0;
-  justify-content: center;
-  align-items: center;
-  flex-direction: column;
-}
-
-.m-tab-bar-item image {
-  width: 22px;
-  height: 22px;
-  display: block;
-}
-
-.m-tab-bar-item view {
-  font-size: 10px;
-}
-
-.scan-code-btn-view {
-  display: flex;
-  flex-direction: column;
-  position: fixed;
-  left: calc(50vw - 38px);
-  bottom: 100px;
-  padding-bottom: env(safe-area-inset-bottom);
-}
-
-.scan-code-btn {
-  width: 80px;
-  height: 80px;
-  position: fixed;
-}

+ 273 - 4112
pages/index/index.js

@@ -1,4115 +1,276 @@
-// index.js
-// 获取应用实例
-import * as echarts from '../../ec-canvas/echarts';
-
-// const { connect } = require("../../utils/mqtt4/mqtt");
-/******************* 必须要改!!不然得不到天气!! ******************/
-const hefengKey = "	aa373d4025b0487196c15d8e6526cfcf"; //  和风天气Web api的key
-/******************* 可能需要你修改的部分 ******************/
-//const mqttHost = "broker.emqx.io"; //mqtt 服务器域名/IP
-// const mqttHost = "www.nekolee.top";
-const mqttHost = "haold.aidsleep.cn";
-// const mqttHost = "192.168.3.65";
-// const mqttPort = 8084; //mqtt 服务器域名/IP
-const mqttPort = 8083; //mqtt 服务器域名/IP
-
-const hefengVIP = false; //  和风天气是免费的api(false)还是付费api(true)
-
-const deviceSubTopic_LED = "/NekoHome/sub_LED"; //  设备订阅topic(小程序发布命令topic)
-const deviceSubTopic_BEEP = "/NekoHome/sub_BEEP";
-const deviceSubTopic_CU = "/NekoHome/sub_CU";
-const deviceSubTopic_DO = "/NekoHome/sub_DO";
-const deviceSubTopic_SAN = "/NekoHome/sub_SAN";
-const deviceSubTopic_Mode = "/NekoHome/sub_mode";
-// const devicePubTopic_env = "/NekoHome/pub/Environment"; //  设备发布topic(订阅环境参数)
-// const devicePubTopic_con = "/NekoHome/pub/Controll"; //  设备发布topic(订阅控制参数)
-const devicePubTopic_env = "testtopic/1"; //  设备发布topic(订阅环境参数)
-const devicePubTopic_con = "testtopic/1"; //  设备发布topic(订阅控制参数)
-/********************* 一般不用动这些 ********************/
-
-//小程序接收的主题
-const mpSubTopic_env = devicePubTopic_env;
-const mpSubTopic_con = devicePubTopic_con;
-
-//小程序发送的主题
-const mpPubTopic_LED = deviceSubTopic_LED;
-const mpPubTopic_BEEP = deviceSubTopic_BEEP;
-const mpPubTopic_CU = deviceSubTopic_CU;
-const mpPubTopic_DO = deviceSubTopic_DO;
-const mpPubTopic_SAN = deviceSubTopic_SAN;
-const mpPubTopic_Mode = deviceSubTopic_Mode;
-
-
-const mqttUrl = `wx://${mqttHost}:${mqttPort}/mqtt`; //  mqtt连接路径
-
-const hefengApi = "https://api.qweather.com/v7"; //  和风天气付费API前缀
-const hefengFreeApi = "https://devapi.qweather.com/v7"; //  和风天气免费API前缀
-
-const hefengWeather = `${hefengVIP ? hefengApi : hefengFreeApi}/weather/now?`; //  和风天气实时天气api
-const hefengAir = `${hefengVIP ? hefengApi : hefengFreeApi}/air/now?`; //  和风天气空气质量api
-
-const geoApi = "https://geoapi.qweather.com/v2/city/lookup?" //  地理位置api(用来获取经纬度对应的城市/城区名字)
-var homeApi = "http://haold.aidsleep.cn:8123/api";
-var homeApiLater = "http://haold.aidsleep.cn:8123";
-var homeApi_https = "https://haold.aidsleep.cn/api";
-var homeApiLater_https = "https://haold.aidsleep.cn";
-var entity = "";
-// const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJiN2JlOGE0MDExZjY0NjA2OGUxYjJiZTE4M2Y2NzU0NSIsImlhdCI6MTcxMTYxNDY2NCwiZXhwIjoyMDI2OTc0NjY0fQ.XJ73cXAoEsouTgvgpNVobq9oKdwlJr88TiAFLYlaahE";
-var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlZGVjOWI3YWQ0MTQ0ZTIxYWQ1NTE1Nzc5NTkzNjBjNiIsImlhdCI6MTcxMjEzNTM2MywiZXhwIjoyMDI3NDk1MzYzfQ.IfrvdiaVuhCKsdy69JvUYhJ64bnhMT8MI1hN8R38whc";
-
-const aipushApi = "https://aipush.aidsleep.cn";
-const token_push = "b74fd5754c5ef24cf600c39194abdaeb";
-
-const options = {
-	connectTimeout: 4000,//超时时间
-	clientId: 'emqx_ODAyNT',//随机生成ID
-	username: 'test1',
-	password: '123456'
-}
-
-
-var humidityValue = 40;
-var humidityMax = 100;
-var humidityMin = 40;
-var humidityMarginLeft = 110;
-let chartCircularProgressBar;//圈圈
-
-
-function updateChartCircularProgressBarOption(rscore_desc, rscore_value, that) {
-	if (chartCircularProgressBar) {
-		setOption(chartCircularProgressBar);
-	} else {
-		// 假设这段代码在小程序的某个函数中执行
-
-		// 创建查询对象
-		const query = wx.createSelectorQuery();
-
-		// 选择第一个id为mychart-dom-gauge的view
-		query.select('#mychart-dom-gauge').boundingClientRect(function (res) {
-			// 如果res不为null,则表示view存在
-			if (res) {
-				that.selectComponent('#mychart-dom-gauge').init((canvas, width, height, dpr) => {
-					const chart = echarts.init(canvas, null, {
-						width: width,
-						height: height,
-						devicePixelRatio: dpr // new
-					});
-					canvas.setChart(chart);
-					setOption(chart);
-
-					// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问
-					chartCircularProgressBar = chart;
-
-					// 注意这里一定要返回 chart 实例,否则会影响事件处理等
-					return chart;
-				});
-			} else {
-				console.log('view不存在');
-			}
-		}).exec(); // 执行查询
-
-	}
-}
-
-function checkState(state) {
-	return state == 'on' || state == 'off';
-}
-
-
-function setOption(chart) {
-	var option = {
-		backgroundColor: "#ffffff",
-		series: [{
-			name: '加湿器',
-			type: 'gauge',
-			startAngle: 230,
-			endAngle: -50,
-			splitNumber: 8,
-			min: humidityMin || 40,
-			max: humidityMax || 70,
-			axisLine: {
-				show: false
-			},
-			axisLabel: {
-				show: false,
-			},
-			anchor: {
-				show: false
-			},
-			splitLine: {
-				distance: -10,
-				length: 6,
-				lineStyle: {
-					width: 1.5,
-					color: '#9499C3'
-				}
-			},
-			pointer: {
-				show: false
-			},
-			axisTick: {
-				distance: -10,
-				splitNumber: 5,
-				lineStyle: {
-					width: 1,
-					color: '#9499C3'
-				}
-			},
-			progress: {
-				show: true,
-				width: 10,
-				itemStyle: {
-					color: "#0BC3AA"
-				}
-			},
-			title: {
-				color: '#6C6970',
-				offsetCenter: [0, '-50%'],
-				lineHeight: 15,
-				fontSize: 12
-			},
-			detail: {
-				valueAnimation: true,
-				width: '100%',
-				offsetCenter: [0, '20%'],
-				fontSize: "28px",
-				fontWeight: 'bolder',
-				formatter: function (value) {
-					return `${value.toFixed(0)}` + '{units|%}'
-				},
-				color: '#3E3D44',
-				rich: {
-					units: {
-						fontSize: "12px",
-						padding: [10, 0, 0, 1],
-						fontWeight: 'bolder',
-						color: '#333333'
-					},
-				}
-			},
-			data: [{
-				value: humidityValue || 0,
-				name: '湿度',
-			}]
-
-		}]
-	};
-
-	chart.setOption(option);
-}
-
-
-// import Notify from '../../@vant/weapp/notify/notify';
-// import Dialog from '../../@vant/weapp/dialog/dialog';
-import Toast from '../../@vant/weapp/toast/toast';
-
+// pages/mine/mine.js
+const defaultAvatarUrl = "../../static/images/no-login.png"
 Page({
-	data: {
-		ecHumidifier: {
-			lazyLoad: true, // 懒加载
-		},
-		weatherBg: '',
-		//单选框
-		radio_select: '10',
-		radio_switch: '10',
-		//倒计时时间
-		Time: 0,
-		//火灾时的呼吸效果变量
-		breathNum: 0,
-		currentMenuTabIndex: -1,
-		currentDialogIndex: 0,
-		menuTabDialogShow: false,
-
-		//火灾头顶警示
-		topTips: true,
-		hide: false,
-
-		//火灾弹窗显示
-		fire_show: false,
-
-		//设备控制弹窗参数 开始
-		show_led: false,
-		show_beep: false,
-		show_curtain: false,
-		show_san: false,
-		show_door: false,
-		show_time: false,
-		actions_led: [
-			{
-				name: '打开',
-				subname: '打开客厅灯',
-				id: 1,
-				url: '',
-				entity_id: '',
-			},
-			{
-				name: '关闭',
-				subname: '关闭客厅灯',
-				id: 0,
-				url: '',
-				entity_id: '',
-			},
-
-		],
-		actions_beep: [
-			{
-				name: '打开',
-				subname: '打开警报器',
-				id: 1,
-				url: '/services/switch/turn_on',
-				entity_id: 'switch.deerma_jsq2g_392f_alarm',
-			},
-			{
-				name: '关闭',
-				subname: '关闭警报器',
-				id: 0,
-				url: '/services/switch/turn_off',
-				entity_id: 'switch.deerma_jsq2g_392f_alarm',
-			},
-
-		],
-		actions_curtain: [
-			{
-				name: '打开',
-				subname: '打开香薰机',
-				id: 90,
-				url: '',
-				entity_id: '',
-			},
-			{
-				name: '关闭',
-				subname: '关闭香薰机',
-				id: 0,
-				url: '',
-				entity_id: '',
-			},
-
-		],
-		actions_san: [
-			{
-				name: '打开',
-				subname: '打开音响',
-				id: 1,
-				url: '',
-				entity_id: '',
-			},
-			{
-				name: '关闭',
-				subname: '关闭音响',
-				id: 0,
-				url: '',
-				entity_id: '',
-			},
-
-		],
-		actions_door: [
-			{
-				name: '打开',
-				subname: '打开智能开关',
-				id: 90,
-				url: '',
-				entity_id: '',
-			},
-			{
-				name: '关闭',
-				subname: '关闭智能开关',
-				id: 0,
-				url: '',
-				entity_id: '',
-			},
-
-		],
-		//设备控制弹窗参数 结束
-
-
-
-		client: {},
-
-		//设备状态参数 开始
-		status_beep: 0,
-		status_led: 0,
-		status_san: 0,
-		status_curtain: 0,
-		status_door: 0,
-		status_fire: 0,
-		status_light: 0,
-		status_mode: 0,
-		//设备状态参数 结束
-
-		//设备环境参数 开始
-		Temp: 0,
-		Humi: 0,
-		Voltage1: 0,
-		Voltage2: 0,
-		//设备环境参数 结束
-
-		//香薰机参数 开始
-		Light: 0,
-		LiquidLevel: 0,
-		//香薰机参数 开始
-		showAuthorizedDialog: false,
-		area: "请求中", //城区
-		city: "请求中", //城市
-		airText: "请求中", //空气优良
-		airValue: 0, //空气指数
-		weather: "请求中", //天气
-		//weatherAdvice: "今天天气不错", //天气建议
-		time: 30 * 60 * 60 * 1000,
-		gradientColor: {
-			'0%': '#ffd01e',
-			'100%': '#ee0a24',
-		},
-		value: 25,
-		pickerValue: [0], // picker-view 的当前值,数组形式,表示选择器的当前位置
-		array: ['0%', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%'], // 滑动块可选的值
-		items: ['0%', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%'], // 滑动块可选的值
-
-		scaleTextStyle: {
-			show: true,
-			size: 12,
-			color: ''
-		},
-		indicatorTextStyle: {
-			show: true,
-			size: 16,
-			text: '湿度'
-		},
-		indicatorTextStyleClimate: {
-			show: true,
-			size: 16,
-			text: '温度'
-		},
-		indicatorValueStyle: {
-			show: true,
-			size: 55,
-			color: ''
-		},
-		indicatorCircleStyle: {
-			show: true,
-			boderColor: [
-				{
-					progress: 0,
-					value: "#4575e8"
-				},
-				{
-					progress: 1,
-					value: "#fff"
-				}
-			]
-		},
-		listCover: [],//窗帘开关
-		listSwitch: [],//开关
-		listScroll: [],//滚动条
-		listUnit: [],//rgb、%、minutes、w等
-		listConversation: [],//智能音响
-		listConversation1: [],//智能音响
-		listHumidity: [],//加湿器
-		listButton: [],//按钮 '按下'
-		listSelect: [],//下拉框的
-		listClimate: [],//空调控制 图像
-
-		listMiotMediaPlayer: [],//智能音箱 图像
-		listMitvMediaPlayer: [],//电视 图像
-
-		listHumidifier: [],//加湿器 图像
-		listAromatherapyMachine: [],//香薰机 图像
-		listSensor: [],//文字描述的
-
-		listText: [],//文本框填写的
-
-		isPlaying: false,
-		currentTime: 0,
-		currentIndex: 0,
-		duration: 0,
-		currentSongTitle: '--',
-		currentSongArtist: '--',
-		canPrev: true,
-		canNext: true,
-		songs: [], // 歌曲列表
-		scrollValue: [],
-		modelList1: [],//起床模式
-		modelList2: [],//观影模式
-		modelList3: [],//睡眠模式
-		selectedIndex: 0, // 默认选中第一个选项
-		home_room: [
-			'company_laboratory',
-			'2802',
-		],
-		climateMode: '',//空调模式:加热还是除湿。在空调增加按钮和减少按钮 时使用
-
-		canvasWidth: 300, // 画布宽度
-		canvasHeight: 150, // 画布高度
-		value: 60, // 当前得分
-		total: 100, // 总分值
-		tvEntityId: '',// 电视实体Id
-		tvEntityIds: [],// 电视实体
-		entityName: '',//
-		sleep_duration: '50',
-		itemList: [
-			{ name: '1', data: [{ value: 10 }, { value: 1 }] },
-			{ name: '2', data: [{ value: 10 }, { value: 4 }] },
-			{ name: '3', data: [{ value: 10 }, { value: 7 }] },
-		],
-		blackList: [
-			// '指示灯','电视模式','电视音量','空调遥控','智能音箱','电视控制码','传感器模式','开关模式','耗电量','智能音箱会话'
-			'加湿器', '空调', '音箱', '窗帘', '纱帘'
-		],
-		temperatureHumidifyName: '温度',
-		temperatureValue: 0,
-		isButtonPressedHumidityUp: false,
-		isButtonPressedHumidityDown: false,
-		isButtonPressedClimateUp: false,
-		isButtonPressedClimateDown: false,
-		tcp: '',
-		w_temp: '',//温度
-		w_humidity: '',//湿度
-		imgSrc: '',//图片地址
-		isLoading: false,
-		observer: '',
-		hotelcode: '',//酒店编码
-		roomcode: '',//房间编码
-		isClickedPrevSong: false,
-		isClickedTogglePlayPause: false,
-		isClickedNextSong: false,
-		isClickedOnHumidifierUp: false,
-		isClickedOnHumidifierDown: false,
-		isClickedOnClimateAuto: false,
-		isClickedOnClimateUp: false,
-		isClickedToggleAromlight: false,//香薰机灯光
-		intervalId1: null,
-		intervalId2: null,
-		sliderValueHumidifier: '',
-		sliderValueClimate: '',
-		humidityMarginLeft: humidityMarginLeft
-	},
-	checkMenuTap(e) {
-		// 三种模式
-		console.log(e.currentTarget.dataset.index)
-		const index = e.currentTarget.dataset.index;
-		if (this.data.currentMenuTabIndex == index) {
-			// 选中的打断
-			return
-		}
-		if (index == 0 && !this.data.modelList1.length) {
-			// 没有的打断
-			return
-		}
-		if (index == 1 && !this.data.modelList2.length) {
-			// 没有的打断
-			return
-		}
-		if (index == 2 && !this.data.modelList3.length) {
-			// 没有的打断
-			return
-		}
-		this.setData({
-			menuTabDialogShow: true,
-			currentDialogIndex: index
-		})
-	},
-	onClickHideMenuTabDialog() {
-		this.setData({
-			menuTabDialogShow: false
-		})
-	},
-	onClickHideSureMenuTabDialog() {
-		var item = null;
-		if (this.data.currentDialogIndex == 0) {
-			item = this.data.modelList1[0];
-		} else if (this.data.currentDialogIndex == 1) {
-			item = this.data.modelList2[0];
-		} else if (this.data.currentDialogIndex == 2) {
-			item = this.data.modelList3[0];
-		}
-
-		// 确认模式
-
-		this.setData({
-			menuTabDialogShow: false,
-			currentMenuTabIndex: this.data.currentDialogIndex
-		})
-		wx.request({
-			url: `${homeApi_https}/services/automation/trigger`,
-			method: 'POST',
-			data: {
-				"entity_id": item.entity_id,
-				"skip_condition": true,
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-			},
-		});
-	},
-	checkHumidityMarginLeft() {
-		var proportion = 440;
-		var percentage = (humidityValue - humidityMin) / (humidityMax - humidityMin);
-		const value = percentage * proportion + humidityMarginLeft;
-		this.setData({
-			humidityMarginLeft: value
-		})
-	},
-	// 加湿器
-	handleTouchEndHumidifier: function (e) {
-		this.setData({
-			sliderValueHumidifier: '',
-		});
-	},
-	// 加湿器更改湿度
-	handleChangingHumidifier: function (e) {
-		// 假设 slider 宽度为屏幕宽度(或某个固定值),这里需要根据实际情况调整  
-		const sliderValueHumidifier = e.detail.value;
-		var proportion = 440;
-		var percentage = (sliderValueHumidifier - humidityMin) / (humidityMax - humidityMin);
-		const humidityMarginLeftValue = percentage * proportion + humidityMarginLeft;
-		this.setData({
-			sliderValueHumidifier: sliderValueHumidifier,
-			humidityMarginLeft: humidityMarginLeftValue
-		});
-	},
-	handleTouchEndClimate: function (e) {
-		this.setData({
-			sliderValueClimate: '',
-		});
-	},
-	handleChangingClimate: function (e) {
-		// 假设 slider 宽度为屏幕宽度(或某个固定值),这里需要根据实际情况调整  
-		const screenWidth = wx.getSystemInfoSync().windowWidth;
-		const sliderValueClimate = e.detail.value;
-		this.setData({
-			sliderValueClimate: sliderValueClimate
-		})
-	},
-	replaceAll: function (str, find, replace) {
-		return str.replace(new RegExp(find, 'g'), replace);
-	},
-	checkFuzzyMatch: function (data) {
-		var searchString = data.attributes.friendly_name
-		var domain = data.entity_id.split(".")[0]
-		var isMatched = true;
-		var list = this.data.blackList;
-		if (!searchString || !list) return false;
-		for (var i = 0; i < list.length; i++) {
-			if (searchString.indexOf(list[i]) !== -1) {
-				isMatched = false;
-				break;
-			}
-		}
-		return isMatched;
-	},
-	onChange: function (e) {
-		this.setData({
-			pickerValue: e.detail.value, // 更新picker-view的值
-		});
-		// 在这里添加点击事件的处理逻辑
-		// 根据pickerValue的变化执行相应的操作
-	},
-	swiperTap(e) {
-		// 处理整个swiper的点击事件
-	},
-	itemTap(e) {
-		// 处理swiper-item的点击事件
-		const index = e.currentTarget.dataset.index;
-		// 根据index执行其他操作
-	},
-	//定时组件
-
-
-	start() {
-		const countDown = this.selectComponent('.control-count-down');
-		countDown.start();
-	},
-
-	pause() {
-		const countDown = this.selectComponent('.control-count-down');
-		countDown.pause();
-	},
-
-	reset() {
-		const countDown = this.selectComponent('.control-count-down');
-		countDown.reset();
-	},
-	set() {
-		this.setData({
-			show_time: true,
-		})
-	},
-	onClose_TimeSet() {
-		this.setData({ show_time: false });
-	},
-	onChange_Silder(event) {
-		wx.showToast({
-			icon: 'none',
-			title: `定时:${event.detail}s`,
-		});
-		this.setData({
-			Time: event.detail,
-		})
-	},
-
-	onChange_Select(event) {
-		this.setData({
-			radio_select: event.detail,
-		});
-	},
-
-	onChange_Switch(event) {
-		this.setData({
-			radio_switch: event.detail,
-		});
-	},
-
-
-	finished() {
-		var that = this;
-		//定时开关哪个设备?
-		if (that.data.radio_select == 2) {
-			if (that.data.radio_switch == 1) {
-				console.log("选择了开");
-				that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":1}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——打开客厅灯");
-					}
-				});
-			} else {
-				console.log("选择了关");
-				that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":0}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——关闭客厅灯");
-					}
-				});
-			}
-		} else if (that.data.radio_select == 3) {
-			console.log("选择了BEEP");
-			if (that.data.radio_switch == 1) {
-				console.log("选择了开");
-				that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":1}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——打开报警器");
-					}
-				});
-			} else {
-				console.log("选择了关");
-				that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":0}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——关闭报警器");
-					}
-				});
-			}
-		} else if (that.data.radio_select == 4) {
-			console.log("选择了CU");
-			if (that.data.radio_switch == 1) {
-				console.log("选择了开");
-				that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":1}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——开窗帘");
-					}
-				});
-			} else {
-				console.log("选择了关");
-				that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":0}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——关窗帘");
-					}
-				});
-			}
-		} else if (that.data.radio_select == 5) {
-			console.log("选择了SAN");
-			if (that.data.radio_switch == 1) {
-				console.log("选择了开");
-				that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":1}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——开风扇");
-					}
-				});
-			} else {
-				console.log("选择了关");
-				that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":0}', function (err) {
-					if (!err) {
-						console.log("成功下发命令——关风扇");
-					}
-				});
-			}
-		}
-
-		Toast('倒计时结束');
-	},
-
-	setTextBreathing: function (cls, e) {
-		//使用记录呼吸效果
-		var transparency = 10;
-		var reduce = true;  //记录当前做透明度增加或降低操作
-		setInterval(function () {
-			if (reduce === true) {
-				transparency -= 1;
-				if (transparency === 0) {
-					reduce = false;
-				}
-			} else if (reduce === false) {
-				transparency += 1;
-				if (transparency === 10) {
-					reduce = true;
-				}
-			}
-			cls._defaultComponent.setData({
-				breathNum: transparency / 10
-			})
-			//通过setData的方式,设置breathNum的值
-		}, 80)
-	},
-
-
-	// 各个设备弹窗逻辑 
-	onOpen_led() {
-		this.setData({ show_led: true });
-	},
-	onClose_led() {
-		this.setData({
-			show_led: false
-		})
-	},
-	onSelect_led(event) {
-		console.log(event.detail.id);
-		this.onLedChange(event.detail.id);
-	},
-
-	onOpen_beep() {
-		this.setData({ show_beep: true });
-	},
-	onClose_beep() {
-		this.setData({
-			show_beep: false
-		})
-	},
-	onSelect_beep(event) {
-		console.log(event.detail.id);
-		this.onBeepChange(event.detail.id, event.detail.url, event.detail.entity_id);
-	},
-	getRealApi() {
-		// if(wx.getStorageSync('res').result && wx.getStorageSync('res').result.includes('辰悦颐养斋')){
-		// 	  homeApi = "http://zhh.aidsleep.cn:9123/api";
-		// 	  homeApiLater = "http://zhh.aidsleep.cn:9123";
-		//  homeApi_https = "https://zhh.aidsleep.cn/api";
-		//  homeApiLater_https = "https://zhh.aidsleep.cn";
-		// 	  entity = wx.getStorageSync('res').result=='company_laboratory'?'公司实验室':wx.getStorageSync('res').result
-		// 	  if(entity && entity.includes('-')){
-		// 		  entity = entity.slice(entity.indexOf('-')+1)
-		// 	  }
-		//  if(entity && entity.includes('|')){
-		//  	 entity = entity.slice(entity.indexOf('|')+1)
-		//  }
-		// }else if(wx.getStorageSync('res').result && (!wx.getStorageSync('res').result.includes('辰悦颐养斋'))){
-		// 	  homeApi = "http://haold.aidsleep.cn:8123/api";
-		// 	  homeApiLater = "http://haold.aidsleep.cn:8123";
-		//  homeApi_https = "https://haold.aidsleep.cn/api";
-		//  homeApiLater_https = "https://haold.aidsleep.cn";
-		//  entity = wx.getStorageSync('res').result=='company_laboratory'?'公司实验室':wx.getStorageSync('res').result
-		// 	  if(entity && entity.includes('-')){
-		// 		  entity = str.slice(str.indexOf('-')+1)
-		// 	  }
-		//  if(entity && entity.includes('|')){
-		//   entity = str.slice(str.indexOf('|')+1)
-		//  }
-		// }
-
-	},
-	onSelect_vangrid(url, entity_id) {
-		// this.setData({
-		//   status_beep: Number(param4)
-		// })
-
-		wx.request({
-			url: `${homeApi_https}` + url,
-			method: 'POST',
-			data: {
-				"entity_id": entity_id
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-			},
-		});
-
-	},
-
-	tvFanChange(e) {
-		var that = this;
-		const listMitvMediaPlayer = that.data.listMitvMediaPlayer;
-		// 获取绑定的参数
-		var entity_id = e.currentTarget.dataset.id;
-		var index = e.currentTarget.dataset.index;
-		//模式
-		var fan = e.currentTarget.dataset.fan;
-		if (fan == "当贝桌面") {
-			listMitvMediaPlayer[index].app_id = "com.dangbei.tvlauncher";
-			listMitvMediaPlayer[index].app_name = "当贝桌面";
-		} else {
-			listMitvMediaPlayer[index].app_id = "com.xiaomi.mitv.tvplayer";
-			listMitvMediaPlayer[index].app_name = "模拟电视";
-		}
-		that.setData({
-			listMitvMediaPlayer: listMitvMediaPlayer
-		})
-		wx.request({
-			url: `${homeApi_https}` + '/services/media_player/select_source',
-			method: 'POST',
-			data: {
-				"entity_id": entity_id,
-				"source": fan
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				// if(res.data){
-				// 	that.getSwitch(res.data,that)
-				// }
-			},
-		});
-
-	},
-	// switch
-	onSelect_All(e) {
-		var that = this;
-		const tempListSwitch = that.data.listSwitch;
-		// 获取绑定的参数
-		var param0 = e.currentTarget.dataset.param0;
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		// var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4 // 0 || 1;
-		var param5 = e.currentTarget.dataset.param5;
-		console.log('param1=' + param1);
-		console.log('param2=' + param2);
-		// console.log('param3='+param3);
-		// console.log('param4='+param4);
-		console.log('param5=' + param5);
-		if (param4 == '1') {
-			tempListSwitch[param0].state = "on"
-		} else {
-			tempListSwitch[param0].state = "off"
-		}
-
-		that.setData({
-			listSwitch: tempListSwitch
-		})
-		// this.setData({
-		//   status_beep: Number(param4)
-		// })
-		// if(param3 == "/turn_on"){
-		// 	that.data.listSwitch[param0].state = "off";
-		// 	that.data.listSwitch[param0].service = "turn_off";
-		// }else if(param3 == "/turn_off"){
-		// 	that.data.listSwitch[param0].state = "on";
-		// 	that.data.listSwitch[param0].service = "turn_on";
-		// }
-		console.log('switch 发生 change 事件,携带值为', e.detail)
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + (e.detail ? '/turn_on' : '/turn_off'),
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				// if(res.data){
-				// 	that.getSwitch(res.data,that)
-				// }
-			},
-		});
-
-	},
-	// 香薰机开关
-	onSelect_All_AromatherapyMachine(e) {
-		var that = this;
-		const tempListSwitch = that.data.listAromatherapyMachine;
-		// 获取绑定的参数
-		var param0 = e.currentTarget.dataset.param0;
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		// var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4 // 0 || 1;
-		var param5 = e.currentTarget.dataset.param5;
-		console.log('param1=' + param1);
-		console.log('param2=' + param2);
-		// console.log('param3='+param3);
-		// console.log('param4='+param4);
-		console.log('param5=' + param5);
-		if (param4 == '1') {
-			tempListSwitch[param0].state = "on"
-		} else {
-			tempListSwitch[param0].state = "off"
-		}
-
-		that.setData({
-			listAromatherapyMachine: tempListSwitch
-		})
-		// this.setData({
-		//   status_beep: Number(param4)
-		// })
-		// if(param3 == "/turn_on"){
-		// 	that.data.listSwitch[param0].state = "off";
-		// 	that.data.listSwitch[param0].service = "turn_off";
-		// }else if(param3 == "/turn_off"){
-		// 	that.data.listSwitch[param0].state = "on";
-		// 	that.data.listSwitch[param0].service = "turn_on";
-		// }
-		console.log('switch 发生 change 事件,携带值为', e.detail)
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + (e.detail ? '/turn_on' : '/turn_off'),
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				// if(res.data){
-				// 	that.getSwitch(res.data,that)
-				// }
-			},
-		});
-
-	},
-	onTap_All(e) {
-		var that = this;
-		// 获取绑定的参数
-		var param0 = e.currentTarget.dataset.param0;
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		// var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		console.log('param1=' + param1);
-		console.log('param2=' + param2);
-		// console.log('param3='+param3);
-		// console.log('param4='+param4);
-		console.log('param5=' + param5);
-		// this.setData({
-		//   status_beep: Number(param4)
-		// })
-		// if(param3 == "/turn_on"){
-		// 	that.data.listSwitch[param0].state = "off";
-		// 	that.data.listSwitch[param0].service = "turn_off";
-		// }else if(param3 == "/turn_off"){
-		// 	that.data.listSwitch[param0].state = "on";
-		// 	that.data.listSwitch[param0].service = "turn_on";
-		// }
-		console.log('switch 发生 change 事件,携带值为', param4)
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + (param4 == '1' ? '/turn_on' : '/turn_off'),
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				// if(res.data){
-				// 	that.getSwitch(res.data,that)
-				// }
-			},
-		});
-
-	},
-	//香薰机灯光控制
-	onSelect_All_aromlight(e) {
-		var that = this;
-		this.setData({
-			isClickedToggleAromlight: true
-		});
-		// 获取绑定的参数
-		var param0 = e.currentTarget.dataset.param0;
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		// var param3 = e.currentTarget.dataset.param3;
-		// var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		console.log('param1=' + param1);
-		console.log('param2=' + param2);
-		// console.log('param3='+param3);
-		// console.log('param4='+param4);
-		console.log('param5=' + param5);
-		// this.setData({
-		//   status_beep: Number(param4)
-		// })
-		// if(param3 == "/turn_on"){
-		// 	that.data.listSwitch[param0].state = "off";
-		// 	that.data.listSwitch[param0].service = "turn_off";
-		// }else if(param3 == "/turn_off"){
-		// 	that.data.listSwitch[param0].state = "on";
-		// 	that.data.listSwitch[param0].service = "turn_on";
-		// }
-		// console.log('switch 发生 change 事件,携带值为', e.detail.value)
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + '/turn_on',
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				// if(res.data){
-				// 	that.getSwitch(res.data,that)
-				// }
-			},
-		});
-
-	},
-	onSelect_Cover(e) {
-		var that = this;
-		// 获取绑定的参数
-		var param0 = e.currentTarget.dataset.param0;
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		// var param3 = e.currentTarget.dataset.param3;
-		// var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		console.log('param1=' + param1);
-		console.log('param2=' + param2);
-		// console.log('param3='+param3);
-		// console.log('param4='+param4);
-		console.log('param5=' + param5);
-		// this.setData({
-		//   status_beep: Number(param4)
-		// })
-		// if(param3 == "/turn_on"){
-		// 	that.data.listSwitch[param0].state = "off";
-		// 	that.data.listSwitch[param0].service = "turn_off";
-		// }else if(param3 == "/turn_off"){
-		// 	that.data.listSwitch[param0].state = "on";
-		// 	that.data.listSwitch[param0].service = "turn_on";
-		// }
-		console.log('switch 发生 change 事件,携带值为', e.detail.value)
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + (e.detail.value ? '/open_cover' : '/close_cover'),
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				// if(res.data){
-				// 	that.getSwitch(res.data,that)
-				// }
-			},
-		});
-
-	},
-	onStop_Cover(e) {
-		var that = this;
-		// 获取绑定的参数
-		var param0 = e.currentTarget.dataset.param0;
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		// var param3 = e.currentTarget.dataset.param3;
-		// var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		console.log('param1=' + param1);
-		console.log('param2=' + param2);
-		// console.log('param3='+param3);
-		// console.log('param4='+param4);
-		console.log('param5=' + param5);
-		// this.setData({
-		//   status_beep: Number(param4)
-		// })
-		// if(param3 == "/turn_on"){
-		// 	that.data.listSwitch[param0].state = "off";
-		// 	that.data.listSwitch[param0].service = "turn_off";
-		// }else if(param3 == "/turn_off"){
-		// 	that.data.listSwitch[param0].state = "on";
-		// 	that.data.listSwitch[param0].service = "turn_on";
-		// }
-		console.log('switch 发生 change 事件,携带值为', e.detail.value)
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + '/stop_cover',
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				// if(res.data){
-				// 	that.getSwitch(res.data,that)
-				// }
-			},
-		});
-
-	},
-	onPressButton(e) {
-		var that = this;
-		// 获取绑定的参数
-		var param = e.currentTarget.dataset.param;
-		console.log("sliderChange-param=" + param);
-		// wx.request({
-		//   url: `${homeApi_https}`+param1+param2+param3, 
-		//   method: 'POST',
-		//   data: {
-		//       "entity_id":param5
-		//     },
-		//    header: {
-		// 	  'content-type': 'application/json', // 默认值
-		//       'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-		//     },
-		//   success(res) {
-		// 	// if(res.data){
-		// 	// 	that.getSwitch(res.data,that)
-		// 	// }
-		//     console.log('res.data====='+JSON.stringify(res.data));
-		//   },
-		// });
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {
-			"entity_id": entity_id,
-			// "value":newValue
-		}
-		this.getService("/services", "/" + domain, "/press", "POST", data);
-	},
-
-	onSelect_beep1(e) {
-		// 获取绑定的参数
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		console.log('param1=' + param1);
-		console.log('param2=' + param2);
-		console.log('param3=' + param3);
-		console.log('param4=' + param4);
-		console.log('param5=' + param5);
-		this.setData({
-			status_beep: Number(param4)
-		})
-
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + param3,
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				console.log('res.data=====' + JSON.stringify(res.data));
-			},
-		});
-
-	},
-	status_led1(e) {
-		// 获取绑定的参数
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		this.setData({
-			status_led: Number(param4)
-		})
-
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + param3,
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				console.log('res.data=====' + JSON.stringify(res.data));
-			},
-		});
-
-	},
-	status_san1(e) {
-		// 获取绑定的参数
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		this.setData({
-			status_san: Number(param4)
-		})
-
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + param3,
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				console.log('res.data=====' + JSON.stringify(res.data));
-			},
-		});
-
-	},
-	status_curtain1(e) {
-		// 获取绑定的参数
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		this.setData({
-			status_curtain: Number(param4)
-		})
-
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + param3,
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				console.log('res.data=====' + JSON.stringify(res.data));
-			},
-		});
-
-	},
-	status_door1(e) {
-		// 获取绑定的参数
-		var param1 = e.currentTarget.dataset.param1;
-		var param2 = e.currentTarget.dataset.param2;
-		var param3 = e.currentTarget.dataset.param3;
-		var param4 = e.currentTarget.dataset.param4;
-		var param5 = e.currentTarget.dataset.param5;
-		this.setData({
-			status_door: Number(param4)
-		})
-
-		wx.request({
-			url: `${homeApi_https}` + param1 + param2 + param3,
-			method: 'POST',
-			data: {
-				"entity_id": param5
-			},
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				console.log('res.data=====' + JSON.stringify(res.data));
-			},
-		});
-
-	},
-	onOpen_curtain() {
-		this.setData({ show_curtain: true });
-	},
-	onClose_curtain() {
-		this.setData({
-			show_curtain: false
-		})
-	},
-	onSelect_curtain(event) {
-		console.log(event.detail.id);
-		this.onCurtainChange(event.detail.id);
-	},
-	onOpen_san() {
-		this.setData({ show_san: true });
-	},
-	onClose_san() {
-		this.setData({
-			show_san: false
-		})
-	},
-	onSelect_san(event) {
-		console.log(event.detail.id);
-		this.onSanChange(event.detail.id);
-	},
-
-	onOpen_door() {
-		this.setData({ show_door: true });
-	},
-	onClose_door() {
-		this.setData({
-			show_door: false
-		})
-	},
-	onSelect_door(event) {
-		console.log(event.detail.id);
-		this.onDoorChange(event.detail.id);
-	},
-
-	initChartHumidifier(canvas, width, height, dpr) {
-
-		console.log("humidityValue=>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", humidityValue);
-		this.selectComponent('#mychart-dom-gauge').init((canvas, width, height, dpr) => {
-			// 获取组件的 canvas、width、height 后的回调函数
-			// 在这里初始化图表
-			const chart = echarts.init(canvas, null, {
-				width: width,
-				height: height,
-				devicePixelRatio: dpr // new
-			});
-			setOption(chart);
-
-			// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问
-			chartCircularProgressBar = chart;
-
-			this.setData({
-				isLoaded: true,
-				isDisposed: false
-			});
-
-			// 注意这里一定要返回 chart 实例,否则会影响事件处理等
-			return chart;
-		});
-	},
-
-
-
-
-	//设备控制函数 开始
-	onFireChange(event) {
-		var that = this;
-		console.log(event);
-		let sw = event;
-		that.setData({
-			status_led: sw
-		})
-
-		if (sw) {
-			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":1}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——打开客厅灯");
-				}
-			});
-		} else {
-			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":0}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——关闭客厅灯");
-				}
-			});
-		}
-	},
-
-
-	onLedChange(event) {
-		var that = this;
-		console.log(event);
-		let sw = event;
-		that.setData({
-			status_led: sw
-		})
-
-		if (sw) {
-			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":1}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——打开客厅灯");
-				}
-			});
-		} else {
-			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":0}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——关闭客厅灯");
-				}
-			});
-		}
-	},
-
-	onBeepChange(event, url, entity_id) {
-		var that = this;
-		console.log(event);
-		let sw = event;
-		that.setData({
-			status_beep: sw
-		})
-		console.log("event=" + event);
-		console.log("url=" + url);
-		console.log("entity_id=" + entity_id);
-		if (sw) {
-			// that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":1}', function (err) {
-			//   if (!err) {
-			//     console.log("成功下发命令——打开报警器");
-			//   }
-			// });
-			this.onSelect_vangrid(url, entity_id);
-		} else {
-			// that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":0}', function (err) {
-			//   if (!err) {
-			//     console.log("成功下发命令——关闭报警器");
-			//   }
-			// });
-			this.onSelect_vangrid(url, entity_id);
-		}
-	},
-
-	onCurtainChange(event) {
-		var that = this;
-		console.log(event);
-		let sw = event;
-		that.setData({
-			status_curtain: sw
-		})
-		if (sw) {
-			that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":1}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——开窗帘");
-				}
-			});
-		} else {
-			that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":0}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——关窗帘");
-				}
-			});
-		}
-	},
-
-
-	onSanChange(event) {
-		var that = this;
-		console.log(event);
-		let sw = event;
-		that.setData({
-			status_san: sw
-		})
-		if (sw) {
-			that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":1}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——开风扇");
-				}
-			});
-		} else {
-			that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":0}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——关风扇");
-				}
-			});
-		}
-	},
-
-	onDoorChange(event) {
-		var that = this;
-		console.log(event);
-		let sw = event;
-		that.setData({
-			status_door: sw
-		})
-		if (sw) {
-			that.data.client.publish(mpPubTopic_DO, '{"target":"DO","value":1}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——开门");
-				}
-			});
-		} else {
-			that.data.client.publish(mpPubTopic_DO, '{"target":"DO","value":0}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——关门");
-				}
-			});
-		}
-	},
-
-	onModeChange(event) {
-		var that = this;
-		console.log(event);
-		let sw = event.detail.value;
-		console.log(sw);
-		that.setData({
-			status_mode: sw
-		})
-		if (sw) {
-			that.data.client.publish(mpPubTopic_Mode, '{"target":"OUT","value":1}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——离家模式");
-				}
-			});
-		} else {
-			that.data.client.publish(mpPubTopic_Mode, '{"target":"OUT","value":0}', function (err) {
-				if (!err) {
-					console.log("成功下发命令——居家模式");
-				}
-			});
-		}
-	},
-
-	getEntityState(list, entity_id) {
-		if (list == null) return null;
-		var obj = list.find(function (obj) {
-			return obj.entity_id === entity_id
-		})
-		console.log('getEntityState==' + obj ? (obj.state == 'on' ? 1 : 0) : null);
-		return obj ? (obj.state == 'on' ? 1 : 0) : null;
-	},
-	getEntityStateValue(list, entity_id) {
-		if (list == null) return null;
-		var obj = list.find(function (obj) {
-			return obj.entity_id === entity_id
-		})
-		console.log('getEntityStateValue==' + obj ? obj.state : null);
-		return obj ? obj.state : null;
-	},
-
-	//扫码
-	tapScan() {
-		wx.scanCode({
-			success: function (res) {
-				console.log('扫码获取的参数', res)
-			}
-		})
-	},
-	getSwitch(resData, that) {
-		try {
-			var listSwitchTemp = [];
-			var listAromatherapyMachineTemp = [];
-			var entityIdList = [];
-			const res = wx.getStorageSync('res');
-			const home_room = wx.getStorageSync('res').home_room;
-			for (let i = 0; i < resData.length; i++) {
-				if (resData[i].attributes && resData[i].attributes.home_room && resData[i].attributes.home_room.includes((entity))) {
-					entityIdList.push(resData[i].entity_id)
-				}
-			}
-			console.log('entityIdList=====' + JSON.stringify(entityIdList));
-			for (let i = 0; i < resData.length; i++) {
-				if ((resData[i].attributes && resData[i].attributes.home_room && resData[i].attributes.home_room.includes((entity)))
-					|| (resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id))
-				) {
-					var obj = {};
-					obj.entity_id = resData[i].entity_id;//实体ID
-					obj.parent_entity_id = resData[i].parent_entity_id;//父实体ID
-					//api/services/<domain>/<service>
-					if (resData[i].entity_id) {
-						obj.domain = resData[i].entity_id.split(".")[0];
-					}
-					obj.state = (resData[i].state == 'unknown' ? "未知" : resData[i].state);
-					if (resData[i].attributes && resData[i].attributes.friendly_name) {
-						obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name); //设备名称
-					}
-					if (resData[i].attributes && resData[i].attributes.home_room) {
-						obj.home_room = resData[i].attributes.home_room.split(' ')[1]; //房间号
-					}
-					if (
-						resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList
-						&& entityIdList.includes(resData[i].attributes.parent_entity_id)
-					) {
-						if (resData[i].state == 'on') {
-							obj.service = 'turn_on';
-						} else if (resData[i].state == 'off') {
-							obj.service = 'turn_off';
-						}
-						//是否 是香薰机灯光
-						obj.isAromlight = obj.friendly_name.includes('香薰机灯光')
-						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.isAromlight && !obj.isAromAtomization && !obj.isAromatherapy) {
-
-							if (!obj.friendly_name.endsWith("电视")) {
-								listSwitchTemp.push(obj)
-							}
-						} else if ((obj.isAromlight || obj.isAromAtomization || obj.isAromatherapy) && checkState(obj.state)) {
-							listAromatherapyMachineTemp.push(obj)
-						}
-					}
-				}
-			}
-			console.log('listSwitchTemp=' + JSON.stringify(listSwitchTemp));
-			listSwitchTemp = that.checkTVList(listSwitchTemp);
-			that.setData({
-				listSwitch: listSwitchTemp,
-				listAromatherapyMachine: listAromatherapyMachineTemp,
-			})
-		} catch (error) {
-			console.error(error);
-		}
-	},
-	//设备控制函数 结束
-	sliderChange(e) {
-		let list = this.data.listScroll;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-
-			if (index == indexS) {
-				array[index].state = e.detail.value;
-			}
-		})
-		this.setData({
-			listScroll: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"value": e.detail.value,
-		}
-		this.getService("/services", "/" + domain, "/set_value", "POST", data);
-		// 设置两秒(2000毫秒)后的延迟
-		// setTimeout(() => {  
-		//   this.getMiotMediaPlayer(this); 
-		// }, 2000);  
-	},
-	onArrowUp(e) {
-		// 在这里处理向上箭头的点击事件  
-		// 例如,你可以增加文本框的值  
-		let currentValue = e.currentTarget.dataset.state;
-		let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字  
-		// this.setData({  
-		//   inputValue: newValue.toString()  
-		// });  
-
-		let list = this.data.listUnit;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index)
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			listUnit: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"value": newValue
-		}
-		this.getService("/services", "/" + domain, "/set_value", "POST", data);
-	},
-	// 加湿器
-	changeHumidity(e) {
-		let list = this.data.listHumidifier;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-
-			if (index == indexS) {
-				array[index].humidity = e.detail;
-			}
-		})
-		this.setData({
-			listHumidifier: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"humidity": e.detail
-		}
-		this.getService("/services", "/" + domain, "/set_humidity", "POST", data);
-	},
-	//加湿器
-	onHumidifierDown(e) {
-		var that = this;
-		this.setData({
-			isClickedOnHumidifierDown: true
-		});
-		// 在这里处理向下箭头的点击事件  
-		// 例如,你可以减少文本框的值  
-		let currentValue = e.currentTarget.dataset.humidity;
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字 
-		if (newValue < min) {
-			newValue = min;
-		}
-		// this.setData({  
-		//   inputValue: newValue.toString()  
-		// });  
-
-		let list = this.data.listHumidifier;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index)
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].humidity = newValue;
-			}
-		})
-		this.setData({
-			listHumidifier: list,
-			// isButtonPressedHumidityDown:!that.data.isButtonPressedHumidityDown
-		})
-		let data = {
-			"entity_id": entity_id,
-			"humidity": newValue
-		}
-		this.getService("/services", "/" + domain, "/set_humidity", "POST", data);
-	},
-	//加湿器
-	onHumidifierUp(e) {
-		var that = this;
-		this.setData({
-			isClickedOnHumidifierUp: true
-		});
-		// 在这里处理向上箭头的点击事件  
-		// 例如,你可以增加文本框的值  
-		let currentValue = e.currentTarget.dataset.humidity || 0;
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字  
-		if (newValue > max) {
-			newValue = max;
-		}
-		// this.setData({  
-		//   inputValue: newValue.toString()  
-		// });  
-
-		let list = this.data.listHumidifier;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index)
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].humidity = newValue;
-			}
-		})
-		this.setData({
-			listHumidifier: list,
-			// isButtonPressedHumidityUp:!that.data.isButtonPressedHumidityUp
-		})
-		let data = {
-			"entity_id": entity_id,
-			"humidity": newValue
-		}
-		console.log(e.currentTarget.dataset);
-		this.getService("/services", "/" + domain, "/set_humidity", "POST", data);
-	},
-	//加湿器
-	onHumidifierOn(e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/turn_on", "POST", data);
-	},
-	//加湿器
-	onHumidifierOff(e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/turn_off", "POST", data);
-	},
-	// 拖动空调的值
-	dragClimate(e) {
-		var that = this;
-		let state = e.currentTarget.dataset.state;
-		console.log(e.detail.value);
-		if (state == "auto") {
-			return
-		}
-		let list = that.data.listClimate;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		// 将本地缓存数据渲染到对应修改的案例
-
-		for (let i = 0; i < list.length; i++) {
-			var element = list[i];
-			if (i == indexS) {
-				element.temperatureTemp = e.detail.value;
-				break;
-			}
-
-		}
-		that.setData({
-			listClimate: list
-		})
-		console.log(list);
-	},
-	// 更改空调的值
-	changeClimate(e) {
-		var that = this;
-		let state = e.currentTarget.dataset.state;
-		if (state == "auto") {
-			return
-		}
-		this.setData({
-			isClickedOnClimateUp: true
-		});
-		console.log('that.data.climateMode==' + that.data.climateMode);
-		if (!that.data.climateMode) {
-			wx.showToast({
-				title: '请先选择模式',
-				icon: 'none'
-			});
-			return;
-		}
-		let currentValue = e.currentTarget.dataset.temperature;
-		let fanMode = e.currentTarget.dataset.fanMode;
-
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {};
-		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-			let indexS = Number(e.currentTarget.dataset.index);
-			// 将本地缓存数据渲染到对应修改的案例
-			list.forEach(function (value, index, array) {
-				if (index == indexS) {
-					array[index].temperature = e.detail;
-				}
-			})
-			this.setData({
-				listClimate: list
-			})
-			data = {
-				"entity_id": entity_id,
-				"temperature": e.detail,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'dry') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				"temperature": e.detail,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'fan_only') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
-				"temperature": e.detail,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		}
-	},
-	// 更改空调的值
-	minusClimate(e) {
-		var that = this;
-		let state = e.currentTarget.dataset.state;
-		if (state == "auto") {
-			return
-		}
-		this.setData({
-			isClickedOnClimateUp: true
-		});
-		console.log('that.data.climateMode==' + that.data.climateMode);
-		if (!that.data.climateMode) {
-			wx.showToast({
-				title: '请先选择模式',
-				icon: 'none'
-			});
-			return;
-		}
-		let currentValue = e.currentTarget.dataset.temperature;
-		let fanMode = e.currentTarget.dataset.fanMode;
-
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		let domain = e.currentTarget.dataset.domain;
-		let temperature = e.currentTarget.dataset.temperature - 1;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {};
-		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-			let indexS = Number(e.currentTarget.dataset.index);
-			// 将本地缓存数据渲染到对应修改的案例
-			list.forEach(function (value, index, array) {
-				if (index == indexS) {
-					array[index].temperature = temperature;
-				}
-			})
-			this.setData({
-				listClimate: list
-			})
-			data = {
-				"entity_id": entity_id,
-				"temperature": temperature,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'dry') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				"temperature": temperature,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'fan_only') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
-				"temperature": temperature,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		}
-	},
-	// 更改空调的值
-	addClimate(e) {
-		var that = this;
-		let state = e.currentTarget.dataset.state;
-		if (state == "auto") {
-			return
-		}
-		this.setData({
-			isClickedOnClimateUp: true
-		});
-		console.log('that.data.climateMode==' + that.data.climateMode);
-		if (!that.data.climateMode) {
-			wx.showToast({
-				title: '请先选择模式',
-				icon: 'none'
-			});
-			return;
-		}
-		let currentValue = e.currentTarget.dataset.temperature;
-		let fanMode = e.currentTarget.dataset.fanMode;
-
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		let domain = e.currentTarget.dataset.domain;
-		let temperature = e.currentTarget.dataset.temperature + 1;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {};
-		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-			let indexS = Number(e.currentTarget.dataset.index);
-			// 将本地缓存数据渲染到对应修改的案例
-			list.forEach(function (value, index, array) {
-				if (index == indexS) {
-					array[index].temperature = temperature;
-				}
-			})
-			this.setData({
-				listClimate: list
-			})
-			data = {
-				"entity_id": entity_id,
-				"temperature": temperature,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'dry') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				"temperature": temperature,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'fan_only') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
-				"temperature": temperature,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		}
-	},
-	onClimateDown(e) {
-		var that = this;
-		if (!that.data.climateMode) {
-			wx.showToast({
-				title: '请先选择模式',
-				icon: 'none'
-			});
-			return;
-		}
-		console.log('that.data.climateMode==' + that.data.climateMode);
-		let currentValue = e.currentTarget.dataset.temperature;
-		let fanMode = e.currentTarget.dataset.fanMode;
-		// let list = this.data.listClimate;
-		// this.setData({  
-		//   inputValue: newValue.toString()  
-		// });  
-
-
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		// this.setData({
-		// 	isButtonPressedClimateDown: !that.data.isButtonPressedClimateDown
-		// })
-		// 将本地缓存数据渲染到对应修改的案例
-		// list.forEach(function (value,index, array){
-		//   if (index == indexS) {
-		//      array[index].temperature = newValue;
-		//     }
-		// })
-		// this.setData({
-		//   listClimate: list
-		// })
-		let data = {};
-		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
-			let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字 
-			if (newValue < min) newValue = min;
-			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-			let indexS = Number(e.currentTarget.dataset.index);
-			// 将本地缓存数据渲染到对应修改的案例
-			list.forEach(function (value, index, array) {
-				if (index == indexS) {
-					array[index].temperature = newValue;
-				}
-			})
-			this.setData({
-				listClimate: list
-			})
-			console.log('onClimateDown-entity_id=' + entity_id);
-			data = {
-				"entity_id": entity_id,
-				"temperature": newValue,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'dry') {
-			let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字 
-			if (newValue < min) newValue = min;
-			data = {
-				"entity_id": entity_id,
-				"temperature": newValue,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'fan_only') {
-			let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字
-			if (newValue < min) newValue = min;
-			data = {
-				"entity_id": entity_id,
-				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
-				"temperature": newValue,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		}
-	},
-	onClimateUp(e) {
-		var that = this;
-		this.setData({
-			isClickedOnClimateUp: true
-		});
-		console.log('that.data.climateMode==' + that.data.climateMode);
-		if (!that.data.climateMode) {
-			wx.showToast({
-				title: '请先选择模式',
-				icon: 'none'
-			});
-			return;
-		}
-		let currentValue = e.currentTarget.dataset.temperature;
-		let fanMode = e.currentTarget.dataset.fanMode;
-
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		// this.setData({  
-		//   inputValue: newValue.toString()  
-		// });  
-
-		// let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-		// let indexS = Number(e.currentTarget.dataset.index)
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// this.setData({
-		// 	isButtonPressedClimateUp: !that.data.isButtonPressedClimateUp
-		// })
-		// 将本地缓存数据渲染到对应修改的案例
-		// list.forEach(function (value,index, array){
-		//   if (index == indexS) {
-		//      array[index].temperature = newValue;
-		//     }
-		// })
-		// this.setData({
-		//   listClimate: list
-		// })
-		let data = {};
-		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-			let indexS = Number(e.currentTarget.dataset.index);
-			// 将本地缓存数据渲染到对应修改的案例
-			list.forEach(function (value, index, array) {
-				if (index == indexS) {
-					array[index].temperature = newValue;
-				}
-			})
-			this.setData({
-				listClimate: list
-			})
-			data = {
-				"entity_id": entity_id,
-				"temperature": newValue,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'dry') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				"temperature": newValue,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		} else if (that.data.climateMode == 'fan_only') {
-			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
-			if (newValue > max) newValue = max;
-			data = {
-				"entity_id": entity_id,
-				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
-				"temperature": newValue,
-				"hvac_mode": that.data.climateMode
-			}
-			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
-		}
-	},
-	onClimateAuto(e) {
-		this.setData({
-			isClickedOnClimateAuto: true
-		});
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			temperatureHumidifyName: '自动',
-			climateMode: 'auto',
-			listClimate: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"hvac_mode": 'auto',
-		}
-		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
-	},
-	onClimateHeat(e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			temperatureHumidifyName: '制热',
-			climateMode: 'heat',
-			listClimate: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"hvac_mode": 'heat',
-		}
-		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
-	},
-	onClimateCool(e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			temperatureHumidifyName: '制冷',
-			climateMode: 'cool',
-			listClimate: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"hvac_mode": 'cool',
-		}
-		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
-	},
-	onClimateDehumidify(e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			temperatureHumidifyName: '除湿',
-			climateMode: 'dry',
-			listClimate: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"hvac_mode": 'dry',
-		}
-		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
-	},
-	onClimateAirSupply(e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			temperatureHumidifyName: '送风',
-			climateMode: 'fan_only',
-			listClimate: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"hvac_mode": 'fan_only',
-		}
-		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
-	},
-	onClimateOff(e) {
-		let state = e.currentTarget.dataset.state;
-		if (state == 'off') {
-			// 如果是关闭的就开成自动
-			this.onClimateAuto(e);
-			return
-		}
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index);
-
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			temperatureHumidifyName: '关闭',
-			climateMode: 'off',
-			listClimate: list
-		})
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/turn_off", "POST", data);
-	},
-	handleInput: function (e) {
-		// 这里你需要自己实现歌曲列表和切换逻辑  
-		// 例如,如果你有一个歌曲列表,你可以通过修改当前播放歌曲的索引来切换歌曲  
-		// 假设你有一个歌曲列表`songs`和一个当前歌曲索引`currentIndex`  
-		// if (this.data.currentIndex > 0) {
-		//   this.data.currentIndex--;  
-		//   // 加载新歌曲并播放  
-		//   this.loadAndPlaySong(this.data.currentIndex);  
-		// }
-		let min = e.currentTarget.dataset.min;
-		let max = e.currentTarget.dataset.max;
-		if (e.detail.value && (e.detail.value.length > max || e.detail.value.length < min)) {
-			wx.showModal({
-				title: '提示',
-				content: '文本长度介于' + min + '~' + max + '长度之间',
-				showCancel: false
-			});
-			return;
-		}
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {
-			"entity_id": entity_id,
-			"value": e.detail.value,
-		}
-		this.getService("/services", "/" + domain, "/set_value", "POST", data);
-	},
-	onArrowDown(e) {
-		// 在这里处理向下箭头的点击事件  
-		// 例如,你可以减少文本框的值  
-		let currentValue = e.currentTarget.dataset.state;
-		let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字  
-		// this.setData({  
-		//   inputValue: newValue.toString()  
-		// });  
-
-		let list = this.data.listUnit;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index)
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].state = newValue;
-			}
-		})
-		this.setData({
-			listUnit: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"value": newValue
-		}
-		this.getService("/services", "/" + domain, "/set_value", "POST", data);
-	},
-	prevSong: function (e) {
-		// 这里你需要自己实现歌曲列表和切换逻辑  
-		// 例如,如果你有一个歌曲列表,你可以通过修改当前播放歌曲的索引来切换歌曲  
-		// 假设你有一个歌曲列表`songs`和一个当前歌曲索引`currentIndex`  
-		// if (this.data.currentIndex > 0) {
-		//   this.data.currentIndex--;  
-		//   // 加载新歌曲并播放  
-		//   this.loadAndPlaySong(this.data.currentIndex);  
-		// }
-		this.setData({
-			isClickedPrevSong: true
-		});
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/media_previous_track", "POST", data);
-		// setTimeout(() => {
-		//   this.getMiotMediaPlayer(this); 
-		// }, 8000); 
-	},
-
-	tvTurnOn: function (e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/turn_on", "POST", data);
-	},
-	tvTurnOff: function (e) {
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/turn_off", "POST", data);
-	},
-
-	// 切换播放/暂停  
-	togglePlayPause: function (e) {
-		// console.log("this.data.isPlaying="+this.data.isPlaying);
-		//    if (this.data.isPlaying) {  
-		//      this.innerAudioContext.pause();  
-		//   this.setData({ isPlaying: false });
-		//   this.getService("/services","/"+domain,"/media_pause","POST",null);
-		//    } else {  
-		//      this.innerAudioContext.play();  
-		//   this.setData({ isPlaying: true });
-		//   this.getService("/services","/"+domain,"/media_play","POST",null);
-		//    }  
-		// let list = this.data.listMiotMediaPlayer;//这里是将需要循环的数组赋值给list
-		this.setData({
-			isClickedTogglePlayPause: true
-		});
-		let indexS = Number(e.currentTarget.dataset.index)
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let state = e.currentTarget.dataset.state;
-		// 将本地缓存数据渲染到对应修改的案例
-		// list.forEach(function (value,index, array){
-		//   if (index == indexS) {
-		//      array[index].state = (state=='playing'?'idle':'playing');
-		//     }
-		// })
-		// this.setData({
-		//   listMiotMediaPlayer: list
-		// })
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/media_play_pause", "POST", data);
-
-		// 设置两秒(2000毫秒)后的延迟  
-		// setTimeout(() => {  
-		//   this.getMiotMediaPlayer(this); 
-		// }, 8000);  
-
-	},
-
-	// 切换下一首歌曲  
-	nextSong: function (e) {
-		// 和prevSong类似,你需要实现歌曲列表和切换逻辑  
-		// 假设歌曲列表为`songs`,当前歌曲索引为`currentIndex`  
-		// if (this.data.currentIndex < songs.length - 1) {  
-		//   this.data.currentIndex++;  
-		//   // 加载新歌曲并播放  
-		//   this.loadAndPlaySong(this.data.currentIndex);  
-		// }
-		this.setData({
-			isClickedNextSong: true
-		});
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		let data = {
-			"entity_id": entity_id,
-		}
-		this.getService("/services", "/" + domain, "/media_next_track", "POST", data);
-		// setTimeout(() => {
-		//   this.getMiotMediaPlayer(this); 
-		// }, 8000); 
-	},
-
-	// 加载并播放指定索引的歌曲  
-	loadAndPlaySong: function (index) {
-		// 假设你有一个歌曲列表`songs`,每个歌曲对象有`url`属性表示音频链接  
-		const song = songs[index];
-		this.innerAudioContext.src = song.url;
-		this.innerAudioContext.play();
-		// 更新当前播放的歌曲信息(例如标题和艺术家)  
-		this.setData({
-			currentSongTitle: song.title,
-			currentSongArtist: song.artist
-		});
-	},
-	base64Decode: function (input) {
-		const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
-		let str = '';
-		let output = '';
-		let chr1, chr2, chr3;
-		let enc1, enc2, enc3, enc4;
-		let i = 0;
-
-		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
-		while (i < input.length) {
-			enc1 = chars.indexOf(input.charAt(i++));
-			enc2 = chars.indexOf(input.charAt(i++));
-			enc3 = chars.indexOf(input.charAt(i++));
-			enc4 = chars.indexOf(input.charAt(i++));
-
-			chr1 = (enc1 << 2) | (enc2 >> 4);
-			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
-			chr3 = ((enc3 & 3) << 6) | enc4;
-
-			str += String.fromCharCode(chr1);
-
-			if (enc3 != 64) {
-				str += String.fromCharCode(chr2);
-			}
-			if (enc4 != 64) {
-				str += String.fromCharCode(chr3);
-			}
-		}
-
-		return str;
-	},
-	onPickerChange: function (e) {
-		//    this.setData({  
-		//      selectedIndex: e.detail.value  
-		//    });  
-		//    // 可以在这里处理选中值的变化,比如发送请求等  
-		//    console.log('选中的值是:', this.data.options[e.detail.value].value);  
-
-		let list = this.data.listSelect;//这里是将需要循环的数组赋值给list
-		let indexS = Number(e.currentTarget.dataset.index)
-		let domain = e.currentTarget.dataset.domain;
-		let entity_id = e.currentTarget.dataset.id;
-		// 将本地缓存数据渲染到对应修改的案例
-		list.forEach(function (value, index, array) {
-			if (index == indexS) {
-				array[index].selectedIndex = e.detail.value;
-			}
-		})
-		this.setData({
-			listSelect: list
-		})
-		let data = {
-			"entity_id": entity_id,
-			"option": e.detail.value,
-		}
-		this.getService("/services", "/" + domain, "/select_option", "POST", data);
-	},
-	getService(services, domain, service, method, data) {
-		wx.request({
-			url: `${homeApi_https}` + services + domain + service,
-			method: method,
-			data: data,
-			header: {
-				'content-type': 'application/json', // 默认值
-				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			},
-			success(res) {
-				console.log('res.data=====' + JSON.stringify(res.data));
-			},
-		});
-	},
-	// 初始化时调用即可
-	showCanvasRing() {
-		try {
-			//作画
-			var ctx = wx.createCanvasContext("circleBar", this); //canvas组建封装,需要后加个this
-			ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight); // 清除画布
-
-			var circle_r = this.data.canvasWidth / 2 - 10; //画布的一半,用来找中心点和半径
-			var scoreText = this.data.value; // 当前得分
-			var total = this.data.total;// 总分值
-
-			var score = (100 * scoreText) / total; // 满分为100时对应的值
-			let that = this;
-
-			//定义起始点
-			ctx.translate(this.data.canvasWidth / 2, this.data.canvasWidth / 2 + 5);
-			//  白边圆弧
-			ctx.beginPath();
-			ctx.setStrokeStyle("#FFFFFF");
-			ctx.setLineWidth(16);
-			ctx.setLineCap("round");
-			ctx.arc(0, 0, circle_r - 15, 1 * Math.PI, 0, false);
-			ctx.stroke();
-			ctx.closePath();
-
-			//灰色圆弧
-			ctx.beginPath();
-			ctx.setStrokeStyle("#D6E4FF");
-			ctx.setLineWidth(12);
-			ctx.setLineCap("round"); //线条结束端点样式 butt 平直 round 圆形 square 正方形
-			ctx.arc(0, 0, circle_r - 15, 1 * Math.PI, 0, false);
-			ctx.stroke();
-			ctx.closePath();
-
-			// 蓝色圆弧
-			ctx.beginPath();
-			ctx.setStrokeStyle("#3366FF");
-			ctx.setLineWidth(16);
-			ctx.arc(
-				0,
-				0,
-				circle_r - 15,
-				1 * Math.PI,
-				(score / 100 + 1) * Math.PI,
-				false
-			);
-			ctx.stroke();
-			ctx.closePath();
-			// 指示器-外层
-			let deg = 270 - score * 1.8;
-			const xAxis = Math.sin(((2 * Math.PI) / 360) * deg) * (circle_r - 15);
-			const yAxis = Math.cos(((2 * Math.PI) / 360) * deg) * (circle_r - 15);
-			ctx.beginPath();
-			ctx.arc(xAxis, yAxis, 11, 0, 2 * Math.PI);
-			ctx.setFillStyle("#FFFFFF");
-			ctx.fill();
-			// 指示器-内层
-			const xAxis2 = Math.sin(((2 * Math.PI) / 360) * deg) * (circle_r - 15);
-			const yAxis2 = Math.cos(((2 * Math.PI) / 360) * deg) * (circle_r - 15); // circle_r - 10
-			ctx.beginPath();
-			ctx.arc(xAxis2, yAxis2, 6, 0, 2 * Math.PI);
-			ctx.setFillStyle("#3366FF");
-			ctx.fill();
-
-			// 文字-总得分
-			ctx.setTextAlign("center"); // 字体位置
-			ctx.setFillStyle("#333333");
-			ctx.font = "normal normal 16px Arial,sans-serif";
-			ctx.fillText("总得分", 0, -30);
-			// 文字-具体分数
-			ctx.setTextAlign("center"); // 字体位置
-			ctx.setFillStyle("#000000");
-			ctx.font = "normal bold 36px Arial,sans-serif";
-			ctx.fillText(scoreText, 0, 13);
-
-			// 最低分
-			ctx.setFillStyle("#666666");
-			ctx.font = "normal normal 13px Arial,sans-serif";
-			ctx.fillText(0, -circle_r + 10, 25);
-			// 最高分
-			ctx.setFillStyle("#666666");
-			ctx.font = "normal normal 13px Arial,sans-serif";
-			ctx.fillText(total, circle_r - 15, 25);
-
-			// 绘图
-			ctx.draw(false, function () {
-				//将生成好的图片保存到本地
-				wx.canvasToTempFilePath(
-					{
-						canvasId: "circleBar",
-						success: function (res) {
-							var tempFilePath = res.tempFilePath;
-							that.setData({
-								loadImagePath: tempFilePath,
-							});
-						},
-						fail: function (res) { },
-					},
-				);
-			});
-		} catch (error) {
-		}
-	},
-
-	getHAData(that, hotelcode, roomcode) {
-		let start = Date.now(); // 获取当前时间(毫秒)
-		// console.log('start=='+start);
-
-
-
-		wx.request({
-			url: `${aipushApi}/getha`, //
-			method: 'POST',
-			//   header: {
-			// 	  'content-type': 'application/json', // 默认值
-			// 	  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			// },
-			data: {
-				"locations": hotelcode, "room": (hotelcode && hotelcode.includes('hotel')) ? roomcode : "", "token": token_push
-			},
-			success(ress) {
-				if (!ress || !ress.data) {
-					console.error("getha(),没有获取到数据");
-					return;
-				}
-				var resData = ress.data
-				console.log("resData-==" + JSON.stringify(resData));
-				console.log("resData.loc-==" + JSON.stringify(resData.loc));
-				homeApi_https = resData.loc + "/api";
-				homeApiLater_https = resData.loc;
-				token = resData.token;
-				// console.log('res.data='+JSON.stringify(resData));
-				if (ress.data.code == "400") {
-					console.error("400错误!");
-					return;
-				}
-				if (ress.data.code == "401") {
-					console.error("401错误!");
-					return;
-				}
-				try {
-
-					//获取HA 设备状态数据
-					// wx.request({
-					//   url: `${homeApi_https}/states`, //获取空气数据
-					//   method: 'GET',
-					//    header: {
-					// 		  'content-type': 'application/json', // 默认值
-					// 	  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-					// 	},
-					//   success(res) {
-					// 	  if(!res || !res.data){
-					// 		  return;
-					// 	  }
-					// 	var resData = res.data
-					// 	// console.log('res.data='+JSON.stringify(resData));
-					// 	if (res.data.code == "400") {
-					// 	  console.error("400错误!");
-					// 	  return;
-					// 	}
-					// 	if (res.data.code == "401") {
-					// 	  console.error("401错误 --- 请检查你的API或Key是否正确!");
-					// 	  return;
-					// 	}
-					// 	try {
-
-
-					// const {
-					//   now
-					// } = res.data;
-					//  console.log('res.data1='+JSON.stringify(resData));
-					//  res.data.find(function (obj) {
-					//   console.log('obj='+obj); 
-					//  })
-					//  res.data.forEach((item, index) => {
-					// console.log(index, item); 
-					//  });
-					var listCoverTemp = [];
-					var listSwitchTemp = [];
-					var listScrollTemp = [];
-					var listUnitTemp = [];
-					var listConversationTemp = [];
-					var listConversation1Temp = [];
-					var listHumidityTemp = [];
-					var listButtonTemp = [];
-					var listSelectTemp = [];
-					var listClimateTemp = [];
-					var listMiotMediaPlayerTemp = [];
-					var listMitvMediaPlayerTemp = [];
-					var listHumidifierTemp = [];
-					var listSensorTemp = [];
-					var listTextTemp = [];
-
-					var tvEntityIdTemp = '';
-					var tvEntityIdsTemp = [];
-					var listAromatherapyMachineTemp = [];
-					var modelList1 = [];
-					var modelList2 = [];
-					var modelList3 = [];
-					var climateModeTemp = '';
-					var temperatureHumidifyNameTemp = '温度';
-					var humidityValueTemp = 0;
-					var humidityMaxTemp = 0;
-					var humidityMinTemp = 0;
-
-					var entityIdList = [];
-					const res = wx.getStorageSync('res');
-					const home_room = wx.getStorageSync('res').home_room;
-					// console.log('entity=====@==='+entity);
-					wx.request({
-						url: `${homeApi_https}/aidsleep/entity`, //获取空气数据
-						method: 'POST',
-						header: {
-							'content-type': 'application/json', // 默认值
-							'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-						},
-						//
-						data: {
-							"template": "{{ label_entities('" + (entity) + "') }}"
-						},
-						success(resTemplate) {
-							let mid = Date.now(); // 再次获取当前时间(毫秒)
-							// console.log('mid=='+mid);
-							if (!resTemplate || !resTemplate.data) {
-								console.log('no data:' + mid);
-								return;
-							}
-							let resData = resTemplate.data;
-							// resData = resData.filter(item1 => {
-							//   return JSON.parse(that.replaceAll(resTemplate.data,'\'','\"')).find(item2 => item2 === item1.entity_id) !== undefined;  
-							// });
-							// console.log('entityIdList-resTemplate====='+JSON.stringify(resTemplate.data));
-							for (let i = 0; i < resData.length; i++) {
-								// if(resTemplate.data.includes(resData[i].entity_id) && that.checkFuzzyMatch(resData[i])){
-								var obj = {};
-								obj.entity_id = resData[i].entity_id;//实体ID
-								obj.parent_entity_id = resData[i].parent_entity_id;//父实体ID
-								//api/services/<domain>/<service>
-								if (resData[i].entity_id) {
-									obj.domain = resData[i].entity_id.split(".")[0];
-								}
-								obj.state = (resData[i].state == 'unknown' ? "未知" : resData[i].state);
-								if (resData[i].attributes && resData[i].attributes.friendly_name) {
-									obj.friendly_name = resData[i].attributes.friendly_name; //设备名称
-
-
-									if (obj.friendly_name.includes("灯带") || obj.friendly_name.includes("吸顶灯")) {
-										obj.imgSrc = '/static/icons/ic_dd_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
-									} else if (obj.friendly_name.includes("走廊灯")) {
-										obj.imgSrc = '/static/icons/ic_zld_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_zld_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #FFEEFA 0%, #FFFFFF 50%)';
-									} else if (obj.friendly_name.includes("筒灯")) {
-										obj.imgSrc = '/static/icons/ic_td_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_td_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #EBF0FF 0%, #FFFFFF 50%)';
-									} else if (obj.friendly_name.includes("主灯")) {
-										obj.imgSrc = '/static/icons/ic_zd_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_zd_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #EFE7FF 0%, #FFFFFF 50%)';
-									} else if (obj.friendly_name.includes("气扇")) {
-										obj.imgSrc = '/static/icons/ic_pqs_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_pqs_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #E3FFE6 0%, #FFFFFF 53%)';
-									} else if (obj.friendly_name.includes("电视")) {
-										obj.imgSrc = '/static/icons/ic_ds_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
-										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
-									} else if (obj.friendly_name.includes("空气净化器")) {
-										obj.imgSrc = '/static/icons/ic_kqjhq_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_kqjhq_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #EBFAFF 0%, #FFFFFF 50%)';
-
-									} else if (obj.friendly_name.includes("香薰机雾化")) {
-										obj.imgSrc = '/static/icons/ic_xxjwh.svg';
-										obj.selectedImgSrc = '/static/icons/ic_xxjwh.svg';
-
-									} else if (obj.friendly_name.endsWith('香薰机') || obj.friendly_name.endsWith('香薰机开关')) {
-										obj.imgSrc = '/static/icons/ic_xxj.svg';
-										obj.selectedImgSrc = '/static/icons/ic_xxj.svg';
-									} else if (obj.friendly_name.includes("灯")) {
-										obj.imgSrc = '/static/icons/ic_dd_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
-									} else {
-										obj.imgSrc = '/static/icons/ic_ds_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
-										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
-									}
-
-
-								}
-								if (resData[i].attributes && resData[i].attributes.home_room) {
-									obj.home_room = resData[i].attributes.home_room.split(' ')[1]; //房间号
-								}
-								if (resData[i].state && that.checkFuzzyMatch(resData[i])
-								) {
-									if (resData[i].state == 'on') {
-										obj.service = 'turn_on';
-									} else if (resData[i].state == 'off') {
-										obj.service = 'turn_off';
-									}
-									//截取字符串,防止开关设备名称过长
-									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
-									//是否 是香薰机灯光
-									obj.isAromlight = obj.friendly_name.includes('香薰机灯光')
-									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.isAromlight && !obj.isAromAtomization && !obj.isAromatherapy) {
-
-										if (!obj.friendly_name.endsWith("电视")) {
-											listSwitchTemp.push(obj)
-										}
-									} else if ((obj.isAromlight || obj.isAromAtomization || obj.isAromatherapy) && checkState(obj.state)) {
-										listAromatherapyMachineTemp.push(obj)
-									}
-								}
-
-								if ((resData[i].state && obj.domain && obj.domain == 'cover') && that.checkFuzzyMatch(resData[i])
-								) {
-									obj.current_position = resData[i].attributes.current_position;
-									obj.target_position = resData[i].attributes.target_position;
-									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
-									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
-										listCoverTemp.push(obj)
-									}
-								}
-
-								//  if((resData[i].state && obj.domain && obj.domain=='number')||
-								// (resData[i].state && obj.domain && obj.domain=='number' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.min = resData[i].attributes.min;
-								//   obj.max = resData[i].attributes.max;
-								//   obj.step = resData[i].attributes.step;
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   if(resData[i].state!='unknown'){
-								// 	  obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
-								//   }
-								//   if((resData[i].attributes.min || resData[i].attributes.max) && resData[i].attributes.unit_of_measurement!='rgb' && resData[i].attributes.unit_of_measurement!='minutes'){
-								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  	listScrollTemp.push(obj);
-								// 	  }
-								//   }else if((resData[i].attributes.min || resData[i].attributes.max) && (resData[i].attributes.unit_of_measurement=='rgb' || resData[i].attributes.unit_of_measurement=='minutes')){
-								// 	  if(resData[i].state!='unknown'){
-								// 	  	obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
-								// 	  }
-								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  	listUnitTemp.push(obj);
-								// 	  }
-								//   }
-								//  }
-								//  if((resData[i].state && obj.domain && obj.domain=='button')||
-								// (resData[i].state && obj.domain && obj.domain=='button' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listButtonTemp.push(obj);
-								//   }
-								//  }
-								//  if((resData[i].state && obj.domain && obj.domain=='select')||
-								// (resData[i].state && obj.domain && obj.domain=='select' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   obj.options = resData[i].attributes.options;
-								//   obj.selectedIndex = 0;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listSelectTemp.push(obj);
-								//   }
-								//  }
-								if ((resData[i].state && obj.domain && obj.domain == 'climate' && resData[i].attributes.entity_class == 'MiirClimateEntity')
-								) {
-									climateModeTemp = obj.state;
-									obj.temperature = resData[i].attributes.temperature;
-									obj.temperatureTemp = resData[i].attributes.temperature;
-									obj.min_temp = resData[i].attributes.min_temp;
-									obj.max_temp = resData[i].attributes.max_temp;
-									obj.hvac_modes = resData[i].attributes.hvac_modes;
-									obj.fan_modes = resData[i].attributes.fan_modes;
-									obj.fan_mode = resData[i].attributes.fan_mode;
-									obj.target_temp_step = resData[i].attributes.target_temp_step;
-									if (obj.state == 'auto') {
-										temperatureHumidifyNameTemp = '自动';
-									}
-
-									if (obj.state == 'heat') {
-										temperatureHumidifyNameTemp = '制热';
-									}
-									if (obj.state == 'cool') {
-										temperatureHumidifyNameTemp = '制冷';
-									}
-									if (obj.state == 'dry') {
-										temperatureHumidifyNameTemp = '除湿';
-									}
-									if (obj.state == 'fan_only') {
-										temperatureHumidifyNameTemp = '送风';
-									}
-									if (obj.state == 'off') {
-										temperatureHumidifyNameTemp = '关闭';
-									}
-
-									if (obj.entity_id && obj.state && obj.friendly_name && obj.domain) {
-										listClimateTemp.push(obj);
-									}
-								}
-								if ((resData[i].state && obj.domain && obj.domain == 'media_player' && resData[i].attributes.entity_class == 'MiotMediaPlayerEntity') && that.checkFuzzyMatch(resData[i])
-								) {
-									// obj["speaker.volume"] = resData[i].attribute["speaker.volume"];
-									obj.repeat = resData[i].attributes.repeat;
-									obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
-									obj.media_title = resData[i].attributes.media_title;
-									obj.media_artist = resData[i].attributes.media_artist;
-									obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
-									obj.media_duration = resData[i].attributes.media_duration;
-									obj.media_position = resData[i].attributes.media_position;
-									obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
-									// obj.microphone.mute = resData[i].attributes.microphone.mute;
-									// obj.speaker.mute = resData[i].attributes.speaker.mute;
-									// console.log('media-player-miot-obj=='+obj);
-									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
-										listMiotMediaPlayerTemp.push(obj);
-									}
-								}
-
-								//  if((resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity')||
-								// (resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.volume_level = resData[i].attributes.volume_level;
-								//   obj.is_volume_muted = resData[i].attributes.is_volume_muted;
-								//   obj.source = resData[i].attributes.source;
-								//   obj.entity_picture = resData[i].attributes.entity_picture?"background-image: url('"+`${homeApiLater_https}`+resData[i].attributes.entity_picture+"');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;":"background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
-								//   obj.media_title = resData[i].attributes.media_title;
-								//   obj.media_artist = resData[i].attributes.media_artist;
-								//   obj.volume_level = resData[i].attributes.volume_level?(resData[i].attributes.volume_level * 100):0;
-								//   obj.media_duration = resData[i].attributes.media_duration;
-								//   obj.media_position = resData[i].attributes.media_position;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listMitvMediaPlayerTemp.push(obj);
-								//   }
-								//  }
-
-								if ((resData[i].state && obj.domain && obj.domain == 'media_player') && that.checkFuzzyMatch(resData[i])
-								) {
-
-									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
-									if (obj.entity_id.includes('teevee') || (obj.entity_id.includes('media_player') && obj.entity_id.includes('tv_dlna_') && obj.friendly_name && obj.friendly_name.includes('电视'))) {
-										obj.volume_level = resData[i].attributes.volume_level;
-										obj.is_volume_muted = resData[i].attributes.is_volume_muted;
-										obj.source = resData[i].attributes.source;
-										obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
-										obj.media_title = resData[i].attributes.media_title;
-										obj.media_artist = resData[i].attributes.media_artist;
-										obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
-										obj.media_duration = resData[i].attributes.media_duration;
-										obj.media_position = resData[i].attributes.media_position;
-										obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
-										// obj["speaker.volume"] = resData[i].attributes["speaker.volume"];
-										// console.log('media-player-mitv-obj=='+obj);
-										obj.device_class = resData[i].attributes.device_class;
-										obj.app_id = resData[i].attributes.app_id;
-										obj.app_name = resData[i].attributes.app_name;
-										if (obj.entity_id && obj.state && obj.state == "playing" && obj.friendly_name && obj.domain) {
-											listMitvMediaPlayerTemp.push(obj);
-										}
-										obj.friendly_name1 = resData[i].attributes.friendly_name;
-										tvEntityIdsTemp.push(obj);
-										// let obj1 = {};
-										// obj1.entity_id = obj.entity_id;
-										// obj1.friendly_name1 = resData[i].attributes.friendly_name;
-										// tvEntityIdsTemp.push(obj1);
-										tvEntityIdTemp = obj.entity_id;
-										// console.log('obj===='+obj);
-										// console.log('tvEntityIdTemp='+tvEntityIdTemp);
-										wx.setStorageSync('tvEntityId', tvEntityIdTemp);
-									}
-								}
-
-								if ((resData[i].state && obj.domain && obj.domain == 'humidifier')
-								) {
-									// 加湿器
-									obj.min_humidity = resData[i].attributes.min_humidity;
-									obj.max_humidity = resData[i].attributes.max_humidity;
-									obj.humidity = resData[i].attributes.humidity;
-									obj.min = obj.min_humidity;
-									obj.max = obj.max_humidity;
-
-									humidityValueTemp = obj.humidity;
-									humidityMaxTemp = obj.max;
-									humidityMinTemp = obj.min;
-									// console.log('humidifier-obj=='+JSON.stringify(obj));
-									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
-										listHumidifierTemp.push(obj);
-									}
-								}
-
-
-								if ((resData[i].state && obj.domain && obj.domain == 'automation')) {
-									console.log("", resData[i].attributes.friendly_name);
-									if (resData[i].attributes.friendly_name.endsWith('起床模式')) {
-										modelList1.push(obj)
-									} else if (resData[i].attributes.friendly_name.endsWith('观影模式')) {
-										modelList2.push(obj)
-									} else if (resData[i].attributes.friendly_name.endsWith('睡眠模式')) {
-										modelList3.push(obj)
-									}
-								}
-
-								//  if((resData[i].state && obj.domain && obj.domain=='sensor')||
-								// (resData[i].state && obj.domain && obj.domain=='sensor' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listSensorTemp.push(obj);
-								//   }
-								//  }
-
-								//  if((resData[i].state && obj.domain && obj.domain=='text')||
-								// (resData[i].state && obj.domain && obj.domain=='text' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode);
-								//   obj.min = resData[i].attributes.min;
-								//   obj.max = resData[i].attributes.max;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listTextTemp.push(obj);
-								//   }
-								//  }
-
-								//  if((resData[i].state && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
-								// || (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
-								//  ){
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  listConversationTemp.push(obj)
-								//   }
-								//  }
-								//  if((resData[i].state && resData[i].attributes && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))||
-								// (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
-								//  ){
-								//   obj.volume = resData[i].attributes.speaker.volume;//音量
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  listConversation1Temp.push(obj)
-								//   }
-								//  }
-								//加湿器单独拿出来
-								// if((obj.friendly_name && obj.friendly_name.includes("加湿器"))||
-								// (resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								// && obj.friendly_name && obj.friendly_name.includes("加湿器"))
-								// ){
-								//  listHumidityTemp.push(obj)
-								// }
-								// }
-							}
-							listSwitchTemp = that.checkTVList(listSwitchTemp);
-							that.setData({
-								// status_beep: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_left_switch_service'), //实验室主灯
-								// status_led: that.getEntityState(res.data,'light.deerma_jsq2g_392f_indicator_light'), //加湿器 Indicator Light
-								// status_san: that.getEntityState(res.data,'switch.xwhzp_xwxfj_a441_diffuser'), //香薰机 Diffuser
-								// status_curtain: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_middle_switch_service'), //实验室侧灯
-								// status_door: that.getEntityState(res.data,'remote.xiaomi_lx06_f593_wifispeaker_4'), //智能音箱
-								// Temp: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_temperature'), //加湿器温度
-								// Humi: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_relative_humidity'), //加湿器湿度
-								// Light: that.getEntityStateValue(res.data,'number.xwhzp_xwxfj_a441_brightness'), //香薰机亮度
-								// LiquidLevel: that.getEntityStateValue(res.data,'sensor.xwhzp_xwxfj_a441_fragrance_liquid_left_level'), //香薰液浓度
-								modelList1,
-								modelList2,
-								modelList3,
-								listSwitch: listSwitchTemp,
-								listUnit: listUnitTemp,
-								listScroll: listScrollTemp,
-								listConversation: listConversationTemp,
-								listConversation1: listConversation1Temp,
-								listHumidity: listHumidityTemp,
-								listButton: listButtonTemp,
-								listSelect: listSelectTemp,
-								listClimate: listClimateTemp,
-								listMiotMediaPlayer: listMiotMediaPlayerTemp,
-								listMitvMediaPlayer: listMitvMediaPlayerTemp,
-								listHumidifier: listHumidifierTemp,
-								listSensor: listSensorTemp,
-								listText: listTextTemp,
-								tvEntityId: tvEntityIdTemp,
-								tvEntityIds: tvEntityIdsTemp,
-								climateMode: climateModeTemp,
-								temperatureHumidifyName: temperatureHumidifyNameTemp,
-								listCover: listCoverTemp,
-								listAromatherapyMachine: listAromatherapyMachineTemp,
-								// ecHumidifier: {
-								// 	onInit: that.initChartHumidifier
-								// },
-								sliderValueHumidifier: ''
-							})
-							if (listHumidifierTemp.length && humidityValue != humidityValueTemp) {
-								humidityValue = humidityValueTemp || 40;
-								humidityMin = humidityMinTemp;
-								humidityMax = humidityMaxTemp;
-								that.checkHumidityMarginLeft()
-								updateChartCircularProgressBarOption()
-							}
-							wx.setStorageSync('tvEntityIds', tvEntityIdsTemp);
-							// console.log('listMiotMediaPlayerTemp='+JSON.stringify(listMiotMediaPlayerTemp));
-							// console.log('listHumidityTemp='+JSON.stringify(listHumidityTemp));
-							// console.log('listClimateTemp='+JSON.stringify(listClimateTemp));
-							// console.log('listSwitchTemp='+JSON.stringify(listSwitchTemp));
-							console.log('tvEntityIdsTemp=' + JSON.stringify(tvEntityIdsTemp));
-							// console.log('listMitvMediaPlayerTemp='+JSON.stringify(listMitvMediaPlayerTemp));
-							console.log('listHumidifierTemp=' + JSON.stringify(listHumidifierTemp));
-						},
-					});
-
-
-
-
-
-					// 	} catch (error) {
-					// 	  console.error(error);
-					// 	}
-
-					//   },
-					// });
-
-				} catch (error) {
-					console.error(error);
-				}
-
-			},
-			fail: function (error) {
-				console.error('error', error);
-				that.setData({
-					isLoading: false,
-				});
-			}
-		});
-
-
-
-		let end = Date.now(); // 再次获取当前时间(毫秒)
-		// console.log('end=='+end);
-		let executionTime = end - start;
-		// console.log(`myFunctionToTest 执行时间为: ${executionTime} 毫秒`);
-		return true;
-	},
-	getHADataStart(that, hotelcode, roomcode) {
-		let start = Date.now(); // 获取当前时间(毫秒)
-		console.log('start==' + start);
-		var that = this;
-
-		wx.request({
-			url: `${aipushApi}/getha`, //
-			method: 'POST',
-			//   header: {
-			// 	  'content-type': 'application/json', // 默认值
-			// 	  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-			// },
-			data: {
-				"locations": hotelcode, "room": (hotelcode && hotelcode.includes('hotel')) ? roomcode : "", "token": token_push
-			},
-			success(ress) {
-				if (!ress || !ress.data) {
-					console.error("getha(),没有获取到数据");
-					return;
-				}
-				var resData = ress.data
-				console.log("resData-==" + JSON.stringify(resData));
-				console.log("resData.loc-==" + JSON.stringify(resData.loc));
-				homeApi_https = resData.loc + "/api";
-				homeApiLater_https = resData.loc;
-				token = resData.token;
-				// console.log('res.data='+JSON.stringify(resData));
-				if (ress.data.code == "400") {
-					console.error("400错误!");
-					return;
-				}
-				if (ress.data.code == "401") {
-					console.error("401错误!");
-					return;
-				}
-				try {
-					//获取HA 设备状态数据
-					// 	wx.request({
-					// 	  url: `${homeApi_https}/states`,
-					// 	  method: 'GET',
-					// 	   header: {
-					// 			  'content-type': 'application/json', // 默认值
-					// 		  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-					// 		},
-					// 	  success(res) {
-					// 	  if(!res || !res.data){
-					// 		  that.setData({
-					// 			isLoading: false,  
-					// 		  });
-					// 		  return;
-					// 	  }
-
-					// var resData = res.data
-					// // console.log('res.data='+JSON.stringify(resData));
-					// if (res.data.code == "400") {
-					//   console.error("400错误!");
-					//   return;
-					// }
-					// if (res.data.code == "401") {
-					//   console.error("401错误 --- 请检查你的API或Key是否正确!");
-					//   return;
-					// }
-					// try {
-
-
-
-
-
-					// const {
-					//   now
-					// } = res.data;
-					//  console.log('res.data1='+JSON.stringify(resData));
-					//  res.data.find(function (obj) {
-					//   console.log('obj='+obj); 
-					//  })
-					//  res.data.forEach((item, index) => {
-					// console.log(index, item); 
-					//  });
-					var listCoverTemp = [];
-					var listSwitchTemp = [];
-					var listScrollTemp = [];
-					var listUnitTemp = [];
-					var listConversationTemp = [];
-					var listConversation1Temp = [];
-					var listHumidityTemp = [];
-					var listButtonTemp = [];
-					var listSelectTemp = [];
-					var listClimateTemp = [];
-					var listMiotMediaPlayerTemp = [];
-					var listMitvMediaPlayerTemp = [];
-					var listHumidifierTemp = [];
-					var listSensorTemp = [];
-					var listTextTemp = [];
-
-					var tvEntityIdTemp = '';
-					var tvEntityIdsTemp = [];
-					var listAromatherapyMachineTemp = [];
-
-					var humidityValueTemp = 0;
-					var humidityMaxTemp = 0;
-					var humidityMinTemp = 0;
-					var climateModeTemp = '';
-					var temperatureHumidifyNameTemp = '温度';
-					var modelList1 = [];
-					var modelList2 = [];
-					var modelList3 = [];
-					var entityIdList = [];
-					const res = wx.getStorageSync('res');
-					const home_room = wx.getStorageSync('res').home_room;
-					// console.log('entity=====@==='+entity);
-					wx.request({
-						url: `${homeApi_https}/aidsleep/entity`, //获取空气数据
-						method: 'POST',
-						header: {
-							'content-type': 'application/json', // 默认值
-							'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
-						},
-						//
-						data: {
-							"template": "{{ label_entities('" + (entity) + "') }}"
-						},
-						success(resTemplate) {
-							let mid = Date.now(); // 再次获取当前时间(毫秒)
-							// console.log('mid=='+mid);
-							if (!resTemplate || !resTemplate.data) {
-								console.log('no data:' + mid);
-								return;
-							}
-							let resData = resTemplate.data;
-							// resData = resData.filter(item1 => {  
-							//   return JSON.parse(that.replaceAll(resTemplate.data,'\'','\"')).find(item2 => item2 === item1.entity_id) !== undefined;  
-							// });
-							console.log("resData-union=" + JSON.stringify(resData));
-							// console.log('entityIdList-resTemplate====='+JSON.stringify(resTemplate.data));
-							for (let i = 0; i < resData.length; i++) {
-								// if(resTemplate.data.includes(resData[i].entity_id) && that.checkFuzzyMatch(resData[i])){
-								var obj = {};
-								obj.entity_id = resData[i].entity_id;//实体ID
-								obj.parent_entity_id = resData[i].parent_entity_id;//父实体ID
-								//api/services/<domain>/<service>
-								if (resData[i].entity_id) {
-									obj.domain = resData[i].entity_id.split(".")[0];
-								}
-								obj.state = (resData[i].state == 'unknown' ? "未知" : resData[i].state);
-								if (resData[i].attributes && resData[i].attributes.friendly_name) {
-									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode); //设备名称
-
-									if (obj.friendly_name.includes("灯带") || obj.friendly_name.includes("吸顶灯")) {
-										obj.imgSrc = '/static/icons/ic_dd_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
-									} else if (obj.friendly_name.includes("走廊灯")) {
-										obj.imgSrc = '/static/icons/ic_zld_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_zld_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #FFEEFA 0%, #FFFFFF 50%)';
-									} else if (obj.friendly_name.includes("筒灯")) {
-										obj.imgSrc = '/static/icons/ic_td_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_td_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #EBF0FF 0%, #FFFFFF 50%)';
-									} else if (obj.friendly_name.includes("主灯")) {
-										obj.imgSrc = '/static/icons/ic_zd_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_zd_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #EFE7FF 0%, #FFFFFF 50%)';
-									} else if (obj.friendly_name.includes("气扇")) {
-										obj.imgSrc = '/static/icons/ic_pqs_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_pqs_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #E3FFE6 0%, #FFFFFF 53%)';
-									} else if (obj.friendly_name.includes("电视")) {
-										obj.imgSrc = '/static/icons/ic_ds_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
-										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
-									} else if (obj.friendly_name.includes("空气净化器")) {
-										obj.imgSrc = '/static/icons/ic_kqjhq_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_kqjhq_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #EBFAFF 0%, #FFFFFF 50%)';
-
-									} else if (obj.friendly_name.includes("香薰机雾化")) {
-										obj.imgSrc = '/static/icons/ic_xxjwh.svg';
-										obj.selectedImgSrc = '/static/icons/ic_xxjwh.svg';
-
-									} else if (obj.friendly_name.endsWith('香薰机') || obj.friendly_name.endsWith('香薰机开关')) {
-										obj.imgSrc = '/static/icons/ic_xxj.svg';
-										obj.selectedImgSrc = '/static/icons/ic_xxj.svg';
-									}
-									else if (obj.friendly_name.includes("灯")) {
-										obj.imgSrc = '/static/icons/ic_dd_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
-										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
-									}
-
-									else {
-										obj.imgSrc = '/static/icons/ic_ds_1.svg';
-										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
-										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
-									}
-
-								}
-								if (resData[i].attributes && resData[i].attributes.home_room) {
-									obj.home_room = resData[i].attributes.home_room.split(' ')[1]; //房间号
-								}
-								if ((resData[i].state && (resData[i].state == 'on' || resData[i].state == 'off')) && that.checkFuzzyMatch(resData[i])
-								) {
-									if (resData[i].state == 'on') {
-										obj.service = 'turn_on';
-									} else if (resData[i].state == 'off') {
-										obj.service = 'turn_off';
-									}
-									//截取字符串,防止开关设备名称过长
-									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
-									//是否 是香薰机灯光
-									obj.isAromlight = obj.friendly_name.includes('香薰机灯光')
-									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)
-										}
-									} else if ((obj.isAromlight || obj.isAromAtomization || obj.isAromatherapy) && checkState(obj.state)) {
-										listAromatherapyMachineTemp.push(obj)
-									}
-								}
-
-								if ((resData[i].state && obj.domain && obj.domain == 'cover') && that.checkFuzzyMatch(resData[i])
-								) {
-									obj.current_position = resData[i].attributes.current_position;
-									obj.target_position = resData[i].attributes.target_position;
-									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
-									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
-										listCoverTemp.push(obj)
-									}
-								}
-
-								//  if((resData[i].state && obj.domain && obj.domain=='number')||
-								// (resData[i].state && obj.domain && obj.domain=='number' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.min = resData[i].attributes.min;
-								//   obj.max = resData[i].attributes.max;
-								//   obj.step = resData[i].attributes.step;
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   if(resData[i].state!='unknown'){
-								// 	  obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
-								//   }
-								//   if((resData[i].attributes.min || resData[i].attributes.max) && resData[i].attributes.unit_of_measurement!='rgb' && resData[i].attributes.unit_of_measurement!='minutes'){
-								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  	listScrollTemp.push(obj);
-								// 	  }
-								//   }else if((resData[i].attributes.min || resData[i].attributes.max) && (resData[i].attributes.unit_of_measurement=='rgb' || resData[i].attributes.unit_of_measurement=='minutes')){
-								// 	  if(resData[i].state!='unknown'){
-								// 	  	obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
-								// 	  }
-								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  	listUnitTemp.push(obj);
-								// 	  }
-								//   }
-								//  }
-								//  if((resData[i].state && obj.domain && obj.domain=='button')||
-								// (resData[i].state && obj.domain && obj.domain=='button' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listButtonTemp.push(obj);
-								//   }
-								//  }
-								//  if((resData[i].state && obj.domain && obj.domain=='select')||
-								// (resData[i].state && obj.domain && obj.domain=='select' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   obj.options = resData[i].attributes.options;
-								//   obj.selectedIndex = 0;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listSelectTemp.push(obj);
-								//   }
-								//  }
-								if ((resData[i].state && obj.domain && obj.domain == 'climate' && resData[i].attributes.entity_class == 'MiirClimateEntity')
-								) {
-									climateModeTemp = obj.state;
-									obj.temperature = resData[i].attributes.temperature;
-									obj.temperatureTemp = resData[i].attributes.temperature;
-									obj.min_temp = resData[i].attributes.min_temp;
-									obj.max_temp = resData[i].attributes.max_temp;
-									obj.hvac_modes = resData[i].attributes.hvac_modes;
-									obj.fan_modes = resData[i].attributes.fan_modes;
-									obj.fan_mode = resData[i].attributes.fan_mode;
-									obj.target_temp_step = resData[i].attributes.target_temp_step;
-									if (obj.state == 'auto') {
-										temperatureHumidifyNameTemp = '自动';
-									}
-
-									if (obj.state == 'heat') {
-										temperatureHumidifyNameTemp = '制热';
-									}
-									if (obj.state == 'cool') {
-										temperatureHumidifyNameTemp = '制冷';
-									}
-									if (obj.state == 'dry') {
-										temperatureHumidifyNameTemp = '除湿';
-									}
-									if (obj.state == 'fan_only') {
-										temperatureHumidifyNameTemp = '送风';
-									}
-									if (obj.state == 'off') {
-										temperatureHumidifyNameTemp = '关闭';
-									}
-
-									if (obj.entity_id && obj.state && obj.friendly_name && obj.domain) {
-										listClimateTemp.push(obj);
-									}
-								}
-								if ((resData[i].state && obj.domain && obj.domain == 'media_player' && resData[i].attributes.entity_class == 'MiotMediaPlayerEntity') && that.checkFuzzyMatch(resData[i])
-								) {
-									// obj["speaker.volume"] = resData[i].attribute["speaker.volume"];
-									obj.repeat = resData[i].attributes.repeat;
-									obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
-									obj.media_title = resData[i].attributes.media_title;
-									obj.media_artist = resData[i].attributes.media_artist;
-									obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
-									obj.media_duration = resData[i].attributes.media_duration;
-									obj.media_position = resData[i].attributes.media_position;
-									obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
-									// obj.microphone.mute = resData[i].attributes.microphone.mute;
-									// obj.speaker.mute = resData[i].attributes.speaker.mute;
-									// console.log('media-player-miot-obj=='+obj);
-									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
-										listMiotMediaPlayerTemp.push(obj);
-									}
-								}
-
-								//  if((resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity')||
-								// (resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.volume_level = resData[i].attributes.volume_level;
-								//   obj.is_volume_muted = resData[i].attributes.is_volume_muted;
-								//   obj.source = resData[i].attributes.source;
-								//   obj.entity_picture = resData[i].attributes.entity_picture?"background-image: url('"+`${homeApiLater_https}`+resData[i].attributes.entity_picture+"');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;":"background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
-								//   obj.media_title = resData[i].attributes.media_title;
-								//   obj.media_artist = resData[i].attributes.media_artist;
-								//   obj.volume_level = resData[i].attributes.volume_level?(resData[i].attributes.volume_level * 100):0;
-								//   obj.media_duration = resData[i].attributes.media_duration;
-								//   obj.media_position = resData[i].attributes.media_position;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listMitvMediaPlayerTemp.push(obj);
-								//   }
-								//  }
-
-								if ((resData[i].state && obj.domain && obj.domain == 'media_player') && that.checkFuzzyMatch(resData[i])
-								) {
-									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
-									if (obj.entity_id.includes('teevee') || (obj.friendly_name && obj.friendly_name.includes('电视'))) {
-										obj.volume_level = resData[i].attributes.volume_level;
-										obj.is_volume_muted = resData[i].attributes.is_volume_muted;
-										obj.source = resData[i].attributes.source;
-										obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
-										obj.media_title = resData[i].attributes.media_title;
-										obj.media_artist = resData[i].attributes.media_artist;
-										obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
-										obj.media_duration = resData[i].attributes.media_duration;
-										obj.media_position = resData[i].attributes.media_position;
-										obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
-										// obj["speaker.volume"] = resData[i].attributes["speaker.volume"];
-										// console.log('media-player-mitv-obj=='+obj);
-										obj.device_class = resData[i].attributes.device_class;
-										obj.app_id = resData[i].attributes.app_id;
-										obj.app_name = resData[i].attributes.app_name;
-										if (obj.entity_id && obj.state && obj.state == "playing" && obj.friendly_name && obj.domain) {
-											listMitvMediaPlayerTemp.push(obj);
-										}
-										obj.friendly_name1 = resData[i].attributes.friendly_name;
-										tvEntityIdsTemp.push(obj);
-										// let obj1 = {};
-										// obj1.entity_id = obj.entity_id;
-										// obj1.friendly_name1 = resData[i].attributes.friendly_name;
-										// tvEntityIdsTemp.push(obj1);
-										tvEntityIdTemp = obj.entity_id;
-										// console.log('obj===='+obj);
-										// console.log('tvEntityIdTemp='+tvEntityIdTemp);
-										wx.setStorageSync('tvEntityId', tvEntityIdTemp);
-									}
-								}
-
-								if ((resData[i].state && obj.domain && obj.domain == 'humidifier')
-								) {
-									obj.min_humidity = resData[i].attributes.min_humidity;
-									obj.max_humidity = resData[i].attributes.max_humidity;
-									obj.humidity = resData[i].attributes.humidity;
-									obj.min = obj.min_humidity;
-									obj.max = obj.max_humidity;
-
-									humidityValueTemp = obj.humidity;
-									humidityMaxTemp = obj.max;
-									humidityMinTemp = obj.min;
-									// console.log('humidifier-obj=='+JSON.stringify(obj));
-									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
-										listHumidifierTemp.push(obj);
-									}
-								}
-
-
-								if ((resData[i].state && obj.domain && obj.domain == 'automation')) {
-									console.log("", resData[i].attributes.friendly_name);
-									if (resData[i].attributes.friendly_name.endsWith('起床模式')) {
-										modelList1.push(obj)
-									} else if (resData[i].attributes.friendly_name.endsWith('观影模式')) {
-										modelList2.push(obj)
-									} else if (resData[i].attributes.friendly_name.endsWith('睡眠模式')) {
-										modelList3.push(obj)
-									}
-								}
-
-								//  if((resData[i].state && obj.domain && obj.domain=='sensor')||
-								// (resData[i].state && obj.domain && obj.domain=='sensor' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
-								//   obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listSensorTemp.push(obj);
-								//   }
-								//  }
-
-								//  if((resData[i].state && obj.domain && obj.domain=='text')||
-								// (resData[i].state && obj.domain && obj.domain=='text' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  )
-								//  ){
-								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode);
-								//   obj.min = resData[i].attributes.min;
-								//   obj.max = resData[i].attributes.max;
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	listTextTemp.push(obj);
-								//   }
-								//  }
-
-								//  if((resData[i].state && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
-								// || (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
-								//  ){
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  listConversationTemp.push(obj)
-								//   }
-								//  }
-								//  if((resData[i].state && resData[i].attributes && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))||
-								// (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								//  && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
-								//  ){
-								//   obj.volume = resData[i].attributes.speaker.volume;//音量
-								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
-								// 	  listConversation1Temp.push(obj)
-								//   }
-								//  }
-								//加湿器单独拿出来
-								// if((obj.friendly_name && obj.friendly_name.includes("加湿器"))||
-								// (resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
-								// && obj.friendly_name && obj.friendly_name.includes("加湿器"))
-								// ){
-								//  listHumidityTemp.push(obj)
-								// }
-								// }
-							}
-							listSwitchTemp = that.checkTVList(listSwitchTemp);
-
-							that.setData({
-								// status_beep: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_left_switch_service'), //实验室主灯
-								// status_led: that.getEntityState(res.data,'light.deerma_jsq2g_392f_indicator_light'), //加湿器 Indicator Light
-								// status_san: that.getEntityState(res.data,'switch.xwhzp_xwxfj_a441_diffuser'), //香薰机 Diffuser
-								// status_curtain: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_middle_switch_service'), //实验室侧灯
-								// status_door: that.getEntityState(res.data,'remote.xiaomi_lx06_f593_wifispeaker_4'), //智能音箱
-								// Temp: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_temperature'), //加湿器温度
-								// Humi: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_relative_humidity'), //加湿器湿度
-								// Light: that.getEntityStateValue(res.data,'number.xwhzp_xwxfj_a441_brightness'), //香薰机亮度
-								// LiquidLevel: that.getEntityStateValue(res.data,'sensor.xwhzp_xwxfj_a441_fragrance_liquid_left_level'), //香薰液浓度
-								modelList1,
-								modelList2,
-								modelList3,
-								listSwitch: listSwitchTemp,
-								listUnit: listUnitTemp,
-								listScroll: listScrollTemp,
-								listConversation: listConversationTemp,
-								listConversation1: listConversation1Temp,
-								listHumidity: listHumidityTemp,
-								listButton: listButtonTemp,
-								listSelect: listSelectTemp,
-								listClimate: listClimateTemp,
-								listMiotMediaPlayer: listMiotMediaPlayerTemp,
-								listMitvMediaPlayer: listMitvMediaPlayerTemp,
-								listHumidifier: listHumidifierTemp,
-								listSensor: listSensorTemp,
-								listText: listTextTemp,
-								tvEntityId: tvEntityIdTemp,
-								tvEntityIds: tvEntityIdsTemp,
-								climateMode: climateModeTemp,
-								temperatureHumidifyName: temperatureHumidifyNameTemp,
-								listCover: listCoverTemp,
-								listAromatherapyMachine: listAromatherapyMachineTemp,
-								// ecHumidifier: {
-								// 	onInit: that.initChartHumidifier
-								// },
-								sliderValueHumidifier: '',
-								isLoading: false,
-							})
-							if (listHumidifierTemp.length && humidityValue != humidityValueTemp) {
-								humidityValue = humidityValueTemp || 40;
-								humidityMin = humidityMinTemp;
-								humidityMax = humidityMaxTemp;
-								that.checkHumidityMarginLeft()
-								that.initChartHumidifier();
-							}
-							wx.setStorageSync('tvEntityIds', tvEntityIdsTemp);
-						},
-					});
-					let mid = Date.now(); // 获取当前时间(毫秒)
-					console.log('mid==' + mid);
-					console.log('start==' + start);
-					console.log('mid-start==' + (mid - start));
-					// that.setData({
-					// 	isLoading: true, 
-					//   });
-
-
-
-
-					// 	} catch (error) {
-					// 	  console.error(error);
-					// 	}
-
-					//   },
-					//   fail: function (error) {
-					// 	  console.error('error', error);  
-					// 	  that.setData({
-					// 		isLoading: false,  
-					// 	  });
-					// 	} 
-					// });
-
-
-				} catch (error) {
-					console.error(error);
-					that.setData({
-						isLoading: false,
-					});
-				}
-
-			},
-			fail: function (error) {
-				console.error('error', error);
-				that.setData({
-					isLoading: false,
-				});
-			}
-		});
-
-
-
-		let end = Date.now(); // 再次获取当前时间(毫秒)
-		console.log('end==' + end);
-		let executionTime = end - start;
-		console.log(`myFunctionToTest 执行时间为: ${executionTime} 毫秒`);
-		return true;
-	},
-	checkTVList(items = []) {
-		// 创建一个新数组来存放不包含"电视"的对象  
-		let newItems = [];
-		// 存放包含"电视"的对象  
-		let tvItems = [];
-
-		// 遍历原数组  
-		items.forEach(item => {
-			// 检查name是否包含"电视"  
-			if (item.friendly_name.includes("电视")) {
-				tvItems.push(item);
-			} else {
-				newItems.push(item);
-			}
-		});
-
-		// 将包含"电视"的对象添加到新数组的末尾  
-		newItems.push(...tvItems);
-
-		// 如果需要,用新数组替换原数组  
-		items = newItems;
-		return items;
-	},
-	imageLoad: function () {
-		this.setData({
-			isLoading: false,
-		});
-		console.log('图片渲染完成');
-	},
-	startInterval: function () {
-		// 使用 setInterval 创建定时任务,每8秒执行一次 this.myMethod 方法 
-		var that = this;
-		that.clearInterval();
-		// this.intervalId = setInterval(() => {  
-		//   that.getHAData(that,that.data.hotelcode,that.data.roomcode);  
-		// }, 6000);
-		this.data.intervalId1 = setInterval(() => {
-			that.getHAData(that, that.data.hotelcode, that.data.roomcode);
-		}, 5000);
-
-		// 第二个定时器,每2秒执行一次  
-		this.data.intervalId2 = setInterval(() => {
-			// 这里执行你的代码  
-			that.setData({
-				isClickedPrevSong: false,
-				isClickedTogglePlayPause: false,
-				isClickedNextSong: false,
-				isClickedOnHumidifierUp: false,
-				isClickedOnHumidifierDown: false,
-				isClickedOnClimateAuto: false,
-				isClickedOnClimateUp: false,
-				isClickedToggleAromlight: false,//香薰机灯光
-			});
-		}, 300);
-	},
-	clearInterval: function () {
-		// 清除定时任务  
-		// if (this.intervalId) {  
-		//   clearInterval(this.intervalId);  
-		//   this.intervalId = null;  
-		// }  
-		if (this.data.intervalId1) {
-			clearInterval(this.data.intervalId1);
-			this.data.intervalId1 = null; // 可选,但建议清除以避免潜在的错误  
-		}
-
-		// 停止第二个定时器  
-		if (this.data.intervalId2) {
-			clearInterval(this.data.intervalId2);
-			this.data.intervalId2 = null; // 可选,但建议清除以避免潜在的错误  
-		}
-	},
-	stopTouchMove: function (e) {
-		return false;
-	},
-	truncateString: function (str, roomcode) {
-		if (!str) return ''
-		let strR = str.replace(roomcode, '')
-		if (strR.length <= 6) {
-			// 如果字符串长度小于等于5,直接返回原字符串  
-			return strR;
-		} else {
-			// 如果字符串长度在6到9之间,返回后6个字符(此时没有前部分可拼接)  
-			return strR.slice(-6);
-		}
-	},
-	onReady() {
-		console.log('页面渲染完成')
-		// 获取组件
-		// 确保页面渲染完成后查找节点
-		if (!wx.getStorageSync('hasAuth')) {
-			this.setData({ showAuthorizedDialog: true })
-		} else {
-			this.showData();
-		}
-
-	},
-	authorizationSuccessful() {
-		console.log("授权成功");
-		this.setData({ showAuthorizedDialog: false })
-		this.showData();
-	},
-	showData() {
-		const that = this;
-		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
-			wx.showModal({
-				title: '提示',
-				content: '请先扫描房间二维码',
-				showCancel: false
-			});
-
-			setTimeout(function () {
-				wx.reLaunch({
-					url: '/pages/scan/scan',
-				})
-			}, 2000) // 设置延时时间,单位为毫秒
-		} else {
-			let hotelcodeTemp = '';
-			let roomcodeTemp = '';
-			if (wx.getStorageSync('res').result.split('|').length != 2) {
-				wx.showModal({
-					title: '提示',
-					content: '房间二维码不正确,请重新扫码',
-					showCancel: false
-				});
-
-				setTimeout(function () {
-					wx.reLaunch({
-						url: '/pages/scan/scan',
-					})
-				}, 2000) // 设置延时时间,单位为毫秒
-			}
-			hotelcodeTemp = wx.getStorageSync('res').result.split('|')[0];
-			roomcodeTemp = wx.getStorageSync('res').result.split('|')[1];
-			entity = roomcodeTemp;
-			if (entity == 'labs') {
-				entity = '公司实验室';
-				wx.setStorageSync('roomname', '604');
-			} else {
-				wx.setStorageSync('roomname', entity);
-			}
-			this.setData({
-				isLoading: true,
-				hotelcode: hotelcodeTemp,
-				roomcode: roomcodeTemp,
-			});
-			if (this.getHADataStart(this, hotelcodeTemp, roomcodeTemp)) {
-				// 页面加载时开始定时任务  
-				// this.startInterval();
-			}
-
-			setTimeout(() => {
-				that.showOther();
-			}, 500);
-
-
-		}
-	},
-	showOther() { 
-		const that = this;
-		that.startInterval();
-		
-	},
-	onLoad(option) {
-
-	},
-	mounted() {
-
-	},
-	onHide() {
-		// wx.clearStorage();
-		// 页面卸载时清除定时任务
-		this.clearInterval();
-		// if(this.tcp){
-		// 	this.tcp.onClose(() => {
-		//   // this.infoList.push('关闭')
-		//   console.log('tcp关闭');
-		//   this.tcp.close()
-		// })
-		// }
-	},
-	onUnload() {
-		//wx.clearStorage();
-		// 页面卸载时清除定时任务  
-		this.clearInterval();
-		// if(this.tcp){
-		// 	this.tcp.onClose(() => {
-		//   // this.infoList.push('关闭')
-		//   console.log('tcp关闭');
-		//   this.tcp.close()
-		// })
-		// }
-		// if (this.data.observer) {  
-		//   this.data.observer.disconnect();  
-		// } 
-	},
-	showLoading: function () {
-		wx.showToast({
-			title: '加载中',
-			icon: 'loading',
-		})
-	},
-	cancelLoading: function () {
-		wx.hideToast()
-	},
-	onShow() {
-		const app = getApp();
-		app.globalData.selectedTabIndex = 0;
-		this.getTabBar().setData({
-			selected: 0
-		})
-		var that = this;
-		that.setData({
-			currentMenuTabIndex: -1
-		})
-		wx.getLocation({
-			type: "wgs84",
-			success(res) {
-				const latitude = res.latitude;
-				const longitude = res.longitude;
-				const key = hefengKey;
-				wx.request({
-					url: `${geoApi}location=${longitude},${latitude}&key=${key}`, //获取地理位置
-					success(res) {
-						console.log('getLocation=' + JSON.stringify(res.data));
-						if (res.data.code == "401") {
-							console.error("HUAQING --- 请检查你的和风天气API或Key是否正确!");
-							return;
-						}
-						try {
-							const {
-								location
-							} = res.data;
-							that.setData({
-								area: location[0].name, //城区
-								city: location[0].adm2 //城市
-							})
-						} catch (error) {
-							console.error(error);
-						}
-					},
-				});
-				wx.request({
-					url: `${hefengWeather}location=${longitude},${latitude}&key=${key}`, //获取实时天气数据
-					success(res) {
-						console.log("实时天气==" + JSON.stringify(res.data));
-						if (res.data.code == "401") {
-							console.error("HUAQING --- 请检查你的和风天气API或Key是否正确!");
-							return;
-						}
-						try {
-							const {
-								now
-							} = res.data;
-
-							var weatherBg = "/subpages/images/weather/qing.png"
-							if (now.text.includes("晴")) {
-								weatherBg = "/subpages/images/weather/qing.png"
-							} else if (now.text.includes("多云") || now.text.includes("阴")) {
-								weatherBg = "/subpages/images/weather/duoyun.png"
-							} else if (now.text.includes("雷") || now.text.includes("雨")) {
-								weatherBg = "/subpages/images/weather/leiyu.png"
-							} else if (now.text.includes("雨")) {
-								weatherBg = "/subpages/images/weather/leiyu.png"
-							} else if (now.text.includes("雪")) {
-								weatherBg = "/subpages/images/weather/xue.png"
-							} else if (now.text.includes("雾") || now.text.includes("霾")) {
-								weatherBg = "/subpages/images/weather/wumai.png"
-							}
-							that.setData({
-								weatherBg,
-								weather: now.text, // 天气
-								w_temp: now.temp, // 温度
-								w_humidity: now.humidity, // 湿度
-							})
-						} catch (error) {
-							console.error(error);
-						}
-
-					},
-				});
-				wx.request({
-					url: `${hefengAir}location=${longitude},${latitude}&key=${key}`, //获取空气数据
-					success(res) {
-						console.log("空气数据==" + JSON.stringify(res.data));
-						if (res.data.code == "401") {
-							console.error("HUAQING --- 请检查你的和风天气API或Key是否正确!");
-							return;
-						}
-						try {
-							const {
-								now
-							} = res.data;
-							that.setData({
-								airText: now.category, //空气质量
-								airValue: now.aqi //空气指数
-							})
-						} catch (error) {
-							console.error(error);
-						}
 
-					},
-				});
-			},
-		});
-	}
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    showAuthorizedDialog: false,
+    showTipsA: false,
+    showTipsB: false,
+    hasAuth: false,
+    avatarUrl: defaultAvatarUrl,
+    nickName: "用户登录",
+    phoneNumber: "",
+    menuCardList: [{
+      icon: "../../static/index/icon/ic_fjkz.png",
+      bgIcon: "../../static/index/bg/bg_fjkz.png",
+      title: "房间控制",
+      type: "navigate",
+      color: "#3C84D9",
+      bgColor: "#EEF4FF",
+      url: "/subpages/main/main"
+    }, {
+      icon: "../../static/index/icon/ic_sm.png",
+      bgIcon: "../../static/index/bg/bg_sm.png",
+      title: "扫码",
+      type: "navigate",
+      color: "#10B09C",
+      bgColor: "#E6FFFC",
+      url: "/subpages/scan/scan"
+    }, {
+      icon: "../../static/index/icon/ic_jrsmbg.png",
+      bgIcon: "../../static/index/bg/bg_jrsmbg.png",
+      title: "今日睡眠报告",
+      type: "navigate",
+      color: "#8658B9",
+      bgColor: "#F6F3FF",
+      url: "/subpages/data/data"
+    }, {
+      icon: "../../static/index/icon/ic_lssmbg.png",
+      bgIcon: "../../static/index/bg/bg_lssmbg.png",
+      title: "历史睡眠报告",
+      type: "navigate",
+      color: "#BB6268",
+      bgColor: "#FFF6F7",
+      url: "/subpages/sleepReport/sleepReport"
+    }, {
+      icon: "../../static/index/icon/ic_wdcd.png",
+      bgIcon: "../../static/index/bg/bg_wdcd.png",
+      title: "我的床垫",
+      type: "navigate",
+      color: "#317A9B",
+      bgColor: "#E6FFFC",
+      url: ""
+    }, {
+      icon: "../../static/index/icon/ic_zxsc.png",
+      bgIcon: "../../static/index/bg/bg_zxsc.png",
+      title: "在线商城",
+      type: "miniProgram",
+      color: "#C2714B",
+      bgColor: "#FFF8F4",
+      appId: "wx63f79b3d61ba632b" || "gh_78da4ac5d0cc",
+      url: "pages/home/dashboard/index"
+    }],
+    menuList: [{
+      icon: "../../static/mine/dcwj.png",
+      title: "调查问卷",
+      type: "navigate",
+      url: "/subpages/testSAS/testSAS"
+    }, {
+      icon: "../../static/mine/zxkf.png",
+      title: "在线客服",
+      type: "contact",
+      url: ""
+    }, {
+      icon: "../../static/mine/bzzx.png",
+      title: "帮助中心",
+      type: "navigate",
+      url: ""
+    }, {
+      icon: "../../static/mine/gywm.png",
+      title: "关于我们",
+      type: "navigate",
+      url: ""
+    }]
+
+  },
+  onCloseTipsDialog() { 
+    this.setData({
+      showTipsA: false,
+      showTipsB:false
+    })
+  },
+  onMenuClick(e) {
+    console.log(e.currentTarget.dataset);
+    const { index } = e.currentTarget.dataset;
+    var hasAuth = wx.getStorageSync("hasAuth");
+    switch (index - 0) {
+      case 0:
+      case 1:
+        // need Login
+        if (hasAuth) {
+          this.toPage(index);
+        } else {
+          this.showDialog();
+        }
+        break;
+      default:
+        this.toPage(index);
+        break;
+    }
+
+  },
+  toPage(index) {
+    const type = this.data.menuList[index].type;
+    const url = this.data.menuList[index].url;
+    if (!url) {
+      return
+    }
+    if (type == 'switchTab') {
+      wx.switchTab({
+        url: url
+      })
+    } else if (type == 'navigate') {
+      wx.navigateTo({
+        url: url
+      })
+    } else if (type == 'miniProgram') {
+      //develop开发版;trial体验版;release正式版
+      const appId = this.data.menuCardList[index].appId;
+      wx.navigateToMiniProgram({
+        appId: appId,
+        path: url,
+        extraData: {
+        },
+        envVersion: 'develop',
+        success(res) {
+          // 打开成功  
+        }
+      })
+    }
+  },
+  onMenuCardClick(e) {
+    console.log(e.currentTarget.dataset);
+    const { index } = e.currentTarget.dataset;
+    var hasAuth = wx.getStorageSync("hasAuth");
+    switch (index - 0) {
+      case 0:
+      case 1:
+        // need Login
+        if (hasAuth) {
+          this.toCardPage(index);
+        } else {
+          this.showDialog();
+        }
+        break;
+      default:
+        this.toCardPage(index);
+        break;
+    }
+  },
+  toCardPage(index) {
+    const type = this.data.menuCardList[index].type;
+    const url = this.data.menuCardList[index].url;
+    if (!url) {
+      return
+    }
+    if (type == 'switchTab') {
+      wx.switchTab({
+        url: url
+      })
+    } else if (type == 'navigate') {
+      wx.navigateTo({
+        url: url
+      })
+    } else if (type == 'miniProgram') {
+      //develop开发版;trial体验版;release正式版
+      const appId = this.data.menuCardList[index].appId;
+      wx.navigateToMiniProgram({
+        appId: appId,
+        path: url,
+        extraData: {
+        },
+        envVersion: 'develop',
+        success(res) {
+          // 打开成功  
+        }
+      })
+    }
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+    this.checkAuth()
+  },
+  showDialog() {
+    var hasAuth = wx.getStorageSync("hasAuth");
+    if (hasAuth) {
+      return
+    }
+    this.setData({
+      showAuthorizedDialog: true
+    })
+  },
+  checkAuth() {
+    var hasAuth = wx.getStorageSync("hasAuth");
+    this.setData({
+      hasAuth: hasAuth
+    })
+    if (hasAuth) {
+      var userInfo = wx.getStorageSync("userInfo");
+      this.setData({
+        nickName: userInfo.nickName || "用户登录",
+        avatarUrl: userInfo.avatarUrl || defaultAvatarUrl,
+        phoneNumber: userInfo.phoneNumber || ""
+      })
+    }
+    return hasAuth;
+  },
+  authorizationSuccessful() {
+    console.log("授权成功");
+    this.setData({ showAuthorizedDialog: false })
+    this.checkAuth();
+  },
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
 })

+ 1 - 3
pages/index/index.json

@@ -1,8 +1,6 @@
 {
   "usingComponents": {
-    "ec-canvas": "../../ec-canvas/ec-canvas",
-    "authorized-login-dialog": "../../componets/authorized-login-dialog/authorizedLoginDialog"
-  },
+    "authorized-login-dialog": "../../componets/authorized-login-dialog/authorizedLoginDialog"},
   "navigationBarRightButton": {
     "hide": true
   },

+ 53 - 371
pages/index/index.wxml

@@ -1,391 +1,73 @@
-<!-- index.wxml -->
-<view>
-  <image src="{{weatherBg}}" mode="widthFix" style="width: 100%;display: block;position: absolute; z-index: -1;top:0" />
-  <view class="container">
-    <van-nav-bar title="" left-text="" left=""></van-nav-bar>
-    <!-- 天气的面板  -->
-    <view class="header-wrapper" wx:if="{{!status_fire}}">
-      <view class="weather-box">
-        <text class="weather-title">空气质量-{{ airText }}</text>
-        <text class="weather-value">{{ airValue }}</text>
-      </view>
-      <view class="weather-box" style="align-items: flex-end;">
-        <text class="weather-title">{{ area }}-{{ city }}</text>
-        <text class="weather-desc">{{ weather }}</text>
-      </view>
-    </view>
-
-
-
-    <view class="contentArea">
-      <view class="menu-tab">
-        <view
-          class="{{!modelList1.length ? 'menu-tab-disenable' : currentMenuTabIndex == 0 ? 'menu-tab-item-active' :  'menu-tab-item'}}"
-          data-index="0" bindtap="checkMenuTap">起床模式</view>
-        <view
-          class="{{!modelList2.length ? 'menu-tab-disenable' : currentMenuTabIndex == 1 ? 'menu-tab-item-active' : 'menu-tab-item'}}"
-          data-index="1" bindtap="checkMenuTap">观影模式</view>
-        <view
-          class="{{!modelList3.length ? 'menu-tab-disenable' : currentMenuTabIndex == 2 ? 'menu-tab-item-active' :  'menu-tab-item'}}"
-          data-index="2" bindtap="checkMenuTap">睡眠模式</view>
-      </view>
-
-      <view class="theFirstRow">
-        <image src="/static/icons/ic_temperature.svg" mode="widthFix" />
-        <text class="theFirstRow-title">温度</text>
-        <text class="theFirstRow-value">{{w_temp}}<text class="theFirstRow-unit">℃</text></text>
-
-        <view style="margin-left: 30rpx;width: 2rpx; background: #e8e8e8; height: 24rpx;" />
-        <image src="/static/icons/ic_humidity.svg" mode="widthFix" />
-        <text class="theFirstRow-title">湿度</text>
-        <text class="theFirstRow-value">{{w_humidity}}<text class="theFirstRow-unit">%</text></text>
-
-      </view>
-      <view wx:if="{{isLoading}}" class="loading-container">
-        <text class="loading-text">数据正在加载,请耐心等待...</text>
-      </view>
-      <view class="data-container sliderList">
+<!--pages/mine/mine.wxml-->
+<view class="container">
+    <view class="top-box" bindtap="showDialog">
+        <image class="top-bg" src="../../static/bg/index_bg.png" mode="widthFix"></image>
+        <view class="user-bg">
 
-        <!-- 普通的-->
-        <view wx:for="{{listSwitch}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
-          <view class="data-card" style="{{item.state=='on' ? 'background: #0BC3AA;' : item.bg}}">
-            <image class="data-card__icon" src="{{item.state=='on' ? item.selectedImgSrc : item.imgSrc}}" />
-            <view class="data-card__text">
-              <text class="data-card__title1"
-                style="{{item.state=='on' ? 'color: #ffffff' :  ''}}">{{item.friendly_name}}</text>
-
-              <view class="data-card__value">
-                <van-switch size="22px" active-color="#2CCEB8" inactive-color="#E8EAEB" checked="{{item.state=='on'}}"
-                  bind:change="onSelect_All" data-param0="{{index}}" data-param1="/services"
-                  data-param2="/{{item.domain}}" data-param3='{{item.state=="on"?"/turn_off":"/turn_on"}}'
-                  data-param4='{{item.state=="on"?"0":"1"}}' data-param5="{{item.entity_id}}"
-                  custom-class="customSwitch" />
-              </view>
-            </view>
-          </view>
-        </view>
-
-
-        <!-- cover  -->
-        <view wx:for="{{listCover}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
-          <view class="data-card">
-            <image class="data-card__icon" src="{{item.imgSrc}}" />
-            <view class="data-card__text">
-              <view class="data-card__title">
-                <text class="text-content">{{item.friendly_name}}</text>
-              </view>
-              <view class="data-card__value">
-                <van-switch size="22px" active-color="#2CCEB8" inactive-color="#E8EAEB" checked="{{item.state=='open'}}"
-                  bindchange="onSelect_Cover" data-param0="{{index}}" data-param1="/services"
-                  data-param2="/{{item.domain}}" data-param3='{{item.state=="open"?"/open_cover":"/close_cover"}}'
-                  data-param4='{{item.state=="open"?"0":"1"}}' data-param5="{{item.entity_id}}" />
-              </view>
-            </view>
-          </view>
         </view>
-        <!-- 电视 card-->
-        <view wx:for="{{listMitvMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
-          <view class="data-card" style="{{item.bg}}">
-            <image class="data-card__icon" src="{{item.imgSrc}}" />
-            <view class="data-card__text">
-              <view class="data-card__title">
-                <text class="text-content">{{item.friendly_name}}</text>
-              </view>
-              <view class="data-card__value">
-                <view class="tv_button-container">
-                  <text
-                    class=" {{(item.app_id=='com.xiaomi.mitv.tvplayer'||item.app_name=='模拟电视')?'tv_disabled-button':'tv_custom-button'}}"
-                    bindtap="tvFanChange" data-id="{{item.entity_id}}" data-fan="当贝桌面"
-                    data-index="{{index}}">电视模式</text>
-                  <text
-                    class=" {{(item.app_id=='com.xiaomi.mitv.tvplayer'||item.app_name=='模拟电视')?'tv_custom-button':'tv_disabled-button'}}"
-                    bindtap="tvFanChange" data-id="{{item.entity_id}}" data-fan="HDMI1"
-                    data-index="{{index}}">机顶盒模式</text>
+        <view class="userInfo-box">
+            <view class="user-h-view" style="align-items: center;">
+                <image class="avatar" src="{{avatarUrl}}" mode="widthFix"></image>
+                <view class="user-v-view" style="flex: 1;height: fit-content;margin:64rpx 30rpx 0 30rpx;">
+                    <text class="username">{{nickName}}</text>
+                    <view class="user-h-view" style="align-items: center;">
+                        <text class="phoneNumber">{{phoneNumber}}</text>
+                        <text wx:if="{{hasAuth}}" class="edit-btn">编辑资料</text>
+                    </view>
                 </view>
-              </view>
             </view>
-          </view>
         </view>
-      </view>
-
-      <view class="body-wrapper" style="margin-top:40rpx; display: flex;flex-direction: column;align-items: center;">
-        <view class="body">
-
-          <!-- 香薰机 -->
-          <view class="test" class="sliderItem" wx:for="{{listAromatherapyMachine}}" wx:for-index="index"
-            wx:for-item="item" wx:if="{{item.isAromatherapy}}">
-
-            <view class="center-view">
-              <view class="title-line"></view>
-              <text class="gray-text">{{item.friendly_name}}</text>
-            </view>
-            <view class="data-media-player" style="flex-direction: row;">
+    </view>
+    <image class="ad-banner" src="../../static/bg/mine-ad.png" mode="widthFix"></image>
 
-              <view class="data-media-1" wx:for="{{listAromatherapyMachine}}" wx:for-index="index2" wx:for-item="item2"
-                wx:if="{{item2.isAromlight}}">
-                <text class="sub-title">{{item2.friendly_name}}</text>
-                <view wx:if="{{item.state=='on'}}" class="btn-pos-view" bindtap="onSelect_All_aromlight"
-                  data-param0="{{index2}}" data-param1="/services" data-param2="/{{item2.domain}}"
-                  data-param3="/turn_on" data-param4='{{item2.state=="on"?"0":"1"}}' data-param5="{{item2.entity_id}}">
-                  <image src="/static/images/ic_light_button_bg.png"></image>
-                  <text>灯光切换</text>
-                </view>
-                <view wx:else class="btn-pos-view" style="filter: grayscale(100%);">
-                  <image src="/static/images/ic_light_button_bg.png"></image>
-                  <text>灯光切换</text>
-                </view>
-              </view>
-              <view class="card-line-v"></view>
-              <view class="data-media-1">
-                <view class="card-data">
-                  <image class="data-card__icon" src="{{item.imgSrc}}" />
-                  <text class="data-card__title1">{{item.friendly_name}}</text>
-                  <view class="data-card__value">
-                    <van-switch size="22px" active-color="#2CCEB8" inactive-color="#E8EAEB"
-                      checked="{{item.state=='on'}}" bind:change="onSelect_All_AromatherapyMachine"
-                      data-param0="{{index}}" data-param1="/services" data-param2="/{{item.domain}}"
-                      data-param3='{{item.state=="on"?"/turn_off":"/turn_on"}}'
-                      data-param4='{{item.state=="on"?"0":"1"}}' data-param5="{{item.entity_id}}"
-                      custom-class="customSwitch" />
-                  </view>
-                </view>
-                <view class="card-data" wx:for="{{listAromatherapyMachine}}" wx:for-index="index2" wx:for-item="item2"
-                  wx:if="{{item2.isAromAtomization}}" style="height: 230rpx;">
-                  <image class="data-card__icon" src="{{item2.imgSrc}}" />
-                  <text class="data-card__title1">{{item2.friendly_name}}</text>
-                  <view class="data-card__value">
-                    <image wx:if="{{item.state=='on'}}" class="power-btn-small"
-                      src="{{item2.state=='on'? '/static/icons/ic_power.svg' : '/static/icons/ic_power_off.svg'}}"
-                      data-param0="{{index2}}" data-param1="/services" data-param2="/{{item2.domain}}"
-                      data-param3='{{item2.state=="on"?"/turn_off":"/turn_on"}}'
-                      data-param4='{{item2.state=="on"?"0":"1"}}' data-param5="{{item2.entity_id}}" bindtap="onTap_All">
-                    </image>
-                    <image wx:else class="power-btn-small"
-                      src="{{item2.state=='on'? '/static/icons/ic_power.svg' : '/static/icons/ic_power_off.svg'}}">
-                    </image>
-                  </view>
-                </view>
 
-              </view>
+    <view class="card-menu">
+        <view class="card-menu-item" wx:for="{{ menuCardList }}" wx:key="index" bindtap="onMenuCardClick"
+            data-index="{{ index }}" style="background-color: {{item.bgColor}};">
+            <image class="bg-card-menu" src="{{item.bgIcon}}" mode="widthFix"></image>
+            <text class="card-menu-title" style="color: {{item.color}};">{{item.title}}</text>
+            <image class="ic-card-menu" src="{{item.icon}}" mode="widthFix"></image>
+        </view>
 
-            </view>
-          </view>
+    </view>
+    <view class="menu-card">
+        <view class="menu-item" wx:for="{{ menuList }}" wx:key="index" bindtap="onMenuClick" data-index="{{ index }}">
+            <image class="ic-menu" src="{{item.icon}}" mode="widthFix"></image>
+            <text class="menu-title">{{item.title}}</text>
+            <button wx:if="{{item.type == 'contact'}}" open-type="contact"></button>
+        </view>
+    </view>
+    <authorized-login-dialog showDialog="{{showAuthorizedDialog}}"
+        bind:authorizationSuccessful="authorizationSuccessful"></authorized-login-dialog>
 
-          <!-- 加湿器 -->
-          <view class="test" wx:for="{{listHumidifier}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
 
-            <view class="center-view">
-              <view class="title-line"></view>
-              <text class="gray-text">{{item.friendly_name}}</text>
-            </view>
-            <view class="data-media-player">
-              <image class="power-btn"
-                src="{{item.state=='on'? '/static/icons/ic_power.svg' : '/static/icons/ic_power_off.svg'}}"
-                data-param0="{{index}}" data-param1="/services" data-param2="/{{item.domain}}"
-                data-param3='{{item.state=="on"?"/turn_off":"/turn_on"}}' data-param4='{{item.state=="on"?"0":"1"}}'
-                data-param5="{{item.entity_id}}" bindtap="onTap_All">
-              </image>
-              <view class="data-card-v" style="width: 100%;">
-                <view class="echarts-container_humidityDial">
-                  <ec-canvas id="mychart-dom-gauge" canvas-id="mychart-gauge" ec="{{ ecHumidifier }}"></ec-canvas>
-                </view>
 
-                <view class="button-row" style="width: 100%;height: 112rpx;margin-left: 15rpx;">
-                  <image src="/static/icons/ic_minus.svg" style="width: 112rpx;height: 112rpx;"
-                    bindtap="onHumidifierDown" data-state='{{item.state}}' data-id="{{item.entity_id}}"
-                    data-domain='{{item.domain}}' data-min='{{item.min}}' data-max='{{item.max}}'
-                    data-humidity='{{item.humidity}}'></image>
-                  <van-slider bar-height="52rpx" active-color="#0BC3AA" class="tui-slider-box"
-                    bind:drag-end="handleTouchEndHumidifier" bind:drag="handleChangingHumidifier"
-                    bind:change="changeHumidity" step="1" min="{{item.min}}" max="{{item.max}}"
-                    data-id="{{item.entity_id}}" data-index="{{index}}" data-domain="{{item.domain}}"
-                    value="{{item.humidity}}" min="{{item.min}}" max="{{item.max}}" data-humidity="{{item.humidity}}">
-                  </van-slider>
-                  <image src="/static/icons/ic_add.svg" style="width: 112rpx;height: 112rpx;" bindtap="onHumidifierUp"
-                    data-state='{{item.state}}' data-id="{{item.entity_id}}" data-domain='{{item.domain}}'
-                    data-min='{{item.min}}' data-max='{{item.max}}' data-humidity='{{item.humidity}}'>
-                  </image>
-                </view>
+    <van-popup show="{{ showTipsA }}" bind:close="onCloseTipsDialog" custom-style="background-color: transparent;">
+        <view class="tips-box">
+            <view class="tips-content">
+                <image class="ic-tips" src="/static/index/icon/ic_zwqx1.png" mode="widthFix"></image>
+                <text class="tips-title">暂无权限</text>
                 <text
-                  style="{{'margin-left:'+humidityMarginLeft+'rpx;margin-top: -50rpx;min-height:50rpx'}}">{{sliderValueHumidifier
-                  ?
-                  sliderValueHumidifier +
-                  '%' : ''}}</text>
-              </view>
-
-
+                    class="tips-desc">{{'暂无权限的原因如下:\n1、您不是酒店住客或者爱眠客床垫用户,没有权限查看睡眠报告。\n2、您是酒店住客,但是没有获取到您的信息,请联系前台。\n3、您是爱眠客床垫用户,请联系客服。'}}</text>
             </view>
-          </view>
-          <!-- 空调 -->
-          <view class="test sliderItem" wx:for="{{listClimate}}" wx:for-index="index" wx:for-item="item">
-            <view class="center-view">
-              <view class="title-line"></view>
-              <text class="gray-text">{{item.friendly_name}}</text>
+            <view class="tips-close-btn" bindtap="onCloseTipsDialog">
+                <van-icon name="close" color="#FFFFFF" size="56rpx" />
             </view>
-            <view class="data-media-player">
-
-              <text wx:if="{{item.state!='auto'}}" class="value-display">
-                {{item.temperatureTemp}}<text class="value-display_unit">°C</text>
-              </text>
-              <text wx:else class="value-display" style="opacity: 0;">
-                {{item.temperatureTemp}}<text class="value-display_unit">°C</text>
-              </text>
-              <view class="button-row" style="margin-left: 15rpx;">
-                <image src="/static/icons/ic_minus.svg" style="width: 112rpx;height: 112rpx;" bindtap="minusClimate"
-                  min="{{item.min_temp}}" max="{{item.max_temp}}" step="1" data-value="{{item.temperature}}"
-                  data-state="{{item.state}}" data-id="{{item.entity_id}}" data-domain="{{item.domain}}"
-                  data-min="{{item.min_temp}}" data-max="{{item.max_temp}}" data-temperature="{{item.temperature}}"
-                  data-fanMode="{{item.fan_mode}}" disabled="{{item.state=='auto'}}"></image>
-                <van-slider bar-height="52rpx" active-color="#3A87FD" class="tui-slider-box" data-index="{{index}}"
-                  bind:change="changeClimate" bind:drag="dragClimate" min="{{item.min_temp}}" max="{{item.max_temp}}"
-                  step="1" value="{{item.temperature}}" data-state="{{item.state}}" data-id="{{item.entity_id}}"
-                  data-domain="{{item.domain}}" data-min="{{item.min_temp}}" data-max="{{item.max_temp}}"
-                  data-temperature="{{item.temperature}}" data-fanMode="{{item.fan_mode}}"
-                  disabled="{{item.state=='auto'}}">
-                  <!-- <text style="color:black">{{sliderValueClimate}}</text> -->
-                </van-slider>
-                <image src="/static/icons/ic_add.svg" style="width: 112rpx;height: 112rpx; " bindtap="addClimate"
-                  min="{{item.min_temp}}" max="{{item.max_temp}}" step="1" data-value="{{item.temperature}}"
-                  data-state="{{item.state}}" data-id="{{item.entity_id}}" data-domain="{{item.domain}}"
-                  data-min="{{item.min_temp}}" data-max="{{item.max_temp}}" data-temperature="{{item.temperature}}"
-                  data-fanMode="{{item.fan_mode}}" disabled="{{item.state=='auto'}}"></image>
-
-              </view>
-              <view class="air-conditioner-controls">
-                <view
-                  class="{{item.state=='auto'?'control-button_1':'control-button'}} {{isClickedOnClimateAuto ? 'clicked' : ''}}"
-                  bindtap="onClimateAuto" data-state="{{item.state}}" data-temperature="{{item.temperature}}"
-                  data-id="{{item.entity_id}}" data-domain="{{item.domain}}">
-                  <image class="control-icon"
-                    src="{{item.state == 'auto' ? '/static/icons/ic_auto_2.svg' : '/static/icons/ic_auto_1.svg'}}" />
-                  <text class="{{item.state=='auto'? 'control-text_select' :'control-text'}}">自动</text>
-                </view>
-                <view class="{{item.state=='heat'?'control-button_1':'control-button'}}" bindtap="onClimateHeat"
-                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
-                  data-domain="{{item.domain}}" data-flag="onHeat">
-                  <image class="control-icon"
-                    src="{{item.state == 'heat' ? '/static/icons/ic_hot_2.svg' : '/static/icons/ic_hot_1.svg'}}" />
-                  <text class="{{item.state=='heat'? 'control-text_select' :'control-text'}}">制热</text>
-                </view>
-                <view class="{{item.state=='cool'?'control-button_1':'control-button'}}" bindtap="onClimateCool"
-                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
-                  data-domain="{{item.domain}}" data-flag="onCool">
-                  <image class="control-icon"
-                    src="{{item.state == 'cool' ? '/static/icons/ic_cold_2.svg' : '/static/icons/ic_cold_1.svg'}}" />
-                  <text class="{{item.state=='cool'? 'control-text_select' :'control-text'}}">制冷</text>
-                </view>
-                <view class="{{item.state=='dry'?'control-button_1':'control-button'}}" bindtap="onClimateDehumidify"
-                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
-                  data-domain="{{item.domain}}" data-flag="onDehumidify">
-                  <image class="control-icon"
-                    src="{{item.state == 'dry' ? '/static/icons/ic_moisture_2.svg' : '/static/icons/ic_moisture_1.svg'}}" />
-                  <text class="{{item.state=='dry'? 'control-text_select' :'control-text'}}">除湿</text>
-                </view>
-                <view class="{{item.state=='fan_only'?'control-button_1':'control-button'}}"
-                  bindtap="onClimateAirSupply" data-state="{{item.state}}" data-temperature="{{item.temperature}}"
-                  data-id="{{item.entity_id}}" data-domain="{{item.domain}}" data-flag="onAirSupply">
-                  <image class="control-icon"
-                    src="{{item.state == 'fan_only' ? '/static/icons/ic_wind_2.svg' : '/static/icons/ic_wind_1.svg'}}" />
-                  <text class="{{item.state=='fan_only'? 'control-text_select' :'control-text'}}">送风</text>
-                </view>
-                <!-- 关闭要单独拿出来 -->
-                <!-- <view class="{{item.state=='off'?'control-button_1':'control-button'}}" bindtap="onClimateOff"
-                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
-                  data-domain="{{item.domain}}">
-                  <image class="control-icon" />
-                  <text class="{{item.state=='off'? 'control-text_select' :'control-text'}}">关闭</text>
-                </view> -->
-              </view>
-              <view class="airConditioning-title">
-                <image src="/static/icons/ic_output_air.svg"></image>
-                <text wx:if="{{item.state!='auto'}}">{{temperatureHumidifyName}}:{{item.temperature}}°C</text>
-                <text wx:else>{{temperatureHumidifyName}}</text>
-              </view>
-              <image class="power-btn"
-                src="{{item.state=='off'? '/static/icons/ic_power_off.svg' : '/static/icons/ic_power.svg'}}"
-                bindtap="onClimateOff" data-state="{{item.state}}" data-temperature="{{item.temperature}}"
-                data-id="{{item.entity_id}}" data-domain="{{item.domain}}"></image>
-
+        </view>
+    </van-popup>
+
+    <van-popup show="{{ showTipsB }}" bind:close="onCloseTipsDialog" custom-style="background-color: transparent;">
+        <view class="tips-box">
+            <view class="tips-contentB">
+                <image class="ic-tips" src="/static/index/icon/ic_zwqx2.png" mode="widthFix"></image>
+                <text class="tips-title">暂无权限</text>
+                <text class="tips-desc">{{'暂无权限的原因如下:\n1、您不是酒店住客,没有权限控制房间智能设备。\n2、您是酒店住客,但是没有获取到您的信息,请联系前台。'}}</text>
             </view>
-          </view>
-          <view wx:for="{{listMiotMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
-            <!-- 一行 -->
-            <view class="data-media-player" style="{{item.entity_picture}}">
-              <!-- 标题 -->
-              <view class="center-view">
-                <view class="title-line"></view>
-                <text class="gray-text">{{item.friendly_name}}</text>
-              </view>
-              <view class="audio-player">
-                <view class="controls">
-                  <image class="control-button_media prev {{isClickedPrevSong ? 'clicked' : ''}}"
-                    src="/static/images/prev.png" bindtap="prevSong" wx:if="{{canPrev}}" data-state="{{item.state}}"
-                    data-id="{{item.entity_id}}" data-domain="{{item.domain}}" />
-                  <image class="control-button_media play {{isClickedTogglePlayPause ? 'clicked' : ''}}"
-                    src="{{item.state=='playing' ? '/static/images/pause.png' : '/static/images/play.png'}}"
-                    bindtap="togglePlayPause" data-state="{{item.state}}" data-id="{{item.entity_id}}"
-                    data-domain="{{item.domain}}" />
-                  <image class="control-button_media next {{isClickedNextSong ? 'clicked' : ''}}"
-                    src="/static/images/next.png" bindtap="nextSong" wx:if="{{canNext}}" data-state="{{item.state}}"
-                    data-id="{{item.entity_id}}" data-domain="{{item.domain}}" bindload="imageLoad" />
-                </view>
-                <view class="progress">
-                  <slider class="progress-bar" value="{{item.media_position}}" min="0" max="{{item.media_duration}}"
-                    bindchange="sliderChange" data-state="{{item.state}}" data-id="{{item.entity_id}}"
-                    data-domain="{{item.domain}}" />
-                </view>
-                <view class="info">
-                  <text class="song-title">歌曲名称:{{item.media_title}}</text>
-                  <text class="song-artist">演唱者:{{item.media_artist}}</text>
-                  <!-- <text class="song-artist">歌曲名称:{{item.media_album_name}}</text> -->
-                </view>
-              </view>
+            <view class="tips-close-btn" bindtap="onCloseTipsDialog">
+                <van-icon name="close" color="#FFFFFF" size="56rpx" />
             </view>
-            <!-- 一行结束 -->
-          </view>
-          <!-- 一行结束 -->
         </view>
-      </view>
-    </view>
-  </view>
-  <van-overlay show="{{ menuTabDialogShow }}" z-index="10086">
-    <view style="height: 100vh;display: flex;flex-direction: column;justify-content: center;">
-      <view style="position: relative;">
-        <image wx:if="{{currentDialogIndex == 0}}" src="/static/bg/ic_qcms_bg.png"
-          style="display: block;width: 620rpx;height: 380rpx; margin: 0 auto;" />
+    </van-popup>
 
-        <view wx:if="{{currentDialogIndex == 0}}" class="dialog-content">
-          <view class="dialog-h">
-            <image class="dialog-icon" src="/static/bg/ic_qcms.png" />
-            <text class="dialog-title">起床模式</text>
-          </view>
-          <text class="dialog-desc">自动调节灯光、窗帘、播放轻柔音乐等, 营造一个舒适温馨的起床环境。</text>
-        </view>
-        <image wx:if="{{currentDialogIndex == 1}}" src="/static/bg/ic_gyms_bg.png"
-          style="display: block;width: 620rpx;height: 380rpx; margin: 0 auto;" />
-        <view wx:if="{{currentDialogIndex == 1}}" class="dialog-content">
-          <view class="dialog-h">
-            <image class="dialog-icon" src="/static/bg/ic_gyms.png" />
-            <text class="dialog-title">观影模式</text>
-          </view>
-          <text class="dialog-desc">一键切换至最佳视听环境,自动调节灯光、窗帘及电视等设置,为您打造沉浸式的观影体验。</text>
-        </view>
-        <image wx:if="{{currentDialogIndex == 2}}" src="/static/bg/ic_smms_bg.png"
-          style="display: block;width: 620rpx;height: 380rpx; margin: 0 auto;" />
-        <view wx:if="{{currentDialogIndex == 2}}" class="dialog-content">
-          <view class="dialog-h">
-            <image class="dialog-icon" src="/static/bg/ic_smms.png" />
-            <text class="dialog-title" style="color: #FDFFC5;">睡眠模式</text>
-          </view>
-          <text class="dialog-desc" style="color: white;">自动调暗灯光、关闭窗帘、播放睡眠视频、音乐及调节室内温度、湿度,营造一个安静舒适的睡眠环境。</text>
-        </view>
-        <text class="dialog-sure-btn" bindtap="onClickHideSureMenuTabDialog">确定</text>
-      </view>
-      <image src="/static/icons/ic_dialog_close.svg"
-        style="display: block;width: 56rpx;height: 56rpx; margin: 30rpx auto;" bindtap="onClickHideMenuTabDialog" />
-    </view>
-  </van-overlay>
 
-  <authorized-login-dialog showDialog="{{showAuthorizedDialog}}"
-    bind:authorizationSuccessful="authorizationSuccessful"></authorized-login-dialog>
 </view>

+ 186 - 1077
pages/index/index.wxss

@@ -1,1141 +1,250 @@
-/**index.wxss**/
+/* pages/mine/mine.wxss */
 page {
-  width: 100vw;
-  padding-bottom: 130px;
-  background: #F6F8F9;
-  display: flex;
-  overflow-x: hidden;
-  flex-direction: column;
+    background-color: #F8F9FA;
 }
 
 .container {
-  display: flex;
-  width: 100vw;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.header-wrapper {
-  width: calc(100% - 120rpx);
-  margin: 0 auto 50rpx auto;
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-}
-
-.weather-box {
-  display: flex;
-  flex-direction: column;
-}
-
-.weather-box .weather-title {
-  font-size: 28rpx;
-  color: #3E3D44;
-}
-
-.weather-box .weather-value {
-  font-size: 72rpx;
-  font-weight: bold;
-  line-height: 80rpx;
-  margin-top: 10rpx;
-  color: #3E3D44;
-}
-
-.weather-box .weather-desc {
-  font-size: 36rpx;
-  color: #3E3D44;
-  line-height: 80rpx;
-  margin-top: 10rpx;
-}
-
-
-.contentArea {
-  width: 100%;
-  display: flex;
-  flex-direction: column;
-  background: #F6F8F9;
-  border-radius: 28rpx 28rpx 0;
-}
-
-.theFirstRow {
-  font-weight: 500;
-  display: flex;
-  justify-content: flex-end;
-  margin-right: 30rpx;
-  align-items: center;
-  flex-direction: row;
-}
-
-.theFirstRow-title {
-  font-size: 20rpx;
-  margin: 0 20rpx;
-  color: #6C6970;
-}
-
-.theFirstRow-value {
-  color: #3E3D44;
-  font-size: 16px;
-  font-weight: 600;
-}
-
-.theFirstRow-unit {
-  color: #3E3D44;
-  font-size: 10px;
-}
-
-.theFirstRow image {
-  width: 30rpx;
-  height: 30rpx;
-  margin-left: 30rpx;
-}
-
-.horizontal-swiper {
-  width: 100%;
-  height: 40rpx;
-}
-
-.swiper-item {
-  width: 400rpx;
-  /* 设置滑动块的宽度 */
-  height: 100%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  background-color: #3c4fff;
-  margin-right: 20rpx;
-  /* 根据需要设置间距 */
-}
-
-.item-content {
-  /* 其他样式 */
-}
-
-.wrapper {
-  padding: 20rpx 30rpx;
-  background-color: #000000;
-}
-
-.wrapper-dark {
-  padding: 30rpx;
-  background-color: #27313b;
-}
-
-
-.header-title {
-  display: flex;
-  justify-content: space-between;
-}
-
-.header-title text {
-  color: #000;
-}
-
-.header-title-fire {
-  display: flex;
-  justify-content: space-between;
-}
-
-.header-title-fire text {
-  color: #fdfbfb;
-  font-size: large;
-  font-weight: 200;
-  margin: 0 auto;
-}
-
-.header-text {
-  font-size: 60rpx;
-  font-weight: 400;
-  display: flex;
-  justify-content: space-between;
-}
-
-.header-text text {
-  color: #000;
-}
-
-.weather-advice {
-  margin-top: 40rpx;
-  font-size: 24rpx;
-}
-
-.data-wrapper {
-  margin-top: 20rpx;
-  display: flex;
-  justify-content: space-between;
-  background-color: #000000;
-
-}
-
-.data {
-  background-color: #fff;
-  width: 300rpx;
-  height: 200rpx;
-  margin: 20rpx 0px;
-  border-radius: 40rpx;
-  display: flex;
-  justify-content: space-around;
-  padding: 0 16rpx;
-  box-shadow: #d6d6d6 0px 0px 10rpx;
-
-}
-
-.data-humidifier {
-  /* margin-top: 30rpx; */
-  background-color: #fff;
-  /* 设置边框样式 */
-  border: 2rpx solid #e0e0e0;
-  /* 边框宽度、样式和颜色 */
-
-  /* 设置圆角弧度 */
-  border-radius: 20rpx;
-  /* 可以根据需要调整圆角的大小 */
-
-  /* 设置阴影效果 */
-  box-shadow: 0rpx 4rpx 8rpx rgba(0, 0, 0, 0.1);
-  /* 阴影的偏移量、模糊半径和颜色 */
-
-  padding-right: 5rpx;
-  margin-top: 10rpx;
-  height: 650rpx;
-}
-
-.body {
-  width: 100%;
-  display: flex;
-  flex-direction: column;
-}
-
-.data-media-player {
-  box-shadow: inset 10px 4px 10px 0px rgba(182, 194, 205, 0.2);
-  border-radius: 20px;
-  background: #FFFFFF;
-  align-items: center;
-  padding: 20rpx 0;
-  margin: 0 40rpx;
-  display: flex;
-  flex-direction: column;
-  margin-bottom: 48rpx;
-  position: relative;
-}
-
-.data-media-1 {
-  flex: 1;
-  display: flex;
-  flex-direction: column;
-}
-
-.data-media-1 .sub-title {
-  color: #6C6970;
-  font-size: 14px;
-  margin-top: 40rpx;
-  margin-left: 30rpx;
-}
-
-.card-data {
-  display: flex;
-  flex-direction: column;
-  padding-right: 30rpx;
-  align-items: flex-end;
-  position: relative;
-  height: 200rpx;
-}
-
-.card-data .data-card__icon {
-  position: absolute;
-  top: 40rpx;
-  left: 40rpx;
-  width: 88rpx;
-  height: 88rpx;
-}
-
-.card-data .data-card__value {
-  margin-top: 40rpx;
-}
-
-.card-data .data-card__title1 {
-  margin-top: 40rpx;
-  font-size: 14px;
-  color: #6C6970;
-}
-
-.card-line {
-  width: calc(100% - 68rpx);
-  margin: 0 auto;
-  background: #E8E8E8;
-  height: 1rpx;
-}
-
-.card-line-v {
-  height: 300rpx;
-  margin: auto 0;
-  background: #E8E8E8;
-  width: 1rpx;
-}
-
-.btn-pos-view {
-  width: 200rpx;
-  height: 200rpx;
-  position: relative;
-  margin-top: 40rpx;
-  margin-left: 40rpx;
-  margin-bottom: 84rpx;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.btn-pos-view image {
-  width: 200rpx;
-  height: 200rpx;
-  display: block;
-}
-
-.btn-pos-view:active {
-  opacity: 0.7;
-}
-
-.btn-pos-view text {
-  width: 200rpx;
-  text-align: center;
-  font-size: 24rpx;
-  color: #6C6970;
-  position: absolute;
-  white-space: nowrap;
-}
-
-.echarts-container_humidityDial {
-  width: 300rpx;
-  display: block;
-  height: 300rpx;
-}
-
-.power-btn {
-  position: absolute;
-  right: 30rpx;
-  top: 40rpx;
-  border-radius: 100%;
-  box-sizing: border-box;
-  box-shadow: 0px 6rpx 18rpx 0px #E3E4E5;
-  width: 110rpx;
-  height: 110rpx;
-}
-
-.power-btn-small {
-  width: 110rpx;
-  height: 110rpx;
-  box-sizing: border-box;
-  border-radius: 100%;
-  box-shadow: 0px 6rpx 18rpx 0px #E3E4E5;
-  margin-top: -10rpx;
-}
-
-.airConditioning-title {
-  position: absolute;
-  left: 40rpx;
-  top: 40rpx;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-}
-
-.airConditioning-title image {
-  width: 48rpx;
-  height: 48rpx;
-}
-
-.airConditioning-title text {
-  font-size: 24rpx;
-  color: #3E3D44;
-  margin-left: 20rpx;
-}
-
-.data-logo {
-  height: 72rpx;
-  width: 72rpx;
-  margin-top: 30rpx;
-}
-
-.data-text {
-  margin-top: 30rpx;
-  color: #7f7f7f;
-
-}
-
-.data-title {
-  text-align: right;
-}
-
-.data-value {
-  font-size: 52rpx;
-}
-
-.panel {
-  display: flex;
-  padding: 0 30rpx;
-}
-
-.cellgroup {
-  margin-top: 12rpx;
-  /* 设置边框样式 */
-  border: 2rpx solid #ebebeb;
-  /* 边框宽度、样式和颜色 */
-
-  /* 设置圆角弧度 */
-  border-radius: 20rpx;
-  /* 可以根据需要调整圆角的大小 */
-  /* 设置阴影效果 */
-  box-shadow: 0rpx 8rpx 12rpx rgba(85, 255, 255, 0.1);
-  /* 阴影的偏移量、模糊半径和颜色 */
-}
-
-
-.circle-humi {
-  margin-left: 150rpx;
-}
-
-.switch {
-  margin-top: 20rpx;
-  display: flex;
-  flex-direction: column;
-  align-items: flex-end;
-}
-
-.silder {
-  margin-top: 50rpx;
-}
-
-.s_view {
-  width: 100%;
-  display: flex;
-  justify-content: center;
-  margin-top: -50rpx;
-  /* margin-bottom: 50rpx; */
-}
-
-.s_view_climate {
-  width: 100%;
-  display: flex;
-  justify-content: center;
-  margin-top: -50rpx;
-  /* margin-bottom: 50rpx; */
-}
-
-.button {
-  width: 90rpx;
-  height: 90rpx;
-  border-radius: 50%;
-  margin: -100rpx 5rpx 5rpx 5rpx;
-  background-color: #00aaff;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  cursor: pointer;
-  transition: background-color 0.3s;
-  border: none;
-  outline: none;
-  z-index: 9999;
-}
-
-.button:hover {
-  background-color: #808080;
-}
-
-.buttonClimate {
-  width: 90rpx;
-  height: 90rpx;
-  border-radius: 50%;
-  margin: -100rpx 5rpx 5rpx 5rpx;
-  background-color: #00aaff;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  cursor: pointer;
-  transition: background-color 0.3s;
-  border: none;
-  outline: none;
-  margin-left: 20rpx;
-  z-index: 9999;
-}
-
-.buttonClimate:hover {
-  background-color: #808080;
-}
-
-.plusHumidifier {
-  font-size: 35rpx;
-  color: white;
-}
-
-.plus {
-  font-size: 60rpx;
-  color: white;
-}
-
-.narrow-slider {
-  width: 200rpx;
-}
-
-.slider-container {
-  display: flex;
-  align-items: center;
-  justify-content: flex-start;
-}
-
-.custom-slider {
-  width: 50%;
-  /* 根据需要调整slider的宽度 */
-}
-
-.slider-value {
-  margin-left: 10rpx;
-  /* 根据需要调整value与slider之间的间距 */
-}
-
-.tui-slider-box {
-  width: 440rpx;
-  margin-top: 20rpx;
-}
-
-.gray-input {
-  /* background-color: #ccc; */
-  background-color: #f5f5f5;
-  /* 其他样式,如字体大小、颜色、边框等 */
-  padding: 10rpx 50rpx 10rpx 10rpx;
-  /* 内边距,使文本不会紧贴着边框 */
-  border: none;
-  /* 移除默认边框 */
-}
-
-.arrow-up,
-.arrow-down {
-  width: 5rpx;
-  /* 箭头的宽度 */
-  height: 5rpx;
-  /* 箭头的高度 */
-  border-width: 6rpx;
-  /* 边框宽度,控制箭头的大小 */
-  border-style: solid;
-  /* 边框样式 */
-  position: absolute;
-  /* 绝对定位,方便后续调整位置 */
-  background-color: #f5f5f5;
-  /* 灰色背景 */
-}
-
-.arrow-up {
-  border-color: transparent transparent white transparent;
-  /* 设置上箭头的颜色 */
-  transform: rotate(-45deg);
-  /* 旋转箭头,使其朝上 */
-  margin-top: 10rpx;
-  /* 设置上箭头的位置 */
-  background-color: #f5f5f5;
-  /* 灰色背景 */
-}
-
-.arrow-down {
-  border-color: white transparent transparent transparent;
-  /* 设置下箭头的颜色 */
-  transform: rotate(45deg);
-  /* 旋转箭头,使其朝下 */
-  margin-top: 20rpx;
-  /* 设置下箭头的位置,确保它在上箭头的下方 */
-  background-color: #f5f5f5;
-  /* 灰色背景 */
-}
-
-.input-unit {
-  margin-left: 10rpx;
-  /* 与文本框之间留一些间距 */
-  color: #666;
-  /* 单位的颜色 */
-  font-size: 24rpx;
-  /* 单位的字体大小 */
-  background-color: #f5f5f5;
-  /* 灰色背景 */
-}
-
-.input-container {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  /* 使得文本框、箭头和单位之间有空隙 */
-  padding: 10rpx;
-  background-color: #f5f5f5;
-  /* 灰色背景 */
-}
-
-.input-text {
-  flex: 1;
-  /* 占据大部分空间 */
-  border: none;
-  padding: 10rpx;
-  background-color: #fff;
-  /* 文本框背景色 */
-  border-radius: 10rpx;
-  /* 圆角 */
-}
-
-.arrow-container {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.arrow {
-  width: 12rpx;
-  height: 12rpx;
-  border: 1rpx solid #666;
-  border-width: 0 1rpx 1rpx 0;
-  /* transform: rotate(-45deg);  */
-  margin-bottom: 0rpx;
-  /* 上下箭头之间的间距 */
-  background-color: #f5f5f5;
-  /* 灰色背景 */
-}
-
-.up-arrow {
-  transform: rotate(225deg);
-  /* 下箭头需要反方向旋转 */
-  margin-bottom: 0;
-  /* 下箭头不需要额外的底部间距 */
-}
-
-.down-arrow {
-  transform: rotate(45deg);
-  /* 下箭头需要反方向旋转 */
-  margin-bottom: 0;
-  /* 下箭头不需要额外的底部间距 */
-}
-
-.input-unit {
-  color: #666;
-  font-size: 24rpx;
-}
-
-.audio-player {
-  width: 100%;
-  padding: 20rpx;
-  box-sizing: border-box;
-  /* margin-top: 20rpx; */
-}
-
-.controls {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 20rpx;
-}
-
-.controls_tv {
-  display: flex;
-  /* justify-content: space-between;  */
-  align-items: left;
-  margin-bottom: 20rpx;
-}
-
-.control-button {
-  width: 96rpx;
-  height: 156rpx;
-  border-radius: 24rpx;
-  background: #F6F8F9;
-}
-
-.control-button_1 {
-  width: 96rpx;
-  height: 156rpx;
-  border-radius: 24rpx;
-  background: #0BC3AA;
-}
-
-.progress {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  margin-bottom: 20rpx;
-}
-
-.progress-bar {
-  width: 80%;
-  height: 40rpx;
-}
-
-.info {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  text-align: center;
-}
-
-.song-title,
-.song-artist {
-  color: #7eff98;
-  /* font-weight: bold; */
-}
-
-.picker-view {
-  background-color: #fff;
-  border: 2rpx solid #ddd;
-  padding: 10rpx;
-  font-size: 28rpx;
-}
-
-.center-view {
-  display: flex;
-  margin-bottom: 30rpx;
-  flex-direction: row;
-  align-items: center;
-  font-size: 32rpx;
-  color: #3E3D44;
-}
-
-.title-line {
-  margin-left: 40rpx;
-  width: 12rpx;
-  height: 32rpx;
-  margin-right: 20rpx;
-  border-radius: 8rpx;
-  background: #0BC3AA;
-}
-
-.gray-text {
-  font-size: 32rpx;
-  color: #3E3D44;
-}
-
-.custom-cell {
-  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);  
-  background-color: #fff;  
-  border-radius: 4px;  */
-}
-
-.air-conditioner-controls {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  flex-direction: row;
-  width: calc(100% - 80rpx);
-  padding: 20rpx 0;
-  background: white;
-}
-
-.control-button {
-  width: 96rpx;
-  height: 156rpx;
-  border-radius: 24rpx;
-  background: #F6F8F9;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.control-button_1 {
-  width: 96rpx;
-  height: 156rpx;
-  border-radius: 24rpx;
-  background: #0BC3AA;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-}
-
-.control-button_media {
-  width: 100rpx;
-  height: 100rpx;
-  border-radius: 50%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  background-color: rgba(203, 203, 203, 0.5);
-  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
-  margin: 0 10rpx;
-}
-
-.control-button_media_1 {
-  width: 100rpx;
-  height: 100rpx;
-  border-radius: 50%;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: center;
-  background-color: rgba(0, 170, 255, 0.5);
-  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
-  margin: 0 10rpx;
+    min-height: 100vh !important;
+    background: #F8F9FA;
+    justify-content: flex-start;
+    display: flex;
+    flex-direction: column;
+    box-sizing: border-box;
 }
 
-.control-button_media_2 {
-  width: 80rpx;
-  height: 80rpx;
-  border-radius: 50%;
-  flex-direction: column;
-  align-items: right;
-  justify-content: right;
-  background-color: rgba(203, 203, 203, 0.5);
-  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
-  margin: 0 10rpx;
+.top-box {
+    width: 100vw;
+    display: flex;
+    flex-direction: column;
+    background: white;
+    position: relative;
 }
 
-.control-icon {
-  width: 40rpx;
-  height: 40rpx;
+.top-bg {
+    width: 100vw;
+    display: block;
 }
 
-.control-text {
-  font-size: 24rpx;
-  color: #3E3D44;
-  margin-top: 10rpx;
+.user-bg {
+    background-color: #F8F9FA;
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 410rpx;
+    min-height: 52rpx;
+    border-radius: 32rpx 32rpx 0 0;
 }
 
-.control-text_select {
-  font-size: 24rpx;
-  color: #ffffff;
-  margin-top: 10rpx;
+.userInfo-box {
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 358rpx;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
 }
 
-.canvas4 {
-  display: flex;
-  flex-direction: column;
-  width: 100%;
-  height: 720rpx;
-  background-color: #d2d9ff;
-  /* 这里设置你想要的背景色 */
+.user-h-view {
+    width: 100%;
+    display: flex;
+    flex-direction: row;
 }
 
-
-/* button {
-    -webkit-tap-highlight-color: transparent;
-    background: -webkit-linear-gradient(bottom,rgb(255, 255, 255),rgb(46, 207, 255),rgb(0, 170, 255));
-    border-radius: 5px;
-    box-sizing: border-box;
-    color: #000;
-    cursor: pointer;
+.avatar {
+    width: 160rpx;
+    height: 160rpx;
     display: block;
-    font-size: 18px;
-    line-height: 2.55555556;
-    margin-left: auto;
-    margin-right: auto;
+    margin-left: 40rpx;
+    border-radius: 100%;
     overflow: hidden;
-    padding-left: 14px;
-    padding-right: 14px;
-    position: relative;
-    text-align: center;
-    text-decoration: none;
-} */
-
-.value-display {
-  font-size: 72rpx;
-  display: block;
-  line-height: 90rpx;
-  font-weight: 700;
-  margin-left: 40rpx;
-  color: #3E3D44;
-}
-
-.value-display_unit {
-  font-size: 28rpx;
-}
-
-.button-row {
-  display: flex;
-  flex-direction: row;
-  margin-bottom: 20rpx;
-}
-
-.round-gradient-button {
-  width: 160rpx;
-  height: 60rpx;
-  border: none;
-  /* background: linear-gradient(to bottom, #ffba4a, #ffaa00);  */
-  /* background: -webkit-linear-gradient(bottom,rgb(255, 255, 255),rgb(46, 207, 255),rgb(0, 170, 255)); */
-  background-color: rgb(0, 170, 255);
-  /* color: white;  */
-  font-size: 26rpx;
-  color: #000;
-  /* border-radius: 20%;  */
-  line-height: 60rpx;
-  text-align: center;
-  /* box-shadow: 0px 4rpx 15rpx rgba(0, 0, 0, 0.2);  */
-}
-
-.round-gradient-button-pressed {
-  background: linear-gradient(to bottom, #87ceeb, #aaaaff);
-  box-shadow: none;
-}
-
-.right-content-cover {
-  display: flex;
-  align-items: center;
-  /* 垂直居中 */
-  justify-content: flex-end;
-  /* 水平靠右对齐 */
-}
-
-.control-button-cover {
-  width: 60rpx;
-  height: 60rpx;
-  padding: 5rpx 25rpx 5rpx 5rpx;
-  border-radius: 50%;
-  background-color: rgba(255, 255, 255, 0.5);
-  /* 白色半透明背景 */
-}
-
-
-.data-container {
-  margin-top: 36rpx;
-  display: grid;
-  justify-content: center;
-  grid-template-columns: repeat(auto-fill, 320rpx);
-  grid-gap: 30rpx;
-}
-
-.data-card-v {
-  display: flex;
-  flex-direction: column;
-
-}
-
-.data-container .data-card {
-  position: relative;
-  /* background-color:#fff; */
-  /* background: linear-gradient(180deg, #E3FFE6 0%, #FFFFFF 53%); */
-  /* background-color: rgba(112, 56, 168, 0.5); */
-  height: 160rpx;
-  box-shadow: inset 20rpx 8rpx 20rpx 0px rgba(182, 194, 205, 0.2);
-  border-radius: 36rpx;
-  display: flex;
-  justify-content: space-between;
-  padding: 24rpx;
-}
-
-.data-container .data-card .data-card__text {
-  position: absolute;
-  right: 24rpx;
-  color: #6C6970;
-  text-align: right;
-  white-space: nowrap;
-}
-
-.data-container .data-card .data-card__icon {
-  height: 88rpx;
-  width: 88rpx;
-  left: 24rpx;
-  top: 36rpx;
-}
-
-.data-container .data-card .data-card__title {
-  padding-top: 18rpx;
-  font-size: 28rpx;
-  font-weight: bold;
-  color: #6C6970;
+    box-sizing: border-box;
+    border: 4rpx solid #FBFBFB;
 }
 
-.data-container .data-card .data-card__title1 {
-  font-size: 28rpx;
-  white-space: pre;
-  font-weight: bold;
-  color: #6C6970;
+.username {
+    font-size: 36rpx;
+    color: #111111;
 }
 
-.data-container .data-card .data-card__value {
-  padding-top: 60rpx;
-  font-size: 52rpx;
-  font-weight: bold;
-  color: #ffffff;
+.edit {
+    width: 40rpx;
+    height: 40rpx;
+    display: block;
 }
 
-.data-container .data-card .data-card__value1 {
-  padding-top: 49rpx;
-  font-size: 30rpx;
-  color: #ffffff;
+.phoneNumber {
+    flex: 1;
+    font-size: 28rpx;
+    color: #666666;
 }
 
-.sliderList {
-  -webkit-overflow-scrolling: touch
+.edit-btn {
+    font-size: 24rpx;
+    background: #EDEEF0;
+    padding: 4rpx 16rpx;
+    color: #777777;
+    border-radius: 60rpx;
 }
 
-.sliderItem {
-  -webkit-overflow-scrolling: touch
+.ad-banner {
+    margin-top: 120rpx;
+    width: calc(100% - 60rpx);
+    display: block;
 }
 
-.loading-container {
-  position: fixed;
-  top: 50%;
-  left: 50%;
-  transform: translate(-50%, -50%);
-  padding: 10px;
-  /* background-color: #9cffa3;  */
-  color: #b1b1b1;
-  border-radius: 4px;
-  z-index: 9999;
-  /* 确保它显示在其他内容之上 */
+.menu-card {
+    background: #FFFFFF;
+    margin-top: 20rpx;
+    margin-bottom: 30rpx;
+    width: calc(100% - 60rpx);
+    overflow: hidden;
+    min-height: 232rpx;
+    align-items: center;
+    display: flex;
+    box-shadow: 0rpx 8rpx 20rpx 0rpx #EEEEEE;
+    flex-direction: row;
+    flex-wrap: wrap;
+    border-radius: 24rpx;
+}
+
+.menu-item {
+    flex: 0 50%;
+    display: flex;
+    height: 116rpx;
+    position: relative;
+    box-sizing: border-box;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    border-bottom: 1rpx solid #EEEEEE;
+    border-right: 1rpx solid #EEEEEE;
 }
 
-.loading-text {
-  /* 其他样式 */
-  width: 300rpx;
-  white-space: nowrap;
+.menu-item button {
+    position: absolute;
+    top: 0;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    line-height: 116rpx;
+    width: 100%;
+    height: 100%;
+    padding: 0;
+    opacity: 0;
+    margin: 0;
 }
 
-.clicked {
-  /* 这里添加你的点击效果样式,例如改变透明度或添加阴影 */
-  opacity: 0.8;
-  /* 或者使用动画 */
-  animation: myAnimation 0.3s;
+.ic-menu {
+    width: 40rpx;
+    height: 40rpx;
 }
 
-.customSwitch {
-  border-color: #E8EAEB;
+.menu-title {
+    color: #444444;
+    font-size: 28rpx;
+    margin-left: 16rpx;
 }
 
-@keyframes myAnimation {
-
-  /* 定义你的动画 */
-  from {
-    transform: scale(1);
-  }
-
-  to {
-    transform: scale(0.95);
-  }
+.menu-item:active {
+    opacity: 0.7;
 }
 
-.tv_button-container {
-  display: flex;
-  flex-direction: row;
-  height: 52rpx;
-  align-items: center;
-  justify-content: space-between;
-  background: #FFF6EA;
-  border-radius: 40rpx;
+.card-menu {
+    width: 100vw;
+    display: flex;
+    flex-direction: row;
+    flex-wrap: wrap;
 }
 
-.tv_custom-button {
-  margin: 4rpx;
-  border: none;
-  text-align: center;
-  background: #FDA64A;
-  font-size: 20rpx;
-  white-space: nowrap;
-  border-radius: 40rpx;
-  padding: 0 12rpx;
-  font-weight: normal;
-  height: 44rpx;
-  line-height: 44rpx;
-  color: white;
-  cursor: pointer;
+.card-menu-item {
+    flex: 0 calc(50% - 45rpx);
+    margin-top: 20rpx;
+    display: flex;
+    flex-direction: column;
+    margin-left: 30rpx;
+    position: relative;
+    border-radius: 32rpx;
+    box-sizing: border-box;
+    border: 1rpx solid #FFFFFF;
 }
 
-.tv_disabled-button {
-  font-size: 20rpx;
-  white-space: nowrap;
-  background: transparent;
-  border: none;
-  padding: 0 12rpx;
-  font-weight: normal;
-  text-align: center;
-  height: 44rpx;
-  line-height: 44rpx;
-  margin: 4rpx;
-  color: #6C6970;
-  cursor: not-allowed;
-  /* 更改鼠标指针样式 */
+.bg-card-menu {
+    width: 100%;
 }
 
-.menu-tab {
-  display: flex;
-  flex-direction: row;
-  width: fit-content;
-  margin: 40rpx;
-  align-items: center;
-  border-radius: 40rpx;
-  background: #FFFFFF;
+.card-menu-title {
+    position: absolute;
+    font-weight: 500;
+    top: 30rpx;
+    left: 30rpx;
+    font-size: 32rpx;
 }
 
-.menu-tab-item {
-  font-size: 28rpx;
-  padding: 8rpx 54rpx;
-  margin: 4rpx;
-  white-space: nowrap;
-  border-radius: 40rpx;
-  color: #6C6970;
+.ic-card-menu {
+    width: 72rpx;
+    height: 72rpx;
+    display: block;
+    position: absolute;
+    right: 24rpx;
+    bottom: 24rpx;
 }
 
-.menu-tab-disenable {
-  font-size: 28rpx;
-  padding: 8rpx 54rpx;
-  margin: 4rpx;
-  white-space: nowrap;
-  border-radius: 40rpx;
-  color: #cccccc;
-}
+/* tips-content */
 
-.menu-tab-item-active {
-  color: #FFFFFF;
-  font-size: 28rpx;
-  padding: 8rpx 48rpx;
-  white-space: nowrap;
-  border-radius: 40rpx;
-  margin: 4rpx;
-  background: #0BC3AA;
+.tips-box {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
 }
 
-.dialog-sure-btn {
-  position: absolute;
-  width: 312rpx;
-  font-size: 28rpx;
-  height: 64rpx;
-  bottom: 40rpx;
-  color: #49AF88;
-  background: #FFFFFF;
-  line-height: 64rpx;
-  left: calc(50% - 156rpx);
-  text-align: center;
-  border-radius: 64rpx;
+.tips-content {
+    width: 630rpx;
+    min-height: 566rpx;
+    background: linear-gradient(180deg, #C7DAFF 0%, #FFFFFF 37%, #FFFFFF 100%);
+    border-radius: 16rpx 16rpx 16rpx 16rpx;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
 }
 
-.dialog-content {
-  width: 620rpx;
-  top: 0;
-  left: 0;
-  position: absolute;
-  margin-left: 60rpx;
-  height: 380rpx;
-  display: flex;
-  flex-direction: column;
+.tips-contentB {
+    width: 630rpx;
+    min-height: 566rpx;
+    background: linear-gradient(180deg, #CCFFF8 0%, #FFFFFF 37%, #FFFFFF 100%);
+    border-radius: 16rpx 16rpx 16rpx 16rpx;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
 }
 
-.dialog-h {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  margin-left: 50rpx;
-  margin-top: 50rpx;
+.tips-close-btn {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    height: 116rpx;
+    width: 116rpx;
 }
 
-.dialog-icon {
-  display: block;
-  width: 36rpx;
-  height: 36rpx;
+.ic-tips {
+    margin-top: 42rpx;
+    height: 200rpx;
+    width: 200rpx;
 }
 
-.dialog-title {
-  margin-left: 20rpx;
-  font-weight: 700;
-  font-size: 32rpx;
-  color: #222222;
+.tips-title {
+    margin-top: 40rpx;
+    color: #3E3D44;
+    font-size: 32rpx;
 }
 
-.dialog-desc {
-  margin: 28rpx 50rpx 0;
-  font-size: 22rpx;
-  color: #333333;
-  line-height: 36rpx;
-  font-weight: 400;
+.tips-desc {
+    width: calc(100% - 72rpx);
+    margin-top: 30rpx;
+    margin-left: auto;
+    margin-right: auto;
+    margin-bottom: 40rpx;
+    color: #6C6970;
+    font-size: 24rpx;
 }

+ 0 - 66
pages/main/main.js

@@ -1,66 +0,0 @@
-// pages/main/main.js
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
-  }
-})

+ 0 - 7
pages/main/main.json

@@ -1,7 +0,0 @@
-{
-  "usingComponents": {},
-  "navigationBarRightButton": {
-    "hide": true
-  },
-  "navigationStyle": "custom"
-}

+ 0 - 4
pages/main/main.wxml

@@ -1,4 +0,0 @@
-<!--pages/main/main.wxml-->
-<view>
-
-</view>

+ 0 - 1
pages/main/main.wxss

@@ -1 +0,0 @@
-/* pages/main/main.wxss */

+ 1 - 2
pages/shop/shop.wxml

@@ -1,2 +1 @@
-<!--pages/shop/shop.wxml-->
-<text class="test">pages/shop/shop.wxml</text>
+<!--pages/shop/shop.wxml-->

+ 1 - 4
pages/shop/shop.wxss

@@ -1,4 +1 @@
-/* pages/shop/shop.wxss */
-.test{
-  font-size: 26rpx;
-}
+/* pages/shop/shop.wxss */

+ 34 - 1
project.private.config.json

@@ -7,6 +7,39 @@
     "preloadBackgroundData": false
   },
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "condition": {},
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "subpages/scan/scan",
+          "pathName": "subpages/scan/scan",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "subpages/mine/mine",
+          "pathName": "subpages/mine/mine",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "subpages/data/data",
+          "pathName": "subpages/data/data",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "subpages/main/main",
+          "pathName": "subpages/main/main",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  },
   "libVersion": "3.5.6"
 }

BIN=BIN
static/bg/index_bg.png


BIN=BIN
static/bg/mine-ad.png


BIN=BIN
static/images/ic_edit.png


BIN=BIN
static/index/bg/bg_fjkz.png


BIN=BIN
static/index/bg/bg_jrsmbg.png


BIN=BIN
static/index/bg/bg_lssmbg.png


BIN=BIN
static/index/bg/bg_sm.png


BIN=BIN
static/index/bg/bg_wdcd.png


BIN=BIN
static/index/bg/bg_zxsc.png


BIN=BIN
static/index/icon/ic_fjkz.png


BIN=BIN
static/index/icon/ic_jrsmbg.png


BIN=BIN
static/index/icon/ic_lssmbg.png


BIN=BIN
static/index/icon/ic_sm.png


BIN=BIN
static/index/icon/ic_wdcd.png


BIN=BIN
static/index/icon/ic_zwqx1.png


BIN=BIN
static/index/icon/ic_zwqx2.png


BIN=BIN
static/index/icon/ic_zxsc.png


BIN=BIN
static/tabs/home-active@2x.png


BIN=BIN
static/tabs/home@2x.png


BIN=BIN
static/tabs/mine-active@2x.png


BIN=BIN
static/tabs/mine@2x.png


BIN=BIN
static/tabs/report-active@2x.png


BIN=BIN
static/tabs/report@2x.png


BIN=BIN
static/tabs/scan.png


BIN=BIN
static/tabs/shop-active@2x.png


BIN=BIN
static/tabs/shop@2x.png


BIN=BIN
static/tabs/tab-bar-bg.png


+ 4115 - 0
subpages/main/main.js

@@ -0,0 +1,4115 @@
+// index.js
+// 获取应用实例
+import * as echarts from '../../ec-canvas/echarts';
+
+// const { connect } = require("../../utils/mqtt4/mqtt");
+/******************* 必须要改!!不然得不到天气!! ******************/
+const hefengKey = "	aa373d4025b0487196c15d8e6526cfcf"; //  和风天气Web api的key
+/******************* 可能需要你修改的部分 ******************/
+//const mqttHost = "broker.emqx.io"; //mqtt 服务器域名/IP
+// const mqttHost = "www.nekolee.top";
+const mqttHost = "haold.aidsleep.cn";
+// const mqttHost = "192.168.3.65";
+// const mqttPort = 8084; //mqtt 服务器域名/IP
+const mqttPort = 8083; //mqtt 服务器域名/IP
+
+const hefengVIP = false; //  和风天气是免费的api(false)还是付费api(true)
+
+const deviceSubTopic_LED = "/NekoHome/sub_LED"; //  设备订阅topic(小程序发布命令topic)
+const deviceSubTopic_BEEP = "/NekoHome/sub_BEEP";
+const deviceSubTopic_CU = "/NekoHome/sub_CU";
+const deviceSubTopic_DO = "/NekoHome/sub_DO";
+const deviceSubTopic_SAN = "/NekoHome/sub_SAN";
+const deviceSubTopic_Mode = "/NekoHome/sub_mode";
+// const devicePubTopic_env = "/NekoHome/pub/Environment"; //  设备发布topic(订阅环境参数)
+// const devicePubTopic_con = "/NekoHome/pub/Controll"; //  设备发布topic(订阅控制参数)
+const devicePubTopic_env = "testtopic/1"; //  设备发布topic(订阅环境参数)
+const devicePubTopic_con = "testtopic/1"; //  设备发布topic(订阅控制参数)
+/********************* 一般不用动这些 ********************/
+
+//小程序接收的主题
+const mpSubTopic_env = devicePubTopic_env;
+const mpSubTopic_con = devicePubTopic_con;
+
+//小程序发送的主题
+const mpPubTopic_LED = deviceSubTopic_LED;
+const mpPubTopic_BEEP = deviceSubTopic_BEEP;
+const mpPubTopic_CU = deviceSubTopic_CU;
+const mpPubTopic_DO = deviceSubTopic_DO;
+const mpPubTopic_SAN = deviceSubTopic_SAN;
+const mpPubTopic_Mode = deviceSubTopic_Mode;
+
+
+const mqttUrl = `wx://${mqttHost}:${mqttPort}/mqtt`; //  mqtt连接路径
+
+const hefengApi = "https://api.qweather.com/v7"; //  和风天气付费API前缀
+const hefengFreeApi = "https://devapi.qweather.com/v7"; //  和风天气免费API前缀
+
+const hefengWeather = `${hefengVIP ? hefengApi : hefengFreeApi}/weather/now?`; //  和风天气实时天气api
+const hefengAir = `${hefengVIP ? hefengApi : hefengFreeApi}/air/now?`; //  和风天气空气质量api
+
+const geoApi = "https://geoapi.qweather.com/v2/city/lookup?" //  地理位置api(用来获取经纬度对应的城市/城区名字)
+var homeApi = "http://haold.aidsleep.cn:8123/api";
+var homeApiLater = "http://haold.aidsleep.cn:8123";
+var homeApi_https = "https://haold.aidsleep.cn/api";
+var homeApiLater_https = "https://haold.aidsleep.cn";
+var entity = "";
+// const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJiN2JlOGE0MDExZjY0NjA2OGUxYjJiZTE4M2Y2NzU0NSIsImlhdCI6MTcxMTYxNDY2NCwiZXhwIjoyMDI2OTc0NjY0fQ.XJ73cXAoEsouTgvgpNVobq9oKdwlJr88TiAFLYlaahE";
+var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlZGVjOWI3YWQ0MTQ0ZTIxYWQ1NTE1Nzc5NTkzNjBjNiIsImlhdCI6MTcxMjEzNTM2MywiZXhwIjoyMDI3NDk1MzYzfQ.IfrvdiaVuhCKsdy69JvUYhJ64bnhMT8MI1hN8R38whc";
+
+const aipushApi = "https://aipush.aidsleep.cn";
+const token_push = "b74fd5754c5ef24cf600c39194abdaeb";
+
+const options = {
+	connectTimeout: 4000,//超时时间
+	clientId: 'emqx_ODAyNT',//随机生成ID
+	username: 'test1',
+	password: '123456'
+}
+
+
+var humidityValue = 40;
+var humidityMax = 100;
+var humidityMin = 40;
+var humidityMarginLeft = 110;
+let chartCircularProgressBar;//圈圈
+
+
+function updateChartCircularProgressBarOption(rscore_desc, rscore_value, that) {
+	if (chartCircularProgressBar) {
+		setOption(chartCircularProgressBar);
+	} else {
+		// 假设这段代码在小程序的某个函数中执行
+
+		// 创建查询对象
+		const query = wx.createSelectorQuery();
+
+		// 选择第一个id为mychart-dom-gauge的view
+		query.select('#mychart-dom-gauge').boundingClientRect(function (res) {
+			// 如果res不为null,则表示view存在
+			if (res) {
+				that.selectComponent('#mychart-dom-gauge').init((canvas, width, height, dpr) => {
+					const chart = echarts.init(canvas, null, {
+						width: width,
+						height: height,
+						devicePixelRatio: dpr // new
+					});
+					canvas.setChart(chart);
+					setOption(chart);
+
+					// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问
+					chartCircularProgressBar = chart;
+
+					// 注意这里一定要返回 chart 实例,否则会影响事件处理等
+					return chart;
+				});
+			} else {
+				console.log('view不存在');
+			}
+		}).exec(); // 执行查询
+
+	}
+}
+
+function checkState(state) {
+	return state == 'on' || state == 'off';
+}
+
+
+function setOption(chart) {
+	var option = {
+		backgroundColor: "#ffffff",
+		series: [{
+			name: '加湿器',
+			type: 'gauge',
+			startAngle: 230,
+			endAngle: -50,
+			splitNumber: 8,
+			min: humidityMin || 40,
+			max: humidityMax || 70,
+			axisLine: {
+				show: false
+			},
+			axisLabel: {
+				show: false,
+			},
+			anchor: {
+				show: false
+			},
+			splitLine: {
+				distance: -10,
+				length: 6,
+				lineStyle: {
+					width: 1.5,
+					color: '#9499C3'
+				}
+			},
+			pointer: {
+				show: false
+			},
+			axisTick: {
+				distance: -10,
+				splitNumber: 5,
+				lineStyle: {
+					width: 1,
+					color: '#9499C3'
+				}
+			},
+			progress: {
+				show: true,
+				width: 10,
+				itemStyle: {
+					color: "#0BC3AA"
+				}
+			},
+			title: {
+				color: '#6C6970',
+				offsetCenter: [0, '-50%'],
+				lineHeight: 15,
+				fontSize: 12
+			},
+			detail: {
+				valueAnimation: true,
+				width: '100%',
+				offsetCenter: [0, '20%'],
+				fontSize: "28px",
+				fontWeight: 'bolder',
+				formatter: function (value) {
+					return `${value.toFixed(0)}` + '{units|%}'
+				},
+				color: '#3E3D44',
+				rich: {
+					units: {
+						fontSize: "12px",
+						padding: [10, 0, 0, 1],
+						fontWeight: 'bolder',
+						color: '#333333'
+					},
+				}
+			},
+			data: [{
+				value: humidityValue || 0,
+				name: '湿度',
+			}]
+
+		}]
+	};
+
+	chart.setOption(option);
+}
+
+
+// import Notify from '../../@vant/weapp/notify/notify';
+// import Dialog from '../../@vant/weapp/dialog/dialog';
+import Toast from '../../@vant/weapp/toast/toast';
+
+Page({
+	data: {
+		ecHumidifier: {
+			lazyLoad: true, // 懒加载
+		},
+		weatherBg: '',
+		//单选框
+		radio_select: '10',
+		radio_switch: '10',
+		//倒计时时间
+		Time: 0,
+		//火灾时的呼吸效果变量
+		breathNum: 0,
+		currentMenuTabIndex: -1,
+		currentDialogIndex: 0,
+		menuTabDialogShow: false,
+
+		//火灾头顶警示
+		topTips: true,
+		hide: false,
+
+		//火灾弹窗显示
+		fire_show: false,
+
+		//设备控制弹窗参数 开始
+		show_led: false,
+		show_beep: false,
+		show_curtain: false,
+		show_san: false,
+		show_door: false,
+		show_time: false,
+		actions_led: [
+			{
+				name: '打开',
+				subname: '打开客厅灯',
+				id: 1,
+				url: '',
+				entity_id: '',
+			},
+			{
+				name: '关闭',
+				subname: '关闭客厅灯',
+				id: 0,
+				url: '',
+				entity_id: '',
+			},
+
+		],
+		actions_beep: [
+			{
+				name: '打开',
+				subname: '打开警报器',
+				id: 1,
+				url: '/services/switch/turn_on',
+				entity_id: 'switch.deerma_jsq2g_392f_alarm',
+			},
+			{
+				name: '关闭',
+				subname: '关闭警报器',
+				id: 0,
+				url: '/services/switch/turn_off',
+				entity_id: 'switch.deerma_jsq2g_392f_alarm',
+			},
+
+		],
+		actions_curtain: [
+			{
+				name: '打开',
+				subname: '打开香薰机',
+				id: 90,
+				url: '',
+				entity_id: '',
+			},
+			{
+				name: '关闭',
+				subname: '关闭香薰机',
+				id: 0,
+				url: '',
+				entity_id: '',
+			},
+
+		],
+		actions_san: [
+			{
+				name: '打开',
+				subname: '打开音响',
+				id: 1,
+				url: '',
+				entity_id: '',
+			},
+			{
+				name: '关闭',
+				subname: '关闭音响',
+				id: 0,
+				url: '',
+				entity_id: '',
+			},
+
+		],
+		actions_door: [
+			{
+				name: '打开',
+				subname: '打开智能开关',
+				id: 90,
+				url: '',
+				entity_id: '',
+			},
+			{
+				name: '关闭',
+				subname: '关闭智能开关',
+				id: 0,
+				url: '',
+				entity_id: '',
+			},
+
+		],
+		//设备控制弹窗参数 结束
+
+
+
+		client: {},
+
+		//设备状态参数 开始
+		status_beep: 0,
+		status_led: 0,
+		status_san: 0,
+		status_curtain: 0,
+		status_door: 0,
+		status_fire: 0,
+		status_light: 0,
+		status_mode: 0,
+		//设备状态参数 结束
+
+		//设备环境参数 开始
+		Temp: 0,
+		Humi: 0,
+		Voltage1: 0,
+		Voltage2: 0,
+		//设备环境参数 结束
+
+		//香薰机参数 开始
+		Light: 0,
+		LiquidLevel: 0,
+		//香薰机参数 开始
+		showAuthorizedDialog: false,
+		area: "请求中", //城区
+		city: "请求中", //城市
+		airText: "请求中", //空气优良
+		airValue: 0, //空气指数
+		weather: "请求中", //天气
+		//weatherAdvice: "今天天气不错", //天气建议
+		time: 30 * 60 * 60 * 1000,
+		gradientColor: {
+			'0%': '#ffd01e',
+			'100%': '#ee0a24',
+		},
+		value: 25,
+		pickerValue: [0], // picker-view 的当前值,数组形式,表示选择器的当前位置
+		array: ['0%', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%'], // 滑动块可选的值
+		items: ['0%', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%', '100%'], // 滑动块可选的值
+
+		scaleTextStyle: {
+			show: true,
+			size: 12,
+			color: ''
+		},
+		indicatorTextStyle: {
+			show: true,
+			size: 16,
+			text: '湿度'
+		},
+		indicatorTextStyleClimate: {
+			show: true,
+			size: 16,
+			text: '温度'
+		},
+		indicatorValueStyle: {
+			show: true,
+			size: 55,
+			color: ''
+		},
+		indicatorCircleStyle: {
+			show: true,
+			boderColor: [
+				{
+					progress: 0,
+					value: "#4575e8"
+				},
+				{
+					progress: 1,
+					value: "#fff"
+				}
+			]
+		},
+		listCover: [],//窗帘开关
+		listSwitch: [],//开关
+		listScroll: [],//滚动条
+		listUnit: [],//rgb、%、minutes、w等
+		listConversation: [],//智能音响
+		listConversation1: [],//智能音响
+		listHumidity: [],//加湿器
+		listButton: [],//按钮 '按下'
+		listSelect: [],//下拉框的
+		listClimate: [],//空调控制 图像
+
+		listMiotMediaPlayer: [],//智能音箱 图像
+		listMitvMediaPlayer: [],//电视 图像
+
+		listHumidifier: [],//加湿器 图像
+		listAromatherapyMachine: [],//香薰机 图像
+		listSensor: [],//文字描述的
+
+		listText: [],//文本框填写的
+
+		isPlaying: false,
+		currentTime: 0,
+		currentIndex: 0,
+		duration: 0,
+		currentSongTitle: '--',
+		currentSongArtist: '--',
+		canPrev: true,
+		canNext: true,
+		songs: [], // 歌曲列表
+		scrollValue: [],
+		modelList1: [],//起床模式
+		modelList2: [],//观影模式
+		modelList3: [],//睡眠模式
+		selectedIndex: 0, // 默认选中第一个选项
+		home_room: [
+			'company_laboratory',
+			'2802',
+		],
+		climateMode: '',//空调模式:加热还是除湿。在空调增加按钮和减少按钮 时使用
+
+		canvasWidth: 300, // 画布宽度
+		canvasHeight: 150, // 画布高度
+		value: 60, // 当前得分
+		total: 100, // 总分值
+		tvEntityId: '',// 电视实体Id
+		tvEntityIds: [],// 电视实体
+		entityName: '',//
+		sleep_duration: '50',
+		itemList: [
+			{ name: '1', data: [{ value: 10 }, { value: 1 }] },
+			{ name: '2', data: [{ value: 10 }, { value: 4 }] },
+			{ name: '3', data: [{ value: 10 }, { value: 7 }] },
+		],
+		blackList: [
+			// '指示灯','电视模式','电视音量','空调遥控','智能音箱','电视控制码','传感器模式','开关模式','耗电量','智能音箱会话'
+			'加湿器', '空调', '音箱', '窗帘', '纱帘'
+		],
+		temperatureHumidifyName: '温度',
+		temperatureValue: 0,
+		isButtonPressedHumidityUp: false,
+		isButtonPressedHumidityDown: false,
+		isButtonPressedClimateUp: false,
+		isButtonPressedClimateDown: false,
+		tcp: '',
+		w_temp: '',//温度
+		w_humidity: '',//湿度
+		imgSrc: '',//图片地址
+		isLoading: false,
+		observer: '',
+		hotelcode: '',//酒店编码
+		roomcode: '',//房间编码
+		isClickedPrevSong: false,
+		isClickedTogglePlayPause: false,
+		isClickedNextSong: false,
+		isClickedOnHumidifierUp: false,
+		isClickedOnHumidifierDown: false,
+		isClickedOnClimateAuto: false,
+		isClickedOnClimateUp: false,
+		isClickedToggleAromlight: false,//香薰机灯光
+		intervalId1: null,
+		intervalId2: null,
+		sliderValueHumidifier: '',
+		sliderValueClimate: '',
+		humidityMarginLeft: humidityMarginLeft
+	},
+	checkMenuTap(e) {
+		// 三种模式
+		console.log(e.currentTarget.dataset.index)
+		const index = e.currentTarget.dataset.index;
+		if (this.data.currentMenuTabIndex == index) {
+			// 选中的打断
+			return
+		}
+		if (index == 0 && !this.data.modelList1.length) {
+			// 没有的打断
+			return
+		}
+		if (index == 1 && !this.data.modelList2.length) {
+			// 没有的打断
+			return
+		}
+		if (index == 2 && !this.data.modelList3.length) {
+			// 没有的打断
+			return
+		}
+		this.setData({
+			menuTabDialogShow: true,
+			currentDialogIndex: index
+		})
+	},
+	onClickHideMenuTabDialog() {
+		this.setData({
+			menuTabDialogShow: false
+		})
+	},
+	onClickHideSureMenuTabDialog() {
+		var item = null;
+		if (this.data.currentDialogIndex == 0) {
+			item = this.data.modelList1[0];
+		} else if (this.data.currentDialogIndex == 1) {
+			item = this.data.modelList2[0];
+		} else if (this.data.currentDialogIndex == 2) {
+			item = this.data.modelList3[0];
+		}
+
+		// 确认模式
+
+		this.setData({
+			menuTabDialogShow: false,
+			currentMenuTabIndex: this.data.currentDialogIndex
+		})
+		wx.request({
+			url: `${homeApi_https}/services/automation/trigger`,
+			method: 'POST',
+			data: {
+				"entity_id": item.entity_id,
+				"skip_condition": true,
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+			},
+		});
+	},
+	checkHumidityMarginLeft() {
+		var proportion = 440;
+		var percentage = (humidityValue - humidityMin) / (humidityMax - humidityMin);
+		const value = percentage * proportion + humidityMarginLeft;
+		this.setData({
+			humidityMarginLeft: value
+		})
+	},
+	// 加湿器
+	handleTouchEndHumidifier: function (e) {
+		this.setData({
+			sliderValueHumidifier: '',
+		});
+	},
+	// 加湿器更改湿度
+	handleChangingHumidifier: function (e) {
+		// 假设 slider 宽度为屏幕宽度(或某个固定值),这里需要根据实际情况调整  
+		const sliderValueHumidifier = e.detail.value;
+		var proportion = 440;
+		var percentage = (sliderValueHumidifier - humidityMin) / (humidityMax - humidityMin);
+		const humidityMarginLeftValue = percentage * proportion + humidityMarginLeft;
+		this.setData({
+			sliderValueHumidifier: sliderValueHumidifier,
+			humidityMarginLeft: humidityMarginLeftValue
+		});
+	},
+	handleTouchEndClimate: function (e) {
+		this.setData({
+			sliderValueClimate: '',
+		});
+	},
+	handleChangingClimate: function (e) {
+		// 假设 slider 宽度为屏幕宽度(或某个固定值),这里需要根据实际情况调整  
+		const screenWidth = wx.getSystemInfoSync().windowWidth;
+		const sliderValueClimate = e.detail.value;
+		this.setData({
+			sliderValueClimate: sliderValueClimate
+		})
+	},
+	replaceAll: function (str, find, replace) {
+		return str.replace(new RegExp(find, 'g'), replace);
+	},
+	checkFuzzyMatch: function (data) {
+		var searchString = data.attributes.friendly_name
+		var domain = data.entity_id.split(".")[0]
+		var isMatched = true;
+		var list = this.data.blackList;
+		if (!searchString || !list) return false;
+		for (var i = 0; i < list.length; i++) {
+			if (searchString.indexOf(list[i]) !== -1) {
+				isMatched = false;
+				break;
+			}
+		}
+		return isMatched;
+	},
+	onChange: function (e) {
+		this.setData({
+			pickerValue: e.detail.value, // 更新picker-view的值
+		});
+		// 在这里添加点击事件的处理逻辑
+		// 根据pickerValue的变化执行相应的操作
+	},
+	swiperTap(e) {
+		// 处理整个swiper的点击事件
+	},
+	itemTap(e) {
+		// 处理swiper-item的点击事件
+		const index = e.currentTarget.dataset.index;
+		// 根据index执行其他操作
+	},
+	//定时组件
+
+
+	start() {
+		const countDown = this.selectComponent('.control-count-down');
+		countDown.start();
+	},
+
+	pause() {
+		const countDown = this.selectComponent('.control-count-down');
+		countDown.pause();
+	},
+
+	reset() {
+		const countDown = this.selectComponent('.control-count-down');
+		countDown.reset();
+	},
+	set() {
+		this.setData({
+			show_time: true,
+		})
+	},
+	onClose_TimeSet() {
+		this.setData({ show_time: false });
+	},
+	onChange_Silder(event) {
+		wx.showToast({
+			icon: 'none',
+			title: `定时:${event.detail}s`,
+		});
+		this.setData({
+			Time: event.detail,
+		})
+	},
+
+	onChange_Select(event) {
+		this.setData({
+			radio_select: event.detail,
+		});
+	},
+
+	onChange_Switch(event) {
+		this.setData({
+			radio_switch: event.detail,
+		});
+	},
+
+
+	finished() {
+		var that = this;
+		//定时开关哪个设备?
+		if (that.data.radio_select == 2) {
+			if (that.data.radio_switch == 1) {
+				console.log("选择了开");
+				that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":1}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——打开客厅灯");
+					}
+				});
+			} else {
+				console.log("选择了关");
+				that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":0}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——关闭客厅灯");
+					}
+				});
+			}
+		} else if (that.data.radio_select == 3) {
+			console.log("选择了BEEP");
+			if (that.data.radio_switch == 1) {
+				console.log("选择了开");
+				that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":1}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——打开报警器");
+					}
+				});
+			} else {
+				console.log("选择了关");
+				that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":0}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——关闭报警器");
+					}
+				});
+			}
+		} else if (that.data.radio_select == 4) {
+			console.log("选择了CU");
+			if (that.data.radio_switch == 1) {
+				console.log("选择了开");
+				that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":1}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——开窗帘");
+					}
+				});
+			} else {
+				console.log("选择了关");
+				that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":0}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——关窗帘");
+					}
+				});
+			}
+		} else if (that.data.radio_select == 5) {
+			console.log("选择了SAN");
+			if (that.data.radio_switch == 1) {
+				console.log("选择了开");
+				that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":1}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——开风扇");
+					}
+				});
+			} else {
+				console.log("选择了关");
+				that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":0}', function (err) {
+					if (!err) {
+						console.log("成功下发命令——关风扇");
+					}
+				});
+			}
+		}
+
+		Toast('倒计时结束');
+	},
+
+	setTextBreathing: function (cls, e) {
+		//使用记录呼吸效果
+		var transparency = 10;
+		var reduce = true;  //记录当前做透明度增加或降低操作
+		setInterval(function () {
+			if (reduce === true) {
+				transparency -= 1;
+				if (transparency === 0) {
+					reduce = false;
+				}
+			} else if (reduce === false) {
+				transparency += 1;
+				if (transparency === 10) {
+					reduce = true;
+				}
+			}
+			cls._defaultComponent.setData({
+				breathNum: transparency / 10
+			})
+			//通过setData的方式,设置breathNum的值
+		}, 80)
+	},
+
+
+	// 各个设备弹窗逻辑 
+	onOpen_led() {
+		this.setData({ show_led: true });
+	},
+	onClose_led() {
+		this.setData({
+			show_led: false
+		})
+	},
+	onSelect_led(event) {
+		console.log(event.detail.id);
+		this.onLedChange(event.detail.id);
+	},
+
+	onOpen_beep() {
+		this.setData({ show_beep: true });
+	},
+	onClose_beep() {
+		this.setData({
+			show_beep: false
+		})
+	},
+	onSelect_beep(event) {
+		console.log(event.detail.id);
+		this.onBeepChange(event.detail.id, event.detail.url, event.detail.entity_id);
+	},
+	getRealApi() {
+		// if(wx.getStorageSync('res').result && wx.getStorageSync('res').result.includes('辰悦颐养斋')){
+		// 	  homeApi = "http://zhh.aidsleep.cn:9123/api";
+		// 	  homeApiLater = "http://zhh.aidsleep.cn:9123";
+		//  homeApi_https = "https://zhh.aidsleep.cn/api";
+		//  homeApiLater_https = "https://zhh.aidsleep.cn";
+		// 	  entity = wx.getStorageSync('res').result=='company_laboratory'?'公司实验室':wx.getStorageSync('res').result
+		// 	  if(entity && entity.includes('-')){
+		// 		  entity = entity.slice(entity.indexOf('-')+1)
+		// 	  }
+		//  if(entity && entity.includes('|')){
+		//  	 entity = entity.slice(entity.indexOf('|')+1)
+		//  }
+		// }else if(wx.getStorageSync('res').result && (!wx.getStorageSync('res').result.includes('辰悦颐养斋'))){
+		// 	  homeApi = "http://haold.aidsleep.cn:8123/api";
+		// 	  homeApiLater = "http://haold.aidsleep.cn:8123";
+		//  homeApi_https = "https://haold.aidsleep.cn/api";
+		//  homeApiLater_https = "https://haold.aidsleep.cn";
+		//  entity = wx.getStorageSync('res').result=='company_laboratory'?'公司实验室':wx.getStorageSync('res').result
+		// 	  if(entity && entity.includes('-')){
+		// 		  entity = str.slice(str.indexOf('-')+1)
+		// 	  }
+		//  if(entity && entity.includes('|')){
+		//   entity = str.slice(str.indexOf('|')+1)
+		//  }
+		// }
+
+	},
+	onSelect_vangrid(url, entity_id) {
+		// this.setData({
+		//   status_beep: Number(param4)
+		// })
+
+		wx.request({
+			url: `${homeApi_https}` + url,
+			method: 'POST',
+			data: {
+				"entity_id": entity_id
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+			},
+		});
+
+	},
+
+	tvFanChange(e) {
+		var that = this;
+		const listMitvMediaPlayer = that.data.listMitvMediaPlayer;
+		// 获取绑定的参数
+		var entity_id = e.currentTarget.dataset.id;
+		var index = e.currentTarget.dataset.index;
+		//模式
+		var fan = e.currentTarget.dataset.fan;
+		if (fan == "当贝桌面") {
+			listMitvMediaPlayer[index].app_id = "com.dangbei.tvlauncher";
+			listMitvMediaPlayer[index].app_name = "当贝桌面";
+		} else {
+			listMitvMediaPlayer[index].app_id = "com.xiaomi.mitv.tvplayer";
+			listMitvMediaPlayer[index].app_name = "模拟电视";
+		}
+		that.setData({
+			listMitvMediaPlayer: listMitvMediaPlayer
+		})
+		wx.request({
+			url: `${homeApi_https}` + '/services/media_player/select_source',
+			method: 'POST',
+			data: {
+				"entity_id": entity_id,
+				"source": fan
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				// if(res.data){
+				// 	that.getSwitch(res.data,that)
+				// }
+			},
+		});
+
+	},
+	// switch
+	onSelect_All(e) {
+		var that = this;
+		const tempListSwitch = that.data.listSwitch;
+		// 获取绑定的参数
+		var param0 = e.currentTarget.dataset.param0;
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		// var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4 // 0 || 1;
+		var param5 = e.currentTarget.dataset.param5;
+		console.log('param1=' + param1);
+		console.log('param2=' + param2);
+		// console.log('param3='+param3);
+		// console.log('param4='+param4);
+		console.log('param5=' + param5);
+		if (param4 == '1') {
+			tempListSwitch[param0].state = "on"
+		} else {
+			tempListSwitch[param0].state = "off"
+		}
+
+		that.setData({
+			listSwitch: tempListSwitch
+		})
+		// this.setData({
+		//   status_beep: Number(param4)
+		// })
+		// if(param3 == "/turn_on"){
+		// 	that.data.listSwitch[param0].state = "off";
+		// 	that.data.listSwitch[param0].service = "turn_off";
+		// }else if(param3 == "/turn_off"){
+		// 	that.data.listSwitch[param0].state = "on";
+		// 	that.data.listSwitch[param0].service = "turn_on";
+		// }
+		console.log('switch 发生 change 事件,携带值为', e.detail)
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + (e.detail ? '/turn_on' : '/turn_off'),
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				// if(res.data){
+				// 	that.getSwitch(res.data,that)
+				// }
+			},
+		});
+
+	},
+	// 香薰机开关
+	onSelect_All_AromatherapyMachine(e) {
+		var that = this;
+		const tempListSwitch = that.data.listAromatherapyMachine;
+		// 获取绑定的参数
+		var param0 = e.currentTarget.dataset.param0;
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		// var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4 // 0 || 1;
+		var param5 = e.currentTarget.dataset.param5;
+		console.log('param1=' + param1);
+		console.log('param2=' + param2);
+		// console.log('param3='+param3);
+		// console.log('param4='+param4);
+		console.log('param5=' + param5);
+		if (param4 == '1') {
+			tempListSwitch[param0].state = "on"
+		} else {
+			tempListSwitch[param0].state = "off"
+		}
+
+		that.setData({
+			listAromatherapyMachine: tempListSwitch
+		})
+		// this.setData({
+		//   status_beep: Number(param4)
+		// })
+		// if(param3 == "/turn_on"){
+		// 	that.data.listSwitch[param0].state = "off";
+		// 	that.data.listSwitch[param0].service = "turn_off";
+		// }else if(param3 == "/turn_off"){
+		// 	that.data.listSwitch[param0].state = "on";
+		// 	that.data.listSwitch[param0].service = "turn_on";
+		// }
+		console.log('switch 发生 change 事件,携带值为', e.detail)
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + (e.detail ? '/turn_on' : '/turn_off'),
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				// if(res.data){
+				// 	that.getSwitch(res.data,that)
+				// }
+			},
+		});
+
+	},
+	onTap_All(e) {
+		var that = this;
+		// 获取绑定的参数
+		var param0 = e.currentTarget.dataset.param0;
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		// var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		console.log('param1=' + param1);
+		console.log('param2=' + param2);
+		// console.log('param3='+param3);
+		// console.log('param4='+param4);
+		console.log('param5=' + param5);
+		// this.setData({
+		//   status_beep: Number(param4)
+		// })
+		// if(param3 == "/turn_on"){
+		// 	that.data.listSwitch[param0].state = "off";
+		// 	that.data.listSwitch[param0].service = "turn_off";
+		// }else if(param3 == "/turn_off"){
+		// 	that.data.listSwitch[param0].state = "on";
+		// 	that.data.listSwitch[param0].service = "turn_on";
+		// }
+		console.log('switch 发生 change 事件,携带值为', param4)
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + (param4 == '1' ? '/turn_on' : '/turn_off'),
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				// if(res.data){
+				// 	that.getSwitch(res.data,that)
+				// }
+			},
+		});
+
+	},
+	//香薰机灯光控制
+	onSelect_All_aromlight(e) {
+		var that = this;
+		this.setData({
+			isClickedToggleAromlight: true
+		});
+		// 获取绑定的参数
+		var param0 = e.currentTarget.dataset.param0;
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		// var param3 = e.currentTarget.dataset.param3;
+		// var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		console.log('param1=' + param1);
+		console.log('param2=' + param2);
+		// console.log('param3='+param3);
+		// console.log('param4='+param4);
+		console.log('param5=' + param5);
+		// this.setData({
+		//   status_beep: Number(param4)
+		// })
+		// if(param3 == "/turn_on"){
+		// 	that.data.listSwitch[param0].state = "off";
+		// 	that.data.listSwitch[param0].service = "turn_off";
+		// }else if(param3 == "/turn_off"){
+		// 	that.data.listSwitch[param0].state = "on";
+		// 	that.data.listSwitch[param0].service = "turn_on";
+		// }
+		// console.log('switch 发生 change 事件,携带值为', e.detail.value)
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + '/turn_on',
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				// if(res.data){
+				// 	that.getSwitch(res.data,that)
+				// }
+			},
+		});
+
+	},
+	onSelect_Cover(e) {
+		var that = this;
+		// 获取绑定的参数
+		var param0 = e.currentTarget.dataset.param0;
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		// var param3 = e.currentTarget.dataset.param3;
+		// var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		console.log('param1=' + param1);
+		console.log('param2=' + param2);
+		// console.log('param3='+param3);
+		// console.log('param4='+param4);
+		console.log('param5=' + param5);
+		// this.setData({
+		//   status_beep: Number(param4)
+		// })
+		// if(param3 == "/turn_on"){
+		// 	that.data.listSwitch[param0].state = "off";
+		// 	that.data.listSwitch[param0].service = "turn_off";
+		// }else if(param3 == "/turn_off"){
+		// 	that.data.listSwitch[param0].state = "on";
+		// 	that.data.listSwitch[param0].service = "turn_on";
+		// }
+		console.log('switch 发生 change 事件,携带值为', e.detail.value)
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + (e.detail.value ? '/open_cover' : '/close_cover'),
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				// if(res.data){
+				// 	that.getSwitch(res.data,that)
+				// }
+			},
+		});
+
+	},
+	onStop_Cover(e) {
+		var that = this;
+		// 获取绑定的参数
+		var param0 = e.currentTarget.dataset.param0;
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		// var param3 = e.currentTarget.dataset.param3;
+		// var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		console.log('param1=' + param1);
+		console.log('param2=' + param2);
+		// console.log('param3='+param3);
+		// console.log('param4='+param4);
+		console.log('param5=' + param5);
+		// this.setData({
+		//   status_beep: Number(param4)
+		// })
+		// if(param3 == "/turn_on"){
+		// 	that.data.listSwitch[param0].state = "off";
+		// 	that.data.listSwitch[param0].service = "turn_off";
+		// }else if(param3 == "/turn_off"){
+		// 	that.data.listSwitch[param0].state = "on";
+		// 	that.data.listSwitch[param0].service = "turn_on";
+		// }
+		console.log('switch 发生 change 事件,携带值为', e.detail.value)
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + '/stop_cover',
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				// if(res.data){
+				// 	that.getSwitch(res.data,that)
+				// }
+			},
+		});
+
+	},
+	onPressButton(e) {
+		var that = this;
+		// 获取绑定的参数
+		var param = e.currentTarget.dataset.param;
+		console.log("sliderChange-param=" + param);
+		// wx.request({
+		//   url: `${homeApi_https}`+param1+param2+param3, 
+		//   method: 'POST',
+		//   data: {
+		//       "entity_id":param5
+		//     },
+		//    header: {
+		// 	  'content-type': 'application/json', // 默认值
+		//       'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+		//     },
+		//   success(res) {
+		// 	// if(res.data){
+		// 	// 	that.getSwitch(res.data,that)
+		// 	// }
+		//     console.log('res.data====='+JSON.stringify(res.data));
+		//   },
+		// });
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {
+			"entity_id": entity_id,
+			// "value":newValue
+		}
+		this.getService("/services", "/" + domain, "/press", "POST", data);
+	},
+
+	onSelect_beep1(e) {
+		// 获取绑定的参数
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		console.log('param1=' + param1);
+		console.log('param2=' + param2);
+		console.log('param3=' + param3);
+		console.log('param4=' + param4);
+		console.log('param5=' + param5);
+		this.setData({
+			status_beep: Number(param4)
+		})
+
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + param3,
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				console.log('res.data=====' + JSON.stringify(res.data));
+			},
+		});
+
+	},
+	status_led1(e) {
+		// 获取绑定的参数
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		this.setData({
+			status_led: Number(param4)
+		})
+
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + param3,
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				console.log('res.data=====' + JSON.stringify(res.data));
+			},
+		});
+
+	},
+	status_san1(e) {
+		// 获取绑定的参数
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		this.setData({
+			status_san: Number(param4)
+		})
+
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + param3,
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				console.log('res.data=====' + JSON.stringify(res.data));
+			},
+		});
+
+	},
+	status_curtain1(e) {
+		// 获取绑定的参数
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		this.setData({
+			status_curtain: Number(param4)
+		})
+
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + param3,
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				console.log('res.data=====' + JSON.stringify(res.data));
+			},
+		});
+
+	},
+	status_door1(e) {
+		// 获取绑定的参数
+		var param1 = e.currentTarget.dataset.param1;
+		var param2 = e.currentTarget.dataset.param2;
+		var param3 = e.currentTarget.dataset.param3;
+		var param4 = e.currentTarget.dataset.param4;
+		var param5 = e.currentTarget.dataset.param5;
+		this.setData({
+			status_door: Number(param4)
+		})
+
+		wx.request({
+			url: `${homeApi_https}` + param1 + param2 + param3,
+			method: 'POST',
+			data: {
+				"entity_id": param5
+			},
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				console.log('res.data=====' + JSON.stringify(res.data));
+			},
+		});
+
+	},
+	onOpen_curtain() {
+		this.setData({ show_curtain: true });
+	},
+	onClose_curtain() {
+		this.setData({
+			show_curtain: false
+		})
+	},
+	onSelect_curtain(event) {
+		console.log(event.detail.id);
+		this.onCurtainChange(event.detail.id);
+	},
+	onOpen_san() {
+		this.setData({ show_san: true });
+	},
+	onClose_san() {
+		this.setData({
+			show_san: false
+		})
+	},
+	onSelect_san(event) {
+		console.log(event.detail.id);
+		this.onSanChange(event.detail.id);
+	},
+
+	onOpen_door() {
+		this.setData({ show_door: true });
+	},
+	onClose_door() {
+		this.setData({
+			show_door: false
+		})
+	},
+	onSelect_door(event) {
+		console.log(event.detail.id);
+		this.onDoorChange(event.detail.id);
+	},
+
+	initChartHumidifier(canvas, width, height, dpr) {
+
+		console.log("humidityValue=>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", humidityValue);
+		this.selectComponent('#mychart-dom-gauge').init((canvas, width, height, dpr) => {
+			// 获取组件的 canvas、width、height 后的回调函数
+			// 在这里初始化图表
+			const chart = echarts.init(canvas, null, {
+				width: width,
+				height: height,
+				devicePixelRatio: dpr // new
+			});
+			setOption(chart);
+
+			// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问
+			chartCircularProgressBar = chart;
+
+			this.setData({
+				isLoaded: true,
+				isDisposed: false
+			});
+
+			// 注意这里一定要返回 chart 实例,否则会影响事件处理等
+			return chart;
+		});
+	},
+
+
+
+
+	//设备控制函数 开始
+	onFireChange(event) {
+		var that = this;
+		console.log(event);
+		let sw = event;
+		that.setData({
+			status_led: sw
+		})
+
+		if (sw) {
+			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":1}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——打开客厅灯");
+				}
+			});
+		} else {
+			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":0}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——关闭客厅灯");
+				}
+			});
+		}
+	},
+
+
+	onLedChange(event) {
+		var that = this;
+		console.log(event);
+		let sw = event;
+		that.setData({
+			status_led: sw
+		})
+
+		if (sw) {
+			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":1}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——打开客厅灯");
+				}
+			});
+		} else {
+			that.data.client.publish(mpPubTopic_LED, '{"target":"LED","value":0}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——关闭客厅灯");
+				}
+			});
+		}
+	},
+
+	onBeepChange(event, url, entity_id) {
+		var that = this;
+		console.log(event);
+		let sw = event;
+		that.setData({
+			status_beep: sw
+		})
+		console.log("event=" + event);
+		console.log("url=" + url);
+		console.log("entity_id=" + entity_id);
+		if (sw) {
+			// that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":1}', function (err) {
+			//   if (!err) {
+			//     console.log("成功下发命令——打开报警器");
+			//   }
+			// });
+			this.onSelect_vangrid(url, entity_id);
+		} else {
+			// that.data.client.publish(mpPubTopic_BEEP, '{"target":"BEEP","value":0}', function (err) {
+			//   if (!err) {
+			//     console.log("成功下发命令——关闭报警器");
+			//   }
+			// });
+			this.onSelect_vangrid(url, entity_id);
+		}
+	},
+
+	onCurtainChange(event) {
+		var that = this;
+		console.log(event);
+		let sw = event;
+		that.setData({
+			status_curtain: sw
+		})
+		if (sw) {
+			that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":1}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——开窗帘");
+				}
+			});
+		} else {
+			that.data.client.publish(mpPubTopic_CU, '{"target":"CU","value":0}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——关窗帘");
+				}
+			});
+		}
+	},
+
+
+	onSanChange(event) {
+		var that = this;
+		console.log(event);
+		let sw = event;
+		that.setData({
+			status_san: sw
+		})
+		if (sw) {
+			that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":1}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——开风扇");
+				}
+			});
+		} else {
+			that.data.client.publish(mpPubTopic_SAN, '{"target":"SAN","value":0}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——关风扇");
+				}
+			});
+		}
+	},
+
+	onDoorChange(event) {
+		var that = this;
+		console.log(event);
+		let sw = event;
+		that.setData({
+			status_door: sw
+		})
+		if (sw) {
+			that.data.client.publish(mpPubTopic_DO, '{"target":"DO","value":1}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——开门");
+				}
+			});
+		} else {
+			that.data.client.publish(mpPubTopic_DO, '{"target":"DO","value":0}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——关门");
+				}
+			});
+		}
+	},
+
+	onModeChange(event) {
+		var that = this;
+		console.log(event);
+		let sw = event.detail.value;
+		console.log(sw);
+		that.setData({
+			status_mode: sw
+		})
+		if (sw) {
+			that.data.client.publish(mpPubTopic_Mode, '{"target":"OUT","value":1}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——离家模式");
+				}
+			});
+		} else {
+			that.data.client.publish(mpPubTopic_Mode, '{"target":"OUT","value":0}', function (err) {
+				if (!err) {
+					console.log("成功下发命令——居家模式");
+				}
+			});
+		}
+	},
+
+	getEntityState(list, entity_id) {
+		if (list == null) return null;
+		var obj = list.find(function (obj) {
+			return obj.entity_id === entity_id
+		})
+		console.log('getEntityState==' + obj ? (obj.state == 'on' ? 1 : 0) : null);
+		return obj ? (obj.state == 'on' ? 1 : 0) : null;
+	},
+	getEntityStateValue(list, entity_id) {
+		if (list == null) return null;
+		var obj = list.find(function (obj) {
+			return obj.entity_id === entity_id
+		})
+		console.log('getEntityStateValue==' + obj ? obj.state : null);
+		return obj ? obj.state : null;
+	},
+
+	//扫码
+	tapScan() {
+		wx.scanCode({
+			success: function (res) {
+				console.log('扫码获取的参数', res)
+			}
+		})
+	},
+	getSwitch(resData, that) {
+		try {
+			var listSwitchTemp = [];
+			var listAromatherapyMachineTemp = [];
+			var entityIdList = [];
+			const res = wx.getStorageSync('res');
+			const home_room = wx.getStorageSync('res').home_room;
+			for (let i = 0; i < resData.length; i++) {
+				if (resData[i].attributes && resData[i].attributes.home_room && resData[i].attributes.home_room.includes((entity))) {
+					entityIdList.push(resData[i].entity_id)
+				}
+			}
+			console.log('entityIdList=====' + JSON.stringify(entityIdList));
+			for (let i = 0; i < resData.length; i++) {
+				if ((resData[i].attributes && resData[i].attributes.home_room && resData[i].attributes.home_room.includes((entity)))
+					|| (resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id))
+				) {
+					var obj = {};
+					obj.entity_id = resData[i].entity_id;//实体ID
+					obj.parent_entity_id = resData[i].parent_entity_id;//父实体ID
+					//api/services/<domain>/<service>
+					if (resData[i].entity_id) {
+						obj.domain = resData[i].entity_id.split(".")[0];
+					}
+					obj.state = (resData[i].state == 'unknown' ? "未知" : resData[i].state);
+					if (resData[i].attributes && resData[i].attributes.friendly_name) {
+						obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name); //设备名称
+					}
+					if (resData[i].attributes && resData[i].attributes.home_room) {
+						obj.home_room = resData[i].attributes.home_room.split(' ')[1]; //房间号
+					}
+					if (
+						resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList
+						&& entityIdList.includes(resData[i].attributes.parent_entity_id)
+					) {
+						if (resData[i].state == 'on') {
+							obj.service = 'turn_on';
+						} else if (resData[i].state == 'off') {
+							obj.service = 'turn_off';
+						}
+						//是否 是香薰机灯光
+						obj.isAromlight = obj.friendly_name.includes('香薰机灯光')
+						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.isAromlight && !obj.isAromAtomization && !obj.isAromatherapy) {
+
+							if (!obj.friendly_name.endsWith("电视")) {
+								listSwitchTemp.push(obj)
+							}
+						} else if ((obj.isAromlight || obj.isAromAtomization || obj.isAromatherapy) && checkState(obj.state)) {
+							listAromatherapyMachineTemp.push(obj)
+						}
+					}
+				}
+			}
+			console.log('listSwitchTemp=' + JSON.stringify(listSwitchTemp));
+			listSwitchTemp = that.checkTVList(listSwitchTemp);
+			that.setData({
+				listSwitch: listSwitchTemp,
+				listAromatherapyMachine: listAromatherapyMachineTemp,
+			})
+		} catch (error) {
+			console.error(error);
+		}
+	},
+	//设备控制函数 结束
+	sliderChange(e) {
+		let list = this.data.listScroll;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+
+			if (index == indexS) {
+				array[index].state = e.detail.value;
+			}
+		})
+		this.setData({
+			listScroll: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"value": e.detail.value,
+		}
+		this.getService("/services", "/" + domain, "/set_value", "POST", data);
+		// 设置两秒(2000毫秒)后的延迟
+		// setTimeout(() => {  
+		//   this.getMiotMediaPlayer(this); 
+		// }, 2000);  
+	},
+	onArrowUp(e) {
+		// 在这里处理向上箭头的点击事件  
+		// 例如,你可以增加文本框的值  
+		let currentValue = e.currentTarget.dataset.state;
+		let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字  
+		// this.setData({  
+		//   inputValue: newValue.toString()  
+		// });  
+
+		let list = this.data.listUnit;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index)
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			listUnit: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"value": newValue
+		}
+		this.getService("/services", "/" + domain, "/set_value", "POST", data);
+	},
+	// 加湿器
+	changeHumidity(e) {
+		let list = this.data.listHumidifier;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+
+			if (index == indexS) {
+				array[index].humidity = e.detail;
+			}
+		})
+		this.setData({
+			listHumidifier: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"humidity": e.detail
+		}
+		this.getService("/services", "/" + domain, "/set_humidity", "POST", data);
+	},
+	//加湿器
+	onHumidifierDown(e) {
+		var that = this;
+		this.setData({
+			isClickedOnHumidifierDown: true
+		});
+		// 在这里处理向下箭头的点击事件  
+		// 例如,你可以减少文本框的值  
+		let currentValue = e.currentTarget.dataset.humidity;
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字 
+		if (newValue < min) {
+			newValue = min;
+		}
+		// this.setData({  
+		//   inputValue: newValue.toString()  
+		// });  
+
+		let list = this.data.listHumidifier;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index)
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].humidity = newValue;
+			}
+		})
+		this.setData({
+			listHumidifier: list,
+			// isButtonPressedHumidityDown:!that.data.isButtonPressedHumidityDown
+		})
+		let data = {
+			"entity_id": entity_id,
+			"humidity": newValue
+		}
+		this.getService("/services", "/" + domain, "/set_humidity", "POST", data);
+	},
+	//加湿器
+	onHumidifierUp(e) {
+		var that = this;
+		this.setData({
+			isClickedOnHumidifierUp: true
+		});
+		// 在这里处理向上箭头的点击事件  
+		// 例如,你可以增加文本框的值  
+		let currentValue = e.currentTarget.dataset.humidity || 0;
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字  
+		if (newValue > max) {
+			newValue = max;
+		}
+		// this.setData({  
+		//   inputValue: newValue.toString()  
+		// });  
+
+		let list = this.data.listHumidifier;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index)
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].humidity = newValue;
+			}
+		})
+		this.setData({
+			listHumidifier: list,
+			// isButtonPressedHumidityUp:!that.data.isButtonPressedHumidityUp
+		})
+		let data = {
+			"entity_id": entity_id,
+			"humidity": newValue
+		}
+		console.log(e.currentTarget.dataset);
+		this.getService("/services", "/" + domain, "/set_humidity", "POST", data);
+	},
+	//加湿器
+	onHumidifierOn(e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/turn_on", "POST", data);
+	},
+	//加湿器
+	onHumidifierOff(e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/turn_off", "POST", data);
+	},
+	// 拖动空调的值
+	dragClimate(e) {
+		var that = this;
+		let state = e.currentTarget.dataset.state;
+		console.log(e.detail.value);
+		if (state == "auto") {
+			return
+		}
+		let list = that.data.listClimate;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		// 将本地缓存数据渲染到对应修改的案例
+
+		for (let i = 0; i < list.length; i++) {
+			var element = list[i];
+			if (i == indexS) {
+				element.temperatureTemp = e.detail.value;
+				break;
+			}
+
+		}
+		that.setData({
+			listClimate: list
+		})
+		console.log(list);
+	},
+	// 更改空调的值
+	changeClimate(e) {
+		var that = this;
+		let state = e.currentTarget.dataset.state;
+		if (state == "auto") {
+			return
+		}
+		this.setData({
+			isClickedOnClimateUp: true
+		});
+		console.log('that.data.climateMode==' + that.data.climateMode);
+		if (!that.data.climateMode) {
+			wx.showToast({
+				title: '请先选择模式',
+				icon: 'none'
+			});
+			return;
+		}
+		let currentValue = e.currentTarget.dataset.temperature;
+		let fanMode = e.currentTarget.dataset.fanMode;
+
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {};
+		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+			let indexS = Number(e.currentTarget.dataset.index);
+			// 将本地缓存数据渲染到对应修改的案例
+			list.forEach(function (value, index, array) {
+				if (index == indexS) {
+					array[index].temperature = e.detail;
+				}
+			})
+			this.setData({
+				listClimate: list
+			})
+			data = {
+				"entity_id": entity_id,
+				"temperature": e.detail,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'dry') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				"temperature": e.detail,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'fan_only') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
+				"temperature": e.detail,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		}
+	},
+	// 更改空调的值
+	minusClimate(e) {
+		var that = this;
+		let state = e.currentTarget.dataset.state;
+		if (state == "auto") {
+			return
+		}
+		this.setData({
+			isClickedOnClimateUp: true
+		});
+		console.log('that.data.climateMode==' + that.data.climateMode);
+		if (!that.data.climateMode) {
+			wx.showToast({
+				title: '请先选择模式',
+				icon: 'none'
+			});
+			return;
+		}
+		let currentValue = e.currentTarget.dataset.temperature;
+		let fanMode = e.currentTarget.dataset.fanMode;
+
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		let domain = e.currentTarget.dataset.domain;
+		let temperature = e.currentTarget.dataset.temperature - 1;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {};
+		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+			let indexS = Number(e.currentTarget.dataset.index);
+			// 将本地缓存数据渲染到对应修改的案例
+			list.forEach(function (value, index, array) {
+				if (index == indexS) {
+					array[index].temperature = temperature;
+				}
+			})
+			this.setData({
+				listClimate: list
+			})
+			data = {
+				"entity_id": entity_id,
+				"temperature": temperature,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'dry') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				"temperature": temperature,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'fan_only') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
+				"temperature": temperature,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		}
+	},
+	// 更改空调的值
+	addClimate(e) {
+		var that = this;
+		let state = e.currentTarget.dataset.state;
+		if (state == "auto") {
+			return
+		}
+		this.setData({
+			isClickedOnClimateUp: true
+		});
+		console.log('that.data.climateMode==' + that.data.climateMode);
+		if (!that.data.climateMode) {
+			wx.showToast({
+				title: '请先选择模式',
+				icon: 'none'
+			});
+			return;
+		}
+		let currentValue = e.currentTarget.dataset.temperature;
+		let fanMode = e.currentTarget.dataset.fanMode;
+
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		let domain = e.currentTarget.dataset.domain;
+		let temperature = e.currentTarget.dataset.temperature + 1;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {};
+		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+			let indexS = Number(e.currentTarget.dataset.index);
+			// 将本地缓存数据渲染到对应修改的案例
+			list.forEach(function (value, index, array) {
+				if (index == indexS) {
+					array[index].temperature = temperature;
+				}
+			})
+			this.setData({
+				listClimate: list
+			})
+			data = {
+				"entity_id": entity_id,
+				"temperature": temperature,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'dry') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				"temperature": temperature,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'fan_only') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
+				"temperature": temperature,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		}
+	},
+	onClimateDown(e) {
+		var that = this;
+		if (!that.data.climateMode) {
+			wx.showToast({
+				title: '请先选择模式',
+				icon: 'none'
+			});
+			return;
+		}
+		console.log('that.data.climateMode==' + that.data.climateMode);
+		let currentValue = e.currentTarget.dataset.temperature;
+		let fanMode = e.currentTarget.dataset.fanMode;
+		// let list = this.data.listClimate;
+		// this.setData({  
+		//   inputValue: newValue.toString()  
+		// });  
+
+
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		// this.setData({
+		// 	isButtonPressedClimateDown: !that.data.isButtonPressedClimateDown
+		// })
+		// 将本地缓存数据渲染到对应修改的案例
+		// list.forEach(function (value,index, array){
+		//   if (index == indexS) {
+		//      array[index].temperature = newValue;
+		//     }
+		// })
+		// this.setData({
+		//   listClimate: list
+		// })
+		let data = {};
+		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
+			let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字 
+			if (newValue < min) newValue = min;
+			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+			let indexS = Number(e.currentTarget.dataset.index);
+			// 将本地缓存数据渲染到对应修改的案例
+			list.forEach(function (value, index, array) {
+				if (index == indexS) {
+					array[index].temperature = newValue;
+				}
+			})
+			this.setData({
+				listClimate: list
+			})
+			console.log('onClimateDown-entity_id=' + entity_id);
+			data = {
+				"entity_id": entity_id,
+				"temperature": newValue,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'dry') {
+			let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字 
+			if (newValue < min) newValue = min;
+			data = {
+				"entity_id": entity_id,
+				"temperature": newValue,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'fan_only') {
+			let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字
+			if (newValue < min) newValue = min;
+			data = {
+				"entity_id": entity_id,
+				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
+				"temperature": newValue,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		}
+	},
+	onClimateUp(e) {
+		var that = this;
+		this.setData({
+			isClickedOnClimateUp: true
+		});
+		console.log('that.data.climateMode==' + that.data.climateMode);
+		if (!that.data.climateMode) {
+			wx.showToast({
+				title: '请先选择模式',
+				icon: 'none'
+			});
+			return;
+		}
+		let currentValue = e.currentTarget.dataset.temperature;
+		let fanMode = e.currentTarget.dataset.fanMode;
+
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		// this.setData({  
+		//   inputValue: newValue.toString()  
+		// });  
+
+		// let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+		// let indexS = Number(e.currentTarget.dataset.index)
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// this.setData({
+		// 	isButtonPressedClimateUp: !that.data.isButtonPressedClimateUp
+		// })
+		// 将本地缓存数据渲染到对应修改的案例
+		// list.forEach(function (value,index, array){
+		//   if (index == indexS) {
+		//      array[index].temperature = newValue;
+		//     }
+		// })
+		// this.setData({
+		//   listClimate: list
+		// })
+		let data = {};
+		if (that.data.climateMode == 'heat' || that.data.climateMode == 'cool') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+			let indexS = Number(e.currentTarget.dataset.index);
+			// 将本地缓存数据渲染到对应修改的案例
+			list.forEach(function (value, index, array) {
+				if (index == indexS) {
+					array[index].temperature = newValue;
+				}
+			})
+			this.setData({
+				listClimate: list
+			})
+			data = {
+				"entity_id": entity_id,
+				"temperature": newValue,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'dry') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字 
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				"temperature": newValue,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		} else if (that.data.climateMode == 'fan_only') {
+			let newValue = parseInt(currentValue) + 1; // 假设文本框中的是数字
+			if (newValue > max) newValue = max;
+			data = {
+				"entity_id": entity_id,
+				// "fan_mode":(fanMode=='Fan Speed Up')?'Fan Speed Down':'Fan Speed Up',
+				"temperature": newValue,
+				"hvac_mode": that.data.climateMode
+			}
+			this.getService("/services", "/" + domain, "/set_temperature", "POST", data);
+		}
+	},
+	onClimateAuto(e) {
+		this.setData({
+			isClickedOnClimateAuto: true
+		});
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			temperatureHumidifyName: '自动',
+			climateMode: 'auto',
+			listClimate: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"hvac_mode": 'auto',
+		}
+		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
+	},
+	onClimateHeat(e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			temperatureHumidifyName: '制热',
+			climateMode: 'heat',
+			listClimate: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"hvac_mode": 'heat',
+		}
+		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
+	},
+	onClimateCool(e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			temperatureHumidifyName: '制冷',
+			climateMode: 'cool',
+			listClimate: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"hvac_mode": 'cool',
+		}
+		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
+	},
+	onClimateDehumidify(e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			temperatureHumidifyName: '除湿',
+			climateMode: 'dry',
+			listClimate: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"hvac_mode": 'dry',
+		}
+		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
+	},
+	onClimateAirSupply(e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			temperatureHumidifyName: '送风',
+			climateMode: 'fan_only',
+			listClimate: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"hvac_mode": 'fan_only',
+		}
+		this.getService("/services", "/" + domain, "/set_hvac_mode", "POST", data);
+	},
+	onClimateOff(e) {
+		let state = e.currentTarget.dataset.state;
+		if (state == 'off') {
+			// 如果是关闭的就开成自动
+			this.onClimateAuto(e);
+			return
+		}
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let list = this.data.listClimate;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index);
+
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			temperatureHumidifyName: '关闭',
+			climateMode: 'off',
+			listClimate: list
+		})
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/turn_off", "POST", data);
+	},
+	handleInput: function (e) {
+		// 这里你需要自己实现歌曲列表和切换逻辑  
+		// 例如,如果你有一个歌曲列表,你可以通过修改当前播放歌曲的索引来切换歌曲  
+		// 假设你有一个歌曲列表`songs`和一个当前歌曲索引`currentIndex`  
+		// if (this.data.currentIndex > 0) {
+		//   this.data.currentIndex--;  
+		//   // 加载新歌曲并播放  
+		//   this.loadAndPlaySong(this.data.currentIndex);  
+		// }
+		let min = e.currentTarget.dataset.min;
+		let max = e.currentTarget.dataset.max;
+		if (e.detail.value && (e.detail.value.length > max || e.detail.value.length < min)) {
+			wx.showModal({
+				title: '提示',
+				content: '文本长度介于' + min + '~' + max + '长度之间',
+				showCancel: false
+			});
+			return;
+		}
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {
+			"entity_id": entity_id,
+			"value": e.detail.value,
+		}
+		this.getService("/services", "/" + domain, "/set_value", "POST", data);
+	},
+	onArrowDown(e) {
+		// 在这里处理向下箭头的点击事件  
+		// 例如,你可以减少文本框的值  
+		let currentValue = e.currentTarget.dataset.state;
+		let newValue = parseInt(currentValue) - 1; // 假设文本框中的是数字  
+		// this.setData({  
+		//   inputValue: newValue.toString()  
+		// });  
+
+		let list = this.data.listUnit;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index)
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].state = newValue;
+			}
+		})
+		this.setData({
+			listUnit: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"value": newValue
+		}
+		this.getService("/services", "/" + domain, "/set_value", "POST", data);
+	},
+	prevSong: function (e) {
+		// 这里你需要自己实现歌曲列表和切换逻辑  
+		// 例如,如果你有一个歌曲列表,你可以通过修改当前播放歌曲的索引来切换歌曲  
+		// 假设你有一个歌曲列表`songs`和一个当前歌曲索引`currentIndex`  
+		// if (this.data.currentIndex > 0) {
+		//   this.data.currentIndex--;  
+		//   // 加载新歌曲并播放  
+		//   this.loadAndPlaySong(this.data.currentIndex);  
+		// }
+		this.setData({
+			isClickedPrevSong: true
+		});
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/media_previous_track", "POST", data);
+		// setTimeout(() => {
+		//   this.getMiotMediaPlayer(this); 
+		// }, 8000); 
+	},
+
+	tvTurnOn: function (e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/turn_on", "POST", data);
+	},
+	tvTurnOff: function (e) {
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/turn_off", "POST", data);
+	},
+
+	// 切换播放/暂停  
+	togglePlayPause: function (e) {
+		// console.log("this.data.isPlaying="+this.data.isPlaying);
+		//    if (this.data.isPlaying) {  
+		//      this.innerAudioContext.pause();  
+		//   this.setData({ isPlaying: false });
+		//   this.getService("/services","/"+domain,"/media_pause","POST",null);
+		//    } else {  
+		//      this.innerAudioContext.play();  
+		//   this.setData({ isPlaying: true });
+		//   this.getService("/services","/"+domain,"/media_play","POST",null);
+		//    }  
+		// let list = this.data.listMiotMediaPlayer;//这里是将需要循环的数组赋值给list
+		this.setData({
+			isClickedTogglePlayPause: true
+		});
+		let indexS = Number(e.currentTarget.dataset.index)
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let state = e.currentTarget.dataset.state;
+		// 将本地缓存数据渲染到对应修改的案例
+		// list.forEach(function (value,index, array){
+		//   if (index == indexS) {
+		//      array[index].state = (state=='playing'?'idle':'playing');
+		//     }
+		// })
+		// this.setData({
+		//   listMiotMediaPlayer: list
+		// })
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/media_play_pause", "POST", data);
+
+		// 设置两秒(2000毫秒)后的延迟  
+		// setTimeout(() => {  
+		//   this.getMiotMediaPlayer(this); 
+		// }, 8000);  
+
+	},
+
+	// 切换下一首歌曲  
+	nextSong: function (e) {
+		// 和prevSong类似,你需要实现歌曲列表和切换逻辑  
+		// 假设歌曲列表为`songs`,当前歌曲索引为`currentIndex`  
+		// if (this.data.currentIndex < songs.length - 1) {  
+		//   this.data.currentIndex++;  
+		//   // 加载新歌曲并播放  
+		//   this.loadAndPlaySong(this.data.currentIndex);  
+		// }
+		this.setData({
+			isClickedNextSong: true
+		});
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		let data = {
+			"entity_id": entity_id,
+		}
+		this.getService("/services", "/" + domain, "/media_next_track", "POST", data);
+		// setTimeout(() => {
+		//   this.getMiotMediaPlayer(this); 
+		// }, 8000); 
+	},
+
+	// 加载并播放指定索引的歌曲  
+	loadAndPlaySong: function (index) {
+		// 假设你有一个歌曲列表`songs`,每个歌曲对象有`url`属性表示音频链接  
+		const song = songs[index];
+		this.innerAudioContext.src = song.url;
+		this.innerAudioContext.play();
+		// 更新当前播放的歌曲信息(例如标题和艺术家)  
+		this.setData({
+			currentSongTitle: song.title,
+			currentSongArtist: song.artist
+		});
+	},
+	base64Decode: function (input) {
+		const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
+		let str = '';
+		let output = '';
+		let chr1, chr2, chr3;
+		let enc1, enc2, enc3, enc4;
+		let i = 0;
+
+		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
+
+		while (i < input.length) {
+			enc1 = chars.indexOf(input.charAt(i++));
+			enc2 = chars.indexOf(input.charAt(i++));
+			enc3 = chars.indexOf(input.charAt(i++));
+			enc4 = chars.indexOf(input.charAt(i++));
+
+			chr1 = (enc1 << 2) | (enc2 >> 4);
+			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+			chr3 = ((enc3 & 3) << 6) | enc4;
+
+			str += String.fromCharCode(chr1);
+
+			if (enc3 != 64) {
+				str += String.fromCharCode(chr2);
+			}
+			if (enc4 != 64) {
+				str += String.fromCharCode(chr3);
+			}
+		}
+
+		return str;
+	},
+	onPickerChange: function (e) {
+		//    this.setData({  
+		//      selectedIndex: e.detail.value  
+		//    });  
+		//    // 可以在这里处理选中值的变化,比如发送请求等  
+		//    console.log('选中的值是:', this.data.options[e.detail.value].value);  
+
+		let list = this.data.listSelect;//这里是将需要循环的数组赋值给list
+		let indexS = Number(e.currentTarget.dataset.index)
+		let domain = e.currentTarget.dataset.domain;
+		let entity_id = e.currentTarget.dataset.id;
+		// 将本地缓存数据渲染到对应修改的案例
+		list.forEach(function (value, index, array) {
+			if (index == indexS) {
+				array[index].selectedIndex = e.detail.value;
+			}
+		})
+		this.setData({
+			listSelect: list
+		})
+		let data = {
+			"entity_id": entity_id,
+			"option": e.detail.value,
+		}
+		this.getService("/services", "/" + domain, "/select_option", "POST", data);
+	},
+	getService(services, domain, service, method, data) {
+		wx.request({
+			url: `${homeApi_https}` + services + domain + service,
+			method: method,
+			data: data,
+			header: {
+				'content-type': 'application/json', // 默认值
+				'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			},
+			success(res) {
+				console.log('res.data=====' + JSON.stringify(res.data));
+			},
+		});
+	},
+	// 初始化时调用即可
+	showCanvasRing() {
+		try {
+			//作画
+			var ctx = wx.createCanvasContext("circleBar", this); //canvas组建封装,需要后加个this
+			ctx.clearRect(0, 0, this.data.canvasWidth, this.data.canvasHeight); // 清除画布
+
+			var circle_r = this.data.canvasWidth / 2 - 10; //画布的一半,用来找中心点和半径
+			var scoreText = this.data.value; // 当前得分
+			var total = this.data.total;// 总分值
+
+			var score = (100 * scoreText) / total; // 满分为100时对应的值
+			let that = this;
+
+			//定义起始点
+			ctx.translate(this.data.canvasWidth / 2, this.data.canvasWidth / 2 + 5);
+			//  白边圆弧
+			ctx.beginPath();
+			ctx.setStrokeStyle("#FFFFFF");
+			ctx.setLineWidth(16);
+			ctx.setLineCap("round");
+			ctx.arc(0, 0, circle_r - 15, 1 * Math.PI, 0, false);
+			ctx.stroke();
+			ctx.closePath();
+
+			//灰色圆弧
+			ctx.beginPath();
+			ctx.setStrokeStyle("#D6E4FF");
+			ctx.setLineWidth(12);
+			ctx.setLineCap("round"); //线条结束端点样式 butt 平直 round 圆形 square 正方形
+			ctx.arc(0, 0, circle_r - 15, 1 * Math.PI, 0, false);
+			ctx.stroke();
+			ctx.closePath();
+
+			// 蓝色圆弧
+			ctx.beginPath();
+			ctx.setStrokeStyle("#3366FF");
+			ctx.setLineWidth(16);
+			ctx.arc(
+				0,
+				0,
+				circle_r - 15,
+				1 * Math.PI,
+				(score / 100 + 1) * Math.PI,
+				false
+			);
+			ctx.stroke();
+			ctx.closePath();
+			// 指示器-外层
+			let deg = 270 - score * 1.8;
+			const xAxis = Math.sin(((2 * Math.PI) / 360) * deg) * (circle_r - 15);
+			const yAxis = Math.cos(((2 * Math.PI) / 360) * deg) * (circle_r - 15);
+			ctx.beginPath();
+			ctx.arc(xAxis, yAxis, 11, 0, 2 * Math.PI);
+			ctx.setFillStyle("#FFFFFF");
+			ctx.fill();
+			// 指示器-内层
+			const xAxis2 = Math.sin(((2 * Math.PI) / 360) * deg) * (circle_r - 15);
+			const yAxis2 = Math.cos(((2 * Math.PI) / 360) * deg) * (circle_r - 15); // circle_r - 10
+			ctx.beginPath();
+			ctx.arc(xAxis2, yAxis2, 6, 0, 2 * Math.PI);
+			ctx.setFillStyle("#3366FF");
+			ctx.fill();
+
+			// 文字-总得分
+			ctx.setTextAlign("center"); // 字体位置
+			ctx.setFillStyle("#333333");
+			ctx.font = "normal normal 16px Arial,sans-serif";
+			ctx.fillText("总得分", 0, -30);
+			// 文字-具体分数
+			ctx.setTextAlign("center"); // 字体位置
+			ctx.setFillStyle("#000000");
+			ctx.font = "normal bold 36px Arial,sans-serif";
+			ctx.fillText(scoreText, 0, 13);
+
+			// 最低分
+			ctx.setFillStyle("#666666");
+			ctx.font = "normal normal 13px Arial,sans-serif";
+			ctx.fillText(0, -circle_r + 10, 25);
+			// 最高分
+			ctx.setFillStyle("#666666");
+			ctx.font = "normal normal 13px Arial,sans-serif";
+			ctx.fillText(total, circle_r - 15, 25);
+
+			// 绘图
+			ctx.draw(false, function () {
+				//将生成好的图片保存到本地
+				wx.canvasToTempFilePath(
+					{
+						canvasId: "circleBar",
+						success: function (res) {
+							var tempFilePath = res.tempFilePath;
+							that.setData({
+								loadImagePath: tempFilePath,
+							});
+						},
+						fail: function (res) { },
+					},
+				);
+			});
+		} catch (error) {
+		}
+	},
+
+	getHAData(that, hotelcode, roomcode) {
+		let start = Date.now(); // 获取当前时间(毫秒)
+		// console.log('start=='+start);
+
+
+
+		wx.request({
+			url: `${aipushApi}/getha`, //
+			method: 'POST',
+			//   header: {
+			// 	  'content-type': 'application/json', // 默认值
+			// 	  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			// },
+			data: {
+				"locations": hotelcode, "room": (hotelcode && hotelcode.includes('hotel')) ? roomcode : "", "token": token_push
+			},
+			success(ress) {
+				if (!ress || !ress.data) {
+					console.error("getha(),没有获取到数据");
+					return;
+				}
+				var resData = ress.data
+				console.log("resData-==" + JSON.stringify(resData));
+				console.log("resData.loc-==" + JSON.stringify(resData.loc));
+				homeApi_https = resData.loc + "/api";
+				homeApiLater_https = resData.loc;
+				token = resData.token;
+				// console.log('res.data='+JSON.stringify(resData));
+				if (ress.data.code == "400") {
+					console.error("400错误!");
+					return;
+				}
+				if (ress.data.code == "401") {
+					console.error("401错误!");
+					return;
+				}
+				try {
+
+					//获取HA 设备状态数据
+					// wx.request({
+					//   url: `${homeApi_https}/states`, //获取空气数据
+					//   method: 'GET',
+					//    header: {
+					// 		  'content-type': 'application/json', // 默认值
+					// 	  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+					// 	},
+					//   success(res) {
+					// 	  if(!res || !res.data){
+					// 		  return;
+					// 	  }
+					// 	var resData = res.data
+					// 	// console.log('res.data='+JSON.stringify(resData));
+					// 	if (res.data.code == "400") {
+					// 	  console.error("400错误!");
+					// 	  return;
+					// 	}
+					// 	if (res.data.code == "401") {
+					// 	  console.error("401错误 --- 请检查你的API或Key是否正确!");
+					// 	  return;
+					// 	}
+					// 	try {
+
+
+					// const {
+					//   now
+					// } = res.data;
+					//  console.log('res.data1='+JSON.stringify(resData));
+					//  res.data.find(function (obj) {
+					//   console.log('obj='+obj); 
+					//  })
+					//  res.data.forEach((item, index) => {
+					// console.log(index, item); 
+					//  });
+					var listCoverTemp = [];
+					var listSwitchTemp = [];
+					var listScrollTemp = [];
+					var listUnitTemp = [];
+					var listConversationTemp = [];
+					var listConversation1Temp = [];
+					var listHumidityTemp = [];
+					var listButtonTemp = [];
+					var listSelectTemp = [];
+					var listClimateTemp = [];
+					var listMiotMediaPlayerTemp = [];
+					var listMitvMediaPlayerTemp = [];
+					var listHumidifierTemp = [];
+					var listSensorTemp = [];
+					var listTextTemp = [];
+
+					var tvEntityIdTemp = '';
+					var tvEntityIdsTemp = [];
+					var listAromatherapyMachineTemp = [];
+					var modelList1 = [];
+					var modelList2 = [];
+					var modelList3 = [];
+					var climateModeTemp = '';
+					var temperatureHumidifyNameTemp = '温度';
+					var humidityValueTemp = 0;
+					var humidityMaxTemp = 0;
+					var humidityMinTemp = 0;
+
+					var entityIdList = [];
+					const res = wx.getStorageSync('res');
+					const home_room = wx.getStorageSync('res').home_room;
+					// console.log('entity=====@==='+entity);
+					wx.request({
+						url: `${homeApi_https}/aidsleep/entity`, //获取空气数据
+						method: 'POST',
+						header: {
+							'content-type': 'application/json', // 默认值
+							'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+						},
+						//
+						data: {
+							"template": "{{ label_entities('" + (entity) + "') }}"
+						},
+						success(resTemplate) {
+							let mid = Date.now(); // 再次获取当前时间(毫秒)
+							// console.log('mid=='+mid);
+							if (!resTemplate || !resTemplate.data) {
+								console.log('no data:' + mid);
+								return;
+							}
+							let resData = resTemplate.data;
+							// resData = resData.filter(item1 => {
+							//   return JSON.parse(that.replaceAll(resTemplate.data,'\'','\"')).find(item2 => item2 === item1.entity_id) !== undefined;  
+							// });
+							// console.log('entityIdList-resTemplate====='+JSON.stringify(resTemplate.data));
+							for (let i = 0; i < resData.length; i++) {
+								// if(resTemplate.data.includes(resData[i].entity_id) && that.checkFuzzyMatch(resData[i])){
+								var obj = {};
+								obj.entity_id = resData[i].entity_id;//实体ID
+								obj.parent_entity_id = resData[i].parent_entity_id;//父实体ID
+								//api/services/<domain>/<service>
+								if (resData[i].entity_id) {
+									obj.domain = resData[i].entity_id.split(".")[0];
+								}
+								obj.state = (resData[i].state == 'unknown' ? "未知" : resData[i].state);
+								if (resData[i].attributes && resData[i].attributes.friendly_name) {
+									obj.friendly_name = resData[i].attributes.friendly_name; //设备名称
+
+
+									if (obj.friendly_name.includes("灯带") || obj.friendly_name.includes("吸顶灯")) {
+										obj.imgSrc = '/static/icons/ic_dd_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
+									} else if (obj.friendly_name.includes("走廊灯")) {
+										obj.imgSrc = '/static/icons/ic_zld_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_zld_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #FFEEFA 0%, #FFFFFF 50%)';
+									} else if (obj.friendly_name.includes("筒灯")) {
+										obj.imgSrc = '/static/icons/ic_td_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_td_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #EBF0FF 0%, #FFFFFF 50%)';
+									} else if (obj.friendly_name.includes("主灯")) {
+										obj.imgSrc = '/static/icons/ic_zd_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_zd_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #EFE7FF 0%, #FFFFFF 50%)';
+									} else if (obj.friendly_name.includes("气扇")) {
+										obj.imgSrc = '/static/icons/ic_pqs_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_pqs_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #E3FFE6 0%, #FFFFFF 53%)';
+									} else if (obj.friendly_name.includes("电视")) {
+										obj.imgSrc = '/static/icons/ic_ds_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
+										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
+									} else if (obj.friendly_name.includes("空气净化器")) {
+										obj.imgSrc = '/static/icons/ic_kqjhq_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_kqjhq_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #EBFAFF 0%, #FFFFFF 50%)';
+
+									} else if (obj.friendly_name.includes("香薰机雾化")) {
+										obj.imgSrc = '/static/icons/ic_xxjwh.svg';
+										obj.selectedImgSrc = '/static/icons/ic_xxjwh.svg';
+
+									} else if (obj.friendly_name.endsWith('香薰机') || obj.friendly_name.endsWith('香薰机开关')) {
+										obj.imgSrc = '/static/icons/ic_xxj.svg';
+										obj.selectedImgSrc = '/static/icons/ic_xxj.svg';
+									} else if (obj.friendly_name.includes("灯")) {
+										obj.imgSrc = '/static/icons/ic_dd_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
+									} else {
+										obj.imgSrc = '/static/icons/ic_ds_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
+										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
+									}
+
+
+								}
+								if (resData[i].attributes && resData[i].attributes.home_room) {
+									obj.home_room = resData[i].attributes.home_room.split(' ')[1]; //房间号
+								}
+								if (resData[i].state && that.checkFuzzyMatch(resData[i])
+								) {
+									if (resData[i].state == 'on') {
+										obj.service = 'turn_on';
+									} else if (resData[i].state == 'off') {
+										obj.service = 'turn_off';
+									}
+									//截取字符串,防止开关设备名称过长
+									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
+									//是否 是香薰机灯光
+									obj.isAromlight = obj.friendly_name.includes('香薰机灯光')
+									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.isAromlight && !obj.isAromAtomization && !obj.isAromatherapy) {
+
+										if (!obj.friendly_name.endsWith("电视")) {
+											listSwitchTemp.push(obj)
+										}
+									} else if ((obj.isAromlight || obj.isAromAtomization || obj.isAromatherapy) && checkState(obj.state)) {
+										listAromatherapyMachineTemp.push(obj)
+									}
+								}
+
+								if ((resData[i].state && obj.domain && obj.domain == 'cover') && that.checkFuzzyMatch(resData[i])
+								) {
+									obj.current_position = resData[i].attributes.current_position;
+									obj.target_position = resData[i].attributes.target_position;
+									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
+									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
+										listCoverTemp.push(obj)
+									}
+								}
+
+								//  if((resData[i].state && obj.domain && obj.domain=='number')||
+								// (resData[i].state && obj.domain && obj.domain=='number' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.min = resData[i].attributes.min;
+								//   obj.max = resData[i].attributes.max;
+								//   obj.step = resData[i].attributes.step;
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   if(resData[i].state!='unknown'){
+								// 	  obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
+								//   }
+								//   if((resData[i].attributes.min || resData[i].attributes.max) && resData[i].attributes.unit_of_measurement!='rgb' && resData[i].attributes.unit_of_measurement!='minutes'){
+								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  	listScrollTemp.push(obj);
+								// 	  }
+								//   }else if((resData[i].attributes.min || resData[i].attributes.max) && (resData[i].attributes.unit_of_measurement=='rgb' || resData[i].attributes.unit_of_measurement=='minutes')){
+								// 	  if(resData[i].state!='unknown'){
+								// 	  	obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
+								// 	  }
+								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  	listUnitTemp.push(obj);
+								// 	  }
+								//   }
+								//  }
+								//  if((resData[i].state && obj.domain && obj.domain=='button')||
+								// (resData[i].state && obj.domain && obj.domain=='button' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listButtonTemp.push(obj);
+								//   }
+								//  }
+								//  if((resData[i].state && obj.domain && obj.domain=='select')||
+								// (resData[i].state && obj.domain && obj.domain=='select' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   obj.options = resData[i].attributes.options;
+								//   obj.selectedIndex = 0;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listSelectTemp.push(obj);
+								//   }
+								//  }
+								if ((resData[i].state && obj.domain && obj.domain == 'climate' && resData[i].attributes.entity_class == 'MiirClimateEntity')
+								) {
+									climateModeTemp = obj.state;
+									obj.temperature = resData[i].attributes.temperature;
+									obj.temperatureTemp = resData[i].attributes.temperature;
+									obj.min_temp = resData[i].attributes.min_temp;
+									obj.max_temp = resData[i].attributes.max_temp;
+									obj.hvac_modes = resData[i].attributes.hvac_modes;
+									obj.fan_modes = resData[i].attributes.fan_modes;
+									obj.fan_mode = resData[i].attributes.fan_mode;
+									obj.target_temp_step = resData[i].attributes.target_temp_step;
+									if (obj.state == 'auto') {
+										temperatureHumidifyNameTemp = '自动';
+									}
+
+									if (obj.state == 'heat') {
+										temperatureHumidifyNameTemp = '制热';
+									}
+									if (obj.state == 'cool') {
+										temperatureHumidifyNameTemp = '制冷';
+									}
+									if (obj.state == 'dry') {
+										temperatureHumidifyNameTemp = '除湿';
+									}
+									if (obj.state == 'fan_only') {
+										temperatureHumidifyNameTemp = '送风';
+									}
+									if (obj.state == 'off') {
+										temperatureHumidifyNameTemp = '关闭';
+									}
+
+									if (obj.entity_id && obj.state && obj.friendly_name && obj.domain) {
+										listClimateTemp.push(obj);
+									}
+								}
+								if ((resData[i].state && obj.domain && obj.domain == 'media_player' && resData[i].attributes.entity_class == 'MiotMediaPlayerEntity') && that.checkFuzzyMatch(resData[i])
+								) {
+									// obj["speaker.volume"] = resData[i].attribute["speaker.volume"];
+									obj.repeat = resData[i].attributes.repeat;
+									obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
+									obj.media_title = resData[i].attributes.media_title;
+									obj.media_artist = resData[i].attributes.media_artist;
+									obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
+									obj.media_duration = resData[i].attributes.media_duration;
+									obj.media_position = resData[i].attributes.media_position;
+									obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
+									// obj.microphone.mute = resData[i].attributes.microphone.mute;
+									// obj.speaker.mute = resData[i].attributes.speaker.mute;
+									// console.log('media-player-miot-obj=='+obj);
+									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
+										listMiotMediaPlayerTemp.push(obj);
+									}
+								}
+
+								//  if((resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity')||
+								// (resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.volume_level = resData[i].attributes.volume_level;
+								//   obj.is_volume_muted = resData[i].attributes.is_volume_muted;
+								//   obj.source = resData[i].attributes.source;
+								//   obj.entity_picture = resData[i].attributes.entity_picture?"background-image: url('"+`${homeApiLater_https}`+resData[i].attributes.entity_picture+"');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;":"background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
+								//   obj.media_title = resData[i].attributes.media_title;
+								//   obj.media_artist = resData[i].attributes.media_artist;
+								//   obj.volume_level = resData[i].attributes.volume_level?(resData[i].attributes.volume_level * 100):0;
+								//   obj.media_duration = resData[i].attributes.media_duration;
+								//   obj.media_position = resData[i].attributes.media_position;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listMitvMediaPlayerTemp.push(obj);
+								//   }
+								//  }
+
+								if ((resData[i].state && obj.domain && obj.domain == 'media_player') && that.checkFuzzyMatch(resData[i])
+								) {
+
+									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
+									if (obj.entity_id.includes('teevee') || (obj.entity_id.includes('media_player') && obj.entity_id.includes('tv_dlna_') && obj.friendly_name && obj.friendly_name.includes('电视'))) {
+										obj.volume_level = resData[i].attributes.volume_level;
+										obj.is_volume_muted = resData[i].attributes.is_volume_muted;
+										obj.source = resData[i].attributes.source;
+										obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
+										obj.media_title = resData[i].attributes.media_title;
+										obj.media_artist = resData[i].attributes.media_artist;
+										obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
+										obj.media_duration = resData[i].attributes.media_duration;
+										obj.media_position = resData[i].attributes.media_position;
+										obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
+										// obj["speaker.volume"] = resData[i].attributes["speaker.volume"];
+										// console.log('media-player-mitv-obj=='+obj);
+										obj.device_class = resData[i].attributes.device_class;
+										obj.app_id = resData[i].attributes.app_id;
+										obj.app_name = resData[i].attributes.app_name;
+										if (obj.entity_id && obj.state && obj.state == "playing" && obj.friendly_name && obj.domain) {
+											listMitvMediaPlayerTemp.push(obj);
+										}
+										obj.friendly_name1 = resData[i].attributes.friendly_name;
+										tvEntityIdsTemp.push(obj);
+										// let obj1 = {};
+										// obj1.entity_id = obj.entity_id;
+										// obj1.friendly_name1 = resData[i].attributes.friendly_name;
+										// tvEntityIdsTemp.push(obj1);
+										tvEntityIdTemp = obj.entity_id;
+										// console.log('obj===='+obj);
+										// console.log('tvEntityIdTemp='+tvEntityIdTemp);
+										wx.setStorageSync('tvEntityId', tvEntityIdTemp);
+									}
+								}
+
+								if ((resData[i].state && obj.domain && obj.domain == 'humidifier')
+								) {
+									// 加湿器
+									obj.min_humidity = resData[i].attributes.min_humidity;
+									obj.max_humidity = resData[i].attributes.max_humidity;
+									obj.humidity = resData[i].attributes.humidity;
+									obj.min = obj.min_humidity;
+									obj.max = obj.max_humidity;
+
+									humidityValueTemp = obj.humidity;
+									humidityMaxTemp = obj.max;
+									humidityMinTemp = obj.min;
+									// console.log('humidifier-obj=='+JSON.stringify(obj));
+									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
+										listHumidifierTemp.push(obj);
+									}
+								}
+
+
+								if ((resData[i].state && obj.domain && obj.domain == 'automation')) {
+									console.log("", resData[i].attributes.friendly_name);
+									if (resData[i].attributes.friendly_name.endsWith('起床模式')) {
+										modelList1.push(obj)
+									} else if (resData[i].attributes.friendly_name.endsWith('观影模式')) {
+										modelList2.push(obj)
+									} else if (resData[i].attributes.friendly_name.endsWith('睡眠模式')) {
+										modelList3.push(obj)
+									}
+								}
+
+								//  if((resData[i].state && obj.domain && obj.domain=='sensor')||
+								// (resData[i].state && obj.domain && obj.domain=='sensor' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listSensorTemp.push(obj);
+								//   }
+								//  }
+
+								//  if((resData[i].state && obj.domain && obj.domain=='text')||
+								// (resData[i].state && obj.domain && obj.domain=='text' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode);
+								//   obj.min = resData[i].attributes.min;
+								//   obj.max = resData[i].attributes.max;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listTextTemp.push(obj);
+								//   }
+								//  }
+
+								//  if((resData[i].state && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
+								// || (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
+								//  ){
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  listConversationTemp.push(obj)
+								//   }
+								//  }
+								//  if((resData[i].state && resData[i].attributes && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))||
+								// (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
+								//  ){
+								//   obj.volume = resData[i].attributes.speaker.volume;//音量
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  listConversation1Temp.push(obj)
+								//   }
+								//  }
+								//加湿器单独拿出来
+								// if((obj.friendly_name && obj.friendly_name.includes("加湿器"))||
+								// (resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								// && obj.friendly_name && obj.friendly_name.includes("加湿器"))
+								// ){
+								//  listHumidityTemp.push(obj)
+								// }
+								// }
+							}
+							listSwitchTemp = that.checkTVList(listSwitchTemp);
+							that.setData({
+								// status_beep: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_left_switch_service'), //实验室主灯
+								// status_led: that.getEntityState(res.data,'light.deerma_jsq2g_392f_indicator_light'), //加湿器 Indicator Light
+								// status_san: that.getEntityState(res.data,'switch.xwhzp_xwxfj_a441_diffuser'), //香薰机 Diffuser
+								// status_curtain: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_middle_switch_service'), //实验室侧灯
+								// status_door: that.getEntityState(res.data,'remote.xiaomi_lx06_f593_wifispeaker_4'), //智能音箱
+								// Temp: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_temperature'), //加湿器温度
+								// Humi: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_relative_humidity'), //加湿器湿度
+								// Light: that.getEntityStateValue(res.data,'number.xwhzp_xwxfj_a441_brightness'), //香薰机亮度
+								// LiquidLevel: that.getEntityStateValue(res.data,'sensor.xwhzp_xwxfj_a441_fragrance_liquid_left_level'), //香薰液浓度
+								modelList1,
+								modelList2,
+								modelList3,
+								listSwitch: listSwitchTemp,
+								listUnit: listUnitTemp,
+								listScroll: listScrollTemp,
+								listConversation: listConversationTemp,
+								listConversation1: listConversation1Temp,
+								listHumidity: listHumidityTemp,
+								listButton: listButtonTemp,
+								listSelect: listSelectTemp,
+								listClimate: listClimateTemp,
+								listMiotMediaPlayer: listMiotMediaPlayerTemp,
+								listMitvMediaPlayer: listMitvMediaPlayerTemp,
+								listHumidifier: listHumidifierTemp,
+								listSensor: listSensorTemp,
+								listText: listTextTemp,
+								tvEntityId: tvEntityIdTemp,
+								tvEntityIds: tvEntityIdsTemp,
+								climateMode: climateModeTemp,
+								temperatureHumidifyName: temperatureHumidifyNameTemp,
+								listCover: listCoverTemp,
+								listAromatherapyMachine: listAromatherapyMachineTemp,
+								// ecHumidifier: {
+								// 	onInit: that.initChartHumidifier
+								// },
+								sliderValueHumidifier: ''
+							})
+							if (listHumidifierTemp.length && humidityValue != humidityValueTemp) {
+								humidityValue = humidityValueTemp || 40;
+								humidityMin = humidityMinTemp;
+								humidityMax = humidityMaxTemp;
+								that.checkHumidityMarginLeft()
+								updateChartCircularProgressBarOption()
+							}
+							wx.setStorageSync('tvEntityIds', tvEntityIdsTemp);
+							// console.log('listMiotMediaPlayerTemp='+JSON.stringify(listMiotMediaPlayerTemp));
+							// console.log('listHumidityTemp='+JSON.stringify(listHumidityTemp));
+							// console.log('listClimateTemp='+JSON.stringify(listClimateTemp));
+							// console.log('listSwitchTemp='+JSON.stringify(listSwitchTemp));
+							console.log('tvEntityIdsTemp=' + JSON.stringify(tvEntityIdsTemp));
+							// console.log('listMitvMediaPlayerTemp='+JSON.stringify(listMitvMediaPlayerTemp));
+							console.log('listHumidifierTemp=' + JSON.stringify(listHumidifierTemp));
+						},
+					});
+
+
+
+
+
+					// 	} catch (error) {
+					// 	  console.error(error);
+					// 	}
+
+					//   },
+					// });
+
+				} catch (error) {
+					console.error(error);
+				}
+
+			},
+			fail: function (error) {
+				console.error('error', error);
+				that.setData({
+					isLoading: false,
+				});
+			}
+		});
+
+
+
+		let end = Date.now(); // 再次获取当前时间(毫秒)
+		// console.log('end=='+end);
+		let executionTime = end - start;
+		// console.log(`myFunctionToTest 执行时间为: ${executionTime} 毫秒`);
+		return true;
+	},
+	getHADataStart(that, hotelcode, roomcode) {
+		let start = Date.now(); // 获取当前时间(毫秒)
+		console.log('start==' + start);
+		var that = this;
+
+		wx.request({
+			url: `${aipushApi}/getha`, //
+			method: 'POST',
+			//   header: {
+			// 	  'content-type': 'application/json', // 默认值
+			// 	  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+			// },
+			data: {
+				"locations": hotelcode, "room": (hotelcode && hotelcode.includes('hotel')) ? roomcode : "", "token": token_push
+			},
+			success(ress) {
+				if (!ress || !ress.data) {
+					console.error("getha(),没有获取到数据");
+					return;
+				}
+				var resData = ress.data
+				console.log("resData-==" + JSON.stringify(resData));
+				console.log("resData.loc-==" + JSON.stringify(resData.loc));
+				homeApi_https = resData.loc + "/api";
+				homeApiLater_https = resData.loc;
+				token = resData.token;
+				// console.log('res.data='+JSON.stringify(resData));
+				if (ress.data.code == "400") {
+					console.error("400错误!");
+					return;
+				}
+				if (ress.data.code == "401") {
+					console.error("401错误!");
+					return;
+				}
+				try {
+					//获取HA 设备状态数据
+					// 	wx.request({
+					// 	  url: `${homeApi_https}/states`,
+					// 	  method: 'GET',
+					// 	   header: {
+					// 			  'content-type': 'application/json', // 默认值
+					// 		  'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+					// 		},
+					// 	  success(res) {
+					// 	  if(!res || !res.data){
+					// 		  that.setData({
+					// 			isLoading: false,  
+					// 		  });
+					// 		  return;
+					// 	  }
+
+					// var resData = res.data
+					// // console.log('res.data='+JSON.stringify(resData));
+					// if (res.data.code == "400") {
+					//   console.error("400错误!");
+					//   return;
+					// }
+					// if (res.data.code == "401") {
+					//   console.error("401错误 --- 请检查你的API或Key是否正确!");
+					//   return;
+					// }
+					// try {
+
+
+
+
+
+					// const {
+					//   now
+					// } = res.data;
+					//  console.log('res.data1='+JSON.stringify(resData));
+					//  res.data.find(function (obj) {
+					//   console.log('obj='+obj); 
+					//  })
+					//  res.data.forEach((item, index) => {
+					// console.log(index, item); 
+					//  });
+					var listCoverTemp = [];
+					var listSwitchTemp = [];
+					var listScrollTemp = [];
+					var listUnitTemp = [];
+					var listConversationTemp = [];
+					var listConversation1Temp = [];
+					var listHumidityTemp = [];
+					var listButtonTemp = [];
+					var listSelectTemp = [];
+					var listClimateTemp = [];
+					var listMiotMediaPlayerTemp = [];
+					var listMitvMediaPlayerTemp = [];
+					var listHumidifierTemp = [];
+					var listSensorTemp = [];
+					var listTextTemp = [];
+
+					var tvEntityIdTemp = '';
+					var tvEntityIdsTemp = [];
+					var listAromatherapyMachineTemp = [];
+
+					var humidityValueTemp = 0;
+					var humidityMaxTemp = 0;
+					var humidityMinTemp = 0;
+					var climateModeTemp = '';
+					var temperatureHumidifyNameTemp = '温度';
+					var modelList1 = [];
+					var modelList2 = [];
+					var modelList3 = [];
+					var entityIdList = [];
+					const res = wx.getStorageSync('res');
+					const home_room = wx.getStorageSync('res').home_room;
+					// console.log('entity=====@==='+entity);
+					wx.request({
+						url: `${homeApi_https}/aidsleep/entity`, //获取空气数据
+						method: 'POST',
+						header: {
+							'content-type': 'application/json', // 默认值
+							'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+						},
+						//
+						data: {
+							"template": "{{ label_entities('" + (entity) + "') }}"
+						},
+						success(resTemplate) {
+							let mid = Date.now(); // 再次获取当前时间(毫秒)
+							// console.log('mid=='+mid);
+							if (!resTemplate || !resTemplate.data) {
+								console.log('no data:' + mid);
+								return;
+							}
+							let resData = resTemplate.data;
+							// resData = resData.filter(item1 => {  
+							//   return JSON.parse(that.replaceAll(resTemplate.data,'\'','\"')).find(item2 => item2 === item1.entity_id) !== undefined;  
+							// });
+							console.log("resData-union=" + JSON.stringify(resData));
+							// console.log('entityIdList-resTemplate====='+JSON.stringify(resTemplate.data));
+							for (let i = 0; i < resData.length; i++) {
+								// if(resTemplate.data.includes(resData[i].entity_id) && that.checkFuzzyMatch(resData[i])){
+								var obj = {};
+								obj.entity_id = resData[i].entity_id;//实体ID
+								obj.parent_entity_id = resData[i].parent_entity_id;//父实体ID
+								//api/services/<domain>/<service>
+								if (resData[i].entity_id) {
+									obj.domain = resData[i].entity_id.split(".")[0];
+								}
+								obj.state = (resData[i].state == 'unknown' ? "未知" : resData[i].state);
+								if (resData[i].attributes && resData[i].attributes.friendly_name) {
+									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode); //设备名称
+
+									if (obj.friendly_name.includes("灯带") || obj.friendly_name.includes("吸顶灯")) {
+										obj.imgSrc = '/static/icons/ic_dd_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
+									} else if (obj.friendly_name.includes("走廊灯")) {
+										obj.imgSrc = '/static/icons/ic_zld_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_zld_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #FFEEFA 0%, #FFFFFF 50%)';
+									} else if (obj.friendly_name.includes("筒灯")) {
+										obj.imgSrc = '/static/icons/ic_td_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_td_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #EBF0FF 0%, #FFFFFF 50%)';
+									} else if (obj.friendly_name.includes("主灯")) {
+										obj.imgSrc = '/static/icons/ic_zd_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_zd_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #EFE7FF 0%, #FFFFFF 50%)';
+									} else if (obj.friendly_name.includes("气扇")) {
+										obj.imgSrc = '/static/icons/ic_pqs_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_pqs_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #E3FFE6 0%, #FFFFFF 53%)';
+									} else if (obj.friendly_name.includes("电视")) {
+										obj.imgSrc = '/static/icons/ic_ds_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
+										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
+									} else if (obj.friendly_name.includes("空气净化器")) {
+										obj.imgSrc = '/static/icons/ic_kqjhq_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_kqjhq_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #EBFAFF 0%, #FFFFFF 50%)';
+
+									} else if (obj.friendly_name.includes("香薰机雾化")) {
+										obj.imgSrc = '/static/icons/ic_xxjwh.svg';
+										obj.selectedImgSrc = '/static/icons/ic_xxjwh.svg';
+
+									} else if (obj.friendly_name.endsWith('香薰机') || obj.friendly_name.endsWith('香薰机开关')) {
+										obj.imgSrc = '/static/icons/ic_xxj.svg';
+										obj.selectedImgSrc = '/static/icons/ic_xxj.svg';
+									}
+									else if (obj.friendly_name.includes("灯")) {
+										obj.imgSrc = '/static/icons/ic_dd_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_dd_2.svg';
+										obj.bg = 'background: linear-gradient(180deg, #DFFFFB 0%, #FFFFFF 53%)';
+									}
+
+									else {
+										obj.imgSrc = '/static/icons/ic_ds_1.svg';
+										obj.selectedImgSrc = '/static/icons/ic_ds_1.svg';
+										obj.bg = 'background: linear-gradient(180deg, #FFF2DF 0%, #FFFFFF 53%)';
+									}
+
+								}
+								if (resData[i].attributes && resData[i].attributes.home_room) {
+									obj.home_room = resData[i].attributes.home_room.split(' ')[1]; //房间号
+								}
+								if ((resData[i].state && (resData[i].state == 'on' || resData[i].state == 'off')) && that.checkFuzzyMatch(resData[i])
+								) {
+									if (resData[i].state == 'on') {
+										obj.service = 'turn_on';
+									} else if (resData[i].state == 'off') {
+										obj.service = 'turn_off';
+									}
+									//截取字符串,防止开关设备名称过长
+									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
+									//是否 是香薰机灯光
+									obj.isAromlight = obj.friendly_name.includes('香薰机灯光')
+									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)
+										}
+									} else if ((obj.isAromlight || obj.isAromAtomization || obj.isAromatherapy) && checkState(obj.state)) {
+										listAromatherapyMachineTemp.push(obj)
+									}
+								}
+
+								if ((resData[i].state && obj.domain && obj.domain == 'cover') && that.checkFuzzyMatch(resData[i])
+								) {
+									obj.current_position = resData[i].attributes.current_position;
+									obj.target_position = resData[i].attributes.target_position;
+									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
+									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
+										listCoverTemp.push(obj)
+									}
+								}
+
+								//  if((resData[i].state && obj.domain && obj.domain=='number')||
+								// (resData[i].state && obj.domain && obj.domain=='number' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.min = resData[i].attributes.min;
+								//   obj.max = resData[i].attributes.max;
+								//   obj.step = resData[i].attributes.step;
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   if(resData[i].state!='unknown'){
+								// 	  obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
+								//   }
+								//   if((resData[i].attributes.min || resData[i].attributes.max) && resData[i].attributes.unit_of_measurement!='rgb' && resData[i].attributes.unit_of_measurement!='minutes'){
+								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  	listScrollTemp.push(obj);
+								// 	  }
+								//   }else if((resData[i].attributes.min || resData[i].attributes.max) && (resData[i].attributes.unit_of_measurement=='rgb' || resData[i].attributes.unit_of_measurement=='minutes')){
+								// 	  if(resData[i].state!='unknown'){
+								// 	  	obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
+								// 	  }
+								// 	  if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  	listUnitTemp.push(obj);
+								// 	  }
+								//   }
+								//  }
+								//  if((resData[i].state && obj.domain && obj.domain=='button')||
+								// (resData[i].state && obj.domain && obj.domain=='button' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listButtonTemp.push(obj);
+								//   }
+								//  }
+								//  if((resData[i].state && obj.domain && obj.domain=='select')||
+								// (resData[i].state && obj.domain && obj.domain=='select' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   obj.options = resData[i].attributes.options;
+								//   obj.selectedIndex = 0;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listSelectTemp.push(obj);
+								//   }
+								//  }
+								if ((resData[i].state && obj.domain && obj.domain == 'climate' && resData[i].attributes.entity_class == 'MiirClimateEntity')
+								) {
+									climateModeTemp = obj.state;
+									obj.temperature = resData[i].attributes.temperature;
+									obj.temperatureTemp = resData[i].attributes.temperature;
+									obj.min_temp = resData[i].attributes.min_temp;
+									obj.max_temp = resData[i].attributes.max_temp;
+									obj.hvac_modes = resData[i].attributes.hvac_modes;
+									obj.fan_modes = resData[i].attributes.fan_modes;
+									obj.fan_mode = resData[i].attributes.fan_mode;
+									obj.target_temp_step = resData[i].attributes.target_temp_step;
+									if (obj.state == 'auto') {
+										temperatureHumidifyNameTemp = '自动';
+									}
+
+									if (obj.state == 'heat') {
+										temperatureHumidifyNameTemp = '制热';
+									}
+									if (obj.state == 'cool') {
+										temperatureHumidifyNameTemp = '制冷';
+									}
+									if (obj.state == 'dry') {
+										temperatureHumidifyNameTemp = '除湿';
+									}
+									if (obj.state == 'fan_only') {
+										temperatureHumidifyNameTemp = '送风';
+									}
+									if (obj.state == 'off') {
+										temperatureHumidifyNameTemp = '关闭';
+									}
+
+									if (obj.entity_id && obj.state && obj.friendly_name && obj.domain) {
+										listClimateTemp.push(obj);
+									}
+								}
+								if ((resData[i].state && obj.domain && obj.domain == 'media_player' && resData[i].attributes.entity_class == 'MiotMediaPlayerEntity') && that.checkFuzzyMatch(resData[i])
+								) {
+									// obj["speaker.volume"] = resData[i].attribute["speaker.volume"];
+									obj.repeat = resData[i].attributes.repeat;
+									obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
+									obj.media_title = resData[i].attributes.media_title;
+									obj.media_artist = resData[i].attributes.media_artist;
+									obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
+									obj.media_duration = resData[i].attributes.media_duration;
+									obj.media_position = resData[i].attributes.media_position;
+									obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
+									// obj.microphone.mute = resData[i].attributes.microphone.mute;
+									// obj.speaker.mute = resData[i].attributes.speaker.mute;
+									// console.log('media-player-miot-obj=='+obj);
+									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
+										listMiotMediaPlayerTemp.push(obj);
+									}
+								}
+
+								//  if((resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity')||
+								// (resData[i].state && obj.domain && obj.domain=='media_player' && resData[i].attributes.entity_class=='MitvMediaPlayerEntity' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.volume_level = resData[i].attributes.volume_level;
+								//   obj.is_volume_muted = resData[i].attributes.is_volume_muted;
+								//   obj.source = resData[i].attributes.source;
+								//   obj.entity_picture = resData[i].attributes.entity_picture?"background-image: url('"+`${homeApiLater_https}`+resData[i].attributes.entity_picture+"');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;":"background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
+								//   obj.media_title = resData[i].attributes.media_title;
+								//   obj.media_artist = resData[i].attributes.media_artist;
+								//   obj.volume_level = resData[i].attributes.volume_level?(resData[i].attributes.volume_level * 100):0;
+								//   obj.media_duration = resData[i].attributes.media_duration;
+								//   obj.media_position = resData[i].attributes.media_position;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listMitvMediaPlayerTemp.push(obj);
+								//   }
+								//  }
+
+								if ((resData[i].state && obj.domain && obj.domain == 'media_player') && that.checkFuzzyMatch(resData[i])
+								) {
+									obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name, roomcode);
+									if (obj.entity_id.includes('teevee') || (obj.friendly_name && obj.friendly_name.includes('电视'))) {
+										obj.volume_level = resData[i].attributes.volume_level;
+										obj.is_volume_muted = resData[i].attributes.is_volume_muted;
+										obj.source = resData[i].attributes.source;
+										obj.entity_picture = resData[i].attributes.entity_picture ? "background-image: url('" + `${homeApiLater_https}` + resData[i].attributes.entity_picture + "');width: 100%; height: 100%;background-size: cover;background-repeat: no-repeat;background-position: center;" : "background: radial-gradient(circle at center, #ff0000, #0000ff);border-radius: 30rpx;";
+										obj.media_title = resData[i].attributes.media_title;
+										obj.media_artist = resData[i].attributes.media_artist;
+										obj.volume_level = resData[i].attributes.volume_level ? (resData[i].attributes.volume_level * 100) : 0;
+										obj.media_duration = resData[i].attributes.media_duration;
+										obj.media_position = resData[i].attributes.media_position;
+										obj.media_late = resData[i].attributes.media_position + '/' + resData[i].attributes.media_duration;
+										// obj["speaker.volume"] = resData[i].attributes["speaker.volume"];
+										// console.log('media-player-mitv-obj=='+obj);
+										obj.device_class = resData[i].attributes.device_class;
+										obj.app_id = resData[i].attributes.app_id;
+										obj.app_name = resData[i].attributes.app_name;
+										if (obj.entity_id && obj.state && obj.state == "playing" && obj.friendly_name && obj.domain) {
+											listMitvMediaPlayerTemp.push(obj);
+										}
+										obj.friendly_name1 = resData[i].attributes.friendly_name;
+										tvEntityIdsTemp.push(obj);
+										// let obj1 = {};
+										// obj1.entity_id = obj.entity_id;
+										// obj1.friendly_name1 = resData[i].attributes.friendly_name;
+										// tvEntityIdsTemp.push(obj1);
+										tvEntityIdTemp = obj.entity_id;
+										// console.log('obj===='+obj);
+										// console.log('tvEntityIdTemp='+tvEntityIdTemp);
+										wx.setStorageSync('tvEntityId', tvEntityIdTemp);
+									}
+								}
+
+								if ((resData[i].state && obj.domain && obj.domain == 'humidifier')
+								) {
+									obj.min_humidity = resData[i].attributes.min_humidity;
+									obj.max_humidity = resData[i].attributes.max_humidity;
+									obj.humidity = resData[i].attributes.humidity;
+									obj.min = obj.min_humidity;
+									obj.max = obj.max_humidity;
+
+									humidityValueTemp = obj.humidity;
+									humidityMaxTemp = obj.max;
+									humidityMinTemp = obj.min;
+									// console.log('humidifier-obj=='+JSON.stringify(obj));
+									if (obj.entity_id && obj.state && checkState(obj.state) && obj.friendly_name && obj.domain) {
+										listHumidifierTemp.push(obj);
+									}
+								}
+
+
+								if ((resData[i].state && obj.domain && obj.domain == 'automation')) {
+									console.log("", resData[i].attributes.friendly_name);
+									if (resData[i].attributes.friendly_name.endsWith('起床模式')) {
+										modelList1.push(obj)
+									} else if (resData[i].attributes.friendly_name.endsWith('观影模式')) {
+										modelList2.push(obj)
+									} else if (resData[i].attributes.friendly_name.endsWith('睡眠模式')) {
+										modelList3.push(obj)
+									}
+								}
+
+								//  if((resData[i].state && obj.domain && obj.domain=='sensor')||
+								// (resData[i].state && obj.domain && obj.domain=='sensor' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode); 
+								//   obj.unit_of_measurement = resData[i].attributes.unit_of_measurement;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listSensorTemp.push(obj);
+								//   }
+								//  }
+
+								//  if((resData[i].state && obj.domain && obj.domain=='text')||
+								// (resData[i].state && obj.domain && obj.domain=='text' && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  )
+								//  ){
+								//   obj.friendly_name = that.truncateString(resData[i].attributes.friendly_name,roomcode);
+								//   obj.min = resData[i].attributes.min;
+								//   obj.max = resData[i].attributes.max;
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	listTextTemp.push(obj);
+								//   }
+								//  }
+
+								//  if((resData[i].state && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
+								// || (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
+								//  ){
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  listConversationTemp.push(obj)
+								//   }
+								//  }
+								//  if((resData[i].state && resData[i].attributes && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))||
+								// (resData[i].state && resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								//  && resData[i].attributes.speaker && resData[i].attributes.speaker.volume && obj.friendly_name && obj.friendly_name.includes("智能音箱"))
+								//  ){
+								//   obj.volume = resData[i].attributes.speaker.volume;//音量
+								//   if(obj.entity_id && obj.state && obj.friendly_name && obj.domain){
+								// 	  listConversation1Temp.push(obj)
+								//   }
+								//  }
+								//加湿器单独拿出来
+								// if((obj.friendly_name && obj.friendly_name.includes("加湿器"))||
+								// (resData[i].attributes && resData[i].attributes.parent_entity_id && entityIdList && entityIdList.includes(resData[i].attributes.parent_entity_id)
+								// && obj.friendly_name && obj.friendly_name.includes("加湿器"))
+								// ){
+								//  listHumidityTemp.push(obj)
+								// }
+								// }
+							}
+							listSwitchTemp = that.checkTVList(listSwitchTemp);
+
+							that.setData({
+								// status_beep: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_left_switch_service'), //实验室主灯
+								// status_led: that.getEntityState(res.data,'light.deerma_jsq2g_392f_indicator_light'), //加湿器 Indicator Light
+								// status_san: that.getEntityState(res.data,'switch.xwhzp_xwxfj_a441_diffuser'), //香薰机 Diffuser
+								// status_curtain: that.getEntityState(res.data,'switch.xiaomi_pro3_02bd_middle_switch_service'), //实验室侧灯
+								// status_door: that.getEntityState(res.data,'remote.xiaomi_lx06_f593_wifispeaker_4'), //智能音箱
+								// Temp: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_temperature'), //加湿器温度
+								// Humi: that.getEntityStateValue(res.data,'sensor.deerma_jsq2g_392f_relative_humidity'), //加湿器湿度
+								// Light: that.getEntityStateValue(res.data,'number.xwhzp_xwxfj_a441_brightness'), //香薰机亮度
+								// LiquidLevel: that.getEntityStateValue(res.data,'sensor.xwhzp_xwxfj_a441_fragrance_liquid_left_level'), //香薰液浓度
+								modelList1,
+								modelList2,
+								modelList3,
+								listSwitch: listSwitchTemp,
+								listUnit: listUnitTemp,
+								listScroll: listScrollTemp,
+								listConversation: listConversationTemp,
+								listConversation1: listConversation1Temp,
+								listHumidity: listHumidityTemp,
+								listButton: listButtonTemp,
+								listSelect: listSelectTemp,
+								listClimate: listClimateTemp,
+								listMiotMediaPlayer: listMiotMediaPlayerTemp,
+								listMitvMediaPlayer: listMitvMediaPlayerTemp,
+								listHumidifier: listHumidifierTemp,
+								listSensor: listSensorTemp,
+								listText: listTextTemp,
+								tvEntityId: tvEntityIdTemp,
+								tvEntityIds: tvEntityIdsTemp,
+								climateMode: climateModeTemp,
+								temperatureHumidifyName: temperatureHumidifyNameTemp,
+								listCover: listCoverTemp,
+								listAromatherapyMachine: listAromatherapyMachineTemp,
+								// ecHumidifier: {
+								// 	onInit: that.initChartHumidifier
+								// },
+								sliderValueHumidifier: '',
+								isLoading: false,
+							})
+							if (listHumidifierTemp.length && humidityValue != humidityValueTemp) {
+								humidityValue = humidityValueTemp || 40;
+								humidityMin = humidityMinTemp;
+								humidityMax = humidityMaxTemp;
+								that.checkHumidityMarginLeft()
+								that.initChartHumidifier();
+							}
+							wx.setStorageSync('tvEntityIds', tvEntityIdsTemp);
+						},
+					});
+					let mid = Date.now(); // 获取当前时间(毫秒)
+					console.log('mid==' + mid);
+					console.log('start==' + start);
+					console.log('mid-start==' + (mid - start));
+					// that.setData({
+					// 	isLoading: true, 
+					//   });
+
+
+
+
+					// 	} catch (error) {
+					// 	  console.error(error);
+					// 	}
+
+					//   },
+					//   fail: function (error) {
+					// 	  console.error('error', error);  
+					// 	  that.setData({
+					// 		isLoading: false,  
+					// 	  });
+					// 	} 
+					// });
+
+
+				} catch (error) {
+					console.error(error);
+					that.setData({
+						isLoading: false,
+					});
+				}
+
+			},
+			fail: function (error) {
+				console.error('error', error);
+				that.setData({
+					isLoading: false,
+				});
+			}
+		});
+
+
+
+		let end = Date.now(); // 再次获取当前时间(毫秒)
+		console.log('end==' + end);
+		let executionTime = end - start;
+		console.log(`myFunctionToTest 执行时间为: ${executionTime} 毫秒`);
+		return true;
+	},
+	checkTVList(items = []) {
+		// 创建一个新数组来存放不包含"电视"的对象  
+		let newItems = [];
+		// 存放包含"电视"的对象  
+		let tvItems = [];
+
+		// 遍历原数组  
+		items.forEach(item => {
+			// 检查name是否包含"电视"  
+			if (item.friendly_name.includes("电视")) {
+				tvItems.push(item);
+			} else {
+				newItems.push(item);
+			}
+		});
+
+		// 将包含"电视"的对象添加到新数组的末尾  
+		newItems.push(...tvItems);
+
+		// 如果需要,用新数组替换原数组  
+		items = newItems;
+		return items;
+	},
+	imageLoad: function () {
+		this.setData({
+			isLoading: false,
+		});
+		console.log('图片渲染完成');
+	},
+	startInterval: function () {
+		// 使用 setInterval 创建定时任务,每8秒执行一次 this.myMethod 方法 
+		var that = this;
+		that.clearInterval();
+		// this.intervalId = setInterval(() => {  
+		//   that.getHAData(that,that.data.hotelcode,that.data.roomcode);  
+		// }, 6000);
+		this.data.intervalId1 = setInterval(() => {
+			that.getHAData(that, that.data.hotelcode, that.data.roomcode);
+		}, 5000);
+
+		// 第二个定时器,每2秒执行一次  
+		this.data.intervalId2 = setInterval(() => {
+			// 这里执行你的代码  
+			that.setData({
+				isClickedPrevSong: false,
+				isClickedTogglePlayPause: false,
+				isClickedNextSong: false,
+				isClickedOnHumidifierUp: false,
+				isClickedOnHumidifierDown: false,
+				isClickedOnClimateAuto: false,
+				isClickedOnClimateUp: false,
+				isClickedToggleAromlight: false,//香薰机灯光
+			});
+		}, 300);
+	},
+	clearInterval: function () {
+		// 清除定时任务  
+		// if (this.intervalId) {  
+		//   clearInterval(this.intervalId);  
+		//   this.intervalId = null;  
+		// }  
+		if (this.data.intervalId1) {
+			clearInterval(this.data.intervalId1);
+			this.data.intervalId1 = null; // 可选,但建议清除以避免潜在的错误  
+		}
+
+		// 停止第二个定时器  
+		if (this.data.intervalId2) {
+			clearInterval(this.data.intervalId2);
+			this.data.intervalId2 = null; // 可选,但建议清除以避免潜在的错误  
+		}
+	},
+	stopTouchMove: function (e) {
+		return false;
+	},
+	truncateString: function (str, roomcode) {
+		if (!str) return ''
+		let strR = str.replace(roomcode, '')
+		if (strR.length <= 6) {
+			// 如果字符串长度小于等于5,直接返回原字符串  
+			return strR;
+		} else {
+			// 如果字符串长度在6到9之间,返回后6个字符(此时没有前部分可拼接)  
+			return strR.slice(-6);
+		}
+	},
+	onReady() {
+		console.log('页面渲染完成')
+		// 获取组件
+		// 确保页面渲染完成后查找节点
+		if (!wx.getStorageSync('hasAuth')) {
+			this.setData({ showAuthorizedDialog: true })
+		} else {
+			this.showData();
+		}
+
+	},
+	authorizationSuccessful() {
+		console.log("授权成功");
+		this.setData({ showAuthorizedDialog: false })
+		this.showData();
+	},
+	showData() {
+		const that = this;
+		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
+			wx.showModal({
+				title: '提示',
+				content: '请先扫描房间二维码',
+				showCancel: false
+			});
+
+			setTimeout(function () {
+				wx.reLaunch({
+					url: '/pages/scan/scan',
+				})
+			}, 2000) // 设置延时时间,单位为毫秒
+		} else {
+			let hotelcodeTemp = '';
+			let roomcodeTemp = '';
+			if (wx.getStorageSync('res').result.split('|').length != 2) {
+				wx.showModal({
+					title: '提示',
+					content: '房间二维码不正确,请重新扫码',
+					showCancel: false
+				});
+
+				setTimeout(function () {
+					wx.reLaunch({
+						url: '/pages/scan/scan',
+					})
+				}, 2000) // 设置延时时间,单位为毫秒
+			}
+			hotelcodeTemp = wx.getStorageSync('res').result.split('|')[0];
+			roomcodeTemp = wx.getStorageSync('res').result.split('|')[1];
+			entity = roomcodeTemp;
+			if (entity == 'labs') {
+				entity = '公司实验室';
+				wx.setStorageSync('roomname', '604');
+			} else {
+				wx.setStorageSync('roomname', entity);
+			}
+			this.setData({
+				isLoading: true,
+				hotelcode: hotelcodeTemp,
+				roomcode: roomcodeTemp,
+			});
+			if (this.getHADataStart(this, hotelcodeTemp, roomcodeTemp)) {
+				// 页面加载时开始定时任务  
+				// this.startInterval();
+			}
+
+			setTimeout(() => {
+				that.showOther();
+			}, 500);
+
+
+		}
+	},
+	showOther() { 
+		const that = this;
+		that.startInterval();
+		
+	},
+	onLoad(option) {
+
+	},
+	mounted() {
+
+	},
+	onHide() {
+		// wx.clearStorage();
+		// 页面卸载时清除定时任务
+		this.clearInterval();
+		// if(this.tcp){
+		// 	this.tcp.onClose(() => {
+		//   // this.infoList.push('关闭')
+		//   console.log('tcp关闭');
+		//   this.tcp.close()
+		// })
+		// }
+	},
+	onUnload() {
+		//wx.clearStorage();
+		// 页面卸载时清除定时任务  
+		this.clearInterval();
+		// if(this.tcp){
+		// 	this.tcp.onClose(() => {
+		//   // this.infoList.push('关闭')
+		//   console.log('tcp关闭');
+		//   this.tcp.close()
+		// })
+		// }
+		// if (this.data.observer) {  
+		//   this.data.observer.disconnect();  
+		// } 
+	},
+	showLoading: function () {
+		wx.showToast({
+			title: '加载中',
+			icon: 'loading',
+		})
+	},
+	cancelLoading: function () {
+		wx.hideToast()
+	},
+	onShow() {
+		// const app = getApp();
+		// app.globalData.selectedTabIndex = 0;
+		// this.getTabBar().setData({
+		// 	selected: 0
+		// })
+		var that = this;
+		that.setData({
+			currentMenuTabIndex: -1
+		})
+		wx.getLocation({
+			type: "wgs84",
+			success(res) {
+				const latitude = res.latitude;
+				const longitude = res.longitude;
+				const key = hefengKey;
+				wx.request({
+					url: `${geoApi}location=${longitude},${latitude}&key=${key}`, //获取地理位置
+					success(res) {
+						console.log('getLocation=' + JSON.stringify(res.data));
+						if (res.data.code == "401") {
+							console.error("HUAQING --- 请检查你的和风天气API或Key是否正确!");
+							return;
+						}
+						try {
+							const {
+								location
+							} = res.data;
+							that.setData({
+								area: location[0].name, //城区
+								city: location[0].adm2 //城市
+							})
+						} catch (error) {
+							console.error(error);
+						}
+					},
+				});
+				wx.request({
+					url: `${hefengWeather}location=${longitude},${latitude}&key=${key}`, //获取实时天气数据
+					success(res) {
+						console.log("实时天气==" + JSON.stringify(res.data));
+						if (res.data.code == "401") {
+							console.error("HUAQING --- 请检查你的和风天气API或Key是否正确!");
+							return;
+						}
+						try {
+							const {
+								now
+							} = res.data;
+
+							var weatherBg = "/subpages/images/weather/qing.png"
+							if (now.text.includes("晴")) {
+								weatherBg = "/subpages/images/weather/qing.png"
+							} else if (now.text.includes("多云") || now.text.includes("阴")) {
+								weatherBg = "/subpages/images/weather/duoyun.png"
+							} else if (now.text.includes("雷") || now.text.includes("雨")) {
+								weatherBg = "/subpages/images/weather/leiyu.png"
+							} else if (now.text.includes("雨")) {
+								weatherBg = "/subpages/images/weather/leiyu.png"
+							} else if (now.text.includes("雪")) {
+								weatherBg = "/subpages/images/weather/xue.png"
+							} else if (now.text.includes("雾") || now.text.includes("霾")) {
+								weatherBg = "/subpages/images/weather/wumai.png"
+							}
+							that.setData({
+								weatherBg,
+								weather: now.text, // 天气
+								w_temp: now.temp, // 温度
+								w_humidity: now.humidity, // 湿度
+							})
+						} catch (error) {
+							console.error(error);
+						}
+
+					},
+				});
+				wx.request({
+					url: `${hefengAir}location=${longitude},${latitude}&key=${key}`, //获取空气数据
+					success(res) {
+						console.log("空气数据==" + JSON.stringify(res.data));
+						if (res.data.code == "401") {
+							console.error("HUAQING --- 请检查你的和风天气API或Key是否正确!");
+							return;
+						}
+						try {
+							const {
+								now
+							} = res.data;
+							that.setData({
+								airText: now.category, //空气质量
+								airValue: now.aqi //空气指数
+							})
+						} catch (error) {
+							console.error(error);
+						}
+
+					},
+				});
+			},
+		});
+	}
+})

+ 10 - 0
subpages/main/main.json

@@ -0,0 +1,10 @@
+{
+  "usingComponents": {
+    "ec-canvas": "../../ec-canvas/ec-canvas",
+    "authorized-login-dialog": "../../componets/authorized-login-dialog/authorizedLoginDialog"
+  },
+  "navigationBarRightButton": {
+    "hide": true
+  },
+  "navigationStyle": "custom"
+}

+ 391 - 0
subpages/main/main.wxml

@@ -0,0 +1,391 @@
+<!-- index.wxml -->
+<view>
+  <image src="{{weatherBg}}" mode="widthFix" style="width: 100%;display: block;position: absolute; z-index: -1;top:0" />
+  <view class="container">
+    <van-nav-bar title="" left-text="" left=""></van-nav-bar>
+    <!-- 天气的面板  -->
+    <view class="header-wrapper" wx:if="{{!status_fire}}">
+      <view class="weather-box">
+        <text class="weather-title">空气质量-{{ airText }}</text>
+        <text class="weather-value">{{ airValue }}</text>
+      </view>
+      <view class="weather-box" style="align-items: flex-end;">
+        <text class="weather-title">{{ area }}-{{ city }}</text>
+        <text class="weather-desc">{{ weather }}</text>
+      </view>
+    </view>
+
+
+
+    <view class="contentArea">
+      <view class="menu-tab">
+        <view
+          class="{{!modelList1.length ? 'menu-tab-disenable' : currentMenuTabIndex == 0 ? 'menu-tab-item-active' :  'menu-tab-item'}}"
+          data-index="0" bindtap="checkMenuTap">起床模式</view>
+        <view
+          class="{{!modelList2.length ? 'menu-tab-disenable' : currentMenuTabIndex == 1 ? 'menu-tab-item-active' : 'menu-tab-item'}}"
+          data-index="1" bindtap="checkMenuTap">观影模式</view>
+        <view
+          class="{{!modelList3.length ? 'menu-tab-disenable' : currentMenuTabIndex == 2 ? 'menu-tab-item-active' :  'menu-tab-item'}}"
+          data-index="2" bindtap="checkMenuTap">睡眠模式</view>
+      </view>
+
+      <view class="theFirstRow">
+        <image src="/static/icons/ic_temperature.svg" mode="widthFix" />
+        <text class="theFirstRow-title">温度</text>
+        <text class="theFirstRow-value">{{w_temp}}<text class="theFirstRow-unit">℃</text></text>
+
+        <view style="margin-left: 30rpx;width: 2rpx; background: #e8e8e8; height: 24rpx;" />
+        <image src="/static/icons/ic_humidity.svg" mode="widthFix" />
+        <text class="theFirstRow-title">湿度</text>
+        <text class="theFirstRow-value">{{w_humidity}}<text class="theFirstRow-unit">%</text></text>
+
+      </view>
+      <view wx:if="{{isLoading}}" class="loading-container">
+        <text class="loading-text">数据正在加载,请耐心等待...</text>
+      </view>
+      <view class="data-container sliderList">
+
+        <!-- 普通的-->
+        <view wx:for="{{listSwitch}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+          <view class="data-card" style="{{item.state=='on' ? 'background: #0BC3AA;' : item.bg}}">
+            <image class="data-card__icon" src="{{item.state=='on' ? item.selectedImgSrc : item.imgSrc}}" />
+            <view class="data-card__text">
+              <text class="data-card__title1"
+                style="{{item.state=='on' ? 'color: #ffffff' :  ''}}">{{item.friendly_name}}</text>
+
+              <view class="data-card__value">
+                <van-switch size="22px" active-color="#2CCEB8" inactive-color="#E8EAEB" checked="{{item.state=='on'}}"
+                  bind:change="onSelect_All" data-param0="{{index}}" data-param1="/services"
+                  data-param2="/{{item.domain}}" data-param3='{{item.state=="on"?"/turn_off":"/turn_on"}}'
+                  data-param4='{{item.state=="on"?"0":"1"}}' data-param5="{{item.entity_id}}"
+                  custom-class="customSwitch" />
+              </view>
+            </view>
+          </view>
+        </view>
+
+
+        <!-- cover  -->
+        <view wx:for="{{listCover}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+          <view class="data-card">
+            <image class="data-card__icon" src="{{item.imgSrc}}" />
+            <view class="data-card__text">
+              <view class="data-card__title">
+                <text class="text-content">{{item.friendly_name}}</text>
+              </view>
+              <view class="data-card__value">
+                <van-switch size="22px" active-color="#2CCEB8" inactive-color="#E8EAEB" checked="{{item.state=='open'}}"
+                  bindchange="onSelect_Cover" data-param0="{{index}}" data-param1="/services"
+                  data-param2="/{{item.domain}}" data-param3='{{item.state=="open"?"/open_cover":"/close_cover"}}'
+                  data-param4='{{item.state=="open"?"0":"1"}}' data-param5="{{item.entity_id}}" />
+              </view>
+            </view>
+          </view>
+        </view>
+        <!-- 电视 card-->
+        <view wx:for="{{listMitvMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+          <view class="data-card" style="{{item.bg}}">
+            <image class="data-card__icon" src="{{item.imgSrc}}" />
+            <view class="data-card__text">
+              <view class="data-card__title">
+                <text class="text-content">{{item.friendly_name}}</text>
+              </view>
+              <view class="data-card__value">
+                <view class="tv_button-container">
+                  <text
+                    class=" {{(item.app_id=='com.xiaomi.mitv.tvplayer'||item.app_name=='模拟电视')?'tv_disabled-button':'tv_custom-button'}}"
+                    bindtap="tvFanChange" data-id="{{item.entity_id}}" data-fan="当贝桌面"
+                    data-index="{{index}}">电视模式</text>
+                  <text
+                    class=" {{(item.app_id=='com.xiaomi.mitv.tvplayer'||item.app_name=='模拟电视')?'tv_custom-button':'tv_disabled-button'}}"
+                    bindtap="tvFanChange" data-id="{{item.entity_id}}" data-fan="HDMI1"
+                    data-index="{{index}}">机顶盒模式</text>
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </view>
+
+      <view class="body-wrapper" style="margin-top:40rpx; display: flex;flex-direction: column;align-items: center;">
+        <view class="body">
+
+          <!-- 香薰机 -->
+          <view class="test" class="sliderItem" wx:for="{{listAromatherapyMachine}}" wx:for-index="index"
+            wx:for-item="item" wx:if="{{item.isAromatherapy}}">
+
+            <view class="center-view">
+              <view class="title-line"></view>
+              <text class="gray-text">{{item.friendly_name}}</text>
+            </view>
+            <view class="data-media-player" style="flex-direction: row;">
+
+              <view class="data-media-1" wx:for="{{listAromatherapyMachine}}" wx:for-index="index2" wx:for-item="item2"
+                wx:if="{{item2.isAromlight}}">
+                <text class="sub-title">{{item2.friendly_name}}</text>
+                <view wx:if="{{item.state=='on'}}" class="btn-pos-view" bindtap="onSelect_All_aromlight"
+                  data-param0="{{index2}}" data-param1="/services" data-param2="/{{item2.domain}}"
+                  data-param3="/turn_on" data-param4='{{item2.state=="on"?"0":"1"}}' data-param5="{{item2.entity_id}}">
+                  <image src="/static/images/ic_light_button_bg.png"></image>
+                  <text>灯光切换</text>
+                </view>
+                <view wx:else class="btn-pos-view" style="filter: grayscale(100%);">
+                  <image src="/static/images/ic_light_button_bg.png"></image>
+                  <text>灯光切换</text>
+                </view>
+              </view>
+              <view class="card-line-v"></view>
+              <view class="data-media-1">
+                <view class="card-data">
+                  <image class="data-card__icon" src="{{item.imgSrc}}" />
+                  <text class="data-card__title1">{{item.friendly_name}}</text>
+                  <view class="data-card__value">
+                    <van-switch size="22px" active-color="#2CCEB8" inactive-color="#E8EAEB"
+                      checked="{{item.state=='on'}}" bind:change="onSelect_All_AromatherapyMachine"
+                      data-param0="{{index}}" data-param1="/services" data-param2="/{{item.domain}}"
+                      data-param3='{{item.state=="on"?"/turn_off":"/turn_on"}}'
+                      data-param4='{{item.state=="on"?"0":"1"}}' data-param5="{{item.entity_id}}"
+                      custom-class="customSwitch" />
+                  </view>
+                </view>
+                <view class="card-data" wx:for="{{listAromatherapyMachine}}" wx:for-index="index2" wx:for-item="item2"
+                  wx:if="{{item2.isAromAtomization}}" style="height: 230rpx;">
+                  <image class="data-card__icon" src="{{item2.imgSrc}}" />
+                  <text class="data-card__title1">{{item2.friendly_name}}</text>
+                  <view class="data-card__value">
+                    <image wx:if="{{item.state=='on'}}" class="power-btn-small"
+                      src="{{item2.state=='on'? '/static/icons/ic_power.svg' : '/static/icons/ic_power_off.svg'}}"
+                      data-param0="{{index2}}" data-param1="/services" data-param2="/{{item2.domain}}"
+                      data-param3='{{item2.state=="on"?"/turn_off":"/turn_on"}}'
+                      data-param4='{{item2.state=="on"?"0":"1"}}' data-param5="{{item2.entity_id}}" bindtap="onTap_All">
+                    </image>
+                    <image wx:else class="power-btn-small"
+                      src="{{item2.state=='on'? '/static/icons/ic_power.svg' : '/static/icons/ic_power_off.svg'}}">
+                    </image>
+                  </view>
+                </view>
+
+              </view>
+
+            </view>
+          </view>
+
+          <!-- 加湿器 -->
+          <view class="test" wx:for="{{listHumidifier}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+
+            <view class="center-view">
+              <view class="title-line"></view>
+              <text class="gray-text">{{item.friendly_name}}</text>
+            </view>
+            <view class="data-media-player">
+              <image class="power-btn"
+                src="{{item.state=='on'? '/static/icons/ic_power.svg' : '/static/icons/ic_power_off.svg'}}"
+                data-param0="{{index}}" data-param1="/services" data-param2="/{{item.domain}}"
+                data-param3='{{item.state=="on"?"/turn_off":"/turn_on"}}' data-param4='{{item.state=="on"?"0":"1"}}'
+                data-param5="{{item.entity_id}}" bindtap="onTap_All">
+              </image>
+              <view class="data-card-v" style="width: 100%;">
+                <view class="echarts-container_humidityDial">
+                  <ec-canvas id="mychart-dom-gauge" canvas-id="mychart-gauge" ec="{{ ecHumidifier }}"></ec-canvas>
+                </view>
+
+                <view class="button-row" style="width: 100%;height: 112rpx;margin-left: 15rpx;">
+                  <image src="/static/icons/ic_minus.svg" style="width: 112rpx;height: 112rpx;"
+                    bindtap="onHumidifierDown" data-state='{{item.state}}' data-id="{{item.entity_id}}"
+                    data-domain='{{item.domain}}' data-min='{{item.min}}' data-max='{{item.max}}'
+                    data-humidity='{{item.humidity}}'></image>
+                  <van-slider bar-height="52rpx" active-color="#0BC3AA" class="tui-slider-box"
+                    bind:drag-end="handleTouchEndHumidifier" bind:drag="handleChangingHumidifier"
+                    bind:change="changeHumidity" step="1" min="{{item.min}}" max="{{item.max}}"
+                    data-id="{{item.entity_id}}" data-index="{{index}}" data-domain="{{item.domain}}"
+                    value="{{item.humidity}}" min="{{item.min}}" max="{{item.max}}" data-humidity="{{item.humidity}}">
+                  </van-slider>
+                  <image src="/static/icons/ic_add.svg" style="width: 112rpx;height: 112rpx;" bindtap="onHumidifierUp"
+                    data-state='{{item.state}}' data-id="{{item.entity_id}}" data-domain='{{item.domain}}'
+                    data-min='{{item.min}}' data-max='{{item.max}}' data-humidity='{{item.humidity}}'>
+                  </image>
+                </view>
+                <text
+                  style="{{'margin-left:'+humidityMarginLeft+'rpx;margin-top: -50rpx;min-height:50rpx'}}">{{sliderValueHumidifier
+                  ?
+                  sliderValueHumidifier +
+                  '%' : ''}}</text>
+              </view>
+
+
+            </view>
+          </view>
+          <!-- 空调 -->
+          <view class="test sliderItem" wx:for="{{listClimate}}" wx:for-index="index" wx:for-item="item">
+            <view class="center-view">
+              <view class="title-line"></view>
+              <text class="gray-text">{{item.friendly_name}}</text>
+            </view>
+            <view class="data-media-player">
+
+              <text wx:if="{{item.state!='auto'}}" class="value-display">
+                {{item.temperatureTemp}}<text class="value-display_unit">°C</text>
+              </text>
+              <text wx:else class="value-display" style="opacity: 0;">
+                {{item.temperatureTemp}}<text class="value-display_unit">°C</text>
+              </text>
+              <view class="button-row" style="margin-left: 15rpx;">
+                <image src="/static/icons/ic_minus.svg" style="width: 112rpx;height: 112rpx;" bindtap="minusClimate"
+                  min="{{item.min_temp}}" max="{{item.max_temp}}" step="1" data-value="{{item.temperature}}"
+                  data-state="{{item.state}}" data-id="{{item.entity_id}}" data-domain="{{item.domain}}"
+                  data-min="{{item.min_temp}}" data-max="{{item.max_temp}}" data-temperature="{{item.temperature}}"
+                  data-fanMode="{{item.fan_mode}}" disabled="{{item.state=='auto'}}"></image>
+                <van-slider bar-height="52rpx" active-color="#3A87FD" class="tui-slider-box" data-index="{{index}}"
+                  bind:change="changeClimate" bind:drag="dragClimate" min="{{item.min_temp}}" max="{{item.max_temp}}"
+                  step="1" value="{{item.temperature}}" data-state="{{item.state}}" data-id="{{item.entity_id}}"
+                  data-domain="{{item.domain}}" data-min="{{item.min_temp}}" data-max="{{item.max_temp}}"
+                  data-temperature="{{item.temperature}}" data-fanMode="{{item.fan_mode}}"
+                  disabled="{{item.state=='auto'}}">
+                  <!-- <text style="color:black">{{sliderValueClimate}}</text> -->
+                </van-slider>
+                <image src="/static/icons/ic_add.svg" style="width: 112rpx;height: 112rpx; " bindtap="addClimate"
+                  min="{{item.min_temp}}" max="{{item.max_temp}}" step="1" data-value="{{item.temperature}}"
+                  data-state="{{item.state}}" data-id="{{item.entity_id}}" data-domain="{{item.domain}}"
+                  data-min="{{item.min_temp}}" data-max="{{item.max_temp}}" data-temperature="{{item.temperature}}"
+                  data-fanMode="{{item.fan_mode}}" disabled="{{item.state=='auto'}}"></image>
+
+              </view>
+              <view class="air-conditioner-controls">
+                <view
+                  class="{{item.state=='auto'?'control-button_1':'control-button'}} {{isClickedOnClimateAuto ? 'clicked' : ''}}"
+                  bindtap="onClimateAuto" data-state="{{item.state}}" data-temperature="{{item.temperature}}"
+                  data-id="{{item.entity_id}}" data-domain="{{item.domain}}">
+                  <image class="control-icon"
+                    src="{{item.state == 'auto' ? '/static/icons/ic_auto_2.svg' : '/static/icons/ic_auto_1.svg'}}" />
+                  <text class="{{item.state=='auto'? 'control-text_select' :'control-text'}}">自动</text>
+                </view>
+                <view class="{{item.state=='heat'?'control-button_1':'control-button'}}" bindtap="onClimateHeat"
+                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
+                  data-domain="{{item.domain}}" data-flag="onHeat">
+                  <image class="control-icon"
+                    src="{{item.state == 'heat' ? '/static/icons/ic_hot_2.svg' : '/static/icons/ic_hot_1.svg'}}" />
+                  <text class="{{item.state=='heat'? 'control-text_select' :'control-text'}}">制热</text>
+                </view>
+                <view class="{{item.state=='cool'?'control-button_1':'control-button'}}" bindtap="onClimateCool"
+                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
+                  data-domain="{{item.domain}}" data-flag="onCool">
+                  <image class="control-icon"
+                    src="{{item.state == 'cool' ? '/static/icons/ic_cold_2.svg' : '/static/icons/ic_cold_1.svg'}}" />
+                  <text class="{{item.state=='cool'? 'control-text_select' :'control-text'}}">制冷</text>
+                </view>
+                <view class="{{item.state=='dry'?'control-button_1':'control-button'}}" bindtap="onClimateDehumidify"
+                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
+                  data-domain="{{item.domain}}" data-flag="onDehumidify">
+                  <image class="control-icon"
+                    src="{{item.state == 'dry' ? '/static/icons/ic_moisture_2.svg' : '/static/icons/ic_moisture_1.svg'}}" />
+                  <text class="{{item.state=='dry'? 'control-text_select' :'control-text'}}">除湿</text>
+                </view>
+                <view class="{{item.state=='fan_only'?'control-button_1':'control-button'}}"
+                  bindtap="onClimateAirSupply" data-state="{{item.state}}" data-temperature="{{item.temperature}}"
+                  data-id="{{item.entity_id}}" data-domain="{{item.domain}}" data-flag="onAirSupply">
+                  <image class="control-icon"
+                    src="{{item.state == 'fan_only' ? '/static/icons/ic_wind_2.svg' : '/static/icons/ic_wind_1.svg'}}" />
+                  <text class="{{item.state=='fan_only'? 'control-text_select' :'control-text'}}">送风</text>
+                </view>
+                <!-- 关闭要单独拿出来 -->
+                <!-- <view class="{{item.state=='off'?'control-button_1':'control-button'}}" bindtap="onClimateOff"
+                  data-state="{{item.state}}" data-temperature="{{item.temperature}}" data-id="{{item.entity_id}}"
+                  data-domain="{{item.domain}}">
+                  <image class="control-icon" />
+                  <text class="{{item.state=='off'? 'control-text_select' :'control-text'}}">关闭</text>
+                </view> -->
+              </view>
+              <view class="airConditioning-title">
+                <image src="/static/icons/ic_output_air.svg"></image>
+                <text wx:if="{{item.state!='auto'}}">{{temperatureHumidifyName}}:{{item.temperature}}°C</text>
+                <text wx:else>{{temperatureHumidifyName}}</text>
+              </view>
+              <image class="power-btn"
+                src="{{item.state=='off'? '/static/icons/ic_power_off.svg' : '/static/icons/ic_power.svg'}}"
+                bindtap="onClimateOff" data-state="{{item.state}}" data-temperature="{{item.temperature}}"
+                data-id="{{item.entity_id}}" data-domain="{{item.domain}}"></image>
+
+            </view>
+          </view>
+          <view wx:for="{{listMiotMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+            <!-- 一行 -->
+            <view class="data-media-player" style="{{item.entity_picture}}">
+              <!-- 标题 -->
+              <view class="center-view">
+                <view class="title-line"></view>
+                <text class="gray-text">{{item.friendly_name}}</text>
+              </view>
+              <view class="audio-player">
+                <view class="controls">
+                  <image class="control-button_media prev {{isClickedPrevSong ? 'clicked' : ''}}"
+                    src="/static/images/prev.png" bindtap="prevSong" wx:if="{{canPrev}}" data-state="{{item.state}}"
+                    data-id="{{item.entity_id}}" data-domain="{{item.domain}}" />
+                  <image class="control-button_media play {{isClickedTogglePlayPause ? 'clicked' : ''}}"
+                    src="{{item.state=='playing' ? '/static/images/pause.png' : '/static/images/play.png'}}"
+                    bindtap="togglePlayPause" data-state="{{item.state}}" data-id="{{item.entity_id}}"
+                    data-domain="{{item.domain}}" />
+                  <image class="control-button_media next {{isClickedNextSong ? 'clicked' : ''}}"
+                    src="/static/images/next.png" bindtap="nextSong" wx:if="{{canNext}}" data-state="{{item.state}}"
+                    data-id="{{item.entity_id}}" data-domain="{{item.domain}}" bindload="imageLoad" />
+                </view>
+                <view class="progress">
+                  <slider class="progress-bar" value="{{item.media_position}}" min="0" max="{{item.media_duration}}"
+                    bindchange="sliderChange" data-state="{{item.state}}" data-id="{{item.entity_id}}"
+                    data-domain="{{item.domain}}" />
+                </view>
+                <view class="info">
+                  <text class="song-title">歌曲名称:{{item.media_title}}</text>
+                  <text class="song-artist">演唱者:{{item.media_artist}}</text>
+                  <!-- <text class="song-artist">歌曲名称:{{item.media_album_name}}</text> -->
+                </view>
+              </view>
+            </view>
+            <!-- 一行结束 -->
+          </view>
+          <!-- 一行结束 -->
+        </view>
+      </view>
+    </view>
+  </view>
+  <van-overlay show="{{ menuTabDialogShow }}" z-index="10086">
+    <view style="height: 100vh;display: flex;flex-direction: column;justify-content: center;">
+      <view style="position: relative;">
+        <image wx:if="{{currentDialogIndex == 0}}" src="/static/bg/ic_qcms_bg.png"
+          style="display: block;width: 620rpx;height: 380rpx; margin: 0 auto;" />
+
+        <view wx:if="{{currentDialogIndex == 0}}" class="dialog-content">
+          <view class="dialog-h">
+            <image class="dialog-icon" src="/static/bg/ic_qcms.png" />
+            <text class="dialog-title">起床模式</text>
+          </view>
+          <text class="dialog-desc">自动调节灯光、窗帘、播放轻柔音乐等, 营造一个舒适温馨的起床环境。</text>
+        </view>
+        <image wx:if="{{currentDialogIndex == 1}}" src="/static/bg/ic_gyms_bg.png"
+          style="display: block;width: 620rpx;height: 380rpx; margin: 0 auto;" />
+        <view wx:if="{{currentDialogIndex == 1}}" class="dialog-content">
+          <view class="dialog-h">
+            <image class="dialog-icon" src="/static/bg/ic_gyms.png" />
+            <text class="dialog-title">观影模式</text>
+          </view>
+          <text class="dialog-desc">一键切换至最佳视听环境,自动调节灯光、窗帘及电视等设置,为您打造沉浸式的观影体验。</text>
+        </view>
+        <image wx:if="{{currentDialogIndex == 2}}" src="/static/bg/ic_smms_bg.png"
+          style="display: block;width: 620rpx;height: 380rpx; margin: 0 auto;" />
+        <view wx:if="{{currentDialogIndex == 2}}" class="dialog-content">
+          <view class="dialog-h">
+            <image class="dialog-icon" src="/static/bg/ic_smms.png" />
+            <text class="dialog-title" style="color: #FDFFC5;">睡眠模式</text>
+          </view>
+          <text class="dialog-desc" style="color: white;">自动调暗灯光、关闭窗帘、播放睡眠视频、音乐及调节室内温度、湿度,营造一个安静舒适的睡眠环境。</text>
+        </view>
+        <text class="dialog-sure-btn" bindtap="onClickHideSureMenuTabDialog">确定</text>
+      </view>
+      <image src="/static/icons/ic_dialog_close.svg"
+        style="display: block;width: 56rpx;height: 56rpx; margin: 30rpx auto;" bindtap="onClickHideMenuTabDialog" />
+    </view>
+  </van-overlay>
+
+  <authorized-login-dialog showDialog="{{showAuthorizedDialog}}"
+    bind:authorizationSuccessful="authorizationSuccessful"></authorized-login-dialog>
+</view>

+ 1141 - 0
subpages/main/main.wxss

@@ -0,0 +1,1141 @@
+/**index.wxss**/
+page {
+  width: 100vw;
+  padding-bottom: 130px;
+  background: #F6F8F9;
+  display: flex;
+  overflow-x: hidden;
+  flex-direction: column;
+}
+
+.container {
+  display: flex;
+  width: 100vw;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.header-wrapper {
+  width: calc(100% - 120rpx);
+  margin: 0 auto 50rpx auto;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+}
+
+.weather-box {
+  display: flex;
+  flex-direction: column;
+}
+
+.weather-box .weather-title {
+  font-size: 28rpx;
+  color: #3E3D44;
+}
+
+.weather-box .weather-value {
+  font-size: 72rpx;
+  font-weight: bold;
+  line-height: 80rpx;
+  margin-top: 10rpx;
+  color: #3E3D44;
+}
+
+.weather-box .weather-desc {
+  font-size: 36rpx;
+  color: #3E3D44;
+  line-height: 80rpx;
+  margin-top: 10rpx;
+}
+
+
+.contentArea {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  background: #F6F8F9;
+  border-radius: 28rpx 28rpx 0;
+}
+
+.theFirstRow {
+  font-weight: 500;
+  display: flex;
+  justify-content: flex-end;
+  margin-right: 30rpx;
+  align-items: center;
+  flex-direction: row;
+}
+
+.theFirstRow-title {
+  font-size: 20rpx;
+  margin: 0 20rpx;
+  color: #6C6970;
+}
+
+.theFirstRow-value {
+  color: #3E3D44;
+  font-size: 16px;
+  font-weight: 600;
+}
+
+.theFirstRow-unit {
+  color: #3E3D44;
+  font-size: 10px;
+}
+
+.theFirstRow image {
+  width: 30rpx;
+  height: 30rpx;
+  margin-left: 30rpx;
+}
+
+.horizontal-swiper {
+  width: 100%;
+  height: 40rpx;
+}
+
+.swiper-item {
+  width: 400rpx;
+  /* 设置滑动块的宽度 */
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #3c4fff;
+  margin-right: 20rpx;
+  /* 根据需要设置间距 */
+}
+
+.item-content {
+  /* 其他样式 */
+}
+
+.wrapper {
+  padding: 20rpx 30rpx;
+  background-color: #000000;
+}
+
+.wrapper-dark {
+  padding: 30rpx;
+  background-color: #27313b;
+}
+
+
+.header-title {
+  display: flex;
+  justify-content: space-between;
+}
+
+.header-title text {
+  color: #000;
+}
+
+.header-title-fire {
+  display: flex;
+  justify-content: space-between;
+}
+
+.header-title-fire text {
+  color: #fdfbfb;
+  font-size: large;
+  font-weight: 200;
+  margin: 0 auto;
+}
+
+.header-text {
+  font-size: 60rpx;
+  font-weight: 400;
+  display: flex;
+  justify-content: space-between;
+}
+
+.header-text text {
+  color: #000;
+}
+
+.weather-advice {
+  margin-top: 40rpx;
+  font-size: 24rpx;
+}
+
+.data-wrapper {
+  margin-top: 20rpx;
+  display: flex;
+  justify-content: space-between;
+  background-color: #000000;
+
+}
+
+.data {
+  background-color: #fff;
+  width: 300rpx;
+  height: 200rpx;
+  margin: 20rpx 0px;
+  border-radius: 40rpx;
+  display: flex;
+  justify-content: space-around;
+  padding: 0 16rpx;
+  box-shadow: #d6d6d6 0px 0px 10rpx;
+
+}
+
+.data-humidifier {
+  /* margin-top: 30rpx; */
+  background-color: #fff;
+  /* 设置边框样式 */
+  border: 2rpx solid #e0e0e0;
+  /* 边框宽度、样式和颜色 */
+
+  /* 设置圆角弧度 */
+  border-radius: 20rpx;
+  /* 可以根据需要调整圆角的大小 */
+
+  /* 设置阴影效果 */
+  box-shadow: 0rpx 4rpx 8rpx rgba(0, 0, 0, 0.1);
+  /* 阴影的偏移量、模糊半径和颜色 */
+
+  padding-right: 5rpx;
+  margin-top: 10rpx;
+  height: 650rpx;
+}
+
+.body {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+}
+
+.data-media-player {
+  box-shadow: inset 10px 4px 10px 0px rgba(182, 194, 205, 0.2);
+  border-radius: 20px;
+  background: #FFFFFF;
+  align-items: center;
+  padding: 20rpx 0;
+  margin: 0 40rpx;
+  display: flex;
+  flex-direction: column;
+  margin-bottom: 48rpx;
+  position: relative;
+}
+
+.data-media-1 {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+}
+
+.data-media-1 .sub-title {
+  color: #6C6970;
+  font-size: 14px;
+  margin-top: 40rpx;
+  margin-left: 30rpx;
+}
+
+.card-data {
+  display: flex;
+  flex-direction: column;
+  padding-right: 30rpx;
+  align-items: flex-end;
+  position: relative;
+  height: 200rpx;
+}
+
+.card-data .data-card__icon {
+  position: absolute;
+  top: 40rpx;
+  left: 40rpx;
+  width: 88rpx;
+  height: 88rpx;
+}
+
+.card-data .data-card__value {
+  margin-top: 40rpx;
+}
+
+.card-data .data-card__title1 {
+  margin-top: 40rpx;
+  font-size: 14px;
+  color: #6C6970;
+}
+
+.card-line {
+  width: calc(100% - 68rpx);
+  margin: 0 auto;
+  background: #E8E8E8;
+  height: 1rpx;
+}
+
+.card-line-v {
+  height: 300rpx;
+  margin: auto 0;
+  background: #E8E8E8;
+  width: 1rpx;
+}
+
+.btn-pos-view {
+  width: 200rpx;
+  height: 200rpx;
+  position: relative;
+  margin-top: 40rpx;
+  margin-left: 40rpx;
+  margin-bottom: 84rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.btn-pos-view image {
+  width: 200rpx;
+  height: 200rpx;
+  display: block;
+}
+
+.btn-pos-view:active {
+  opacity: 0.7;
+}
+
+.btn-pos-view text {
+  width: 200rpx;
+  text-align: center;
+  font-size: 24rpx;
+  color: #6C6970;
+  position: absolute;
+  white-space: nowrap;
+}
+
+.echarts-container_humidityDial {
+  width: 300rpx;
+  display: block;
+  height: 300rpx;
+}
+
+.power-btn {
+  position: absolute;
+  right: 30rpx;
+  top: 40rpx;
+  border-radius: 100%;
+  box-sizing: border-box;
+  box-shadow: 0px 6rpx 18rpx 0px #E3E4E5;
+  width: 110rpx;
+  height: 110rpx;
+}
+
+.power-btn-small {
+  width: 110rpx;
+  height: 110rpx;
+  box-sizing: border-box;
+  border-radius: 100%;
+  box-shadow: 0px 6rpx 18rpx 0px #E3E4E5;
+  margin-top: -10rpx;
+}
+
+.airConditioning-title {
+  position: absolute;
+  left: 40rpx;
+  top: 40rpx;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.airConditioning-title image {
+  width: 48rpx;
+  height: 48rpx;
+}
+
+.airConditioning-title text {
+  font-size: 24rpx;
+  color: #3E3D44;
+  margin-left: 20rpx;
+}
+
+.data-logo {
+  height: 72rpx;
+  width: 72rpx;
+  margin-top: 30rpx;
+}
+
+.data-text {
+  margin-top: 30rpx;
+  color: #7f7f7f;
+
+}
+
+.data-title {
+  text-align: right;
+}
+
+.data-value {
+  font-size: 52rpx;
+}
+
+.panel {
+  display: flex;
+  padding: 0 30rpx;
+}
+
+.cellgroup {
+  margin-top: 12rpx;
+  /* 设置边框样式 */
+  border: 2rpx solid #ebebeb;
+  /* 边框宽度、样式和颜色 */
+
+  /* 设置圆角弧度 */
+  border-radius: 20rpx;
+  /* 可以根据需要调整圆角的大小 */
+  /* 设置阴影效果 */
+  box-shadow: 0rpx 8rpx 12rpx rgba(85, 255, 255, 0.1);
+  /* 阴影的偏移量、模糊半径和颜色 */
+}
+
+
+.circle-humi {
+  margin-left: 150rpx;
+}
+
+.switch {
+  margin-top: 20rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: flex-end;
+}
+
+.silder {
+  margin-top: 50rpx;
+}
+
+.s_view {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  margin-top: -50rpx;
+  /* margin-bottom: 50rpx; */
+}
+
+.s_view_climate {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  margin-top: -50rpx;
+  /* margin-bottom: 50rpx; */
+}
+
+.button {
+  width: 90rpx;
+  height: 90rpx;
+  border-radius: 50%;
+  margin: -100rpx 5rpx 5rpx 5rpx;
+  background-color: #00aaff;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  cursor: pointer;
+  transition: background-color 0.3s;
+  border: none;
+  outline: none;
+  z-index: 9999;
+}
+
+.button:hover {
+  background-color: #808080;
+}
+
+.buttonClimate {
+  width: 90rpx;
+  height: 90rpx;
+  border-radius: 50%;
+  margin: -100rpx 5rpx 5rpx 5rpx;
+  background-color: #00aaff;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  cursor: pointer;
+  transition: background-color 0.3s;
+  border: none;
+  outline: none;
+  margin-left: 20rpx;
+  z-index: 9999;
+}
+
+.buttonClimate:hover {
+  background-color: #808080;
+}
+
+.plusHumidifier {
+  font-size: 35rpx;
+  color: white;
+}
+
+.plus {
+  font-size: 60rpx;
+  color: white;
+}
+
+.narrow-slider {
+  width: 200rpx;
+}
+
+.slider-container {
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+}
+
+.custom-slider {
+  width: 50%;
+  /* 根据需要调整slider的宽度 */
+}
+
+.slider-value {
+  margin-left: 10rpx;
+  /* 根据需要调整value与slider之间的间距 */
+}
+
+.tui-slider-box {
+  width: 440rpx;
+  margin-top: 20rpx;
+}
+
+.gray-input {
+  /* background-color: #ccc; */
+  background-color: #f5f5f5;
+  /* 其他样式,如字体大小、颜色、边框等 */
+  padding: 10rpx 50rpx 10rpx 10rpx;
+  /* 内边距,使文本不会紧贴着边框 */
+  border: none;
+  /* 移除默认边框 */
+}
+
+.arrow-up,
+.arrow-down {
+  width: 5rpx;
+  /* 箭头的宽度 */
+  height: 5rpx;
+  /* 箭头的高度 */
+  border-width: 6rpx;
+  /* 边框宽度,控制箭头的大小 */
+  border-style: solid;
+  /* 边框样式 */
+  position: absolute;
+  /* 绝对定位,方便后续调整位置 */
+  background-color: #f5f5f5;
+  /* 灰色背景 */
+}
+
+.arrow-up {
+  border-color: transparent transparent white transparent;
+  /* 设置上箭头的颜色 */
+  transform: rotate(-45deg);
+  /* 旋转箭头,使其朝上 */
+  margin-top: 10rpx;
+  /* 设置上箭头的位置 */
+  background-color: #f5f5f5;
+  /* 灰色背景 */
+}
+
+.arrow-down {
+  border-color: white transparent transparent transparent;
+  /* 设置下箭头的颜色 */
+  transform: rotate(45deg);
+  /* 旋转箭头,使其朝下 */
+  margin-top: 20rpx;
+  /* 设置下箭头的位置,确保它在上箭头的下方 */
+  background-color: #f5f5f5;
+  /* 灰色背景 */
+}
+
+.input-unit {
+  margin-left: 10rpx;
+  /* 与文本框之间留一些间距 */
+  color: #666;
+  /* 单位的颜色 */
+  font-size: 24rpx;
+  /* 单位的字体大小 */
+  background-color: #f5f5f5;
+  /* 灰色背景 */
+}
+
+.input-container {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  /* 使得文本框、箭头和单位之间有空隙 */
+  padding: 10rpx;
+  background-color: #f5f5f5;
+  /* 灰色背景 */
+}
+
+.input-text {
+  flex: 1;
+  /* 占据大部分空间 */
+  border: none;
+  padding: 10rpx;
+  background-color: #fff;
+  /* 文本框背景色 */
+  border-radius: 10rpx;
+  /* 圆角 */
+}
+
+.arrow-container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.arrow {
+  width: 12rpx;
+  height: 12rpx;
+  border: 1rpx solid #666;
+  border-width: 0 1rpx 1rpx 0;
+  /* transform: rotate(-45deg);  */
+  margin-bottom: 0rpx;
+  /* 上下箭头之间的间距 */
+  background-color: #f5f5f5;
+  /* 灰色背景 */
+}
+
+.up-arrow {
+  transform: rotate(225deg);
+  /* 下箭头需要反方向旋转 */
+  margin-bottom: 0;
+  /* 下箭头不需要额外的底部间距 */
+}
+
+.down-arrow {
+  transform: rotate(45deg);
+  /* 下箭头需要反方向旋转 */
+  margin-bottom: 0;
+  /* 下箭头不需要额外的底部间距 */
+}
+
+.input-unit {
+  color: #666;
+  font-size: 24rpx;
+}
+
+.audio-player {
+  width: 100%;
+  padding: 20rpx;
+  box-sizing: border-box;
+  /* margin-top: 20rpx; */
+}
+
+.controls {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 20rpx;
+}
+
+.controls_tv {
+  display: flex;
+  /* justify-content: space-between;  */
+  align-items: left;
+  margin-bottom: 20rpx;
+}
+
+.control-button {
+  width: 96rpx;
+  height: 156rpx;
+  border-radius: 24rpx;
+  background: #F6F8F9;
+}
+
+.control-button_1 {
+  width: 96rpx;
+  height: 156rpx;
+  border-radius: 24rpx;
+  background: #0BC3AA;
+}
+
+.progress {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-bottom: 20rpx;
+}
+
+.progress-bar {
+  width: 80%;
+  height: 40rpx;
+}
+
+.info {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  text-align: center;
+}
+
+.song-title,
+.song-artist {
+  color: #7eff98;
+  /* font-weight: bold; */
+}
+
+.picker-view {
+  background-color: #fff;
+  border: 2rpx solid #ddd;
+  padding: 10rpx;
+  font-size: 28rpx;
+}
+
+.center-view {
+  display: flex;
+  margin-bottom: 30rpx;
+  flex-direction: row;
+  align-items: center;
+  font-size: 32rpx;
+  color: #3E3D44;
+}
+
+.title-line {
+  margin-left: 40rpx;
+  width: 12rpx;
+  height: 32rpx;
+  margin-right: 20rpx;
+  border-radius: 8rpx;
+  background: #0BC3AA;
+}
+
+.gray-text {
+  font-size: 32rpx;
+  color: #3E3D44;
+}
+
+.custom-cell {
+  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);  
+  background-color: #fff;  
+  border-radius: 4px;  */
+}
+
+.air-conditioner-controls {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  flex-direction: row;
+  width: calc(100% - 80rpx);
+  padding: 20rpx 0;
+  background: white;
+}
+
+.control-button {
+  width: 96rpx;
+  height: 156rpx;
+  border-radius: 24rpx;
+  background: #F6F8F9;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.control-button_1 {
+  width: 96rpx;
+  height: 156rpx;
+  border-radius: 24rpx;
+  background: #0BC3AA;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.control-button_media {
+  width: 100rpx;
+  height: 100rpx;
+  border-radius: 50%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  background-color: rgba(203, 203, 203, 0.5);
+  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
+  margin: 0 10rpx;
+}
+
+.control-button_media_1 {
+  width: 100rpx;
+  height: 100rpx;
+  border-radius: 50%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  background-color: rgba(0, 170, 255, 0.5);
+  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
+  margin: 0 10rpx;
+}
+
+.control-button_media_2 {
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 50%;
+  flex-direction: column;
+  align-items: right;
+  justify-content: right;
+  background-color: rgba(203, 203, 203, 0.5);
+  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1);
+  margin: 0 10rpx;
+}
+
+.control-icon {
+  width: 40rpx;
+  height: 40rpx;
+}
+
+.control-text {
+  font-size: 24rpx;
+  color: #3E3D44;
+  margin-top: 10rpx;
+}
+
+.control-text_select {
+  font-size: 24rpx;
+  color: #ffffff;
+  margin-top: 10rpx;
+}
+
+.canvas4 {
+  display: flex;
+  flex-direction: column;
+  width: 100%;
+  height: 720rpx;
+  background-color: #d2d9ff;
+  /* 这里设置你想要的背景色 */
+}
+
+
+/* button {
+    -webkit-tap-highlight-color: transparent;
+    background: -webkit-linear-gradient(bottom,rgb(255, 255, 255),rgb(46, 207, 255),rgb(0, 170, 255));
+    border-radius: 5px;
+    box-sizing: border-box;
+    color: #000;
+    cursor: pointer;
+    display: block;
+    font-size: 18px;
+    line-height: 2.55555556;
+    margin-left: auto;
+    margin-right: auto;
+    overflow: hidden;
+    padding-left: 14px;
+    padding-right: 14px;
+    position: relative;
+    text-align: center;
+    text-decoration: none;
+} */
+
+.value-display {
+  font-size: 72rpx;
+  display: block;
+  line-height: 90rpx;
+  font-weight: 700;
+  margin-left: 40rpx;
+  color: #3E3D44;
+}
+
+.value-display_unit {
+  font-size: 28rpx;
+}
+
+.button-row {
+  display: flex;
+  flex-direction: row;
+  margin-bottom: 20rpx;
+}
+
+.round-gradient-button {
+  width: 160rpx;
+  height: 60rpx;
+  border: none;
+  /* background: linear-gradient(to bottom, #ffba4a, #ffaa00);  */
+  /* background: -webkit-linear-gradient(bottom,rgb(255, 255, 255),rgb(46, 207, 255),rgb(0, 170, 255)); */
+  background-color: rgb(0, 170, 255);
+  /* color: white;  */
+  font-size: 26rpx;
+  color: #000;
+  /* border-radius: 20%;  */
+  line-height: 60rpx;
+  text-align: center;
+  /* box-shadow: 0px 4rpx 15rpx rgba(0, 0, 0, 0.2);  */
+}
+
+.round-gradient-button-pressed {
+  background: linear-gradient(to bottom, #87ceeb, #aaaaff);
+  box-shadow: none;
+}
+
+.right-content-cover {
+  display: flex;
+  align-items: center;
+  /* 垂直居中 */
+  justify-content: flex-end;
+  /* 水平靠右对齐 */
+}
+
+.control-button-cover {
+  width: 60rpx;
+  height: 60rpx;
+  padding: 5rpx 25rpx 5rpx 5rpx;
+  border-radius: 50%;
+  background-color: rgba(255, 255, 255, 0.5);
+  /* 白色半透明背景 */
+}
+
+
+.data-container {
+  margin-top: 36rpx;
+  display: grid;
+  justify-content: center;
+  grid-template-columns: repeat(auto-fill, 320rpx);
+  grid-gap: 30rpx;
+}
+
+.data-card-v {
+  display: flex;
+  flex-direction: column;
+
+}
+
+.data-container .data-card {
+  position: relative;
+  /* background-color:#fff; */
+  /* background: linear-gradient(180deg, #E3FFE6 0%, #FFFFFF 53%); */
+  /* background-color: rgba(112, 56, 168, 0.5); */
+  height: 160rpx;
+  box-shadow: inset 20rpx 8rpx 20rpx 0px rgba(182, 194, 205, 0.2);
+  border-radius: 36rpx;
+  display: flex;
+  justify-content: space-between;
+  padding: 24rpx;
+}
+
+.data-container .data-card .data-card__text {
+  position: absolute;
+  right: 24rpx;
+  color: #6C6970;
+  text-align: right;
+  white-space: nowrap;
+}
+
+.data-container .data-card .data-card__icon {
+  height: 88rpx;
+  width: 88rpx;
+  left: 24rpx;
+  top: 36rpx;
+}
+
+.data-container .data-card .data-card__title {
+  padding-top: 18rpx;
+  font-size: 28rpx;
+  font-weight: bold;
+  color: #6C6970;
+}
+
+.data-container .data-card .data-card__title1 {
+  font-size: 28rpx;
+  white-space: pre;
+  font-weight: bold;
+  color: #6C6970;
+}
+
+.data-container .data-card .data-card__value {
+  padding-top: 60rpx;
+  font-size: 52rpx;
+  font-weight: bold;
+  color: #ffffff;
+}
+
+.data-container .data-card .data-card__value1 {
+  padding-top: 49rpx;
+  font-size: 30rpx;
+  color: #ffffff;
+}
+
+.sliderList {
+  -webkit-overflow-scrolling: touch
+}
+
+.sliderItem {
+  -webkit-overflow-scrolling: touch
+}
+
+.loading-container {
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  padding: 10px;
+  /* background-color: #9cffa3;  */
+  color: #b1b1b1;
+  border-radius: 4px;
+  z-index: 9999;
+  /* 确保它显示在其他内容之上 */
+}
+
+.loading-text {
+  /* 其他样式 */
+  width: 300rpx;
+  white-space: nowrap;
+}
+
+.clicked {
+  /* 这里添加你的点击效果样式,例如改变透明度或添加阴影 */
+  opacity: 0.8;
+  /* 或者使用动画 */
+  animation: myAnimation 0.3s;
+}
+
+.customSwitch {
+  border-color: #E8EAEB;
+}
+
+@keyframes myAnimation {
+
+  /* 定义你的动画 */
+  from {
+    transform: scale(1);
+  }
+
+  to {
+    transform: scale(0.95);
+  }
+}
+
+.tv_button-container {
+  display: flex;
+  flex-direction: row;
+  height: 52rpx;
+  align-items: center;
+  justify-content: space-between;
+  background: #FFF6EA;
+  border-radius: 40rpx;
+}
+
+.tv_custom-button {
+  margin: 4rpx;
+  border: none;
+  text-align: center;
+  background: #FDA64A;
+  font-size: 20rpx;
+  white-space: nowrap;
+  border-radius: 40rpx;
+  padding: 0 12rpx;
+  font-weight: normal;
+  height: 44rpx;
+  line-height: 44rpx;
+  color: white;
+  cursor: pointer;
+}
+
+.tv_disabled-button {
+  font-size: 20rpx;
+  white-space: nowrap;
+  background: transparent;
+  border: none;
+  padding: 0 12rpx;
+  font-weight: normal;
+  text-align: center;
+  height: 44rpx;
+  line-height: 44rpx;
+  margin: 4rpx;
+  color: #6C6970;
+  cursor: not-allowed;
+  /* 更改鼠标指针样式 */
+}
+
+.menu-tab {
+  display: flex;
+  flex-direction: row;
+  width: fit-content;
+  margin: 40rpx;
+  align-items: center;
+  border-radius: 40rpx;
+  background: #FFFFFF;
+}
+
+.menu-tab-item {
+  font-size: 28rpx;
+  padding: 8rpx 54rpx;
+  margin: 4rpx;
+  white-space: nowrap;
+  border-radius: 40rpx;
+  color: #6C6970;
+}
+
+.menu-tab-disenable {
+  font-size: 28rpx;
+  padding: 8rpx 54rpx;
+  margin: 4rpx;
+  white-space: nowrap;
+  border-radius: 40rpx;
+  color: #cccccc;
+}
+
+.menu-tab-item-active {
+  color: #FFFFFF;
+  font-size: 28rpx;
+  padding: 8rpx 48rpx;
+  white-space: nowrap;
+  border-radius: 40rpx;
+  margin: 4rpx;
+  background: #0BC3AA;
+}
+
+.dialog-sure-btn {
+  position: absolute;
+  width: 312rpx;
+  font-size: 28rpx;
+  height: 64rpx;
+  bottom: 40rpx;
+  color: #49AF88;
+  background: #FFFFFF;
+  line-height: 64rpx;
+  left: calc(50% - 156rpx);
+  text-align: center;
+  border-radius: 64rpx;
+}
+
+.dialog-content {
+  width: 620rpx;
+  top: 0;
+  left: 0;
+  position: absolute;
+  margin-left: 60rpx;
+  height: 380rpx;
+  display: flex;
+  flex-direction: column;
+}
+
+.dialog-h {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-left: 50rpx;
+  margin-top: 50rpx;
+}
+
+.dialog-icon {
+  display: block;
+  width: 36rpx;
+  height: 36rpx;
+}
+
+.dialog-title {
+  margin-left: 20rpx;
+  font-weight: 700;
+  font-size: 32rpx;
+  color: #222222;
+}
+
+.dialog-desc {
+  margin: 28rpx 50rpx 0;
+  font-size: 22rpx;
+  color: #333333;
+  line-height: 36rpx;
+  font-weight: 400;
+}

+ 5 - 5
pages/mine/mine.js → subpages/mine/mine.js

@@ -88,11 +88,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    const app = getApp();
-    app.globalData.selectedTabIndex = 3;
-    this.getTabBar().setData({
-      selected: 3
-    })
+    // const app = getApp();
+    // app.globalData.selectedTabIndex = 3;
+    // this.getTabBar().setData({
+    //   selected: 3
+    // })
   
     this.checkAuth()
   },

+ 0 - 0
pages/mine/mine.json → subpages/mine/mine.json


+ 0 - 0
pages/mine/mine.wxml → subpages/mine/mine.wxml


+ 0 - 0
pages/mine/mine.wxss → subpages/mine/mine.wxss


+ 5 - 5
pages/scan/scan.js → subpages/scan/scan.js

@@ -73,11 +73,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    const app = getApp();
-    app.globalData.selectedTabIndex = 4;
-    this.getTabBar().setData({
-      selected: 4
-    })
+    // const app = getApp();
+    // app.globalData.selectedTabIndex = 4;
+    // this.getTabBar().setData({
+    //   selected: 4
+    // })
 
     this.checkAuth()
   },

+ 0 - 0
pages/scan/scan.json → subpages/scan/scan.json


+ 0 - 0
pages/scan/scan.wxml → subpages/scan/scan.wxml


+ 0 - 0
pages/scan/scan.wxss → subpages/scan/scan.wxss


+ 0 - 0
pages/setTime/setTime.wxss → subpages/setTime/setTime.wxss


+ 5 - 5
pages/sleepReport/sleepReport.js → subpages/sleepReport/sleepReport.js

@@ -102,11 +102,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    const app = getApp();
-    app.globalData.selectedTabIndex = 2;
-    this.getTabBar().setData({
-      selected: 2
-    })
+    // const app = getApp();
+    // app.globalData.selectedTabIndex = 2;
+    // this.getTabBar().setData({
+    //   selected: 2
+    // })
   },
 
   /**

+ 0 - 0
pages/sleepReport/sleepReport.json → subpages/sleepReport/sleepReport.json


+ 0 - 0
pages/sleepReport/sleepReport.wxml → subpages/sleepReport/sleepReport.wxml


+ 0 - 0
pages/sleepReport/sleepReport.wxss → subpages/sleepReport/sleepReport.wxss