@ledvance/ui-biz-bundle 1.1.55 → 1.1.57
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 +2 -1
- package/src/modules/biorhythm/Router.ts +34 -0
- package/src/modules/fixedTime/Router.ts +26 -0
- package/src/modules/flags/FlagActions.ts +12 -4
- package/src/modules/flags/FlagPage.tsx +31 -11
- package/src/modules/flags/Router.ts +25 -0
- package/src/modules/history/Router.ts +16 -0
- package/src/modules/mood/FantasyRouter.ts +35 -0
- package/src/modules/mood/MixMood/Router.ts +44 -0
- package/src/modules/mood/Router.ts +53 -0
- package/src/modules/music/Router.ts +16 -0
- package/src/modules/powerOnBehavior/Router.ts +16 -0
- package/src/modules/randomTime/Router.ts +25 -0
- package/src/modules/sleepWakeup/Router.ts +25 -0
- package/src/modules/timeSchedule/Router.ts +25 -0
- package/src/modules/timer/Router.ts +16 -0
- package/src/navigation/Routers.d.ts +0 -7
- package/src/navigation/Routers.ts +15 -304
- package/src/newModules/childLock/ChildLockPage.tsx +97 -0
- package/src/newModules/childLock/Router.ts +16 -0
- package/src/newModules/energyConsumption/EnergyConsumptionActions.ts +23 -0
- package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +84 -0
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +321 -0
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +392 -0
- package/src/newModules/energyConsumption/Router.ts +34 -0
- package/src/newModules/energyConsumption/co2Data.ts +23655 -0
- package/src/newModules/energyConsumption/component/BarChart.tsx +93 -0
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +282 -0
- package/src/newModules/energyConsumption/component/Overview.tsx +116 -0
- package/src/newModules/fixedTime/FixedTimeActions.ts +234 -0
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +341 -0
- package/src/newModules/fixedTime/FixedTimePage.tsx +231 -0
- package/src/newModules/fixedTime/Router.ts +25 -0
- package/src/newModules/lightMode/LightModePage.tsx +204 -0
- package/src/newModules/lightMode/Router.ts +16 -0
- package/src/newModules/mood/AddMoodPage.tsx +178 -0
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +653 -0
- package/src/newModules/mood/Interface.ts +219 -0
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +781 -0
- package/src/newModules/mood/MoodActions.ts +235 -0
- package/src/newModules/mood/MoodInfo.ts +2151 -0
- package/src/newModules/mood/MoodItem.tsx +148 -0
- package/src/newModules/mood/MoodPage.tsx +385 -0
- package/src/newModules/mood/MoodParse.ts +442 -0
- package/src/newModules/mood/RecommendMoodItem.tsx +68 -0
- package/src/newModules/mood/Router.ts +53 -0
- package/src/newModules/mood/StaticMoodEditorPage.tsx +343 -0
- package/src/newModules/mood/tools.ts +12 -0
- package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +96 -0
- package/src/newModules/overchargeSwitch/Router.ts +16 -0
- package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +266 -0
- package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +173 -0
- package/src/newModules/powerOnBehavior/PowerOnBehaviorActions.ts +106 -0
- package/src/newModules/powerOnBehavior/Router.ts +16 -0
- package/src/newModules/randomTime/RandomTimeActions.ts +232 -0
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +322 -0
- package/src/newModules/randomTime/RandomTimePage.tsx +230 -0
- package/src/newModules/randomTime/Router.ts +25 -0
- package/src/newModules/randomTime/Summary.tsx +116 -0
- package/src/newModules/swithInching/Router.ts +16 -0
- package/src/newModules/swithInching/SwithInching.tsx +231 -0
- package/src/newModules/swithInching/SwithInchingAction.ts +55 -0
- package/src/newModules/swithInching/pickerView.tsx +91 -0
- package/src/newModules/timeSchedule/Interface.ts +111 -0
- package/src/newModules/timeSchedule/Router.ts +25 -0
- package/src/newModules/timeSchedule/TimeScheduleActions.ts +53 -0
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +662 -0
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +222 -0
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +259 -0
- package/src/newModules/timeSchedule/components/ScheduleCard.tsx +109 -0
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
import { NavigationRoute, TransitionPresets } from 'tuya-panel-kit'
|
|
2
|
-
import TimeSchedulePage from '../modules/timeSchedule/TimeSchedulePage'
|
|
3
|
-
import TimeScheduleEditPage from '../modules/timeSchedule/TimeScheduleEditpage'
|
|
4
|
-
import DynamicMoodEditorPage from '../modules/mood/DynamicMoodEditorPage'
|
|
5
|
-
import StaticMoodEditorPage from '../modules/mood/StaticMoodEditorPage'
|
|
6
|
-
import AddMoodPage from '../modules/mood/AddMoodPage'
|
|
7
|
-
import MoodPage from '../modules/mood/MoodPage'
|
|
8
|
-
import FantasyMoodPage from '../modules/mood/FantasyMood'
|
|
9
|
-
import FantasyMoodEditPage from '../modules/mood/FantasyMoodEditPage'
|
|
10
|
-
import MixMoodPage from '../modules/mood/MixMood/MixMoodPage'
|
|
11
|
-
import MixMoodEditPage from '../modules/mood/MixMood/MixMoodEditPage'
|
|
12
|
-
import AddMixMoodPage from '../modules/mood/MixMood/AddMixMoodPage'
|
|
13
|
-
import TimerPage from '../modules/timer/TimerPage'
|
|
14
|
-
import SleepWakeUpPage from 'modules/sleepWakeup/SleepWakeUpPage'
|
|
15
|
-
import SleepWakeUpDetailPage from 'modules/sleepWakeup/SleepWakeUpDetailPage'
|
|
16
|
-
import BiorhythmPage from '../modules/biorhythm/BiorhythmPage'
|
|
17
|
-
import BiorhythmEditPage from '../modules/biorhythm/BiorhythmEditPage'
|
|
18
|
-
import BiologicalIconSelectPage from '../modules/biorhythm/IconSelect'
|
|
19
|
-
import MusicPage from '../modules/music/MusicPage'
|
|
20
|
-
import SelectPage from '../modules/select/SelectPage'
|
|
21
|
-
import FixedTimePage from '../modules/fixedTime/FixedTimePage'
|
|
22
|
-
import FixedTimeDetailPage from '../modules/fixedTime/FixedTimeDetailPage'
|
|
23
|
-
import RandomTimePage from 'modules/randomTime/RandomTimePage'
|
|
24
|
-
import RandomTimeDetailPage from '../modules/randomTime/RandomTimeDetailPage'
|
|
25
|
-
import HistoryPage from '../modules/history/HistoryPage'
|
|
26
|
-
import PowerOnBehaviorPage from '../modules/powerOnBehavior/PowerOnBehaviorPage'
|
|
27
|
-
import FlagPage from '../modules/flags/FlagPage'
|
|
28
|
-
import FlagEditPage from '../modules/flags/FlagEditPage'
|
|
29
|
-
|
|
30
1
|
export const ui_biz_routerKey = {
|
|
31
2
|
'ui_biz_time_schedule': 'ui_biz_time_schedule',
|
|
32
3
|
'ui_biz_time_schedule_edit': 'ui_biz_time_schedule_edit',
|
|
@@ -54,279 +25,19 @@ export const ui_biz_routerKey = {
|
|
|
54
25
|
'ui_biz_history': 'ui_biz_history',
|
|
55
26
|
'ui_biz_power_behavior': 'ui_biz_power_behavior',
|
|
56
27
|
'ui_biz_flag_page': 'ui_biz_flag_page',
|
|
57
|
-
'ui_biz_flag_page_edit': 'ui_biz_flag_page_edit'
|
|
28
|
+
'ui_biz_flag_page_edit': 'ui_biz_flag_page_edit',
|
|
29
|
+
'ui_biz_time_schedule_new': 'ui_biz_time_schedule_new',
|
|
30
|
+
'ui_biz_time_schedule_edit_new': 'ui_biz_time_schedule_edit_new',
|
|
31
|
+
'ui_biz_fixed_time_new': 'ui_biz_fixed_time_new',
|
|
32
|
+
'ui_biz_fixed_time_edit_new': 'ui_biz_fixed_time_edit_new',
|
|
33
|
+
'ui_biz_random_time_new': 'ui_biz_random_time_new',
|
|
34
|
+
'ui_biz_random_time_edit_new': 'ui_biz_random_time_edit_new',
|
|
35
|
+
'ui_biz_energy_consumption': 'ui_biz_energy_consumption',
|
|
36
|
+
'ui_biz_energy_consumption_detail': 'ui_biz_energy_consumption_detail',
|
|
37
|
+
'ui_biz_energy_consumption_chart': 'ui_biz_energy_consumption_chart',
|
|
38
|
+
'ui_biz_power_behavior_plug': 'ui_biz_power_behavior_plug',
|
|
39
|
+
'ui_biz_switch_inching': 'ui_biz_switch_inching',
|
|
40
|
+
'ui_biz_light_mode': 'ui_biz_light_mode',
|
|
41
|
+
'ui_biz_overcharge_switch': 'ui_biz_overcharge_switch',
|
|
42
|
+
'ui_biz_child_lock': 'ui_biz_child_lock',
|
|
58
43
|
}
|
|
59
|
-
|
|
60
|
-
export const BiologicalRouters: NavigationRoute[] = [
|
|
61
|
-
{
|
|
62
|
-
name: ui_biz_routerKey.bi_biz_biological,
|
|
63
|
-
component: BiorhythmPage,
|
|
64
|
-
options: {
|
|
65
|
-
hideTopbar: true,
|
|
66
|
-
showOfflineView: false,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: ui_biz_routerKey.bi_biz_biological_edit,
|
|
71
|
-
component: BiorhythmEditPage,
|
|
72
|
-
options: {
|
|
73
|
-
hideTopbar: true,
|
|
74
|
-
showOfflineView: false,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: ui_biz_routerKey.bi_biz_biological_icon_select,
|
|
79
|
-
component: BiologicalIconSelectPage,
|
|
80
|
-
options: {
|
|
81
|
-
hideTopbar: true,
|
|
82
|
-
showOfflineView: false,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
]
|
|
86
|
-
|
|
87
|
-
export const TimeSchedulePageRouters: NavigationRoute[] = [
|
|
88
|
-
{
|
|
89
|
-
name: ui_biz_routerKey.ui_biz_time_schedule,
|
|
90
|
-
component: TimeSchedulePage,
|
|
91
|
-
options: {
|
|
92
|
-
hideTopbar: true,
|
|
93
|
-
showOfflineView: false,
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: ui_biz_routerKey.ui_biz_time_schedule_edit,
|
|
98
|
-
component: TimeScheduleEditPage,
|
|
99
|
-
options: {
|
|
100
|
-
hideTopbar: true,
|
|
101
|
-
showOfflineView: false,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
]
|
|
105
|
-
|
|
106
|
-
export const MoodPageRouters: NavigationRoute[] = [
|
|
107
|
-
{
|
|
108
|
-
name: ui_biz_routerKey.ui_biz_dynamic_mood_edit,
|
|
109
|
-
component: DynamicMoodEditorPage,
|
|
110
|
-
options: {
|
|
111
|
-
hideTopbar: true,
|
|
112
|
-
showOfflineView: false,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: ui_biz_routerKey.ui_biz_static_mood_edit,
|
|
117
|
-
component: StaticMoodEditorPage,
|
|
118
|
-
options: {
|
|
119
|
-
hideTopbar: true,
|
|
120
|
-
showOfflineView: false,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
name: ui_biz_routerKey.ui_biz_mood_add,
|
|
125
|
-
component: AddMoodPage,
|
|
126
|
-
options: {
|
|
127
|
-
hideTopbar: true,
|
|
128
|
-
showOfflineView: false,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: ui_biz_routerKey.ui_biz_mood,
|
|
133
|
-
component: MoodPage,
|
|
134
|
-
options: {
|
|
135
|
-
hideTopbar: true,
|
|
136
|
-
showOfflineView: false,
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: ui_biz_routerKey.ui_biz_select_page,
|
|
141
|
-
component: SelectPage,
|
|
142
|
-
options: {
|
|
143
|
-
gesture: true,
|
|
144
|
-
hideTopbar: true,
|
|
145
|
-
...TransitionPresets.ModalPresentationIOS,
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
]
|
|
149
|
-
|
|
150
|
-
export const FantasyMoodRouters: NavigationRoute[] = [
|
|
151
|
-
{
|
|
152
|
-
name: ui_biz_routerKey.ui_biz_fantasy_mood,
|
|
153
|
-
component: FantasyMoodPage,
|
|
154
|
-
options: {
|
|
155
|
-
hideTopbar: true,
|
|
156
|
-
showOfflineView: false,
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: ui_biz_routerKey.ui_biz_fantasy_mood_edit,
|
|
161
|
-
component: FantasyMoodEditPage,
|
|
162
|
-
options: {
|
|
163
|
-
hideTopbar: true,
|
|
164
|
-
showOfflineView: false,
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: ui_biz_routerKey.ui_biz_select_page,
|
|
169
|
-
component: SelectPage,
|
|
170
|
-
options: {
|
|
171
|
-
gesture: true,
|
|
172
|
-
hideTopbar: true,
|
|
173
|
-
...TransitionPresets.ModalPresentationIOS,
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
]
|
|
177
|
-
|
|
178
|
-
export const MixMoodRouters: NavigationRoute[] = [
|
|
179
|
-
{
|
|
180
|
-
name: ui_biz_routerKey.ui_biz_mix_mood,
|
|
181
|
-
component: MixMoodPage,
|
|
182
|
-
options: {
|
|
183
|
-
hideTopbar: true,
|
|
184
|
-
showOfflineView: false,
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
name: ui_biz_routerKey.ui_biz_mix_mood_edit,
|
|
189
|
-
component: MixMoodEditPage,
|
|
190
|
-
options: {
|
|
191
|
-
hideTopbar: true,
|
|
192
|
-
showOfflineView: false,
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
name: ui_biz_routerKey.ui_biz_mix_mood_add,
|
|
197
|
-
component: AddMixMoodPage,
|
|
198
|
-
options: {
|
|
199
|
-
hideTopbar: true,
|
|
200
|
-
showOfflineView: false,
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: ui_biz_routerKey.ui_biz_select_page,
|
|
205
|
-
component: SelectPage,
|
|
206
|
-
options: {
|
|
207
|
-
gesture: true,
|
|
208
|
-
hideTopbar: true,
|
|
209
|
-
...TransitionPresets.ModalPresentationIOS,
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
]
|
|
213
|
-
|
|
214
|
-
export const TimerPageRouters: NavigationRoute[] = [
|
|
215
|
-
{
|
|
216
|
-
name: ui_biz_routerKey.ui_biz_timer,
|
|
217
|
-
component: TimerPage,
|
|
218
|
-
options: {
|
|
219
|
-
hideTopbar: true,
|
|
220
|
-
showOfflineView: false,
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
]
|
|
224
|
-
|
|
225
|
-
export const SleepWakeUpPageRouters: NavigationRoute[] = [
|
|
226
|
-
{
|
|
227
|
-
name: ui_biz_routerKey.ui_biz_sleep_wakeUp,
|
|
228
|
-
component: SleepWakeUpPage,
|
|
229
|
-
options: {
|
|
230
|
-
hideTopbar: true,
|
|
231
|
-
showOfflineView: false,
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
name: ui_biz_routerKey.ui_biz_sleep_wakeUp_edit,
|
|
236
|
-
component: SleepWakeUpDetailPage,
|
|
237
|
-
options: {
|
|
238
|
-
hideTopbar: true,
|
|
239
|
-
showOfflineView: false,
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
]
|
|
243
|
-
|
|
244
|
-
export const MusicPageRouters: NavigationRoute[] = [
|
|
245
|
-
{
|
|
246
|
-
name: ui_biz_routerKey.ui_biz_music,
|
|
247
|
-
component: MusicPage,
|
|
248
|
-
options: {
|
|
249
|
-
hideTopbar: true,
|
|
250
|
-
showOfflineView: false,
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
]
|
|
254
|
-
|
|
255
|
-
export const FixedTimePageRouters: NavigationRoute[] = [
|
|
256
|
-
{
|
|
257
|
-
name: ui_biz_routerKey.ui_biz_fixed_time,
|
|
258
|
-
component: FixedTimePage,
|
|
259
|
-
options: {
|
|
260
|
-
hideTopbar: true,
|
|
261
|
-
showOfflineView: false,
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
name: ui_biz_routerKey.ui_biz_fixed_time_edit,
|
|
266
|
-
component: FixedTimeDetailPage,
|
|
267
|
-
options: {
|
|
268
|
-
hideTopbar: true,
|
|
269
|
-
showOfflineView: false,
|
|
270
|
-
},
|
|
271
|
-
}
|
|
272
|
-
]
|
|
273
|
-
|
|
274
|
-
export const RandomTimePageRouters: NavigationRoute[] = [
|
|
275
|
-
{
|
|
276
|
-
name: ui_biz_routerKey.ui_biz_random_time,
|
|
277
|
-
component: RandomTimePage,
|
|
278
|
-
options: {
|
|
279
|
-
hideTopbar: true,
|
|
280
|
-
showOfflineView: false,
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
name: ui_biz_routerKey.ui_biz_random_time_edit,
|
|
285
|
-
component: RandomTimeDetailPage,
|
|
286
|
-
options: {
|
|
287
|
-
hideTopbar: true,
|
|
288
|
-
showOfflineView: false,
|
|
289
|
-
},
|
|
290
|
-
}
|
|
291
|
-
]
|
|
292
|
-
|
|
293
|
-
export const HistoryPageRouters: NavigationRoute[] = [
|
|
294
|
-
{
|
|
295
|
-
name: ui_biz_routerKey.ui_biz_history,
|
|
296
|
-
component: HistoryPage,
|
|
297
|
-
options: {
|
|
298
|
-
hideTopbar: true,
|
|
299
|
-
showOfflineView: false,
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
]
|
|
303
|
-
|
|
304
|
-
export const PowerOnBehaviorPageRouters: NavigationRoute[] = [
|
|
305
|
-
{
|
|
306
|
-
name: ui_biz_routerKey.ui_biz_power_behavior,
|
|
307
|
-
component: PowerOnBehaviorPage,
|
|
308
|
-
options: {
|
|
309
|
-
hideTopbar: true,
|
|
310
|
-
showOfflineView: false,
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
]
|
|
314
|
-
|
|
315
|
-
export const FlagPageRouters: NavigationRoute[] = [
|
|
316
|
-
{
|
|
317
|
-
name: ui_biz_routerKey.ui_biz_flag_page,
|
|
318
|
-
component: FlagPage,
|
|
319
|
-
options: {
|
|
320
|
-
hideTopbar: true,
|
|
321
|
-
showOfflineView: false,
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
name: ui_biz_routerKey.ui_biz_flag_page_edit,
|
|
326
|
-
component: FlagEditPage,
|
|
327
|
-
options: {
|
|
328
|
-
hideTopbar: true,
|
|
329
|
-
showOfflineView: false,
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
]
|
|
@@ -0,0 +1,97 @@
|
|
|
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 {View, Text, StyleSheet, Image} from "react-native";
|
|
9
|
+
import {Result} from "@ledvance/base/src/models/modules/Result";
|
|
10
|
+
import res from "@ledvance/base/src/res";
|
|
11
|
+
import {useParams} from "@ledvance/base/src/hooks/Hooks";
|
|
12
|
+
|
|
13
|
+
const { convertX: cx } = Utils.RatioUtils
|
|
14
|
+
|
|
15
|
+
export interface ChildLockPageParams {
|
|
16
|
+
childLockCode: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function useChildLock(childLockCode: string): [boolean, (v: boolean) => Promise<Result<any>>] {
|
|
20
|
+
return useDp(childLockCode)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ChildLockPage = () => {
|
|
24
|
+
const params = useParams<ChildLockPageParams>()
|
|
25
|
+
const devInfo = useDeviceInfo()
|
|
26
|
+
const [childLock, setChildLock] = useChildLock(params.childLockCode)
|
|
27
|
+
const state = useReactive({
|
|
28
|
+
loading: false
|
|
29
|
+
})
|
|
30
|
+
return (<Page
|
|
31
|
+
backText={devInfo.name}
|
|
32
|
+
headlineText={I18n.getLang('sockets_specific_settings_child_lock')}
|
|
33
|
+
loading={state.loading}>
|
|
34
|
+
<View style={styles.tipInfoContainer}>
|
|
35
|
+
<Image style={styles.image} source={res.ic_info} />
|
|
36
|
+
<Text style={{ color: '#000' }}>
|
|
37
|
+
{I18n.getLang('childlock_overview_description_text')}
|
|
38
|
+
</Text>
|
|
39
|
+
</View>
|
|
40
|
+
<View style={[styles.titleBGView, styles.shadow]}>
|
|
41
|
+
<Text style={styles.title}>{I18n.getLang('sockets_specific_settings_child_lock')}</Text>
|
|
42
|
+
<View style={[styles.colorBlock, { backgroundColor: 'red', opacity: 0 }]} />
|
|
43
|
+
<Spacer style={{ flex: 1 }} height={0} width={0} />
|
|
44
|
+
<SwitchButton value={childLock} onValueChange={async v => {
|
|
45
|
+
state.loading = true
|
|
46
|
+
await setChildLock(v)
|
|
47
|
+
state.loading = false
|
|
48
|
+
} } />
|
|
49
|
+
</View>
|
|
50
|
+
</Page>)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
tipInfoContainer: {
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
marginHorizontal: cx(24),
|
|
57
|
+
marginVertical: cx(10)
|
|
58
|
+
},
|
|
59
|
+
image: {
|
|
60
|
+
width: cx(16),
|
|
61
|
+
height: cx(16),
|
|
62
|
+
marginRight: cx(5),
|
|
63
|
+
tintColor: '#000'
|
|
64
|
+
},
|
|
65
|
+
titleBGView: {
|
|
66
|
+
flexDirection: 'row',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
paddingHorizontal: cx(16),
|
|
69
|
+
marginHorizontal: cx(24),
|
|
70
|
+
},
|
|
71
|
+
colorBlock: {
|
|
72
|
+
width: cx(20),
|
|
73
|
+
height: cx(20),
|
|
74
|
+
marginStart: cx(12),
|
|
75
|
+
borderRadius: cx(4),
|
|
76
|
+
},
|
|
77
|
+
title: {
|
|
78
|
+
color: '#000',
|
|
79
|
+
fontSize: cx(14),
|
|
80
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
81
|
+
paddingVertical: cx(16),
|
|
82
|
+
},
|
|
83
|
+
shadow: {
|
|
84
|
+
shadowColor: '#000000',
|
|
85
|
+
shadowOpacity: 0.2,
|
|
86
|
+
shadowRadius: 8,
|
|
87
|
+
elevation:8,
|
|
88
|
+
shadowOffset: {
|
|
89
|
+
width: 0,
|
|
90
|
+
height: 4,
|
|
91
|
+
},
|
|
92
|
+
backgroundColor: '#fff',
|
|
93
|
+
borderRadius: 8,
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
export default ChildLockPage
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {NavigationRoute} from "tuya-panel-kit";
|
|
2
|
+
import ChildLockPage from "./ChildLockPage";
|
|
3
|
+
import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
4
|
+
|
|
5
|
+
const ChildLockPageRouters: NavigationRoute[] = [
|
|
6
|
+
{
|
|
7
|
+
name: ui_biz_routerKey.ui_biz_child_lock,
|
|
8
|
+
component: ChildLockPage,
|
|
9
|
+
options:{
|
|
10
|
+
hideTopbar: true,
|
|
11
|
+
showOfflineView: false,
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
export default ChildLockPageRouters
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useDp } from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
2
|
+
import { localeNumber } from "@ledvance/base/src/utils/common";
|
|
3
|
+
import {EnergyData} from "./component/EnergyModal";
|
|
4
|
+
import {NativeApi} from "@ledvance/base/src/api/native";
|
|
5
|
+
|
|
6
|
+
export function useElectricCurrent(dpCode: string): number {
|
|
7
|
+
const current = useDp<number, any>(dpCode)[0] || 0
|
|
8
|
+
return localeNumber(current, 1)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useVoltage(dpCode: string): number {
|
|
12
|
+
const voltage = useDp<number, any>(dpCode)[0] / 10 || 0;
|
|
13
|
+
return localeNumber(voltage, 1)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function usePower(dpCode: string): number {
|
|
17
|
+
const power = useDp<number, any>(dpCode)[0] / 10 || 0;
|
|
18
|
+
return localeNumber(power, 1)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function updatePrice(devId: string, energyData: EnergyData){
|
|
22
|
+
return await NativeApi.putJson(devId, 'energiepreise', JSON.stringify(energyData))
|
|
23
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Platform, View, StyleSheet, Image, Text } from "react-native";
|
|
3
|
+
import { useRoute } from '@react-navigation/core'
|
|
4
|
+
import Page from "@ledvance/base/src/components/Page";
|
|
5
|
+
import res from "@ledvance/base/src/res";
|
|
6
|
+
import I18n from "@ledvance/base/src/i18n";
|
|
7
|
+
import { Utils } from "tuya-panel-kit";
|
|
8
|
+
import BarChart from "./component/BarChart";
|
|
9
|
+
import { exportFile } from "@ledvance/base/src/utils/common";
|
|
10
|
+
import { OverviewItem } from "./EnergyConsumptionPage";
|
|
11
|
+
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
12
|
+
|
|
13
|
+
const { convertX: cx, height, width } = Utils.RatioUtils
|
|
14
|
+
|
|
15
|
+
export interface EnergyConsumptionChartProps {
|
|
16
|
+
addEleDpCode: string
|
|
17
|
+
headlineText: string
|
|
18
|
+
chartData: OverviewItem[],
|
|
19
|
+
over365Days?: boolean
|
|
20
|
+
over7Days?: boolean
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const EnergyConsumptionChart = () => {
|
|
24
|
+
const props = useRoute().params as EnergyConsumptionChartProps
|
|
25
|
+
const computeNum = Platform.OS === 'ios' && 180 || 130
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Page
|
|
29
|
+
backText={I18n.getLang('consumption_data_annual_bar_chart_system_back_text')}
|
|
30
|
+
headlineText={props.headlineText}
|
|
31
|
+
headlineIcon={props.chartData?.length && res.download_icon}
|
|
32
|
+
onHeadlineIconClick={() => {
|
|
33
|
+
exportFile(props.chartData)
|
|
34
|
+
}}
|
|
35
|
+
showGreenery={false}
|
|
36
|
+
greeneryIcon={res.energy_consumption_greenery}
|
|
37
|
+
>
|
|
38
|
+
<View style={{ marginHorizontal: cx(24) }}>
|
|
39
|
+
{
|
|
40
|
+
props.over7Days ? (
|
|
41
|
+
<View style={styles.listEmptyView}>
|
|
42
|
+
<Spacer height={cx(26)} />
|
|
43
|
+
<Image
|
|
44
|
+
style={styles.listEmptyImage}
|
|
45
|
+
source={{ uri: res.ldv_timer_empty }} />
|
|
46
|
+
<Spacer height={cx(14)} />
|
|
47
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
48
|
+
<Image style={styles.listEmptyTextIcon} source={{ uri: res.ic_info }} />
|
|
49
|
+
<Spacer width={cx(4)} height={0} />
|
|
50
|
+
<Text style={styles.listEmptyText}>
|
|
51
|
+
{I18n.getLang('energyconsumption_hourlylimit')}
|
|
52
|
+
</Text>
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
|
+
) : (
|
|
56
|
+
<BarChart height={height - cx(computeNum)} data={props.chartData} width={width - cx(80)} />
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
</View>
|
|
60
|
+
</Page>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const styles = StyleSheet.create({
|
|
65
|
+
listEmptyView: {
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
},
|
|
68
|
+
listEmptyImage: {
|
|
69
|
+
width: cx(200),
|
|
70
|
+
height: cx(200),
|
|
71
|
+
},
|
|
72
|
+
listEmptyTextIcon: {
|
|
73
|
+
width: cx(16),
|
|
74
|
+
height: cx(16),
|
|
75
|
+
tintColor: '#000',
|
|
76
|
+
},
|
|
77
|
+
listEmptyText: {
|
|
78
|
+
color: '#000',
|
|
79
|
+
fontSize: cx(12),
|
|
80
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export default EnergyConsumptionChart
|