Commit 5eac97ee authored by sliao's avatar sliao

fix

parent 96254d43
{
"schema": [
{
"attr": 1667,
"canTrigger": true,
"code": "switch_led",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_power",
"id": 20,
"mode": "rw",
"name": "灯开关",
"property": {
"type": "bool"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "work_mode",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_mode",
"id": 21,
"mode": "rw",
"name": "灯模式",
"property": {
"range": [
"white",
"colour",
"scene",
"music"
],
"type": "enum"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "bright_value",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-liangdu1",
"id": 22,
"mode": "rw",
"name": "亮度值",
"property": {
"min": 10,
"max": 1000,
"scale": 0,
"step": 1,
"type": "value"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "temp_value",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_half",
"id": 23,
"mode": "rw",
"name": "冷暖值",
"property": {
"min": 0,
"max": 1000,
"scale": 0,
"step": 1,
"type": "value"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "colour_data",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-yanse",
"id": 24,
"mode": "rw",
"name": "彩光",
"property": {
"type": "string",
"maxlen": 255
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "scene_data",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-shoucang",
"id": 25,
"mode": "rw",
"name": "场景",
"property": {
"type": "string",
"maxlen": 255
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "countdown",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-a_nav_timer",
"id": 26,
"mode": "rw",
"name": "灯倒计时",
"property": {
"unit": "s",
"min": 0,
"max": 86400,
"scale": 0,
"step": 1,
"type": "value"
},
"type": "obj"
},
{
"attr": 128,
"canTrigger": true,
"code": "music_data",
"defaultRecommend": false,
"editPermission": false,
"executable": true,
"extContent": "",
"iconname": "icon-deng",
"id": 27,
"mode": "wr",
"name": "音乐灯",
"property": {
"type": "string",
"maxlen": 255
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "control_data",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_box2",
"id": 28,
"mode": "wr",
"name": "调节",
"property": {
"type": "string",
"maxlen": 255
},
"type": "obj"
},
{
"attr": 128,
"canTrigger": true,
"code": "power_memory",
"defaultRecommend": false,
"editPermission": false,
"executable": true,
"extContent": "",
"iconname": "icon-Trigger",
"id": 33,
"mode": "rw",
"name": "断电记忆",
"type": "raw"
},
{
"attr": 128,
"canTrigger": true,
"code": "do_not_disturb",
"defaultRecommend": false,
"editPermission": false,
"executable": true,
"extContent": "",
"iconname": "icon-dp_mode",
"id": 34,
"mode": "rw",
"name": "勿扰模式",
"property": {
"type": "bool"
},
"type": "obj"
},
{
"attr": 128,
"canTrigger": true,
"code": "switch_gradient",
"defaultRecommend": false,
"editPermission": false,
"executable": true,
"extContent": "",
"iconname": "icon-dp_mode",
"id": 35,
"mode": "rw",
"name": "开关渐变",
"type": "raw"
},
{
"attr": 128,
"canTrigger": true,
"code": "mix_light_scene",
"defaultRecommend": false,
"editPermission": false,
"executable": true,
"extContent": "",
"iconname": "icon-dp_mode",
"id": 36,
"mode": "rw",
"name": "混光场景",
"type": "raw"
},
{
"attr": 640,
"canTrigger": true,
"code": "mix_rgbcw",
"defaultRecommend": true,
"editPermission": false,
"executable": true,
"extContent": "",
"iconname": "icon-deng",
"id": 51,
"mode": "rw",
"name": "混光",
"type": "raw"
},
{
"attr": 1664,
"canTrigger": true,
"code": "fan_switch",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_power2",
"id": 60,
"mode": "rw",
"name": "风扇开关",
"property": {
"type": "bool"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "fan_mode",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-a_mode_fan",
"id": 61,
"mode": "rw",
"name": "风模式",
"property": {
"range": [
"fresh",
"nature"
],
"type": "enum"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "fan_speed",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-FanSpeed",
"id": 62,
"mode": "rw",
"name": "风速",
"property": {
"min": 1,
"max": 100,
"scale": 0,
"step": 1,
"type": "value"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "fan_direction",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_mode",
"id": 63,
"mode": "rw",
"name": "风向",
"property": {
"range": [
"forward",
"reverse"
],
"type": "enum"
},
"type": "obj"
},
{
"attr": 1664,
"canTrigger": true,
"code": "fan_countdown_left",
"defaultRecommend": true,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_time3",
"id": 64,
"mode": "rw",
"name": "风扇倒计时",
"property": {
"unit": "min",
"min": 0,
"max": 540,
"scale": 0,
"step": 1,
"type": "value"
},
"type": "obj"
},
{
"attr": 1152,
"canTrigger": true,
"code": "fan_beep",
"defaultRecommend": false,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-dp_voice",
"id": 66,
"mode": "rw",
"name": "蜂鸣器",
"property": {
"type": "bool"
},
"type": "obj"
},
{
"attr": 1152,
"canTrigger": true,
"code": "fault",
"defaultRecommend": false,
"editPermission": true,
"executable": true,
"extContent": "",
"iconname": "icon-baojing",
"id": 67,
"mode": "ro",
"name": "故障告警",
"property": {
"label": [
"motor_fault"
],
"type": "bitmap",
"maxlen": 1
},
"type": "obj"
}
],
"panelConfig": {
"bic": [
{
"code": "timer",
"selected": false
},
{
"code": "jump_url",
"selected": false
}
]
},
"pv": "2.0",
"icon": "https://images.tuyacn.com/smart/icon/bay1667456326777tesu/df74fc5b76dbb325c175c5ffbe189828.png",
"isOnline": true,
"uuid": "vdevo166780480910513",
"bv": "2.0",
"ability": 0,
"devId": "vdevo166780480910513",
"productId": "hcwquhbmkmjatays",
"dps": {
"20": false,
"21": "white",
"22": 10,
"23": 0,
"24": "",
"25": "",
"26": 0,
"27": "",
"28": "",
"34": false,
"60": true,
"61": "fresh",
"62": 1,
"63": "forward",
"64": 0,
"66": false,
"67": 0
},
"ip": "36.27.64.253",
"activeTime": 1667804809,
"isShare": false,
"name": "fengshandeng-vdevo",
"i18nTime": 1667804685162,
"localKey": "edb05e1e62e54406",
"dpCodes": {
"switch_led": false,
"work_mode": "white",
"bright_value": 10,
"temp_value": 0,
"colour_data": "",
"scene_data": "",
"countdown": 0,
"music_data": "",
"control_data": "",
"do_not_disturb": false,
"fan_switch": true,
"fan_mode": "fresh",
"fan_speed": 1,
"fan_direction": "forward",
"fan_countdown_left": 0,
"fan_beep": false,
"fault": 0
},
"capability": 1025,
"category": "fsd",
"attribute": 274877906948,
"devAttribute": 0,
"devTimezoneId": "Asia/Shanghai",
"isCloudOnline": true,
"latitude": "",
"longitude": "",
"dpName": {},
"dpsTime": {
"20": 1667805655637,
"21": 1667804809165,
"22": 1667804809165,
"23": 1667804809165,
"24": 1667804809165,
"25": 1667804809165,
"26": 1667804809165,
"27": 1667804809165,
"28": 1667804809165,
"33": 1667804809165,
"34": 1667804809165,
"35": 1667804809165,
"36": 1667804809165,
"51": 1667804809165,
"60": 1667895485379,
"61": 1667804809165,
"62": 1667804809165,
"63": 1667804809165,
"64": 1667804809165,
"66": 1667804809165,
"67": 1667804809165
},
"isVirtualDevice": true,
"idCodes": {
"20": "switch_led",
"21": "work_mode",
"22": "bright_value",
"23": "temp_value",
"24": "colour_data",
"25": "scene_data",
"26": "countdown",
"27": "music_data",
"28": "control_data",
"33": "power_memory",
"34": "do_not_disturb",
"35": "switch_gradient",
"36": "mix_light_scene",
"51": "mix_rgbcw",
"60": "fan_switch",
"61": "fan_mode",
"62": "fan_speed",
"63": "fan_direction",
"64": "fan_countdown_left",
"66": "fan_beep",
"67": "fault"
},
"codeIds": {
"switch_led": 20,
"work_mode": 21,
"bright_value": 22,
"temp_value": 23,
"colour_data": 24,
"scene_data": 25,
"countdown": 26,
"music_data": 27,
"control_data": 28,
"power_memory": 33,
"do_not_disturb": 34,
"switch_gradient": 35,
"mix_light_scene": 36,
"mix_rgbcw": 51,
"fan_switch": 60,
"fan_mode": 61,
"fan_speed": 62,
"fan_direction": 63,
"fan_countdown_left": 64,
"fan_beep": 66,
"fault": 67
}
}
\ No newline at end of file
...@@ -5,7 +5,7 @@ import '@/i18n'; ...@@ -5,7 +5,7 @@ import '@/i18n';
import composeLayout from './composeLayout'; import composeLayout from './composeLayout';
import { SdmProvider } from '@ray-js/sdm-react'; import { SdmProvider } from '@ray-js/sdm-react';
import { devices } from '@/devices'; import { devices } from '@/devices';
import { ProductName } from '@/constants'; // import { ProductName } from '@/constants';
const { initPanelEnvironment } = kit; const { initPanelEnvironment } = kit;
...@@ -14,7 +14,7 @@ interface Props { ...@@ -14,7 +14,7 @@ interface Props {
} }
initPanelEnvironment({ useDefaultOffline: true }); initPanelEnvironment({ useDefaultOffline: true });
class App extends React.Component<Props> { class App extends React.Component<Props>{
componentDidMount() { componentDidMount() {
console.info('app did mount '); console.info('app did mount ');
} }
...@@ -25,7 +25,7 @@ class App extends React.Component<Props> { ...@@ -25,7 +25,7 @@ class App extends React.Component<Props> {
render() { render() {
return <SdmProvider value={devices[ProductName]} >{this.props.children}</SdmProvider>; return <SdmProvider value={devices.fan} >{this.props.children}</SdmProvider>;
} }
} }
......
...@@ -9,23 +9,28 @@ ...@@ -9,23 +9,28 @@
// position: absolute; // position: absolute;
// top: calc(50vh - 175px); // top: calc(50vh - 175px);
margin-top: 90px; margin-top: 90px;
padding: 20px 0 40px; padding: 0 0 40px;
color: #000000; color: #000000;
z-index: 9999; z-index: 9999;
} }
.lightModalTop { .lightModalTop {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 20px; // padding: 0 20px;
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
font-size: 16px; font-size: 16px;
margin-bottom: 40px; margin-bottom: 40px;
}
.lightCloseBg {
padding: 20px 20px 0;
} }
.lightModalClose { .lightModalClose {
width: 24px; width: 24px;
height: 24px; height: 24px;
} }
.lightMiddle { .lightMiddle {
// width: 100%; // width: 100%;
height: 155px; height: 155px;
...@@ -86,6 +91,7 @@ ...@@ -86,6 +91,7 @@
top: 1px; top: 1px;
bottom: 1px; bottom: 1px;
z-index: 2; z-index: 2;
border-radius: 0 0 0 16px;
} }
.lightBtn { .lightBtn {
width: 310px; width: 310px;
......
...@@ -23,7 +23,7 @@ export const LightPanel = React.memo<Props>(props => { ...@@ -23,7 +23,7 @@ export const LightPanel = React.memo<Props>(props => {
const brightCode = 'bright_value' const brightCode = 'bright_value'
const temperatureCode = 'temp_value' const temperatureCode = 'temp_value'
const switchCode = 'switch_led' const switchCode = 'light'
let { isShow, setModal} = props; let { isShow, setModal} = props;
const brightVal = useSdmProps(dpState => { const brightVal = useSdmProps(dpState => {
...@@ -33,8 +33,8 @@ export const LightPanel = React.memo<Props>(props => { ...@@ -33,8 +33,8 @@ export const LightPanel = React.memo<Props>(props => {
}); });
const temperatureVal = useSdmProps(dpState => { const temperatureVal = useSdmProps(dpState => {
const val = dpState[temperatureCode] const val = dpState[temperatureCode]
const percent = getValueInRange(val || 0, cctRange).percent // const percent = getValueInRange(val || 0, cctRange).percent
return percent return val
}); });
const switchVal = useSdmProps(dpState => dpState[switchCode]); const switchVal = useSdmProps(dpState => dpState[switchCode]);
...@@ -44,12 +44,14 @@ export const LightPanel = React.memo<Props>(props => { ...@@ -44,12 +44,14 @@ export const LightPanel = React.memo<Props>(props => {
const brightAction = actions[brightCode] as DpCommonAction<number> const brightAction = actions[brightCode] as DpCommonAction<number>
const temperatureAction = actions[temperatureCode] as DpCommonAction<number> const temperatureAction = actions[temperatureCode] as DpCommonAction<number>
const [point, setPoint] = useState({pageX: getOrignPointX(), pageY: 234}) const [point, setPoint] = useState({pageX: getOrignPointX(), pageY: 250})
const [selectColor, setColor] = useState(pointToRGB(point.pageX)) const [selectColor, setColor] = useState(pointToRGB(point.pageX))
function getOrignPointX() { function getOrignPointX() {
const percent = getValueInRange(temperatureVal || 10, cctRange).percent const percent = getValueInRange(temperatureVal || 10, cctRange).percent
return 28 + 319 * Number((percent / 100).toFixed()) const originX = 28 + 319 * (percent / 100)
console.log(temperatureVal, percent, originX);
return originX
} }
//0-value是值 1-value是百分比 左边最小值是0,右边最大值range[1],起始位置rang[0] //0-value是值 1-value是百分比 左边最小值是0,右边最大值range[1],起始位置rang[0]
function getValueInRange(value, range, type = 0) { function getValueInRange(value, range, type = 0) {
...@@ -61,21 +63,15 @@ export const LightPanel = React.memo<Props>(props => { ...@@ -61,21 +63,15 @@ export const LightPanel = React.memo<Props>(props => {
} }
function touchStart(e) { function touchStart(e) {
console.log(e, 'start touch'); handlePoint(e)
handlePoint(e)
} }
function handleTouch(e) { function handleTouch(e) {
// console.log(e, 'handle touch'); handlePoint(e)
// const point = e.changedTouches.length && e.changedTouches[0]
// console.log(point, 'pppppppoint');
// handlePoint(e)
} }
function touchEnd(e) { function touchEnd(e) {
console.log(e, 'end touch'); handlePoint(e)
handlePoint(e)
} }
function handlePoint(e) { function handlePoint(e) {
...@@ -145,7 +141,7 @@ export const LightPanel = React.memo<Props>(props => { ...@@ -145,7 +141,7 @@ export const LightPanel = React.memo<Props>(props => {
function progressMove(e) { function progressMove(e) {
console.log(e, 'progressMove'); console.log(e, 'progressMove');
// handleProgress(e) handleProgress(e)
} }
function progressEnd(e) { function progressEnd(e) {
...@@ -172,11 +168,12 @@ export const LightPanel = React.memo<Props>(props => { ...@@ -172,11 +168,12 @@ export const LightPanel = React.memo<Props>(props => {
<View className={styles.modalback} style={{background:'rgba(0, 0, 0, 0.1)',backdropFilter:'blur(35px)', visibility: isShow ? 'visible':'hidden' }}> <View className={styles.modalback} style={{background:'rgba(0, 0, 0, 0.1)',backdropFilter:'blur(35px)', visibility: isShow ? 'visible':'hidden' }}>
<View className={styles.lightModal}> <View className={styles.lightModal}>
<View className={styles.lightModalTop}> <View className={styles.lightModalTop}>
<View>Light <View className={styles.lightCloseBg}>Light</View>
</View> <View className={styles.lightCloseBg}>
<Image className={styles.lightModalClose} src={iconClose} onClick={() => { <Image className={styles.lightModalClose} src={iconClose} onClick={() => {
setModal(false) setModal(false)
}}></Image> }}></Image>
</View>
</View> </View>
<View <View
className={styles.lightMiddle} className={styles.lightMiddle}
...@@ -190,7 +187,7 @@ export const LightPanel = React.memo<Props>(props => { ...@@ -190,7 +187,7 @@ export const LightPanel = React.memo<Props>(props => {
onTouchEnd={progressEnd}> onTouchEnd={progressEnd}>
<Image className={styles.progressSun} src={iconSun}></Image> <Image className={styles.progressSun} src={iconSun}></Image>
<View className={styles.progressTitle}>{brightVal}%</View> <View className={styles.progressTitle}>{brightVal}%</View>
<View className={styles.progressBar} style={{width: brightVal + '%'}}></View> <View className={styles.progressBar} style={{width: (brightVal - 0.5) + '%', borderBottomRightRadius: brightVal == 100 ? '16px':'0'}}></View>
</View> </View>
<View className={styles.lightBtn} style={{backgroundColor: switchVal ? '#6395F6':'rgba(0,0,0,0.5)'}} onClick={handleLightOn}> <View className={styles.lightBtn} style={{backgroundColor: switchVal ? '#6395F6':'rgba(0,0,0,0.5)'}} onClick={handleLightOn}>
<Image className={styles.lightBtnIcon} src={iconLightWhite}></Image> <Image className={styles.lightBtnIcon} src={iconLightWhite}></Image>
......
...@@ -105,19 +105,24 @@ ...@@ -105,19 +105,24 @@
position: relative; position: relative;
} }
.modalBg { .modalBg {
position: absolute; // position: absolute;
left: 0; // left: 0;
right: 0; // right: 0;
bottom: 101px; margin-bottom: -164px;
display: flex; display: flex;
flex-direction: column;
// align-items: flex-end;
background-color: white; background-color: white;
min-height: 127px; min-height: 127px;
flex-direction: column;
width: 90vw; width: 90vw;
z-index: 999; z-index: 999;
box-shadow: 0px 4px 24px rgba(0, 0, 0, 0.05); box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.05);
border-radius: 24px; border-radius: 24px;
align-self: center;
} }
.swiper { .swiper {
width: 100%; width: 100%;
...@@ -128,6 +133,7 @@ ...@@ -128,6 +133,7 @@
width: 36px; width: 36px;
height: 16px; height: 16px;
margin-bottom: -1px; margin-bottom: -1px;
z-index: 10000;
} }
.sliderBg { .sliderBg {
......
...@@ -16,7 +16,7 @@ import { Text, View, Swiper, SwiperItem} from '@ray-js/components'; ...@@ -16,7 +16,7 @@ import { Text, View, Swiper, SwiperItem} from '@ray-js/components';
// openTimerPage, // openTimerPage,
// } from '@ray-js/api'; // } from '@ray-js/api';
// import { hooks } from '@ray-js/panel-sdk'; // import { hooks } from '@ray-js/panel-sdk';
import { router, usePageEvent, setNavigationBarTitle } from '@ray-js/ray'; import { router, usePageEvent, setNavigationBarTitle} from '@ray-js/ray';
import React from 'react'; import React from 'react';
import { useSelector } from '@/redux'; import { useSelector } from '@/redux';
import styles from './index.module.less'; import styles from './index.module.less';
...@@ -63,7 +63,9 @@ export function Home() { ...@@ -63,7 +63,9 @@ export function Home() {
const fanModeCode = 'mode' const fanModeCode = 'mode'
const currentTempCode = 'temp_current' const currentTempCode = 'temp_current'
const isOpen = useSdmProps((props) => props[fanSwitchCode]) const isOpen = useSdmProps((props) => {
return Boolean(props[fanSwitchCode])
})
const spinSpeed = useSdmProps((props) => Number(props[fanSpeedCode])) const spinSpeed = useSdmProps((props) => Number(props[fanSpeedCode]))
const fanModeVal = useSdmProps((props) => props[fanModeCode]) const fanModeVal = useSdmProps((props) => props[fanModeCode])
...@@ -191,7 +193,20 @@ export function Home() { ...@@ -191,7 +193,20 @@ export function Home() {
</View> </View>
) )
} }
const toggleModal = () => {
console.log('toggleModal');
// setModal(false)
setMenuIndex(null)
};
const modalSetting = {
show: true,
position: 'center',
overlay:true,
onClickOverlay: toggleModal,
overlayStyle: {backgroundColor: 'transparent'}
}
return ( return (
<View className={styles.page}> <View className={styles.page}>
...@@ -208,16 +223,18 @@ export function Home() { ...@@ -208,16 +223,18 @@ export function Home() {
</View> </View>
<View className={styles.sliderBg}> <View className={styles.sliderBg}>
<Slider <Slider
activeColor='linear-gradient(180deg, #87ABF2 11.62%, #4B7EE2 100%)' activeColor='linear-gradient(-90deg, #87ABF2 11.62%, #4B7EE2 100%)'
blockColor='white' blockColor='white'
blockSize={28} blockSize={28}
min={0} min={1}
max={100} max={100}
value={spinSpeed} value={spinSpeed}
step={1} step={1}
disabled={!isOpen} disabled={!isOpen}
onChange={(e) => { onChange={(e) => {
console.log('SliderChange', e) speedAction.set(e.value)
}}
onChanging={(e) => {
speedAction.set(e.value) speedAction.set(e.value)
}} }}
/> />
...@@ -236,7 +253,8 @@ export function Home() { ...@@ -236,7 +253,8 @@ export function Home() {
> >
{ {
menuIndex == 1 ? menuIndex == 1 ?
<View className={styles.modalBg}> <Modal show={true} position='center' overlay={true} onClickOverlay={toggleModal} overlayStyle={{backgroundColor: 'transparent'}}>
<View className={styles.modalBg} >
<Swiper dots={true} dotActiveColor='#6395F6' dotColor='rgba(99,149,246, 0.2)'> <Swiper dots={true} dotActiveColor='#6395F6' dotColor='rgba(99,149,246, 0.2)'>
<SwiperItem> <SwiperItem>
<View className={styles.swiperItem}> <View className={styles.swiperItem}>
...@@ -262,10 +280,14 @@ export function Home() { ...@@ -262,10 +280,14 @@ export function Home() {
</View> </View>
</SwiperItem> </SwiperItem>
</Swiper> </Swiper>
</View> </View>
: menuIndex == 3 ? <View className={styles.modalBg} style={{height: '213px', display: 'flex', flexDirection:'column', padding:'16px 16px 0', gap:'12px'}}> </Modal>
: menuIndex == 3 ?
<Modal show={true} position='center' overlay={true} onClickOverlay={toggleModal} overlayStyle={{backgroundColor: 'transparent'}}>
<View className={styles.modalBg} style={{height: '213px', display: 'flex', flexDirection:'column', padding:'16px 16px 0', gap:'12px', marginBottom:'-102px'}}>
<FanVertical></FanVertical> <FanVertical></FanVertical>
</View> </View>
</Modal>
: null : null
} }
<Image className={styles.middleware} src={middleware} style={{visibility: menuIndex == index ? 'visible':'hidden'}} /> <Image className={styles.middleware} src={middleware} style={{visibility: menuIndex == index ? 'visible':'hidden'}} />
......
...@@ -5,7 +5,8 @@ export const routes: Routes = [ ...@@ -5,7 +5,8 @@ export const routes: Routes = [
route: '/', route: '/',
path: '/pages/home/index', path: '/pages/home/index',
name: 'Home', name: 'Home',
}, id:'home'
}
// { // {
// route: '/common/page4/index', // route: '/common/page4/index',
// path: '/pages/common/page4/index', // path: '/pages/common/page4/index',
......
...@@ -3,10 +3,10 @@ import { ProductName } from '@/constants'; ...@@ -3,10 +3,10 @@ import { ProductName } from '@/constants';
type SmartDeviceSchema = typeof import('@/devices/schema').fanSchema; type SmartDeviceSchema = typeof import('@/devices/schema').fanSchema;
type SmartDevices = { type SmartDevices = {
[ProductName]?: import('@tuya-miniapp/sdm').SmartDeviceModel<SmartDeviceSchema>; fan?: import('@tuya-miniapp/sdm').SmartDeviceModel<SmartDeviceSchema>;
}; };
declare module '@ray-js/sdm-react' { // declare module '@ray-js/sdm-react' {
// export const SdmProvider: React.FC<{ // export const SdmProvider: React.FC<{
// value: SmartDeviceModel<SmartDeviceSchema>; // value: SmartDeviceModel<SmartDeviceSchema>;
// children: React.ReactNode; // children: React.ReactNode;
...@@ -27,5 +27,5 @@ declare module '@ray-js/sdm-react' { ...@@ -27,5 +27,5 @@ declare module '@ray-js/sdm-react' {
// selector: (device: SmartDeviceInstanceData) => Device, // selector: (device: SmartDeviceInstanceData) => Device,
// equalityFn?: (a: Device, b: Device) => boolean // equalityFn?: (a: Device, b: Device) => boolean
// ): Device; // ): Device;
export function useActions(): SmartDevices[ProductName]['model']['actions']; // export function useActions(): SmartDevices[ProductName]['model']['actions'];
} // }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment