@ledvance/group-ui-biz-bundle 1.0.75 → 1.0.77
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/biorhythm/BiorhythmPage.tsx +1 -1
- package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +22 -30
- package/src/modules/energyConsumption/EnergyConsumptionDetail.tsx +2 -2
- package/src/modules/energyConsumption/EnergyConsumptionPage.tsx +1 -1
- package/src/modules/energyConsumption/component/Overview.tsx +1 -1
- package/src/modules/fixedTimeForPlug/FixedTimeForPlugDetailPage.tsx +67 -86
- package/src/modules/fixedTimeForPlug/FixedTimeForPlugPage.tsx +44 -58
- package/src/modules/fixedTimeForPlug/ItemCard.tsx +29 -26
- package/src/modules/fixedTimeForPlug/Summary.tsx +62 -58
- package/src/modules/lightMode/LightModePage.tsx +2 -2
- package/src/modules/mood_new/AddMoodPage.tsx +16 -15
- package/src/modules/mood_new/MixDynamicMoodEditor.tsx +108 -104
- package/src/modules/mood_new/MoodItem.tsx +59 -54
- package/src/modules/mood_new/MoodPage.tsx +42 -40
- package/src/modules/mood_new/StaticMoodEditorPage.tsx +39 -46
- package/src/modules/overchargeSwitch/OverchargeSwitchPage.tsx +5 -2
- package/src/modules/randomTimeForPlug/ItemCard.tsx +29 -26
- package/src/modules/randomTimeForPlug/RandomTimeForPlugDetailPage.tsx +46 -81
- package/src/modules/randomTimeForPlug/RandomTimeForPlugPage.tsx +58 -67
- package/src/modules/randomTimeForPlug/Summary.tsx +62 -58
- package/src/modules/sleepWakeUp/SleepWakeUpDetailPage.tsx +1 -1
- package/src/modules/sleepWakeUp/SleepWakeUpPage.tsx +1 -1
- package/src/modules/swithInching/SwithInching.tsx +3 -2
- package/src/modules/timeSchedule/Interface.ts +3 -1
- package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +175 -190
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +55 -54
- package/src/modules/timeSchedule/components/ManuaSettings.tsx +11 -10
- package/src/modules/timeSchedule/components/ScheduleCard.tsx +47 -63
- package/src/modules/timeSchedule/components/Summary.tsx +63 -59
- package/src/modules/timer/TimerAction.ts +15 -2
- package/src/modules/timer/TimerPage.tsx +120 -117
- package/src/modules/swithInching/pickerView.tsx +0 -91
|
@@ -26,10 +26,11 @@ import { useFlagMode } from '../flags/FlagActions';
|
|
|
26
26
|
import { WorkMode } from '@ledvance/base/src/utils/interface';
|
|
27
27
|
|
|
28
28
|
const cx = Utils.RatioUtils.convertX;
|
|
29
|
+
const { withTheme } = Utils.ThemeUtils
|
|
29
30
|
|
|
30
31
|
const MAX_MOOD_COUNT = 255;
|
|
31
32
|
|
|
32
|
-
const MoodPage = () => {
|
|
33
|
+
const MoodPage = (props: {theme?: any}) => {
|
|
33
34
|
const params = useParams<MoodPageParams>();
|
|
34
35
|
const deviceInfo = useDeviceInfo();
|
|
35
36
|
const uaGroupInfo = useUAGroupInfo()
|
|
@@ -196,8 +197,8 @@ const MoodPage = () => {
|
|
|
196
197
|
state.originMoods = cloneDeep(newScene);
|
|
197
198
|
setMoods(cloneDeep(newScene));
|
|
198
199
|
if (mode === 'del' && ((params.isCeilingLight ?
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
(moodInfo.scene?.mainLamp.id !== checkedMood.mainLamp.id || moodInfo.scene?.secondaryLamp.id !== checkedMood.secondaryLamp.id) :
|
|
201
|
+
moodInfo.scene?.id !== checkedMood.id) ||
|
|
201
202
|
(params.isCeilingLight ? (workMode !== WorkMode.Scene && rgbicWorkMode !== WorkMode.Scene) : workMode !== WorkMode.Scene) ||
|
|
202
203
|
!switchLed)) {
|
|
203
204
|
return {
|
|
@@ -252,6 +253,27 @@ const MoodPage = () => {
|
|
|
252
253
|
return !!state.originMoods.filter(m => !(params.isCeilingLight ? (m.mainLamp.id === mood.mainLamp.id && m.secondaryLamp.id === mood.secondaryLamp.id) : (m.id === mood.id))).find(m => m.name === mood.name)
|
|
253
254
|
}, [state.originMoods, params.isCeilingLight])
|
|
254
255
|
|
|
256
|
+
const styles = StyleSheet.create({
|
|
257
|
+
tagLine: {
|
|
258
|
+
flexDirection: 'row',
|
|
259
|
+
marginHorizontal: cx(24),
|
|
260
|
+
},
|
|
261
|
+
infoLine: {
|
|
262
|
+
marginHorizontal: cx(24),
|
|
263
|
+
},
|
|
264
|
+
addMoodPopover: {
|
|
265
|
+
position: 'absolute',
|
|
266
|
+
right: cx(60),
|
|
267
|
+
top: Platform.OS === 'android' ? cx(90) : cx(130),
|
|
268
|
+
maxWidth: cx(200),
|
|
269
|
+
backgroundColor: props.theme.card.background,
|
|
270
|
+
},
|
|
271
|
+
popoverItem: {
|
|
272
|
+
padding: cx(5),
|
|
273
|
+
alignItems: 'flex-start',
|
|
274
|
+
},
|
|
275
|
+
})
|
|
276
|
+
|
|
255
277
|
return (
|
|
256
278
|
<>
|
|
257
279
|
<Page
|
|
@@ -268,21 +290,21 @@ const MoodPage = () => {
|
|
|
268
290
|
loading={state.loading}
|
|
269
291
|
>
|
|
270
292
|
{!params.isStripLight && <View style={styles.tagLine}>
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
293
|
+
<Tag
|
|
294
|
+
checked={state.staticTagChecked}
|
|
295
|
+
text={Strings.getLang('mood_overview_filter_name_text1')}
|
|
296
|
+
onCheckedChange={checked => {
|
|
297
|
+
state.staticTagChecked = checked;
|
|
298
|
+
}}
|
|
299
|
+
/>
|
|
300
|
+
<Spacer width={cx(8)} height={0} />
|
|
301
|
+
<Tag
|
|
302
|
+
checked={state.dynamicTagChecked}
|
|
303
|
+
text={Strings.getLang('mood_overview_filter_name_text2')}
|
|
304
|
+
onCheckedChange={checked => {
|
|
305
|
+
state.dynamicTagChecked = checked;
|
|
306
|
+
}}
|
|
307
|
+
/>
|
|
286
308
|
</View>}
|
|
287
309
|
<Spacer height={cx(10)} />
|
|
288
310
|
{state.originMoods.length >= MAX_MOOD_COUNT && (
|
|
@@ -291,7 +313,7 @@ const MoodPage = () => {
|
|
|
291
313
|
<InfoText
|
|
292
314
|
icon={res.ic_warning_amber}
|
|
293
315
|
text={Strings.getLang('mood_overview_warning_max_number_text')}
|
|
294
|
-
contentColor={
|
|
316
|
+
contentColor={props.theme.global.warning}
|
|
295
317
|
/>
|
|
296
318
|
<Spacer height={cx(6)} />
|
|
297
319
|
</View>
|
|
@@ -346,25 +368,5 @@ const MoodPage = () => {
|
|
|
346
368
|
);
|
|
347
369
|
};
|
|
348
370
|
|
|
349
|
-
const styles = StyleSheet.create({
|
|
350
|
-
tagLine: {
|
|
351
|
-
flexDirection: 'row',
|
|
352
|
-
marginHorizontal: cx(24),
|
|
353
|
-
},
|
|
354
|
-
infoLine: {
|
|
355
|
-
marginHorizontal: cx(24),
|
|
356
|
-
},
|
|
357
|
-
addMoodPopover: {
|
|
358
|
-
position: 'absolute',
|
|
359
|
-
right: cx(60),
|
|
360
|
-
top: Platform.OS === 'android' ? cx(90) : cx(130),
|
|
361
|
-
maxWidth: cx(200),
|
|
362
|
-
backgroundColor: '#fff',
|
|
363
|
-
},
|
|
364
|
-
popoverItem: {
|
|
365
|
-
padding: cx(5),
|
|
366
|
-
alignItems: 'flex-start',
|
|
367
|
-
},
|
|
368
|
-
});
|
|
369
371
|
|
|
370
|
-
export default MoodPage
|
|
372
|
+
export default withTheme(MoodPage)
|
|
@@ -24,6 +24,7 @@ import LdvSwitch from '@ledvance/base/src/components/ldvSwitch';
|
|
|
24
24
|
import { showDialog } from '@ledvance/base/src/utils/common';
|
|
25
25
|
|
|
26
26
|
const cx = Utils.RatioUtils.convertX;
|
|
27
|
+
const { withTheme } = Utils.ThemeUtils
|
|
27
28
|
|
|
28
29
|
export interface StaticMoodEditorPageParams {
|
|
29
30
|
mode: 'add' | 'edit';
|
|
@@ -41,7 +42,7 @@ export interface StaticMoodEditorPageState {
|
|
|
41
42
|
loading: boolean;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
const StaticMoodEditorPage = () => {
|
|
45
|
+
const StaticMoodEditorPage = (props: { theme?: any }) => {
|
|
45
46
|
const navigation = useNavigation();
|
|
46
47
|
const routeParams = useParams<StaticMoodEditorPageParams>();
|
|
47
48
|
const params = cloneDeep(routeParams);
|
|
@@ -117,6 +118,41 @@ const StaticMoodEditorPage = () => {
|
|
|
117
118
|
return state.mood.name.length > 0 && state.mood.name.length < 33 && !nameRepeat && (params.mode === 'add' || !checkMoodChanged)
|
|
118
119
|
}, [nameRepeat, state.mood.name, checkMoodChanged, params.mode])
|
|
119
120
|
|
|
121
|
+
|
|
122
|
+
const styles = StyleSheet.create({
|
|
123
|
+
root: {
|
|
124
|
+
flex: 1,
|
|
125
|
+
flexDirection: 'column',
|
|
126
|
+
},
|
|
127
|
+
name: {
|
|
128
|
+
marginHorizontal: cx(24),
|
|
129
|
+
},
|
|
130
|
+
adjustCard: {
|
|
131
|
+
marginTop: cx(12),
|
|
132
|
+
marginHorizontal: cx(24),
|
|
133
|
+
},
|
|
134
|
+
fanAdjustCard: {
|
|
135
|
+
marginHorizontal: cx(24),
|
|
136
|
+
},
|
|
137
|
+
preview: {
|
|
138
|
+
width: cx(20),
|
|
139
|
+
height: cx(20),
|
|
140
|
+
marginStart: cx(12),
|
|
141
|
+
borderRadius: cx(4),
|
|
142
|
+
},
|
|
143
|
+
deleteBtn: {
|
|
144
|
+
width: '100%',
|
|
145
|
+
height: cx(50),
|
|
146
|
+
backgroundColor: props.theme.button.delete,
|
|
147
|
+
borderRadius: cx(8),
|
|
148
|
+
},
|
|
149
|
+
deleteBtnText: {
|
|
150
|
+
color: props.theme.button.fontColor,
|
|
151
|
+
fontSize: cx(16),
|
|
152
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
|
|
120
156
|
return (
|
|
121
157
|
<Page
|
|
122
158
|
backText={I18n.getLang('mesh_device_detail_mode')}
|
|
@@ -147,7 +183,7 @@ const StaticMoodEditorPage = () => {
|
|
|
147
183
|
}}
|
|
148
184
|
maxLength={33}
|
|
149
185
|
showError={state.mood.name.length > 32 || nameRepeat}
|
|
150
|
-
tipColor={nameRepeat ?
|
|
186
|
+
tipColor={nameRepeat ? props.theme.global.error : undefined}
|
|
151
187
|
tipIcon={nameRepeat ? res.ic_text_field_input_error : undefined}
|
|
152
188
|
errorText={I18n.getLang(
|
|
153
189
|
nameRepeat ? 'string_light_pp_field_sm_add_error1' : 'add_new_dynamic_mood_alert_text'
|
|
@@ -253,47 +289,4 @@ const StaticMoodEditorPage = () => {
|
|
|
253
289
|
);
|
|
254
290
|
};
|
|
255
291
|
|
|
256
|
-
|
|
257
|
-
root: {
|
|
258
|
-
flex: 1,
|
|
259
|
-
flexDirection: 'column',
|
|
260
|
-
},
|
|
261
|
-
name: {
|
|
262
|
-
marginHorizontal: cx(24),
|
|
263
|
-
},
|
|
264
|
-
adjustCard: {
|
|
265
|
-
marginTop: cx(12),
|
|
266
|
-
marginHorizontal: cx(24),
|
|
267
|
-
},
|
|
268
|
-
fanAdjustCard: {
|
|
269
|
-
marginHorizontal: cx(24),
|
|
270
|
-
},
|
|
271
|
-
lightLine: {
|
|
272
|
-
flexDirection: 'row',
|
|
273
|
-
marginHorizontal: cx(16),
|
|
274
|
-
},
|
|
275
|
-
light: {
|
|
276
|
-
color: '#000',
|
|
277
|
-
fontSize: cx(18),
|
|
278
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
279
|
-
},
|
|
280
|
-
preview: {
|
|
281
|
-
width: cx(20),
|
|
282
|
-
height: cx(20),
|
|
283
|
-
marginStart: cx(12),
|
|
284
|
-
borderRadius: cx(4),
|
|
285
|
-
},
|
|
286
|
-
deleteBtn: {
|
|
287
|
-
width: '100%',
|
|
288
|
-
height: cx(50),
|
|
289
|
-
backgroundColor: '#666',
|
|
290
|
-
borderRadius: cx(8),
|
|
291
|
-
},
|
|
292
|
-
deleteBtnText: {
|
|
293
|
-
color: '#fff',
|
|
294
|
-
fontSize: cx(16),
|
|
295
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
296
|
-
},
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
export default StaticMoodEditorPage;
|
|
292
|
+
export default withTheme(StaticMoodEditorPage)
|
|
@@ -57,6 +57,9 @@ const OverchargeSwitchPage = (props: { theme?: any }) => {
|
|
|
57
57
|
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
58
58
|
paddingVertical: cx(16),
|
|
59
59
|
},
|
|
60
|
+
desc: {
|
|
61
|
+
color: props.theme.global.fontColor,
|
|
62
|
+
},
|
|
60
63
|
shadow: {
|
|
61
64
|
shadowColor: props.theme.card.shadowColor,
|
|
62
65
|
shadowOpacity: 0.2,
|
|
@@ -66,7 +69,7 @@ const OverchargeSwitchPage = (props: { theme?: any }) => {
|
|
|
66
69
|
width: 0,
|
|
67
70
|
height: 4,
|
|
68
71
|
},
|
|
69
|
-
backgroundColor: props.theme.
|
|
72
|
+
backgroundColor: props.theme.card.background,
|
|
70
73
|
borderRadius: 8,
|
|
71
74
|
},
|
|
72
75
|
})
|
|
@@ -80,7 +83,7 @@ const OverchargeSwitchPage = (props: { theme?: any }) => {
|
|
|
80
83
|
<Text style={styles.title}>{I18n.getLang('switch_overcharge_headline_text')}</Text>
|
|
81
84
|
</View>
|
|
82
85
|
<View style={{ paddingBottom: cx(16) }}>
|
|
83
|
-
<Text>{I18n.getLang('switch_overcharge_headline_description')}</Text>
|
|
86
|
+
<Text style={styles.desc}>{I18n.getLang('switch_overcharge_headline_description')}</Text>
|
|
84
87
|
</View>
|
|
85
88
|
</View>
|
|
86
89
|
<Spacer style={{ flex: 1 }} height={0} width={0} />
|
|
@@ -7,9 +7,11 @@ import {getIsClosed, loopText} from "@ledvance/base/src/utils/common";
|
|
|
7
7
|
import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
|
|
8
8
|
|
|
9
9
|
const {convertX: cx} = Utils.RatioUtils
|
|
10
|
+
const { withTheme } = Utils.ThemeUtils
|
|
10
11
|
const {parseTimer} = Utils.TimeUtils
|
|
11
12
|
|
|
12
13
|
export interface ItemCardProps<T> {
|
|
14
|
+
theme?: any
|
|
13
15
|
item: T & {
|
|
14
16
|
enable: boolean
|
|
15
17
|
startTime: number
|
|
@@ -25,8 +27,33 @@ export interface ItemCardProps<T> {
|
|
|
25
27
|
|
|
26
28
|
const ItemCard = <T, >(props: ItemCardProps<T>) => {
|
|
27
29
|
const {item, is24Hour, onSwitch, onPress} = props
|
|
28
|
-
// 判断是否关闭
|
|
30
|
+
// 判断是否关闭
|
|
29
31
|
const closed = getIsClosed(item)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
itemCard: {
|
|
36
|
+
marginHorizontal: cx(24),
|
|
37
|
+
paddingHorizontal: cx(16),
|
|
38
|
+
},
|
|
39
|
+
switchLine: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
},
|
|
43
|
+
time: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
color: props.theme.global.fontColor,
|
|
46
|
+
fontSize: cx(16),
|
|
47
|
+
fontWeight: 'bold',
|
|
48
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
49
|
+
},
|
|
50
|
+
switchBtn: {},
|
|
51
|
+
loopText: {
|
|
52
|
+
color: props.theme.global.fontColor,
|
|
53
|
+
fontSize: cx(14),
|
|
54
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
55
|
+
},
|
|
56
|
+
})
|
|
30
57
|
return (
|
|
31
58
|
<Card style={styles.itemCard} onPress={onPress}>
|
|
32
59
|
<Spacer height={cx(16)}/>
|
|
@@ -52,28 +79,4 @@ const ItemCard = <T, >(props: ItemCardProps<T>) => {
|
|
|
52
79
|
)
|
|
53
80
|
}
|
|
54
81
|
|
|
55
|
-
|
|
56
|
-
itemCard: {
|
|
57
|
-
marginHorizontal: cx(24),
|
|
58
|
-
paddingHorizontal: cx(16),
|
|
59
|
-
},
|
|
60
|
-
switchLine: {
|
|
61
|
-
flexDirection: 'row',
|
|
62
|
-
alignItems: 'center',
|
|
63
|
-
},
|
|
64
|
-
time: {
|
|
65
|
-
flex: 1,
|
|
66
|
-
color: '#000',
|
|
67
|
-
fontSize: cx(16),
|
|
68
|
-
fontWeight: 'bold',
|
|
69
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
70
|
-
},
|
|
71
|
-
switchBtn: {},
|
|
72
|
-
loopText: {
|
|
73
|
-
color: '#000',
|
|
74
|
-
fontSize: cx(14),
|
|
75
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
76
|
-
},
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
export default ItemCard
|
|
82
|
+
export default withTheme(ItemCard)
|
|
@@ -20,6 +20,7 @@ import {RandomTimeParam} from "./RandomTimeForPlugAction";
|
|
|
20
20
|
import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
|
|
21
21
|
|
|
22
22
|
const {parseTimer} = Utils.TimeUtils
|
|
23
|
+
const { withTheme } = Utils.ThemeUtils
|
|
23
24
|
const {convertX: cx} = Utils.RatioUtils;
|
|
24
25
|
|
|
25
26
|
interface RandomTimeDetailParam extends RandomTimeParam {
|
|
@@ -40,7 +41,7 @@ const newRandomTimeItem = (): RandomTimeItem => {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
const RandomTimeForPlugDetailPage = () => {
|
|
44
|
+
const RandomTimeForPlugDetailPage = (props: { theme?: any }) => {
|
|
44
45
|
const navigation = useNavigation()
|
|
45
46
|
const params = useRoute().params as RandomTimeDetailParam
|
|
46
47
|
const initItem = newRandomTimeItem();
|
|
@@ -102,6 +103,36 @@ const RandomTimeForPlugDetailPage = () => {
|
|
|
102
103
|
}
|
|
103
104
|
})
|
|
104
105
|
}
|
|
106
|
+
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
cardContainer: {
|
|
109
|
+
marginHorizontal: cx(24)
|
|
110
|
+
},
|
|
111
|
+
itemTitle: {
|
|
112
|
+
color: props.theme.global.fontColor,
|
|
113
|
+
fontSize: cx(16),
|
|
114
|
+
fontWeight: 'bold',
|
|
115
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
116
|
+
},
|
|
117
|
+
applyContent: {
|
|
118
|
+
backgroundColor: props.theme.container.background,
|
|
119
|
+
borderRadius: 4,
|
|
120
|
+
minHeight: cx(55),
|
|
121
|
+
flex: 1,
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
paddingHorizontal: cx(10),
|
|
124
|
+
paddingTop: cx(10)
|
|
125
|
+
},
|
|
126
|
+
applyItem: {
|
|
127
|
+
paddingLeft: cx(5),
|
|
128
|
+
flexDirection: 'row',
|
|
129
|
+
justifyContent: 'space-between',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
backgroundColor: props.theme.global.background,
|
|
132
|
+
height: cx(35),
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
|
|
105
136
|
return (
|
|
106
137
|
<Page
|
|
107
138
|
backText={I18n.getLang('randomtimecycle_sockets_headline_text')}
|
|
@@ -130,8 +161,9 @@ const RandomTimeForPlugDetailPage = () => {
|
|
|
130
161
|
/>
|
|
131
162
|
{/* pick */}
|
|
132
163
|
<TimerPicker
|
|
133
|
-
itemTextColor=
|
|
134
|
-
style={{paddingVertical: cx(0), marginVertical: cx(0)}}
|
|
164
|
+
itemTextColor="#aeadb5"
|
|
165
|
+
style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
|
|
166
|
+
pickerFontColor={props.theme.global.fontColor}
|
|
135
167
|
is12Hours={!params.is24Hour}
|
|
136
168
|
startTime={state.item.startTime}
|
|
137
169
|
endTime={state.item.endTime}
|
|
@@ -147,7 +179,9 @@ const RandomTimeForPlugDetailPage = () => {
|
|
|
147
179
|
state.item.weeks[rawIndex] = state.item.weeks[rawIndex] === 1 ? 0 : 1
|
|
148
180
|
}}/>
|
|
149
181
|
<Spacer/>
|
|
150
|
-
<Text style={styles.cardContainer
|
|
182
|
+
<Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
|
|
183
|
+
{loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
|
|
184
|
+
</Text>
|
|
151
185
|
<Spacer/>
|
|
152
186
|
{/*Apply for */}
|
|
153
187
|
<View style={styles.cardContainer}>
|
|
@@ -155,15 +189,17 @@ const RandomTimeForPlugDetailPage = () => {
|
|
|
155
189
|
<Spacer height={cx(10)}/>
|
|
156
190
|
<View style={styles.applyContent}>
|
|
157
191
|
{state.item.channel === undefined ?
|
|
158
|
-
<Text
|
|
192
|
+
<Text style={{color: props.theme.global.fontColor}}>
|
|
193
|
+
{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
|
|
194
|
+
</Text> :
|
|
159
195
|
<View style={[styles.applyItem, {marginBottom: cx(10), borderRadius: 4}]}>
|
|
160
|
-
<Text style={{color:
|
|
196
|
+
<Text style={{color: props.theme.global.fontColor}}>{params.channels[state.item.channel]}</Text>
|
|
161
197
|
{params.channels.length > 1 && <TouchableOpacity
|
|
162
198
|
onPress={() => {
|
|
163
199
|
state.item.channel = undefined
|
|
164
200
|
}}
|
|
165
201
|
style={{paddingHorizontal: cx(5)}}>
|
|
166
|
-
<Image style={{width: cx(16), height: cx(16)}} source={res.ic_arrows_nav_clear}/>
|
|
202
|
+
<Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.ic_arrows_nav_clear}/>
|
|
167
203
|
</TouchableOpacity>}
|
|
168
204
|
</View>
|
|
169
205
|
}
|
|
@@ -180,8 +216,8 @@ const RandomTimeForPlugDetailPage = () => {
|
|
|
180
216
|
state.item.channel = index
|
|
181
217
|
}}
|
|
182
218
|
>
|
|
183
|
-
<Text style={{color:
|
|
184
|
-
<Image style={{width: cx(16), height: cx(16)}} source={res.device_panel_timer_add}/>
|
|
219
|
+
<Text style={{color: props.theme.global.fontColor}}>{item}</Text>
|
|
220
|
+
<Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.device_panel_timer_add}/>
|
|
185
221
|
</TouchableOpacity>
|
|
186
222
|
)
|
|
187
223
|
})}
|
|
@@ -211,75 +247,4 @@ const RandomTimeForPlugDetailPage = () => {
|
|
|
211
247
|
)
|
|
212
248
|
}
|
|
213
249
|
|
|
214
|
-
|
|
215
|
-
cardContainer: {
|
|
216
|
-
marginHorizontal: cx(24)
|
|
217
|
-
},
|
|
218
|
-
itemTitle: {
|
|
219
|
-
color: '#000',
|
|
220
|
-
fontSize: cx(16),
|
|
221
|
-
fontWeight: 'bold',
|
|
222
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
223
|
-
},
|
|
224
|
-
applyContent: {
|
|
225
|
-
backgroundColor: '#f6f6f6',
|
|
226
|
-
borderRadius: 4,
|
|
227
|
-
minHeight: cx(55),
|
|
228
|
-
flex: 1,
|
|
229
|
-
justifyContent: 'center',
|
|
230
|
-
paddingHorizontal: cx(10),
|
|
231
|
-
paddingTop: cx(10)
|
|
232
|
-
},
|
|
233
|
-
applyItem: {
|
|
234
|
-
paddingLeft: cx(5),
|
|
235
|
-
flexDirection: 'row',
|
|
236
|
-
justifyContent: 'space-between',
|
|
237
|
-
alignItems: 'center',
|
|
238
|
-
backgroundColor: '#fff',
|
|
239
|
-
height: cx(35),
|
|
240
|
-
},
|
|
241
|
-
summaryContainer: {
|
|
242
|
-
flexDirection: 'row',
|
|
243
|
-
justifyContent: 'flex-start',
|
|
244
|
-
marginBottom: cx(10)
|
|
245
|
-
},
|
|
246
|
-
summaryLeft: {
|
|
247
|
-
flexDirection: 'row',
|
|
248
|
-
justifyContent: 'flex-start',
|
|
249
|
-
alignItems: 'center',
|
|
250
|
-
},
|
|
251
|
-
summaryImg: {
|
|
252
|
-
width: cx(12),
|
|
253
|
-
height: cx(12),
|
|
254
|
-
marginRight: cx(6)
|
|
255
|
-
},
|
|
256
|
-
leftTitle: {
|
|
257
|
-
fontSize: cx(14),
|
|
258
|
-
color: '#000'
|
|
259
|
-
},
|
|
260
|
-
summaryRight: {
|
|
261
|
-
flexDirection: 'column',
|
|
262
|
-
marginLeft: cx(21),
|
|
263
|
-
borderRadius: cx(16),
|
|
264
|
-
backgroundColor: '#cbcbcb',
|
|
265
|
-
},
|
|
266
|
-
rightItem: {
|
|
267
|
-
paddingHorizontal: cx(12),
|
|
268
|
-
color: '#000',
|
|
269
|
-
},
|
|
270
|
-
rightTitle: {
|
|
271
|
-
paddingLeft: cx(12),
|
|
272
|
-
paddingRight: cx(12),
|
|
273
|
-
fontSize: cx(10),
|
|
274
|
-
textAlign: 'center',
|
|
275
|
-
alignSelf: 'flex-start'
|
|
276
|
-
},
|
|
277
|
-
filletCorner: {
|
|
278
|
-
flexDirection: 'row',
|
|
279
|
-
backgroundColor: '#cbcbcb',
|
|
280
|
-
borderRadius: cx(16),
|
|
281
|
-
alignSelf: 'flex-start'
|
|
282
|
-
}
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
export default RandomTimeForPlugDetailPage
|
|
250
|
+
export default withTheme(RandomTimeForPlugDetailPage)
|
|
@@ -12,11 +12,13 @@ import {RandomTimeItem, RandomTimeParam, useRandomTime} from "./RandomTimeForPlu
|
|
|
12
12
|
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
13
13
|
import ItemCard from "./ItemCard";
|
|
14
14
|
import {cloneDeep} from "lodash";
|
|
15
|
+
import InfoText from "@ledvance/base/src/components/InfoText";
|
|
15
16
|
|
|
16
17
|
const {convertX: cx, topBarHeight} = Utils.RatioUtils;
|
|
18
|
+
const { withTheme } = Utils.ThemeUtils
|
|
17
19
|
const MAX_NUM = 16
|
|
18
20
|
|
|
19
|
-
const RandomTimeForPlugPage = () => {
|
|
21
|
+
const RandomTimeForPlugPage = (props: { theme?: any}) => {
|
|
20
22
|
const devInfo = useDeviceInfo()
|
|
21
23
|
const navigation = useNavigation()
|
|
22
24
|
const params = useRoute().params as RandomTimeParam
|
|
@@ -58,17 +60,56 @@ const RandomTimeForPlugPage = () => {
|
|
|
58
60
|
}
|
|
59
61
|
}, [randomTimeList])
|
|
60
62
|
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
bg: {
|
|
65
|
+
marginTop: topBarHeight,
|
|
66
|
+
flex: 1,
|
|
67
|
+
},
|
|
68
|
+
emptyListCon: {
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
marginTop: cx(30),
|
|
72
|
+
},
|
|
73
|
+
emptyImage: {
|
|
74
|
+
width: cx(225),
|
|
75
|
+
height: cx(198)
|
|
76
|
+
},
|
|
77
|
+
execTip: {
|
|
78
|
+
color: props.theme.global.fontColor,
|
|
79
|
+
marginLeft: cx(24),
|
|
80
|
+
},
|
|
81
|
+
maxImg: {
|
|
82
|
+
width: cx(16),
|
|
83
|
+
height: cx(16),
|
|
84
|
+
tintColor: props.theme.global.warning
|
|
85
|
+
},
|
|
86
|
+
maxTip: {
|
|
87
|
+
color: props.theme.global.secondFontColor,
|
|
88
|
+
},
|
|
89
|
+
addButton: {
|
|
90
|
+
height: cx(36),
|
|
91
|
+
width: cx(150),
|
|
92
|
+
marginVertical: cx(25),
|
|
93
|
+
marginHorizontal: cx(24),
|
|
94
|
+
borderRadius: cx(6),
|
|
95
|
+
backgroundColor: props.theme.button.primary,
|
|
96
|
+
},
|
|
97
|
+
addButtonText: {
|
|
98
|
+
fontSize: cx(12),
|
|
99
|
+
fontWeight: 'bold',
|
|
100
|
+
color: props.theme.button.fontColor,
|
|
101
|
+
textAlign: 'center'
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
|
|
61
105
|
const renderList = () => {
|
|
62
106
|
return (
|
|
63
107
|
<ScrollView nestedScrollEnabled={true}>
|
|
64
|
-
<Text style={{
|
|
65
|
-
color: '#000',
|
|
66
|
-
marginLeft: cx(24),
|
|
67
|
-
}}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
|
|
108
|
+
<Text style={styles.execTip}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
|
|
68
109
|
<Spacer height={cx(10)}/>
|
|
69
110
|
{isMaxNum && <View style={{marginHorizontal: cx(24), flexDirection: 'row'}}>
|
|
70
|
-
<Image style={
|
|
71
|
-
<Text>{I18n.getLang('fixedtimecycle_warning_max_number_text')}</Text>
|
|
111
|
+
<Image style={styles.maxImg} source={res.ic_warning_amber}/>
|
|
112
|
+
<Text style={styles.maxTip}>{I18n.getLang('fixedtimecycle_warning_max_number_text')}</Text>
|
|
72
113
|
</View>}
|
|
73
114
|
<FlatList
|
|
74
115
|
data={randomTimeList}
|
|
@@ -103,30 +144,14 @@ const RandomTimeForPlugPage = () => {
|
|
|
103
144
|
style={styles.emptyImage}
|
|
104
145
|
source={{uri: res.ldv_timer_empty}}
|
|
105
146
|
resizeMode="contain"/>
|
|
106
|
-
<
|
|
107
|
-
style={{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
>
|
|
114
|
-
<Image
|
|
115
|
-
source={{uri: res.device_panel_schedule_alert}}
|
|
116
|
-
style={{width: cx(16), height: cx(16)}}
|
|
117
|
-
/>
|
|
118
|
-
<Text style={styles.emptyNoTime}>{I18n.getLang('randomtimecycle_empty_information_text')}</Text>
|
|
119
|
-
</View>
|
|
120
|
-
<View
|
|
121
|
-
style={{
|
|
122
|
-
height: cx(36),
|
|
123
|
-
width: cx(150),
|
|
124
|
-
marginVertical: cx(25),
|
|
125
|
-
marginHorizontal: cx(24),
|
|
126
|
-
borderRadius: cx(6),
|
|
127
|
-
backgroundColor: '#f60',
|
|
128
|
-
}}
|
|
129
|
-
>
|
|
147
|
+
<InfoText
|
|
148
|
+
style={{width: 'auto', alignItems: 'center'}}
|
|
149
|
+
icon={res.device_panel_schedule_alert}
|
|
150
|
+
text={I18n.getLang('randomtimecycle_empty_information_text')}
|
|
151
|
+
textStyle={{flex: undefined}}
|
|
152
|
+
contentColor={props.theme.global.secondFontColor}
|
|
153
|
+
/>
|
|
154
|
+
<View style={styles.addButton}>
|
|
130
155
|
<TouchableOpacity
|
|
131
156
|
style={{
|
|
132
157
|
flex: 1,
|
|
@@ -135,7 +160,7 @@ const RandomTimeForPlugPage = () => {
|
|
|
135
160
|
}}
|
|
136
161
|
onPress={() => onAddOrEditItem('add')}
|
|
137
162
|
>
|
|
138
|
-
<Text style={
|
|
163
|
+
<Text style={styles.addButtonText}>
|
|
139
164
|
{I18n.getLang('randomtimecycle_empty_bttn_text')}
|
|
140
165
|
</Text>
|
|
141
166
|
</TouchableOpacity>
|
|
@@ -156,38 +181,4 @@ const RandomTimeForPlugPage = () => {
|
|
|
156
181
|
)
|
|
157
182
|
}
|
|
158
183
|
|
|
159
|
-
|
|
160
|
-
bg: {
|
|
161
|
-
marginTop: topBarHeight,
|
|
162
|
-
flex: 1,
|
|
163
|
-
},
|
|
164
|
-
emptyListCon: {
|
|
165
|
-
justifyContent: 'center',
|
|
166
|
-
alignItems: 'center',
|
|
167
|
-
marginTop: cx(30),
|
|
168
|
-
},
|
|
169
|
-
emptyImage: {
|
|
170
|
-
width: cx(225),
|
|
171
|
-
height: cx(198)
|
|
172
|
-
},
|
|
173
|
-
emptyNoTime: {
|
|
174
|
-
fontSize: cx(12),
|
|
175
|
-
color: '#000'
|
|
176
|
-
},
|
|
177
|
-
emptyTimeTip: {
|
|
178
|
-
fontSize: cx(12),
|
|
179
|
-
lineHeight: cx(17),
|
|
180
|
-
marginTop: cx(6),
|
|
181
|
-
width: '76%',
|
|
182
|
-
textAlign: 'center'
|
|
183
|
-
},
|
|
184
|
-
listContainer: {
|
|
185
|
-
bottom: cx(74)
|
|
186
|
-
},
|
|
187
|
-
categoryList: {
|
|
188
|
-
marginHorizontal: cx(24),
|
|
189
|
-
marginBottom: cx(12),
|
|
190
|
-
},
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
export default RandomTimeForPlugPage
|
|
184
|
+
export default withTheme(RandomTimeForPlugPage)
|