@ledvance/ui-biz-bundle 1.1.69 → 1.1.71
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/.babelrc +31 -31
- package/.eslintignore +5 -5
- package/.eslintrc.js +27 -27
- package/.prettierrc.js +1 -1
- package/.versionrc +5 -5
- package/package.json +74 -74
- package/rn-cli.config.js +8 -8
- package/src/hooks/DeviceDpStateHooks.d.ts +14 -14
- package/src/hooks/DeviceDpStateHooks.ts +50 -50
- package/src/modules/biorhythm/BiorhythmActions.d.ts +8 -8
- package/src/modules/biorhythm/BiorhythmActions.ts +324 -324
- package/src/modules/biorhythm/BiorhythmBean.d.ts +58 -58
- package/src/modules/biorhythm/BiorhythmBean.ts +230 -230
- package/src/modules/biorhythm/BiorhythmEditPage.d.ts +14 -14
- package/src/modules/biorhythm/BiorhythmEditPage.tsx +324 -324
- package/src/modules/biorhythm/BiorhythmPage.d.ts +10 -10
- package/src/modules/biorhythm/BiorhythmPage.tsx +796 -796
- package/src/modules/biorhythm/IconSelect.d.ts +2 -2
- package/src/modules/biorhythm/IconSelect.tsx +81 -81
- package/src/modules/biorhythm/Router.ts +34 -34
- package/src/modules/biorhythm/circular/ItemIcon.d.ts +22 -22
- package/src/modules/biorhythm/circular/ItemIcon.tsx +172 -172
- package/src/modules/biorhythm/circular/Progress.d.ts +24 -24
- package/src/modules/biorhythm/circular/Progress.tsx +411 -411
- package/src/modules/biorhythm/circular/TimeCircular.d.ts +11 -11
- package/src/modules/biorhythm/circular/TimeCircular.tsx +70 -70
- package/src/modules/biorhythm/iconListData.d.ts +7 -7
- package/src/modules/biorhythm/iconListData.ts +29 -29
- package/src/modules/biorhythm/pIdList.d.ts +2 -2
- package/src/modules/biorhythm/pIdList.ts +35 -35
- package/src/modules/biorhythm/res/BiologicalRes.d.ts +43 -43
- package/src/modules/biorhythm/res/BiologicalRes.ts +41 -41
- package/src/modules/config/ldvConfig.d.ts +2 -2
- package/src/modules/config/ldvConfig.tsx +18 -18
- package/src/modules/fixedTime/FixedTimeActions.ts +173 -173
- package/src/modules/fixedTime/FixedTimeDetailPage.tsx +372 -372
- package/src/modules/fixedTime/FixedTimePage.tsx +213 -213
- package/src/modules/fixedTime/Router.ts +26 -26
- package/src/modules/flags/FlagActions.ts +267 -267
- package/src/modules/flags/FlagEditPage.tsx +441 -441
- package/src/modules/flags/FlagInfo.tsx +563 -563
- package/src/modules/flags/FlagItem.tsx +90 -90
- package/src/modules/flags/FlagPage.tsx +277 -277
- package/src/modules/flags/Router.ts +25 -25
- package/src/modules/history/HistoryPage.d.ts +2 -2
- package/src/modules/history/HistoryPage.tsx +261 -261
- package/src/modules/history/Router.ts +16 -16
- package/src/modules/history/SwitchHistoryPageActions.d.ts +14 -14
- package/src/modules/history/SwitchHistoryPageActions.ts +76 -76
- package/src/modules/mood/AddMoodPage.d.ts +10 -10
- package/src/modules/mood/AddMoodPage.tsx +792 -792
- package/src/modules/mood/DynamicMoodEditorPage.d.ts +6 -6
- package/src/modules/mood/DynamicMoodEditorPage.tsx +561 -561
- package/src/modules/mood/FantasyMood.tsx +176 -176
- package/src/modules/mood/FantasyMoodEditPage.tsx +582 -582
- package/src/modules/mood/FantasyMoodItem.tsx +104 -104
- package/src/modules/mood/FantasyRouter.ts +35 -35
- package/src/modules/mood/MixMood/AddMixMoodPage.tsx +247 -247
- package/src/modules/mood/MixMood/MixMoodActions.ts +128 -128
- package/src/modules/mood/MixMood/MixMoodEditPage.tsx +721 -721
- package/src/modules/mood/MixMood/MixMoodItem.tsx +134 -134
- package/src/modules/mood/MixMood/MixMoodPage.tsx +326 -326
- package/src/modules/mood/MixMood/MixSceneBeans.ts +364 -364
- package/src/modules/mood/MixMood/RecommendMixMoodItem.tsx +69 -69
- package/src/modules/mood/MixMood/Router.ts +44 -44
- package/src/modules/mood/MoodItem.d.ts +11 -11
- package/src/modules/mood/MoodItem.tsx +114 -114
- package/src/modules/mood/MoodPage.d.ts +16 -16
- package/src/modules/mood/MoodPage.tsx +296 -296
- package/src/modules/mood/RecommendMoodItem.d.ts +13 -13
- package/src/modules/mood/RecommendMoodItem.tsx +74 -74
- package/src/modules/mood/Router.ts +53 -53
- package/src/modules/mood/StaticMoodEditorPage.d.ts +16 -16
- package/src/modules/mood/StaticMoodEditorPage.tsx +320 -320
- package/src/modules/mood/tools.d.ts +3 -3
- package/src/modules/mood/tools.ts +11 -11
- package/src/modules/music/MusicDataBean.d.ts +47 -47
- package/src/modules/music/MusicDataBean.ts +167 -167
- package/src/modules/music/MusicManager.d.ts +27 -27
- package/src/modules/music/MusicManager.ts +207 -207
- package/src/modules/music/MusicPage.d.ts +10 -10
- package/src/modules/music/MusicPage.tsx +347 -347
- package/src/modules/music/MusicPageActions.d.ts +35 -35
- package/src/modules/music/MusicPageActions.ts +317 -317
- package/src/modules/music/Router.ts +16 -16
- package/src/modules/music/SelecetGenre.d.ts +7 -7
- package/src/modules/music/SelecetGenre.tsx +63 -63
- package/src/modules/music/color.d.ts +2 -2
- package/src/modules/music/color.ts +73 -73
- package/src/modules/music/res/index.d.ts +10 -10
- package/src/modules/music/res/index.ts +9 -9
- package/src/modules/powerOnBehavior/PowerOnBehaviorActions.ts +11 -11
- package/src/modules/powerOnBehavior/PowerOnBehaviorPage.tsx +173 -173
- package/src/modules/powerOnBehavior/Router.ts +16 -16
- package/src/modules/randomTime/RandomTimeActions.ts +160 -160
- package/src/modules/randomTime/RandomTimeDetailPage.tsx +337 -337
- package/src/modules/randomTime/RandomTimePage.tsx +214 -214
- package/src/modules/randomTime/Router.ts +25 -25
- package/src/modules/randomTime/Summary.tsx +122 -122
- package/src/modules/scene/SceneAction.d.ts +13 -13
- package/src/modules/scene/SceneAction.ts +473 -473
- package/src/modules/scene/SceneDetailPage.d.ts +1 -1
- package/src/modules/scene/SceneDetailPage.tsx +421 -421
- package/src/modules/scene/SceneInfo.d.ts +72 -72
- package/src/modules/scene/SceneInfo.ts +1059 -1059
- package/src/modules/scene/ScenePage.d.ts +7 -7
- package/src/modules/scene/ScenePage.tsx +147 -147
- package/src/modules/select/SelectPage.d.ts +12 -12
- package/src/modules/select/SelectPage.tsx +137 -137
- package/src/modules/sleepWakeup/DeviceState.d.ts +9 -9
- package/src/modules/sleepWakeup/DeviceState.tsx +99 -99
- package/src/modules/sleepWakeup/LdvScheduleItem.d.ts +15 -15
- package/src/modules/sleepWakeup/LdvScheduleItem.tsx +176 -176
- package/src/modules/sleepWakeup/Router.ts +25 -25
- package/src/modules/sleepWakeup/SleepWakeUpActions.d.ts +2 -2
- package/src/modules/sleepWakeup/SleepWakeUpActions.ts +180 -180
- package/src/modules/sleepWakeup/SleepWakeUpDetailPage.d.ts +2 -2
- package/src/modules/sleepWakeup/SleepWakeUpDetailPage.tsx +616 -616
- package/src/modules/sleepWakeup/SleepWakeUpPage.d.ts +13 -13
- package/src/modules/sleepWakeup/SleepWakeUpPage.tsx +424 -424
- package/src/modules/sleepWakeup/utils.d.ts +44 -44
- package/src/modules/sleepWakeup/utils.ts +253 -253
- package/src/modules/timeSchedule/DeviceState.d.ts +17 -17
- package/src/modules/timeSchedule/DeviceState.tsx +94 -94
- package/src/modules/timeSchedule/LdvScheduleItem.d.ts +15 -15
- package/src/modules/timeSchedule/LdvScheduleItem.tsx +130 -130
- package/src/modules/timeSchedule/ManualSetting.d.ts +14 -14
- package/src/modules/timeSchedule/ManualSetting.tsx +219 -219
- package/src/modules/timeSchedule/MoodSetting.d.ts +11 -11
- package/src/modules/timeSchedule/MoodSetting.tsx +228 -228
- package/src/modules/timeSchedule/Router.ts +25 -25
- package/src/modules/timeSchedule/ScheduleScene.d.ts +6 -6
- package/src/modules/timeSchedule/ScheduleScene.tsx +144 -144
- package/src/modules/timeSchedule/SingleLightView.d.ts +12 -12
- package/src/modules/timeSchedule/SingleLightView.tsx +175 -175
- package/src/modules/timeSchedule/TimeScheduleBean.d.ts +14 -14
- package/src/modules/timeSchedule/TimeScheduleBean.ts +18 -18
- package/src/modules/timeSchedule/TimeScheduleEditpage.d.ts +6 -6
- package/src/modules/timeSchedule/TimeScheduleEditpage.tsx +765 -765
- package/src/modules/timeSchedule/TimeSchedulePage.d.ts +13 -13
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +358 -358
- package/src/modules/timeSchedule/components/ColorList.ts +23 -23
- package/src/modules/timeSchedule/components/LampSwitchCard.tsx +106 -106
- package/src/modules/timeSchedule/mix/MixLightActions.d.ts +3 -3
- package/src/modules/timeSchedule/mix/MixLightActions.ts +49 -49
- package/src/modules/timeSchedule/mix/MixLightBean.d.ts +10 -10
- package/src/modules/timeSchedule/mix/MixLightBean.ts +9 -9
- package/src/modules/timeSchedule/mix/MixLightView.d.ts +7 -7
- package/src/modules/timeSchedule/mix/MixLightView.tsx +197 -197
- package/src/modules/timeSchedule/utils.d.ts +1 -1
- package/src/modules/timeSchedule/utils.ts +6 -6
- package/src/modules/timer/Router.ts +16 -16
- package/src/modules/timer/TimerPage.d.ts +11 -11
- package/src/modules/timer/TimerPage.tsx +384 -384
- package/src/modules/timer/TimerPageAction.d.ts +22 -22
- package/src/modules/timer/TimerPageAction.ts +131 -131
- package/src/navigation/Routers.d.ts +15 -15
- package/src/navigation/Routers.ts +46 -46
- package/src/navigation/tools.d.ts +9 -9
- package/src/navigation/tools.ts +21 -21
- package/src/newModules/biorhythm/BiorhythmActions.ts +62 -11
- package/src/newModules/biorhythm/BiorhythmPage.tsx +1 -4
- package/src/newModules/childLock/ChildLockPage.tsx +97 -97
- package/src/newModules/childLock/Router.ts +16 -16
- package/src/newModules/energyConsumption/EnergyConsumptionActions.ts +23 -23
- package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +84 -84
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +322 -322
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +393 -393
- package/src/newModules/energyConsumption/Router.ts +34 -34
- package/src/newModules/energyConsumption/co2Data.ts +23655 -23655
- package/src/newModules/energyConsumption/component/BarChart.tsx +93 -93
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +284 -284
- package/src/newModules/energyConsumption/component/Overview.tsx +118 -118
- package/src/newModules/fixedTime/FixedTimeActions.ts +241 -241
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +345 -345
- package/src/newModules/fixedTime/FixedTimePage.tsx +302 -302
- package/src/newModules/fixedTime/Router.ts +25 -25
- package/src/newModules/lightMode/LightModePage.tsx +204 -204
- package/src/newModules/lightMode/Router.ts +16 -16
- package/src/newModules/mood/Interface.ts +5 -0
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +8 -5
- package/src/newModules/mood/MoodActions.ts +32 -20
- package/src/newModules/mood/MoodItem.tsx +3 -3
- package/src/newModules/mood/MoodPage.tsx +31 -15
- package/src/newModules/mood/MoodParse.ts +5 -6
- package/src/newModules/mood/RecommendMoodItem.tsx +3 -3
- package/src/newModules/mood/Router.ts +9 -0
- package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +96 -96
- package/src/newModules/overchargeSwitch/Router.ts +16 -16
- package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +266 -266
- package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +173 -173
- package/src/newModules/powerOnBehavior/PowerOnBehaviorActions.ts +106 -106
- package/src/newModules/powerOnBehavior/Router.ts +27 -27
- package/src/newModules/randomTime/RandomTimeActions.ts +238 -238
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +325 -325
- package/src/newModules/randomTime/RandomTimePage.tsx +299 -299
- package/src/newModules/randomTime/Router.ts +25 -25
- package/src/newModules/randomTime/Summary.tsx +116 -116
- package/src/newModules/remoteControl/RemoteControlActions.ts +5 -5
- package/src/newModules/remoteControl/RemoteControlPage.tsx +51 -51
- package/src/newModules/remoteControl/Router.ts +15 -15
- package/src/newModules/select/Route.ts +16 -16
- package/src/newModules/select/SelectPage.d.ts +12 -12
- package/src/newModules/select/SelectPage.tsx +137 -137
- package/src/newModules/sleepWakeUp/Interface.ts +69 -69
- package/src/newModules/sleepWakeUp/Router.ts +24 -24
- package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +317 -317
- package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +661 -661
- package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +455 -455
- package/src/newModules/sleepWakeUp/utils.ts +253 -253
- package/src/newModules/swithInching/Router.ts +16 -16
- package/src/newModules/swithInching/SwithInching.tsx +231 -231
- package/src/newModules/swithInching/SwithInchingAction.ts +55 -55
- package/src/newModules/swithInching/pickerView.tsx +91 -91
- package/src/newModules/timeSchedule/Interface.ts +142 -142
- package/src/newModules/timeSchedule/Router.ts +25 -25
- package/src/newModules/timeSchedule/TimeScheduleActions.ts +53 -53
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +648 -648
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +253 -253
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +460 -460
- package/src/newModules/timeSchedule/components/ScheduleCard.tsx +125 -125
- package/tsconfig.json +50 -50
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
2
2
|
import Page from '@ledvance/base/src/components/Page';
|
|
3
3
|
import { Utils } from 'tuya-panel-kit';
|
|
4
|
-
import { saveMoodList, useWorkMode } from './MoodActions';
|
|
4
|
+
import { saveMoodList, useSwitchLed, useWorkMode } from './MoodActions';
|
|
5
5
|
import {
|
|
6
6
|
useDeviceId,
|
|
7
7
|
useDeviceInfo,
|
|
8
8
|
useFlagMode,
|
|
9
9
|
useMoods,
|
|
10
10
|
} from '@ledvance/base/src/models/modules/NativePropsSlice';
|
|
11
|
-
import { useReactive } from 'ahooks';
|
|
11
|
+
import { useReactive, useUpdateEffect } from 'ahooks';
|
|
12
12
|
import Strings from '@ledvance/base/src/i18n';
|
|
13
13
|
import res from '@ledvance/base/src/res';
|
|
14
14
|
import { FlatList, StyleSheet, View, Platform } from 'react-native';
|
|
@@ -39,7 +39,9 @@ const MoodPage = () => {
|
|
|
39
39
|
const [moods, setMoods] = useMoods();
|
|
40
40
|
const [mainWork, setMainWork] = useWorkMode(params.mainWorkMode);
|
|
41
41
|
const [secondaryWork, setSecondaryWork] = useWorkMode(params.secondaryWorkMode!);
|
|
42
|
+
const [switchLed] = useSwitchLed(params.switchLedDp)
|
|
42
43
|
const [flagMode, setFlagMode] = useFlagMode();
|
|
44
|
+
|
|
43
45
|
const state = useReactive<MoodPageState>({
|
|
44
46
|
currentMood: undefined,
|
|
45
47
|
staticTagChecked: true,
|
|
@@ -68,7 +70,7 @@ const MoodPage = () => {
|
|
|
68
70
|
).then(res => {
|
|
69
71
|
state.loading = false
|
|
70
72
|
if (res.success && Array.isArray(res.data)) {
|
|
71
|
-
console.log(res.data, '
|
|
73
|
+
console.log(res.data, ' <--- res.data')
|
|
72
74
|
state.originMoods = cloneDeep(res.data);
|
|
73
75
|
}
|
|
74
76
|
});
|
|
@@ -164,14 +166,27 @@ const MoodPage = () => {
|
|
|
164
166
|
if (mode === 'add') {
|
|
165
167
|
newScene = [checkedMood, ...state.originMoods];
|
|
166
168
|
} else if (mode === 'del') {
|
|
167
|
-
|
|
169
|
+
if (params.isCeilingLight) {
|
|
170
|
+
newScene = state.originMoods.filter(item => (item.mainLamp.id !== checkedMood.mainLamp.id) || (item.secondaryLamp.id !== checkedMood.secondaryLamp.id))
|
|
171
|
+
} else {
|
|
172
|
+
newScene = state.originMoods.filter(item => item.id !== checkedMood.id);
|
|
173
|
+
}
|
|
168
174
|
} else {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
if (params.isCeilingLight) {
|
|
176
|
+
newScene = state.originMoods.map(item => {
|
|
177
|
+
if (item.mainLamp.id === checkedMood.mainLamp.id && item.secondaryLamp.id === checkedMood.secondaryLamp.id) {
|
|
178
|
+
return checkedMood;
|
|
179
|
+
}
|
|
180
|
+
return item;
|
|
181
|
+
});
|
|
182
|
+
} else {
|
|
183
|
+
newScene = state.originMoods.map(item => {
|
|
184
|
+
if (item.id === checkedMood.id) {
|
|
185
|
+
return checkedMood;
|
|
186
|
+
}
|
|
187
|
+
return item;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
175
190
|
}
|
|
176
191
|
const mood = mode === 'del' ? (newScene.length === 0 ? undefined : newScene[0]) : checkedMood;
|
|
177
192
|
const res = await saveMoodList(devId, newScene, params, params.featureId);
|
|
@@ -186,7 +201,7 @@ const MoodPage = () => {
|
|
|
186
201
|
(params.isCeilingLight
|
|
187
202
|
? currentMood.mainLamp.id !== moodInfo.mainLamp.id &&
|
|
188
203
|
currentMood.secondaryLamp.id !== moodInfo.secondaryLamp.id
|
|
189
|
-
: currentMood.id !== moodInfo.id)
|
|
204
|
+
: currentMood.id !== moodInfo.id) || !switchLed
|
|
190
205
|
) {
|
|
191
206
|
return {
|
|
192
207
|
success: true,
|
|
@@ -254,15 +269,15 @@ const MoodPage = () => {
|
|
|
254
269
|
(moodItem: MoodUIInfo) => {
|
|
255
270
|
if (params.isCeilingLight) {
|
|
256
271
|
return (
|
|
257
|
-
moodInfo.mainLamp.id === moodItem.mainLamp.id &&
|
|
272
|
+
moodInfo.mainLamp.id === moodItem.mainLamp.id &&
|
|
258
273
|
moodInfo.secondaryLamp.id === moodItem.secondaryLamp.id &&
|
|
259
|
-
(mainWork === WorkMode.Scene || secondaryWork === WorkMode.Scene)
|
|
274
|
+
(mainWork === WorkMode.Scene || secondaryWork === WorkMode.Scene) && !flagMode.flagMode && switchLed
|
|
260
275
|
);
|
|
261
276
|
} else {
|
|
262
|
-
return moodInfo.id === moodItem.id && mainWork === WorkMode.Scene && !flagMode.flagMode
|
|
277
|
+
return moodInfo.id === moodItem.id && mainWork === WorkMode.Scene && !flagMode.flagMode && switchLed
|
|
263
278
|
}
|
|
264
279
|
},
|
|
265
|
-
[moodInfo, mainWork]
|
|
280
|
+
[moodInfo, mainWork, secondaryWork, flagMode?.flagMode, switchLed]
|
|
266
281
|
);
|
|
267
282
|
|
|
268
283
|
const nameRepeat = useCallback((mood: MoodUIInfo) => {
|
|
@@ -321,6 +336,7 @@ const MoodPage = () => {
|
|
|
321
336
|
enable={getItemEnable(item)}
|
|
322
337
|
isMix={!!(params.isMixLight || params.isCeilingLight)}
|
|
323
338
|
mood={item}
|
|
339
|
+
deviceTypeOption={params}
|
|
324
340
|
onPress={() => {
|
|
325
341
|
navigationRoute(item.mainLamp.nodes.length === 1, 'edit', item);
|
|
326
342
|
}}
|
|
@@ -6,7 +6,6 @@ const { nToHS, toFixed, sToN } = Utils;
|
|
|
6
6
|
|
|
7
7
|
// light source
|
|
8
8
|
export function dp2Obj(dp: string, isFan: boolean = false, isUVCFan?: boolean): MoodInfo {
|
|
9
|
-
console.log(dp, '< ---- dppppp')
|
|
10
9
|
if (!dp || dp?.length <= 8) return getDefaultMood();
|
|
11
10
|
let dpCopy = dp;
|
|
12
11
|
let fanEnable: undefined | boolean = undefined;
|
|
@@ -424,16 +423,16 @@ export function MixCeilingDpObj(mainDp: string, secondaryDp: string): MoodInfo {
|
|
|
424
423
|
id: 0,
|
|
425
424
|
version: 0,
|
|
426
425
|
mainLamp: {
|
|
426
|
+
...mainLamp.mainLamp,
|
|
427
427
|
id: mainLamp.id,
|
|
428
428
|
version: mainLamp.version,
|
|
429
|
-
...mainLamp.mainLamp,
|
|
430
429
|
},
|
|
431
430
|
secondaryLamp: secondaryLamp
|
|
432
431
|
? {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
432
|
+
...secondaryLamp.mainLamp,
|
|
433
|
+
version: secondaryLamp.version,
|
|
434
|
+
id: secondaryLamp.id
|
|
435
|
+
}
|
|
437
436
|
: {
|
|
438
437
|
mode: 0,
|
|
439
438
|
speed: 75,
|
|
@@ -28,7 +28,7 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
|
|
|
28
28
|
const { mood, isMix, deviceTypeOption } = props;
|
|
29
29
|
|
|
30
30
|
const gradientMode = useMemo(() => (
|
|
31
|
-
deviceTypeOption?.isStringLight ? MoodJumpGradientMode.StringGradient :
|
|
31
|
+
deviceTypeOption?.isStringLight ? MoodJumpGradientMode.StringGradient : deviceTypeOption?.isStripLight ? MoodJumpGradientMode.StripGradient : MoodJumpGradientMode.SourceGradient
|
|
32
32
|
), [MoodJumpGradientMode, deviceTypeOption])
|
|
33
33
|
|
|
34
34
|
return (
|
|
@@ -46,9 +46,9 @@ const RecommendMixMoodItem = (props: RecommendMixMoodItemProps) => {
|
|
|
46
46
|
{!!(mood.mainLamp) && (
|
|
47
47
|
<>
|
|
48
48
|
<View style={styles.lineStyle}>
|
|
49
|
-
<MixMoodColorsLine mixSubLight={mood?.mainLamp} isMix={isMix} type={mood.mainLamp.mode === gradientMode ? 'gradient' : 'separate'}/>
|
|
49
|
+
<MixMoodColorsLine mixSubLight={mood?.mainLamp} isMix={isMix} type={(mood.mainLamp.mode === gradientMode && !deviceTypeOption?.isCeilingLight) ? 'gradient' : 'separate'}/>
|
|
50
50
|
<Spacer height={cx(7)} />
|
|
51
|
-
{(isMix && !!mood.secondaryLamp.nodes.length) && <MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode ===
|
|
51
|
+
{(isMix && !!mood.secondaryLamp.nodes.length) && <MixMoodColorsLine mixSubLight={mood.secondaryLamp} isMix={isMix} type={mood.secondaryLamp.mode === (deviceTypeOption?.isMixLight ? MoodJumpGradientMode.SourceGradient : MoodJumpGradientMode.StripGradient) ? 'gradient' : 'separate'}/>}
|
|
52
52
|
</View>
|
|
53
53
|
<Spacer height={cx(24)} />
|
|
54
54
|
</>
|
|
@@ -4,6 +4,7 @@ import StaticMoodEditorPage from "./StaticMoodEditorPage";
|
|
|
4
4
|
import AddMoodPage from "./AddMoodPage";
|
|
5
5
|
import MoodPage from "./MoodPage";
|
|
6
6
|
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
7
|
+
import MixDynamicMoodEditorPage from "./MixDynamicMoodEditor";
|
|
7
8
|
|
|
8
9
|
const MoodPageRouters: NavigationRoute[] = [
|
|
9
10
|
{
|
|
@@ -14,6 +15,14 @@ const MoodPageRouters: NavigationRoute[] = [
|
|
|
14
15
|
showOfflineView: false,
|
|
15
16
|
},
|
|
16
17
|
},
|
|
18
|
+
{
|
|
19
|
+
name: ui_biz_routerKey.ui_biz_dynamic_mix_mood_edit,
|
|
20
|
+
component: MixDynamicMoodEditorPage,
|
|
21
|
+
options: {
|
|
22
|
+
hideTopbar: true,
|
|
23
|
+
showOfflineView: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
17
26
|
{
|
|
18
27
|
name: ui_biz_routerKey.ui_biz_static_mood_edit,
|
|
19
28
|
component: StaticMoodEditorPage,
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {SwitchButton, Utils} from "tuya-panel-kit";
|
|
3
|
-
import Page from "@ledvance/base/src/components/Page";
|
|
4
|
-
import I18n from "@ledvance/base/src/i18n/index";
|
|
5
|
-
import {useDeviceInfo, useDp} from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
6
|
-
import {useReactive} from "ahooks";
|
|
7
|
-
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
8
|
-
import {StyleSheet, Text, View} from "react-native";
|
|
9
|
-
import {Result} from "@ledvance/base/src/models/modules/Result";
|
|
10
|
-
import {useParams} from "@ledvance/base/src/hooks/Hooks";
|
|
11
|
-
|
|
12
|
-
const { convertX: cx } = Utils.RatioUtils
|
|
13
|
-
|
|
14
|
-
export interface OverchargeSwitchPageParams {
|
|
15
|
-
overchargeSwitchCode: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function useOverchargeSwitch(overchargeSwitchCode: string): [boolean, (v: boolean) => Promise<Result<any>>] {
|
|
19
|
-
return useDp(overchargeSwitchCode)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const OverchargeSwitchPage = () => {
|
|
23
|
-
const params = useParams<OverchargeSwitchPageParams>()
|
|
24
|
-
const devInfo = useDeviceInfo()
|
|
25
|
-
const [overchargeSwitch, setOverchargeSwitch] = useOverchargeSwitch(params.overchargeSwitchCode)
|
|
26
|
-
const state = useReactive({
|
|
27
|
-
loading: false
|
|
28
|
-
})
|
|
29
|
-
return (<Page
|
|
30
|
-
backText={devInfo.name}
|
|
31
|
-
loading={state.loading}>
|
|
32
|
-
<View style={[styles.titleBGView, styles.shadow]}>
|
|
33
|
-
<View style={{ flex: 7 }}>
|
|
34
|
-
<View>
|
|
35
|
-
<Text style={styles.title}>{I18n.getLang('switch_overcharge_headline_text')}</Text>
|
|
36
|
-
</View>
|
|
37
|
-
<View style={{ paddingBottom: cx(16) }}>
|
|
38
|
-
<Text>{I18n.getLang('switch_overcharge_headline_description')}</Text>
|
|
39
|
-
</View>
|
|
40
|
-
</View>
|
|
41
|
-
<Spacer style={{ flex: 1 }} height={0} width={0} />
|
|
42
|
-
<SwitchButton value={overchargeSwitch} onValueChange={async v => {
|
|
43
|
-
state.loading = true
|
|
44
|
-
await setOverchargeSwitch(v)
|
|
45
|
-
state.loading = false
|
|
46
|
-
} } />
|
|
47
|
-
</View>
|
|
48
|
-
</Page>)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const styles = StyleSheet.create({
|
|
52
|
-
tipInfoContainer: {
|
|
53
|
-
flexDirection: 'row',
|
|
54
|
-
marginHorizontal: cx(24),
|
|
55
|
-
marginVertical: cx(10)
|
|
56
|
-
},
|
|
57
|
-
image: {
|
|
58
|
-
width: cx(16),
|
|
59
|
-
height: cx(16),
|
|
60
|
-
marginRight: cx(5),
|
|
61
|
-
tintColor: '#000'
|
|
62
|
-
},
|
|
63
|
-
titleBGView: {
|
|
64
|
-
flexDirection: 'row',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
paddingHorizontal: cx(16),
|
|
67
|
-
marginHorizontal: cx(24),
|
|
68
|
-
marginTop: cx(30)
|
|
69
|
-
},
|
|
70
|
-
colorBlock: {
|
|
71
|
-
width: cx(20),
|
|
72
|
-
height: cx(20),
|
|
73
|
-
marginStart: cx(12),
|
|
74
|
-
borderRadius: cx(4),
|
|
75
|
-
},
|
|
76
|
-
title: {
|
|
77
|
-
color: '#000',
|
|
78
|
-
fontSize: cx(14),
|
|
79
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
80
|
-
paddingVertical: cx(16),
|
|
81
|
-
},
|
|
82
|
-
shadow: {
|
|
83
|
-
shadowColor: '#000000',
|
|
84
|
-
shadowOpacity: 0.2,
|
|
85
|
-
shadowRadius: 8,
|
|
86
|
-
elevation:8,
|
|
87
|
-
shadowOffset: {
|
|
88
|
-
width: 0,
|
|
89
|
-
height: 4,
|
|
90
|
-
},
|
|
91
|
-
backgroundColor: '#fff',
|
|
92
|
-
borderRadius: 8,
|
|
93
|
-
},
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
export default OverchargeSwitchPage
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {SwitchButton, Utils} from "tuya-panel-kit";
|
|
3
|
+
import Page from "@ledvance/base/src/components/Page";
|
|
4
|
+
import I18n from "@ledvance/base/src/i18n/index";
|
|
5
|
+
import {useDeviceInfo, useDp} from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
6
|
+
import {useReactive} from "ahooks";
|
|
7
|
+
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
8
|
+
import {StyleSheet, Text, View} from "react-native";
|
|
9
|
+
import {Result} from "@ledvance/base/src/models/modules/Result";
|
|
10
|
+
import {useParams} from "@ledvance/base/src/hooks/Hooks";
|
|
11
|
+
|
|
12
|
+
const { convertX: cx } = Utils.RatioUtils
|
|
13
|
+
|
|
14
|
+
export interface OverchargeSwitchPageParams {
|
|
15
|
+
overchargeSwitchCode: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function useOverchargeSwitch(overchargeSwitchCode: string): [boolean, (v: boolean) => Promise<Result<any>>] {
|
|
19
|
+
return useDp(overchargeSwitchCode)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const OverchargeSwitchPage = () => {
|
|
23
|
+
const params = useParams<OverchargeSwitchPageParams>()
|
|
24
|
+
const devInfo = useDeviceInfo()
|
|
25
|
+
const [overchargeSwitch, setOverchargeSwitch] = useOverchargeSwitch(params.overchargeSwitchCode)
|
|
26
|
+
const state = useReactive({
|
|
27
|
+
loading: false
|
|
28
|
+
})
|
|
29
|
+
return (<Page
|
|
30
|
+
backText={devInfo.name}
|
|
31
|
+
loading={state.loading}>
|
|
32
|
+
<View style={[styles.titleBGView, styles.shadow]}>
|
|
33
|
+
<View style={{ flex: 7 }}>
|
|
34
|
+
<View>
|
|
35
|
+
<Text style={styles.title}>{I18n.getLang('switch_overcharge_headline_text')}</Text>
|
|
36
|
+
</View>
|
|
37
|
+
<View style={{ paddingBottom: cx(16) }}>
|
|
38
|
+
<Text>{I18n.getLang('switch_overcharge_headline_description')}</Text>
|
|
39
|
+
</View>
|
|
40
|
+
</View>
|
|
41
|
+
<Spacer style={{ flex: 1 }} height={0} width={0} />
|
|
42
|
+
<SwitchButton value={overchargeSwitch} onValueChange={async v => {
|
|
43
|
+
state.loading = true
|
|
44
|
+
await setOverchargeSwitch(v)
|
|
45
|
+
state.loading = false
|
|
46
|
+
} } />
|
|
47
|
+
</View>
|
|
48
|
+
</Page>)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const styles = StyleSheet.create({
|
|
52
|
+
tipInfoContainer: {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
marginHorizontal: cx(24),
|
|
55
|
+
marginVertical: cx(10)
|
|
56
|
+
},
|
|
57
|
+
image: {
|
|
58
|
+
width: cx(16),
|
|
59
|
+
height: cx(16),
|
|
60
|
+
marginRight: cx(5),
|
|
61
|
+
tintColor: '#000'
|
|
62
|
+
},
|
|
63
|
+
titleBGView: {
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
paddingHorizontal: cx(16),
|
|
67
|
+
marginHorizontal: cx(24),
|
|
68
|
+
marginTop: cx(30)
|
|
69
|
+
},
|
|
70
|
+
colorBlock: {
|
|
71
|
+
width: cx(20),
|
|
72
|
+
height: cx(20),
|
|
73
|
+
marginStart: cx(12),
|
|
74
|
+
borderRadius: cx(4),
|
|
75
|
+
},
|
|
76
|
+
title: {
|
|
77
|
+
color: '#000',
|
|
78
|
+
fontSize: cx(14),
|
|
79
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
80
|
+
paddingVertical: cx(16),
|
|
81
|
+
},
|
|
82
|
+
shadow: {
|
|
83
|
+
shadowColor: '#000000',
|
|
84
|
+
shadowOpacity: 0.2,
|
|
85
|
+
shadowRadius: 8,
|
|
86
|
+
elevation:8,
|
|
87
|
+
shadowOffset: {
|
|
88
|
+
width: 0,
|
|
89
|
+
height: 4,
|
|
90
|
+
},
|
|
91
|
+
backgroundColor: '#fff',
|
|
92
|
+
borderRadius: 8,
|
|
93
|
+
},
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
export default OverchargeSwitchPage
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {NavigationRoute} from "tuya-panel-kit";
|
|
2
|
-
import OverchargeSwitchPage from "./OverchargeSwitchPage";
|
|
3
|
-
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
4
|
-
|
|
5
|
-
const OverchargeSwitchPageRouters: NavigationRoute[] = [
|
|
6
|
-
{
|
|
7
|
-
name: ui_biz_routerKey.ui_biz_overcharge_switch,
|
|
8
|
-
component: OverchargeSwitchPage,
|
|
9
|
-
options:{
|
|
10
|
-
hideTopbar: true,
|
|
11
|
-
showOfflineView: false,
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
export default OverchargeSwitchPageRouters
|
|
1
|
+
import {NavigationRoute} from "tuya-panel-kit";
|
|
2
|
+
import OverchargeSwitchPage from "./OverchargeSwitchPage";
|
|
3
|
+
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
4
|
+
|
|
5
|
+
const OverchargeSwitchPageRouters: NavigationRoute[] = [
|
|
6
|
+
{
|
|
7
|
+
name: ui_biz_routerKey.ui_biz_overcharge_switch,
|
|
8
|
+
component: OverchargeSwitchPage,
|
|
9
|
+
options:{
|
|
10
|
+
hideTopbar: true,
|
|
11
|
+
showOfflineView: false,
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
export default OverchargeSwitchPageRouters
|