@ledvance/group-ui-biz-bundle 1.0.75 → 1.0.76
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/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/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/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
|
@@ -6,8 +6,10 @@ import { Utils } from "tuya-panel-kit";
|
|
|
6
6
|
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
7
7
|
|
|
8
8
|
const { convertX: cx } = Utils.RatioUtils;
|
|
9
|
+
const { withTheme } = Utils.ThemeUtils
|
|
9
10
|
|
|
10
11
|
interface SummaryProps {
|
|
12
|
+
theme?: any
|
|
11
13
|
style?: ViewStyle
|
|
12
14
|
frequency?: string | ReactElement
|
|
13
15
|
time?: string | ReactElement
|
|
@@ -16,6 +18,53 @@ interface SummaryProps {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const Summary = (props: SummaryProps) => {
|
|
21
|
+
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
cardContainer: {
|
|
24
|
+
marginHorizontal: cx(24),
|
|
25
|
+
},
|
|
26
|
+
itemTitle: {
|
|
27
|
+
color: props.theme.global.fontColor,
|
|
28
|
+
fontSize: cx(16),
|
|
29
|
+
fontWeight: 'bold',
|
|
30
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
31
|
+
},
|
|
32
|
+
summaryContainer: {
|
|
33
|
+
flex: 1,
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
marginBottom: cx(10),
|
|
36
|
+
},
|
|
37
|
+
summaryLeft: {
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
minWidth: cx(100)
|
|
41
|
+
},
|
|
42
|
+
summaryImg: {
|
|
43
|
+
tintColor: props.theme.global.fontColor,
|
|
44
|
+
width: cx(12),
|
|
45
|
+
height: cx(12),
|
|
46
|
+
marginRight: cx(6)
|
|
47
|
+
},
|
|
48
|
+
leftTitle: {
|
|
49
|
+
fontSize: cx(14),
|
|
50
|
+
color: props.theme.global.fontColor,
|
|
51
|
+
},
|
|
52
|
+
summaryRight: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
flexDirection: 'column',
|
|
55
|
+
marginLeft: cx(15),
|
|
56
|
+
},
|
|
57
|
+
rightWrap: {
|
|
58
|
+
borderRadius: cx(16),
|
|
59
|
+
paddingHorizontal: cx(12),
|
|
60
|
+
alignSelf: 'flex-start',
|
|
61
|
+
backgroundColor: props.theme.tag.background,
|
|
62
|
+
},
|
|
63
|
+
rightItem: {
|
|
64
|
+
color: props.theme.tag.fontColor,
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
|
|
19
68
|
return (
|
|
20
69
|
<View style={styles.cardContainer}>
|
|
21
70
|
<Text style={styles.itemTitle}>{I18n.getLang('add_randomtimecycle_subheadline_text')}</Text>
|
|
@@ -56,68 +105,23 @@ const Summary = (props: SummaryProps) => {
|
|
|
56
105
|
</View>
|
|
57
106
|
</View>
|
|
58
107
|
{!props.hideActions && <View style={[styles.summaryContainer, { alignItems: 'flex-start' }]}>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
108
|
+
<View style={styles.summaryLeft}>
|
|
109
|
+
<Image
|
|
110
|
+
source={res.summary_icon3}
|
|
111
|
+
resizeMode="contain"
|
|
112
|
+
style={styles.summaryImg}
|
|
113
|
+
/>
|
|
114
|
+
<View>
|
|
115
|
+
<Text style={styles.leftTitle}>{I18n.getLang('motion_detection_add_time_schedule_actions_text1')}</Text>
|
|
116
|
+
</View>
|
|
117
|
+
</View>
|
|
118
|
+
<View style={styles.summaryRight}>
|
|
119
|
+
{props.actions}
|
|
67
120
|
</View>
|
|
68
|
-
</View>
|
|
69
|
-
<View style={styles.summaryRight}>
|
|
70
|
-
{props.actions}
|
|
71
|
-
</View>
|
|
72
121
|
</View>}
|
|
73
122
|
</View>
|
|
74
123
|
</View>
|
|
75
124
|
)
|
|
76
125
|
}
|
|
77
126
|
|
|
78
|
-
|
|
79
|
-
cardContainer: {
|
|
80
|
-
marginHorizontal: cx(24),
|
|
81
|
-
},
|
|
82
|
-
itemTitle: {
|
|
83
|
-
color: '#000',
|
|
84
|
-
fontSize: cx(16),
|
|
85
|
-
fontWeight: 'bold',
|
|
86
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
87
|
-
},
|
|
88
|
-
summaryContainer: {
|
|
89
|
-
flex: 1,
|
|
90
|
-
flexDirection: 'row',
|
|
91
|
-
marginBottom: cx(10),
|
|
92
|
-
},
|
|
93
|
-
summaryLeft: {
|
|
94
|
-
flexDirection: 'row',
|
|
95
|
-
alignItems: 'center',
|
|
96
|
-
minWidth: cx(100)
|
|
97
|
-
},
|
|
98
|
-
summaryImg: {
|
|
99
|
-
width: cx(12),
|
|
100
|
-
height: cx(12),
|
|
101
|
-
marginRight: cx(6)
|
|
102
|
-
},
|
|
103
|
-
leftTitle: {
|
|
104
|
-
fontSize: cx(14),
|
|
105
|
-
color: '#000'
|
|
106
|
-
},
|
|
107
|
-
summaryRight: {
|
|
108
|
-
flex: 1,
|
|
109
|
-
flexDirection: 'column',
|
|
110
|
-
marginLeft: cx(15),
|
|
111
|
-
},
|
|
112
|
-
rightWrap: {
|
|
113
|
-
borderRadius: cx(16),
|
|
114
|
-
paddingHorizontal: cx(12),
|
|
115
|
-
alignSelf: 'flex-start',
|
|
116
|
-
backgroundColor: '#cbcbcb',
|
|
117
|
-
},
|
|
118
|
-
rightItem: {
|
|
119
|
-
color: '#000',
|
|
120
|
-
},
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
export default memo(Summary)
|
|
127
|
+
export default memo(withTheme(Summary))
|
|
@@ -60,7 +60,7 @@ const LightModePage = (props: { theme?: any }) => {
|
|
|
60
60
|
},
|
|
61
61
|
modeSelectGroup: {
|
|
62
62
|
marginHorizontal: cx(24),
|
|
63
|
-
backgroundColor: props.theme.
|
|
63
|
+
backgroundColor: props.theme.container.background,
|
|
64
64
|
borderRadius: cx(4),
|
|
65
65
|
},
|
|
66
66
|
modeTip: {
|
|
@@ -76,7 +76,7 @@ const LightModePage = (props: { theme?: any }) => {
|
|
|
76
76
|
line: {
|
|
77
77
|
height: cx(1),
|
|
78
78
|
marginHorizontal: cx(12),
|
|
79
|
-
backgroundColor:
|
|
79
|
+
backgroundColor: props.theme.container.divider,
|
|
80
80
|
},
|
|
81
81
|
itemRoot: {
|
|
82
82
|
flexDirection: 'row',
|
|
@@ -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)
|