浏览代码

消息通讯

xujunjie 1 年之前
父节点
当前提交
54f5d545ae
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/pages/Controller/Hardware.js

+ 9 - 1
src/pages/Controller/Hardware.js

@@ -2,11 +2,19 @@ import PageContent from '@/components/PageContent';
 import PageTitle from '@/components/PageTitle';
 import TabsContent from '@/components/TabsContent';
 import { UnityAction } from '@/utils/utils';
+import { useEffect } from 'react';
 import AirConditioner from './components/AirConditioner';
 import Light from './components/Light';
 
 function Hardware() {
-  const handleTabsChange = (tab) => {};
+  const handleTabsChange = (tab) => {
+    UnityAction.sendMsg(tab == '1' ? 'ACData' : 'lightData');
+  };
+
+  useEffect(() => {
+    UnityAction.sendMsg('ACData');
+  }, []);
+  
   return (
     <PageContent closeable={false}>
       <PageTitle