@ledvance/group-ui-biz-bundle 1.0.66 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/flags/FlagEditPage.tsx +6 -2
- package/src/modules/mood_new/AddMoodPage.tsx +2 -2
- package/src/modules/mood_new/Interface.ts +1 -0
- package/src/modules/mood_new/MoodActions.ts +2 -0
- package/src/modules/mood_new/MoodPage.tsx +2 -1
- package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +4 -3
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +34 -32
- package/src/modules/timeSchedule/components/ManuaSettings.tsx +6 -6
package/package.json
CHANGED
|
@@ -56,11 +56,15 @@ const FlagEditPage = () => {
|
|
|
56
56
|
}, [state.currentNode, state.currentWhiteNode])
|
|
57
57
|
|
|
58
58
|
useUpdateEffect(() =>{
|
|
59
|
-
state.
|
|
59
|
+
if (state.colorPaintBucketIdx < state.mood.colors.length){
|
|
60
|
+
state.currentNode = state.mood.colors[state.colorPaintBucketIdx]
|
|
61
|
+
}
|
|
60
62
|
}, [JSON.stringify(state.mood.colors), state.colorPaintBucketIdx])
|
|
61
63
|
|
|
62
64
|
useUpdateEffect(() =>{
|
|
63
|
-
state.
|
|
65
|
+
if (state.whitePaintBucketIdx < state.mood.whiteColors.length ){
|
|
66
|
+
state.currentWhiteNode = state.mood.whiteColors[state.whitePaintBucketIdx]
|
|
67
|
+
}
|
|
64
68
|
}, [JSON.stringify(state.mood.whiteColors), state.whitePaintBucketIdx])
|
|
65
69
|
|
|
66
70
|
const checkMoodDataChanged = useMemo(() =>{
|
|
@@ -66,7 +66,7 @@ const AddMoodPage = () => {
|
|
|
66
66
|
? ui_biz_routerKey.group_ui_biz_dynamic_mix_mood_edit
|
|
67
67
|
: ui_biz_routerKey.group_ui_biz_dynamic_mood_edit;
|
|
68
68
|
const currentMood = moodItem.mainLamp
|
|
69
|
-
? { ...moodItem, id: mainId, mainLamp: { ...moodItem.mainLamp, id: mainId }, secondaryLamp: { ...moodItem.secondaryLamp, id: secondaryId } }
|
|
69
|
+
? { ...moodItem, id: mainId, mainLamp: { ...moodItem.mainLamp, id: mainId }, secondaryLamp: { ...moodItem.secondaryLamp, id: moodItem.secondaryLamp?.nodes?.length ? secondaryId : -1} }
|
|
70
70
|
: newMood(mainId, secondaryId, moduleParams.isSupportColor, routeParams.isStatic, moduleParams);
|
|
71
71
|
navigation.navigate(url, {
|
|
72
72
|
...routeParams,
|
|
@@ -182,7 +182,7 @@ function newMood(
|
|
|
182
182
|
nodes: isStatic ? [node] : [node, { ...node }],
|
|
183
183
|
},
|
|
184
184
|
secondaryLamp: {
|
|
185
|
-
id: secondaryId,
|
|
185
|
+
id: isStatic ? -1 : secondaryId,
|
|
186
186
|
enable: true,
|
|
187
187
|
mode: MoodJumpGradientMode.StripJump,
|
|
188
188
|
speed: 75,
|
|
@@ -66,6 +66,7 @@ export function useMoodScene(params: MoodPageParams): [SceneDataType, (value: Sc
|
|
|
66
66
|
const dps = {}
|
|
67
67
|
if (moodInfo?.scene) {
|
|
68
68
|
const { mainLamp, secondaryLamp } = moodInfo.scene
|
|
69
|
+
dps[params.switchLedDp] = true
|
|
69
70
|
if (mainLamp?.nodes?.length) {
|
|
70
71
|
const mainDp = getMoodDp(params.isCeilingLight ? ({...moodInfo.scene, id: mainLamp.id!}) : moodInfo.scene, params)
|
|
71
72
|
if (mainDp && params.mainDp) {
|
|
@@ -109,6 +110,7 @@ export function useMoodScene(params: MoodPageParams): [SceneDataType, (value: Sc
|
|
|
109
110
|
const config = {} as SceneDataConfigType
|
|
110
111
|
if (moodInfo?.scene) {
|
|
111
112
|
const { mainLamp, secondaryLamp } = moodInfo.scene
|
|
113
|
+
config.switch_led = true
|
|
112
114
|
if (mainLamp?.nodes?.length) {
|
|
113
115
|
config.work_mode = WorkMode.Scene
|
|
114
116
|
config.workMode = WorkMode.Scene
|
|
@@ -53,7 +53,8 @@ const MoodPage = () => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
const moodIds = useMemo(() => {
|
|
56
|
-
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
const mainIds = map(params.isCeilingLight ? (state.originMoods.map(m => m.mainLamp) || []) : state.originMoods, 'id').filter(v => v !== undefined)
|
|
57
58
|
const secondaryIds = map(state.originMoods.map(m => m.secondaryLamp) || [], 'id')
|
|
58
59
|
return filter([...mainIds, ...secondaryIds], v => v !== undefined) as number[]
|
|
59
60
|
}, [JSON.stringify(state.originMoods)])
|
|
@@ -381,6 +381,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
381
381
|
isSupportBrightness={props.isSupportBrightness}
|
|
382
382
|
isSupportTemperature={props.isSupportTemperature}
|
|
383
383
|
isCeilingLight={props.isCeilingLight}
|
|
384
|
+
isUVCFan={props.isUVCFan}
|
|
384
385
|
manualData={state.manualData}
|
|
385
386
|
onManualChange={manual => {
|
|
386
387
|
// @ts-ignore
|
|
@@ -552,14 +553,14 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
|
|
|
552
553
|
? DeviceType.CeilingLight
|
|
553
554
|
: props.isFanLight ?
|
|
554
555
|
DeviceType.FanLight
|
|
556
|
+
: props.isCeilingLight
|
|
557
|
+
? DeviceType.CeilingLight
|
|
555
558
|
: DeviceType.LightSource;
|
|
556
559
|
const deviceData =
|
|
557
|
-
deviceType === DeviceType.StripLight
|
|
560
|
+
(deviceType === DeviceType.StripLight || deviceType === DeviceType.CeilingLight)
|
|
558
561
|
? defStripDeviceData
|
|
559
562
|
: deviceType === DeviceType.MixLight
|
|
560
563
|
? defMixDeviceData
|
|
561
|
-
: deviceType === DeviceType.CeilingLight
|
|
562
|
-
? defCeilingLihtDeviceData
|
|
563
564
|
: deviceType === DeviceType.FanLight
|
|
564
565
|
? defFanLightDeviceData
|
|
565
566
|
: defDeviceData;
|
|
@@ -14,11 +14,12 @@ import Spacer from '@ledvance/base/src/components/Spacer';
|
|
|
14
14
|
import InfoText from '@ledvance/base/src/components/InfoText';
|
|
15
15
|
import DeleteButton from '@ledvance/base/src/components/DeleteButton';
|
|
16
16
|
import { useReactive, useUpdateEffect } from 'ahooks';
|
|
17
|
-
import { addTimeSchedule, modDelTimeSchedule, getTimeSchedule, modifyTimeSchedule } from "
|
|
18
|
-
import {
|
|
17
|
+
import { addTimeSchedule, modDelTimeSchedule, getTimeSchedule, modifyTimeSchedule } from "./TimeScheduleActions";
|
|
18
|
+
import { DeviceStateType, Timer } from './Interface';
|
|
19
19
|
import { useParams } from '@ledvance/base/src/hooks/Hooks';
|
|
20
|
-
import ScheduleCard from '
|
|
21
|
-
import { ui_biz_routerKey } from "
|
|
20
|
+
import ScheduleCard from './components/ScheduleCard';
|
|
21
|
+
import { ui_biz_routerKey } from "../../navigation/Routers";
|
|
22
|
+
import { ApplyForItem } from '@ledvance/base/src/utils/interface';
|
|
22
23
|
|
|
23
24
|
const { convertX: cx } = Utils.RatioUtils;
|
|
24
25
|
const MAX_NUM = 30;
|
|
@@ -36,7 +37,7 @@ export interface TimeSchedulePageParams {
|
|
|
36
37
|
isFanLight?: boolean
|
|
37
38
|
isUVCFan?: boolean;
|
|
38
39
|
applyForList: ApplyForItem[];
|
|
39
|
-
applyForDisabled
|
|
40
|
+
applyForDisabled?: boolean; // 是否可以选择apply for
|
|
40
41
|
manualDataDp2Obj: (dps: Record<string, any>) => DeviceStateType;
|
|
41
42
|
manualDataObj2Dp: (deviceState: DeviceStateType, applyForList: ApplyForItem[]) => Record<string, any>;
|
|
42
43
|
}
|
|
@@ -141,6 +142,7 @@ const TimeSchedulePage = () => {
|
|
|
141
142
|
iconStyle={{ tintColor: '#ff9500' }}
|
|
142
143
|
/>
|
|
143
144
|
)}
|
|
145
|
+
{ state.timeScheduleList.length > 0 ?
|
|
144
146
|
<FlatList
|
|
145
147
|
data={state.timeScheduleList}
|
|
146
148
|
renderItem={({ item }) => (
|
|
@@ -161,36 +163,36 @@ const TimeSchedulePage = () => {
|
|
|
161
163
|
/>
|
|
162
164
|
)}
|
|
163
165
|
keyExtractor={item => item.id.toString()}
|
|
164
|
-
ListEmptyComponent={
|
|
165
|
-
<View style={styles.emptyContainer}>
|
|
166
|
-
<Spacer height={cx(60)} />
|
|
167
|
-
<Image
|
|
168
|
-
style={styles.emptyImage}
|
|
169
|
-
source={{ uri: res.ldv_timer_empty }}
|
|
170
|
-
resizeMode="contain"
|
|
171
|
-
/>
|
|
172
|
-
<InfoText
|
|
173
|
-
icon={res.device_panel_schedule_alert}
|
|
174
|
-
text={I18n.getLang('timeschedule_overview_empty_information_text')}
|
|
175
|
-
style={{ width: 'auto', alignItems: 'center' }}
|
|
176
|
-
textStyle={{ color: '#000', fontSize: cx(12), flex: undefined }}
|
|
177
|
-
iconStyle={{ tintColor: '#000' }}
|
|
178
|
-
/>
|
|
179
|
-
<Spacer height={cx(16)} />
|
|
180
|
-
<DeleteButton
|
|
181
|
-
style={styles.addBtn}
|
|
182
|
-
text={`${I18n.getLang('timeschedule_overview_empty_button_add_text')}`}
|
|
183
|
-
textStyle={{ fontSize: cx(12) }}
|
|
184
|
-
onPress={() => {
|
|
185
|
-
navigateToEdit('add');
|
|
186
|
-
}}
|
|
187
|
-
/>
|
|
188
|
-
</View>
|
|
189
|
-
)}
|
|
166
|
+
ListEmptyComponent={<Spacer />}
|
|
190
167
|
ListHeaderComponent={() => <Spacer height={cx(10)} />}
|
|
191
168
|
ItemSeparatorComponent={() => <Spacer />}
|
|
192
169
|
ListFooterComponent={() => <Spacer height={cx(30)} />}
|
|
193
|
-
/>
|
|
170
|
+
/> :
|
|
171
|
+
<View style={styles.emptyContainer}>
|
|
172
|
+
<Spacer height={cx(60)}/>
|
|
173
|
+
<Image
|
|
174
|
+
style={styles.emptyImage}
|
|
175
|
+
source={{uri: res.ldv_timer_empty}}
|
|
176
|
+
resizeMode="contain"
|
|
177
|
+
/>
|
|
178
|
+
<InfoText
|
|
179
|
+
icon={res.device_panel_schedule_alert}
|
|
180
|
+
text={I18n.getLang('timeschedule_overview_empty_information_text')}
|
|
181
|
+
style={{width: 'auto', alignItems: 'center'}}
|
|
182
|
+
textStyle={{color: '#000', fontSize: cx(12), flex: undefined}}
|
|
183
|
+
iconStyle={{tintColor: '#000'}}
|
|
184
|
+
/>
|
|
185
|
+
<Spacer height={cx(16)}/>
|
|
186
|
+
<DeleteButton
|
|
187
|
+
style={styles.addBtn}
|
|
188
|
+
text={`${I18n.getLang('timeschedule_overview_empty_button_add_text')}`}
|
|
189
|
+
textStyle={{fontSize: cx(12)}}
|
|
190
|
+
onPress={() => {
|
|
191
|
+
navigateToEdit('add');
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
</View>
|
|
195
|
+
}
|
|
194
196
|
</ScrollView>
|
|
195
197
|
</Page>
|
|
196
198
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
|
-
import { CeilingLightData, DeviceType, ManualSettingProps, StripLightData, directOptions, modeOptions } from '../Interface';
|
|
2
|
+
import { CeilingLightData, DeviceType, FanLightData, ManualSettingProps, StripLightData, directOptions, modeOptions } from '../Interface';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import Card from '@ledvance/base/src/components/Card';
|
|
5
5
|
import LampAdjustView from '@ledvance/base/src/components/LampAdjustView';
|
|
@@ -71,7 +71,7 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
71
71
|
<View key={item.dp}>
|
|
72
72
|
<Card style={{ marginHorizontal: cx(24) }}>
|
|
73
73
|
<LdvSwitch
|
|
74
|
-
title={item.key}
|
|
74
|
+
title={item.name || item.key}
|
|
75
75
|
color={'#fff'}
|
|
76
76
|
colorAlpha={1}
|
|
77
77
|
enable={item.enable}
|
|
@@ -141,9 +141,9 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
141
141
|
isSupportDirection={props.isUVCFan}
|
|
142
142
|
isSupportDisinfect={props.isUVCFan}
|
|
143
143
|
isSupportMode={props.isUVCFan}
|
|
144
|
-
directValue={
|
|
145
|
-
disinfect={
|
|
146
|
-
modeValue={
|
|
144
|
+
directValue={(state.deviceData as FanLightData).direction}
|
|
145
|
+
disinfect={(state.deviceData as FanLightData).disinfect}
|
|
146
|
+
modeValue={(state.deviceData as FanLightData).mode}
|
|
147
147
|
directOptions={directOptions}
|
|
148
148
|
modeOptions={modeOptions}
|
|
149
149
|
directChange={(direction: any) => {
|
|
@@ -170,7 +170,7 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
170
170
|
// @ts-ignore
|
|
171
171
|
fanSpeed={deviceData.fanSpeed}
|
|
172
172
|
onFanSwitch={() => {}}
|
|
173
|
-
onFanSpeedChangeComplete={(fanSpeed) => {
|
|
173
|
+
onFanSpeedChangeComplete={(fanSpeed) => {
|
|
174
174
|
state.deviceData = {
|
|
175
175
|
...state.deviceData,
|
|
176
176
|
fanSpeed
|