@ledvance/group-ui-biz-bundle 1.0.73 → 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/biorhythm/BiorhythmDetailPage.tsx +1 -1
- package/src/modules/biorhythm/circular/Progress.tsx +2 -2
- 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 +68 -87
- 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/fixedTimingForLight/FixedTimingForLightDetailPage.tsx +2 -2
- package/src/modules/lightMode/LightModePage.tsx +2 -2
- package/src/modules/mood_new/MoodInfo.ts +170 -18
- package/src/modules/mood_new/StaticMoodEditorPage.tsx +8 -0
- package/src/modules/overchargeSwitch/OverchargeSwitchPage.tsx +5 -2
- package/src/modules/randomTimeForPlug/ItemCard.tsx +29 -26
- package/src/modules/randomTimeForPlug/RandomTimeForPlugDetailPage.tsx +47 -82
- package/src/modules/randomTimeForPlug/RandomTimeForPlugPage.tsx +58 -67
- package/src/modules/randomTimeForPlug/Summary.tsx +62 -58
- package/src/modules/randomTimingForLight/RandomTimingForLightDetailPage.tsx +2 -2
- package/src/modules/sleepWakeUp/SleepWakeUpDetailPage.tsx +35 -28
- 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 +22 -3
- package/src/modules/timer/TimerPage.tsx +120 -117
- package/src/modules/swithInching/pickerView.tsx +0 -91
|
@@ -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
|
})}
|
|
@@ -189,7 +225,7 @@ const RandomTimeForPlugDetailPage = () => {
|
|
|
189
225
|
<Spacer/>
|
|
190
226
|
{/* summary */}
|
|
191
227
|
<Summary
|
|
192
|
-
frequency={loopText(state.item.weeks)}
|
|
228
|
+
frequency={loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
|
|
193
229
|
time={params.is24Hour ?
|
|
194
230
|
`${parseTimer(state.item.startTime * 60)} - ${parseTimer(state.item.endTime * 60)}`
|
|
195
231
|
:
|
|
@@ -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)
|
|
@@ -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))
|
|
@@ -170,7 +170,7 @@ const RandomTimingForLightDetailPage = () => {
|
|
|
170
170
|
state.item.weeks[rawIndex] = state.item.weeks[rawIndex] === 1 ? 0 : 1
|
|
171
171
|
}}/>
|
|
172
172
|
<Spacer/>
|
|
173
|
-
<Text style={styles.cardContainer}>{loopText(state.item.weeks, parseTimer(state.item.
|
|
173
|
+
<Text style={styles.cardContainer}>{loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}</Text>
|
|
174
174
|
<Spacer/>
|
|
175
175
|
{/*Apply for */}
|
|
176
176
|
<View style={styles.cardContainer}>
|
|
@@ -261,7 +261,7 @@ const RandomTimingForLightDetailPage = () => {
|
|
|
261
261
|
</View>
|
|
262
262
|
{/* summary */}
|
|
263
263
|
<Summary
|
|
264
|
-
frequency={loopText(state.item.weeks)}
|
|
264
|
+
frequency={loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
|
|
265
265
|
time={params.is24Hour ?
|
|
266
266
|
`${parseTimer(state.item.startTime * 60)} - ${parseTimer(state.item.endTime * 60)}`
|
|
267
267
|
:
|
|
@@ -34,6 +34,8 @@ import {getEndTime, getStartTime, SleepWakeUpItem} from "./SleepWakeUpActions";
|
|
|
34
34
|
const { convertX: cx } = Utils.RatioUtils;
|
|
35
35
|
const { toFixedString } = Utils.NumberUtils;
|
|
36
36
|
const { withTheme } = Utils.ThemeUtils
|
|
37
|
+
const {parseTimer} = Utils.TimeUtils
|
|
38
|
+
|
|
37
39
|
|
|
38
40
|
interface SleepWakeUpDetailPageProps extends SleepWakeUpPageRouteParams {
|
|
39
41
|
mode: 'add' | 'edit';
|
|
@@ -253,7 +255,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
|
|
|
253
255
|
return (
|
|
254
256
|
<Page
|
|
255
257
|
backText={I18n.getLang('add_sleepschedule_one_source_system_back_text')}
|
|
256
|
-
showBackDialog={showBackDialog()
|
|
258
|
+
showBackDialog={showBackDialog()}
|
|
257
259
|
loading={state.loading}
|
|
258
260
|
backDialogTitle={I18n.getLang('cancel_dialog_leave_unsaved_titel')}
|
|
259
261
|
backDialogContent={I18n.getLang(
|
|
@@ -264,25 +266,35 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
|
|
|
264
266
|
rightButtonIcon={showBackDialog() && caSubmit ? res.ic_check : res.ic_uncheck}
|
|
265
267
|
rightButtonIconClick={async () => {
|
|
266
268
|
if (!showBackDialog() || !caSubmit || state.loading) return;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
269
|
+
showDialog({
|
|
270
|
+
method: 'confirm',
|
|
271
|
+
title: I18n.getLang('conflict_dialog_active_item_sleepschedule_titel'),
|
|
272
|
+
subTitle: I18n.getLang('group_conflict_feature'),
|
|
273
|
+
confirmText: I18n.getLang('registration_dialog_button_yes'),
|
|
274
|
+
cancelText: I18n.getLang('registration_dialog_button_no'),
|
|
275
|
+
onConfirm: async (_, { close }) => {
|
|
276
|
+
state.loading = true
|
|
277
|
+
close()
|
|
278
|
+
if (state.sleepWakeUp.isColorMode) {
|
|
279
|
+
state.sleepWakeUp.brightness = 0;
|
|
280
|
+
state.sleepWakeUp.temperature = 0;
|
|
281
|
+
} else {
|
|
282
|
+
state.sleepWakeUp.hue = 0;
|
|
283
|
+
state.sleepWakeUp.sat = 0;
|
|
284
|
+
state.sleepWakeUp.value = 0;
|
|
285
|
+
}
|
|
286
|
+
state.sleepWakeUp.enable = true
|
|
287
|
+
const res = await params.modDeleteTimeSchedule(
|
|
288
|
+
params.mode,
|
|
289
|
+
state.sleepWakeUp.isSleep,
|
|
290
|
+
{...state.sleepWakeUp, settingTime: new Date().getTime()}
|
|
291
|
+
);
|
|
292
|
+
state.loading = false;
|
|
293
|
+
if (res.success) {
|
|
294
|
+
navigation.goBack();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
})
|
|
286
298
|
}}
|
|
287
299
|
headlineText={I18n.getLang(
|
|
288
300
|
params.isSleep
|
|
@@ -339,7 +351,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
|
|
|
339
351
|
}}
|
|
340
352
|
/>
|
|
341
353
|
<Spacer />
|
|
342
|
-
<Text style={{ marginHorizontal: cx(24), color: props.theme.global.fontColor }}>{loopText(state.sleepWakeUp.weeks)}</Text>
|
|
354
|
+
<Text style={{ marginHorizontal: cx(24), color: props.theme.global.fontColor }}>{loopText(state.sleepWakeUp.weeks, parseTimer(getEndTime(state.sleepWakeUp) * 60))}</Text>
|
|
343
355
|
<Spacer />
|
|
344
356
|
</View>
|
|
345
357
|
|
|
@@ -556,7 +568,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
|
|
|
556
568
|
style={styles.summaryLeft}
|
|
557
569
|
/>
|
|
558
570
|
<View style={styles.summaryRight}>
|
|
559
|
-
<Text style={styles.rightItem}>{loopText(state.sleepWakeUp.weeks)}</Text>
|
|
571
|
+
<Text style={styles.rightItem}>{loopText(state.sleepWakeUp.weeks, parseTimer(getEndTime(state.sleepWakeUp) * 60))}</Text>
|
|
560
572
|
</View>
|
|
561
573
|
</View>
|
|
562
574
|
<View style={styles.summaryContainer}>
|
|
@@ -604,12 +616,7 @@ const SleepWakeUpDetailPage = (props: {theme?: any}) => {
|
|
|
604
616
|
</Text>
|
|
605
617
|
<View style={styles.filletCorner}>
|
|
606
618
|
<Text style={styles.rightTitle}>
|
|
607
|
-
{convertMinutesTo12HourFormat(
|
|
608
|
-
params.isSleep
|
|
609
|
-
? getEndTime(state.sleepWakeUp)
|
|
610
|
-
: getEndTime(state.sleepWakeUp),
|
|
611
|
-
is24HourClock
|
|
612
|
-
)}
|
|
619
|
+
{convertMinutesTo12HourFormat(getEndTime(state.sleepWakeUp),is24HourClock)}
|
|
613
620
|
</Text>
|
|
614
621
|
</View>
|
|
615
622
|
</View>
|
|
@@ -191,7 +191,7 @@ const SleepWakeUpPage = (props: {theme?: any}) => {
|
|
|
191
191
|
alignItems: 'center'
|
|
192
192
|
},
|
|
193
193
|
emptyBtn: {
|
|
194
|
-
backgroundColor: props.theme.button.
|
|
194
|
+
backgroundColor: props.theme.button.primary,
|
|
195
195
|
borderRadius: cx(5),
|
|
196
196
|
paddingHorizontal: cx(15),
|
|
197
197
|
paddingVertical: cx(10)
|
|
@@ -4,7 +4,7 @@ import Page from "@ledvance/base/src/components/Page";
|
|
|
4
4
|
import {useDeviceInfo} from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
5
5
|
import {useNavigation} from '@react-navigation/native'
|
|
6
6
|
import {SwitchButton, Utils} from "tuya-panel-kit";
|
|
7
|
-
import LdvPickerView from "
|
|
7
|
+
import LdvPickerView from "@ledvance/base/src/components/ldvPickerView";
|
|
8
8
|
import I18n from '@ledvance/base/src/i18n'
|
|
9
9
|
import {useReactive, useUpdateEffect} from "ahooks";
|
|
10
10
|
import {useSwitchInching} from "./SwithInchingAction";
|
|
@@ -71,7 +71,7 @@ const SwitchInching = (props: { theme?: any }) => {
|
|
|
71
71
|
|
|
72
72
|
const styles = StyleSheet.create({
|
|
73
73
|
switchContainer: {
|
|
74
|
-
backgroundColor: props.theme.
|
|
74
|
+
backgroundColor: props.theme.container.background,
|
|
75
75
|
marginHorizontal: cx(24),
|
|
76
76
|
padding: cx(10),
|
|
77
77
|
borderRadius: cx(6),
|
|
@@ -149,6 +149,7 @@ const SwitchInching = (props: { theme?: any }) => {
|
|
|
149
149
|
<View style={styles.pickContainer}>
|
|
150
150
|
{switchInching.enable && <View style={styles.disabledCover}/>}
|
|
151
151
|
<LdvPickerView
|
|
152
|
+
maxHour={61}
|
|
152
153
|
hour={state.minute}
|
|
153
154
|
minute={state.second}
|
|
154
155
|
unit={[
|
|
@@ -67,6 +67,7 @@ export interface HSV {
|
|
|
67
67
|
export type Category = 'light' | 'socket' | 'fan' | 'mainLight' | 'secondaryLight'
|
|
68
68
|
|
|
69
69
|
export interface ApplyForItem {
|
|
70
|
+
name?: string
|
|
70
71
|
key: string;
|
|
71
72
|
dp: string;
|
|
72
73
|
type: Category;
|
|
@@ -86,6 +87,7 @@ interface judgmentSupport {
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
export interface ManualSettingProps extends judgmentSupport {
|
|
90
|
+
theme?: any
|
|
89
91
|
applyForList: ApplyForItem[];
|
|
90
92
|
dps: Record<string, any>;
|
|
91
93
|
manualData: ComponentConfig;
|
|
@@ -127,7 +129,7 @@ export interface CeilingLightData extends DeviceData, StripLightData, MixLightDa
|
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
export interface FanLightData extends DeviceData {
|
|
130
|
-
fanSpeed: number
|
|
132
|
+
fanSpeed: number
|
|
131
133
|
direction: 'forward' | 'reverse'
|
|
132
134
|
mode: 'nature' | 'normal'
|
|
133
135
|
disinfect: boolean
|