@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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/modules/biorhythm/BiorhythmDetailPage.tsx +1 -1
  3. package/src/modules/biorhythm/circular/Progress.tsx +2 -2
  4. package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +22 -30
  5. package/src/modules/energyConsumption/EnergyConsumptionDetail.tsx +2 -2
  6. package/src/modules/energyConsumption/EnergyConsumptionPage.tsx +1 -1
  7. package/src/modules/energyConsumption/component/Overview.tsx +1 -1
  8. package/src/modules/fixedTimeForPlug/FixedTimeForPlugDetailPage.tsx +68 -87
  9. package/src/modules/fixedTimeForPlug/FixedTimeForPlugPage.tsx +44 -58
  10. package/src/modules/fixedTimeForPlug/ItemCard.tsx +29 -26
  11. package/src/modules/fixedTimeForPlug/Summary.tsx +62 -58
  12. package/src/modules/fixedTimingForLight/FixedTimingForLightDetailPage.tsx +2 -2
  13. package/src/modules/lightMode/LightModePage.tsx +2 -2
  14. package/src/modules/mood_new/MoodInfo.ts +170 -18
  15. package/src/modules/mood_new/StaticMoodEditorPage.tsx +8 -0
  16. package/src/modules/overchargeSwitch/OverchargeSwitchPage.tsx +5 -2
  17. package/src/modules/randomTimeForPlug/ItemCard.tsx +29 -26
  18. package/src/modules/randomTimeForPlug/RandomTimeForPlugDetailPage.tsx +47 -82
  19. package/src/modules/randomTimeForPlug/RandomTimeForPlugPage.tsx +58 -67
  20. package/src/modules/randomTimeForPlug/Summary.tsx +62 -58
  21. package/src/modules/randomTimingForLight/RandomTimingForLightDetailPage.tsx +2 -2
  22. package/src/modules/sleepWakeUp/SleepWakeUpDetailPage.tsx +35 -28
  23. package/src/modules/sleepWakeUp/SleepWakeUpPage.tsx +1 -1
  24. package/src/modules/swithInching/SwithInching.tsx +3 -2
  25. package/src/modules/timeSchedule/Interface.ts +3 -1
  26. package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +175 -190
  27. package/src/modules/timeSchedule/TimeSchedulePage.tsx +55 -54
  28. package/src/modules/timeSchedule/components/ManuaSettings.tsx +11 -10
  29. package/src/modules/timeSchedule/components/ScheduleCard.tsx +47 -63
  30. package/src/modules/timeSchedule/components/Summary.tsx +63 -59
  31. package/src/modules/timer/TimerAction.ts +22 -3
  32. package/src/modules/timer/TimerPage.tsx +120 -117
  33. package/src/modules/swithInching/pickerView.tsx +0 -91
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/group-ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.0.73",
7
+ "version": "1.0.76",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -102,7 +102,7 @@ const BiorhythmEditPage = () => {
102
102
 
103
103
  const canSaveMoodData = useMemo(() =>{
104
104
  return state.planData.name.length > 0 && state.planData.name.length < 33 && !nameRepeatFlag && !checkBiorhythmDataChanged && !minimumTipEnable()
105
- }, [nameRepeatFlag, state.planData.name, checkBiorhythmDataChanged])
105
+ }, [nameRepeatFlag, state.planData.name, checkBiorhythmDataChanged, minimumTipEnable()])
106
106
 
107
107
  return (
108
108
  <Page
@@ -265,10 +265,10 @@ export default class Progress extends Component<any> {
265
265
  }
266
266
  item.time = changeMinutes
267
267
  this.setState({ iconDataList: [].concat(iconDataList) }, () => {
268
- this.playTimeChangeCallBack(item.index, Math.round(changeMinutes))
268
+ this.playTimeChangeCallBack(item.index ?? item.id, Math.round(changeMinutes))
269
269
  })
270
270
  } else {
271
- this.playTimeChangeCallBack(item.index, Math.round(item.time))
271
+ this.playTimeChangeCallBack(item.index ?? item.id, Math.round(item.time))
272
272
  }
273
273
  }}
274
274
  />
@@ -12,6 +12,7 @@ import Spacer from "@ledvance/base/src/components/Spacer";
12
12
  import InfoText from "@ledvance/base/src/components/InfoText";
13
13
 
14
14
  const { convertX: cx, height, width } = Utils.RatioUtils
15
+ const { withTheme } = Utils.ThemeUtils
15
16
 
16
17
  export interface EnergyConsumptionChartProps {
17
18
  addEleDpCode: string
@@ -21,37 +22,48 @@ export interface EnergyConsumptionChartProps {
21
22
  over7Days?: boolean
22
23
  }
23
24
 
24
- const EnergyConsumptionChart = () => {
25
- const props = useRoute().params as EnergyConsumptionChartProps
25
+ const EnergyConsumptionChart = (props: { theme?: any }) => {
26
+ const params = useRoute().params as EnergyConsumptionChartProps
26
27
  const computeNum = Platform.OS === 'ios' && 180 || 130
28
+
29
+ const styles = StyleSheet.create({
30
+ listEmptyView: {
31
+ alignItems: 'center',
32
+ },
33
+ listEmptyImage: {
34
+ width: cx(200),
35
+ height: cx(200),
36
+ },
37
+ })
38
+
27
39
  return (
28
40
  <Page
29
41
  backText={I18n.getLang('consumption_data_annual_bar_chart_system_back_text')}
30
- headlineText={props.headlineText}
31
- headlineIcon={props.chartData?.length ? res.download_icon : undefined}
42
+ headlineText={params.headlineText}
43
+ headlineIcon={params.chartData?.length ? res.download_icon : undefined}
32
44
  onHeadlineIconClick={() => {
33
- exportFile(props.chartData)
45
+ exportFile(params.chartData)
34
46
  }}
35
47
  showGreenery={false}
36
48
  greeneryIcon={res.energy_consumption_greenery}
37
49
  >
38
50
  <View style={{ marginHorizontal: cx(24) }}>
39
51
  {
40
- props.over7Days ? (
52
+ params.over7Days ? (
41
53
  <View style={styles.listEmptyView}>
42
54
  <Spacer height={cx(26)} />
43
55
  <Image
44
56
  style={styles.listEmptyImage}
45
57
  source={{ uri: res.ldv_timer_empty }} />
46
58
  <Spacer height={cx(14)} />
47
- <InfoText
59
+ <InfoText
48
60
  text={I18n.getLang('energyconsumption_hourlylimit')}
49
61
  icon={res.ic_info}
50
- contentColor='#000'
62
+ contentColor={props.theme.global.fontColor}
51
63
  />
52
64
  </View>
53
65
  ) : (
54
- <BarChart height={height - cx(computeNum)} data={props.chartData} width={width - cx(80)} />
66
+ <BarChart height={height - cx(computeNum)} data={params.chartData} width={width - cx(80)} />
55
67
  )
56
68
  }
57
69
  </View>
@@ -59,24 +71,4 @@ const EnergyConsumptionChart = () => {
59
71
  )
60
72
  }
61
73
 
62
- const styles = StyleSheet.create({
63
- listEmptyView: {
64
- alignItems: 'center',
65
- },
66
- listEmptyImage: {
67
- width: cx(200),
68
- height: cx(200),
69
- },
70
- listEmptyTextIcon: {
71
- width: cx(16),
72
- height: cx(16),
73
- tintColor: '#000',
74
- },
75
- listEmptyText: {
76
- color: '#000',
77
- fontSize: cx(12),
78
- fontFamily: 'helvetica_neue_lt_std_roman',
79
- },
80
- });
81
-
82
- export default EnergyConsumptionChart
74
+ export default withTheme(EnergyConsumptionChart)
@@ -74,7 +74,7 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
74
74
  return
75
75
  }
76
76
  const promiseGroup = params.deviceIdGroup.map(devId => getDataWithSpecified(devId, params.addEleDpCode, startDay, endDay, 'sum').catch(error => ({ error })))
77
- state.loading = true
77
+ state.loading = true
78
78
  const res = await Promise.all(promiseGroup);
79
79
  state.loading = false
80
80
  // @ts-ignore
@@ -203,7 +203,7 @@ const EnergyConsumptionDetail = (props: { theme?: any }) => {
203
203
  paddingHorizontal: cx(10),
204
204
  paddingVertical: cx(8),
205
205
  marginTop: cx(8),
206
- backgroundColor: props.theme.button.active,
206
+ backgroundColor: props.theme.button.primary,
207
207
  alignItems: 'center',
208
208
  justifyContent: 'center'
209
209
  }
@@ -249,7 +249,7 @@ const EnergyConsumptionPage = (props: { theme?: any }) => {
249
249
  paddingHorizontal: cx(10),
250
250
  paddingVertical: cx(8),
251
251
  marginTop: cx(8),
252
- backgroundColor: props.theme.button.active,
252
+ backgroundColor: props.theme.button.primary,
253
253
  alignItems: 'center',
254
254
  justifyContent: 'center',
255
255
  },
@@ -80,7 +80,7 @@ const OverView = (props: OverViewProps) => {
80
80
  </View>
81
81
  <Image
82
82
  source={res.energy_consumption_right}
83
- style={{ width: cx(16), height: cx(16), marginLeft: cx(8) }}
83
+ style={{ width: cx(16), height: cx(16), marginLeft: cx(8), tintColor: props.theme.global.secondFontColor }}
84
84
  />
85
85
  </View>
86
86
  </View>
@@ -21,6 +21,7 @@ import LdvPickerView from "@ledvance/base/src/components/ldvPickerView";
21
21
 
22
22
  const {parseTimer} = Utils.TimeUtils
23
23
  const {convertX: cx} = Utils.RatioUtils;
24
+ const { withTheme } = Utils.ThemeUtils
24
25
 
25
26
  interface FixedTimeDetailParam extends FixedTimeParam {
26
27
  mode: 'add' | 'edit',
@@ -42,7 +43,7 @@ const newFixedTimeItem = (): FixedTimeItem => {
42
43
  }
43
44
  }
44
45
 
45
- const FixedTimeForPlugDetailPage = () => {
46
+ const FixedTimeForPlugDetailPage = (props: { theme?: any }) => {
46
47
  const navigation = useNavigation()
47
48
  const params = useRoute().params as FixedTimeDetailParam
48
49
  const initItem = newFixedTimeItem();
@@ -129,6 +130,50 @@ const FixedTimeForPlugDetailPage = () => {
129
130
  }
130
131
  })
131
132
  }
133
+
134
+ const styles = StyleSheet.create({
135
+ cardContainer: {
136
+ marginHorizontal: cx(24)
137
+ },
138
+ itemTitle: {
139
+ color: props.theme.global.fontColor,
140
+ fontSize: cx(16),
141
+ fontWeight: 'bold',
142
+ fontFamily: 'helvetica_neue_lt_std_bd',
143
+ },
144
+ applyContent: {
145
+ backgroundColor: props.theme.container.background,
146
+ borderRadius: 4,
147
+ minHeight: cx(55),
148
+ flex: 1,
149
+ justifyContent: 'center',
150
+ paddingHorizontal: cx(10),
151
+ paddingTop: cx(10)
152
+ },
153
+ applyItem: {
154
+ paddingLeft: cx(5),
155
+ flexDirection: 'row',
156
+ justifyContent: 'space-between',
157
+ alignItems: 'center',
158
+ backgroundColor: props.theme.global.background,
159
+ height: cx(35),
160
+ },
161
+ rightTitle: {
162
+ color: props.theme.tag.fontColor,
163
+ paddingLeft: cx(12),
164
+ paddingRight: cx(12),
165
+ fontSize: cx(10),
166
+ textAlign: 'center',
167
+ alignSelf: 'flex-start'
168
+ },
169
+ filletCorner: {
170
+ flexDirection: 'row',
171
+ backgroundColor: props.theme.tag.background,
172
+ borderRadius: cx(16),
173
+ alignSelf: 'flex-start'
174
+ }
175
+ })
176
+
132
177
  return (
133
178
  <Page
134
179
  backText={I18n.getLang('fixedTimeCycle_socket_headline')}
@@ -158,7 +203,8 @@ const FixedTimeForPlugDetailPage = () => {
158
203
  {/* pick */}
159
204
  <TimerPicker
160
205
  itemTextColor='#aeadb5'
161
- style={{paddingVertical: cx(0), marginVertical: cx(0)}}
206
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
207
+ pickerFontColor={props.theme.global.fontColor}
162
208
  is12Hours={!params.is24Hour}
163
209
  startTime={state.item.startTime}
164
210
  endTime={state.item.endTime}
@@ -174,7 +220,9 @@ const FixedTimeForPlugDetailPage = () => {
174
220
  state.item.weeks[rawIndex] = state.item.weeks[rawIndex] === 1 ? 0 : 1
175
221
  }}/>
176
222
  <Spacer/>
177
- <Text style={styles.cardContainer}>{loopText(state.item.weeks, parseTimer(state.item.startTime * 60))}</Text>
223
+ <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
224
+ {loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
225
+ </Text>
178
226
  <Spacer/>
179
227
  {/*Apply for */}
180
228
  <View style={styles.cardContainer}>
@@ -182,15 +230,17 @@ const FixedTimeForPlugDetailPage = () => {
182
230
  <Spacer height={cx(10)}/>
183
231
  <View style={styles.applyContent}>
184
232
  {state.item.channel === undefined ?
185
- <Text>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text> :
233
+ <Text style={{color: props.theme.global.fontColor}}>
234
+ {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
235
+ </Text> :
186
236
  <View style={[styles.applyItem, {marginBottom: cx(10), borderRadius: 4}]}>
187
- <Text style={{color: '#000'}}>{params.channels[state.item.channel]}</Text>
237
+ <Text style={{color: props.theme.global.fontColor}}>{params.channels[state.item.channel]}</Text>
188
238
  {params.channels.length > 1 && <TouchableOpacity
189
239
  onPress={() => {
190
240
  state.item.channel = undefined
191
241
  }}
192
242
  style={{paddingHorizontal: cx(5)}}>
193
- <Image style={{width: cx(16), height: cx(16)}} source={res.ic_arrows_nav_clear}/>
243
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.ic_arrows_nav_clear}/>
194
244
  </TouchableOpacity>}
195
245
  </View>
196
246
  }
@@ -207,8 +257,8 @@ const FixedTimeForPlugDetailPage = () => {
207
257
  state.item.channel = index
208
258
  }}
209
259
  >
210
- <Text style={{color: '#000'}}>{item}</Text>
211
- <Image style={{width: cx(16), height: cx(16)}} source={res.device_panel_timer_add}/>
260
+ <Text style={{color: props.theme.global.fontColor}}>{item}</Text>
261
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor}} source={res.device_panel_timer_add}/>
212
262
  </TouchableOpacity>
213
263
  )
214
264
  })}
@@ -217,11 +267,11 @@ const FixedTimeForPlugDetailPage = () => {
217
267
  <View style={styles.cardContainer}>
218
268
  <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline4_text')}</Text>
219
269
  {!isTimeEffective && <View style={{ flexDirection: 'row', alignItems: 'center' }}>
220
- <Image style={{ width: cx(16), height: cx(16), tintColor: 'rgb(255,149,0)' }} source={res.ic_warning_amber} />
221
- <Text style={{ fontSize: cx(12), color: 'rgb(255,149,0)' }}>{I18n.getLang('addTimeCycle_warning_text')}</Text>
270
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.warning }} source={res.ic_warning_amber} />
271
+ <Text style={{ fontSize: cx(12), color: props.theme.global.warning }}>{I18n.getLang('addTimeCycle_warning_text')}</Text>
222
272
  </View>}
223
273
  <View >
224
- <Text style={{ color: '#000', marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text')}</Text>
274
+ <Text style={{ color: props.theme.global.fontColor, marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text')}</Text>
225
275
  <LdvPickerView
226
276
  hour={state.onHour}
227
277
  minute={state.onMinute}
@@ -231,7 +281,9 @@ const FixedTimeForPlugDetailPage = () => {
231
281
  />
232
282
  </View>
233
283
  <View>
234
- <Text style={{ color: '#000', marginVertical: cx(10) }}>{I18n.getLang('addTimeCycle_settings_sec_text2')}</Text>
284
+ <Text style={{ color: props.theme.global.fontColor, marginVertical: cx(10) }}>
285
+ {I18n.getLang('addTimeCycle_settings_sec_text2')}
286
+ </Text>
235
287
  <LdvPickerView
236
288
  hour={state.offHour}
237
289
  minute={state.offMinute}
@@ -244,7 +296,7 @@ const FixedTimeForPlugDetailPage = () => {
244
296
  <Spacer/>
245
297
  {/* summary */}
246
298
  <Summary
247
- frequency={loopText(state.item.weeks)}
299
+ frequency={loopText(state.item.weeks, parseTimer(state.item.endTime * 60))}
248
300
  time={params.is24Hour ?
249
301
  `${parseTimer(state.item.startTime * 60)} - ${parseTimer(state.item.endTime * 60)}`
250
302
  :
@@ -253,7 +305,7 @@ const FixedTimeForPlugDetailPage = () => {
253
305
  actions={<View style={{ flex: 1 }}>
254
306
  <>
255
307
  <View>
256
- <Text style={{ fontSize: cx(12), color: '#000000' }}>
308
+ <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
257
309
  {I18n.formatValue('feature_summary_action_txt_4', `${Number(state.onHour)}`, `${Number(state.onMinute)}`)}
258
310
  </Text>
259
311
  </View>
@@ -265,7 +317,7 @@ const FixedTimeForPlugDetailPage = () => {
265
317
  </>
266
318
  <>
267
319
  <View>
268
- <Text style={{ fontSize: cx(12), color: '#000000' }}>
320
+ <Text style={{ fontSize: cx(12), color: props.theme.global.fontColor }}>
269
321
  {I18n.formatValue('feature_summary_action_txt_6', `${Number(state.offHour)}`, `${Number(state.offMinute)}`)}
270
322
  </Text>
271
323
  </View>
@@ -291,75 +343,4 @@ const FixedTimeForPlugDetailPage = () => {
291
343
  )
292
344
  }
293
345
 
294
- const styles = StyleSheet.create({
295
- cardContainer: {
296
- marginHorizontal: cx(24)
297
- },
298
- itemTitle: {
299
- color: '#000',
300
- fontSize: cx(16),
301
- fontWeight: 'bold',
302
- fontFamily: 'helvetica_neue_lt_std_bd',
303
- },
304
- applyContent: {
305
- backgroundColor: '#f6f6f6',
306
- borderRadius: 4,
307
- minHeight: cx(55),
308
- flex: 1,
309
- justifyContent: 'center',
310
- paddingHorizontal: cx(10),
311
- paddingTop: cx(10)
312
- },
313
- applyItem: {
314
- paddingLeft: cx(5),
315
- flexDirection: 'row',
316
- justifyContent: 'space-between',
317
- alignItems: 'center',
318
- backgroundColor: '#fff',
319
- height: cx(35),
320
- },
321
- summaryContainer: {
322
- flexDirection: 'row',
323
- justifyContent: 'flex-start',
324
- marginBottom: cx(10)
325
- },
326
- summaryLeft: {
327
- flexDirection: 'row',
328
- justifyContent: 'flex-start',
329
- alignItems: 'center',
330
- },
331
- summaryImg: {
332
- width: cx(12),
333
- height: cx(12),
334
- marginRight: cx(6)
335
- },
336
- leftTitle: {
337
- fontSize: cx(14),
338
- color: '#000'
339
- },
340
- summaryRight: {
341
- flexDirection: 'column',
342
- marginLeft: cx(21),
343
- borderRadius: cx(16),
344
- backgroundColor: '#cbcbcb',
345
- },
346
- rightItem: {
347
- paddingHorizontal: cx(12),
348
- color: '#000',
349
- },
350
- rightTitle: {
351
- paddingLeft: cx(12),
352
- paddingRight: cx(12),
353
- fontSize: cx(10),
354
- textAlign: 'center',
355
- alignSelf: 'flex-start'
356
- },
357
- filletCorner: {
358
- flexDirection: 'row',
359
- backgroundColor: '#cbcbcb',
360
- borderRadius: cx(16),
361
- alignSelf: 'flex-start'
362
- }
363
- })
364
-
365
- export default FixedTimeForPlugDetailPage
346
+ export default withTheme(FixedTimeForPlugDetailPage)
@@ -12,11 +12,13 @@ import {cloneDeep} from "lodash";
12
12
  import Spacer from "@ledvance/base/src/components/Spacer";
13
13
  import {Utils} from "tuya-panel-kit";
14
14
  import ItemCard from "./ItemCard";
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 = 10
18
20
 
19
- const FixedTimeForPlugPage = () => {
21
+ const FixedTimeForPlugPage = (props: { theme?: any}) => {
20
22
  const devInfo = useDeviceInfo()
21
23
  const navigation = useNavigation()
22
24
  const params = useRoute().params as FixedTimeParam
@@ -58,17 +60,42 @@ const FixedTimeForPlugPage = () => {
58
60
  }
59
61
  }, [fixedTimeList])
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
+ })
90
+
61
91
  const renderList = () => {
62
92
  return (
63
93
  <ScrollView nestedScrollEnabled={true}>
64
- <Text style={{
65
- color: '#000',
66
- marginLeft: cx(24),
67
- }}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
94
+ <Text style={styles.execTip}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
68
95
  <Spacer height={cx(10)}/>
69
96
  {isMaxNum && <View style={{marginHorizontal: cx(24), flexDirection: 'row'}}>
70
- <Image style={{width: cx(16), height: cx(16), tintColor: '#ff9500'}} source={res.ic_warning_amber}/>
71
- <Text>{I18n.getLang('randomtimecycle_warning_max_number_text')}</Text>
97
+ <Image style={styles.maxImg} source={res.ic_warning_amber}/>
98
+ <Text style={styles.maxTip}>{I18n.getLang('randomtimecycle_warning_max_number_text')}</Text>
72
99
  </View>}
73
100
  <FlatList
74
101
  data={fixedTimeList}
@@ -103,20 +130,13 @@ const FixedTimeForPlugPage = () => {
103
130
  style={styles.emptyImage}
104
131
  source={{uri: res.ldv_timer_empty}}
105
132
  resizeMode="contain"/>
106
- <View
107
- style={{
108
- marginHorizontal: cx(24),
109
- marginTop: cx(30),
110
- flexDirection: 'row',
111
- alignItems: 'center',
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('fixedTimeCycle_information_text')}</Text>
119
- </View>
133
+ <InfoText
134
+ style={{width: 'auto', alignItems: 'center'}}
135
+ icon={res.device_panel_schedule_alert}
136
+ text={I18n.getLang('fixedTimeCycle_information_text')}
137
+ textStyle={{flex: undefined}}
138
+ contentColor={props.theme.global.secondFontColor}
139
+ />
120
140
  <View
121
141
  style={{
122
142
  height: cx(36),
@@ -124,7 +144,7 @@ const FixedTimeForPlugPage = () => {
124
144
  marginVertical: cx(25),
125
145
  marginHorizontal: cx(24),
126
146
  borderRadius: cx(6),
127
- backgroundColor: '#f60',
147
+ backgroundColor: props.theme.button.primary,
128
148
  }}
129
149
  >
130
150
  <TouchableOpacity
@@ -135,7 +155,7 @@ const FixedTimeForPlugPage = () => {
135
155
  }}
136
156
  onPress={() => onAddOrEditItem('add')}
137
157
  >
138
- <Text style={{fontSize: cx(12), fontWeight: 'bold', color: '#fff', textAlign: 'center'}}>
158
+ <Text style={{fontSize: cx(12), fontWeight: 'bold', color: props.theme.button.fontColor, textAlign: 'center'}}>
139
159
  {I18n.getLang('fixedTimeCycle_bttn_text')}
140
160
  </Text>
141
161
  </TouchableOpacity>
@@ -158,38 +178,4 @@ const FixedTimeForPlugPage = () => {
158
178
  )
159
179
  }
160
180
 
161
- const styles = StyleSheet.create({
162
- bg: {
163
- marginTop: topBarHeight,
164
- flex: 1,
165
- },
166
- emptyListCon: {
167
- justifyContent: 'center',
168
- alignItems: 'center',
169
- marginTop: cx(30),
170
- },
171
- emptyImage: {
172
- width: cx(225),
173
- height: cx(198)
174
- },
175
- emptyNoTime: {
176
- fontSize: cx(12),
177
- color: '#000'
178
- },
179
- emptyTimeTip: {
180
- fontSize: cx(12),
181
- lineHeight: cx(17),
182
- marginTop: cx(6),
183
- width: '76%',
184
- textAlign: 'center'
185
- },
186
- listContainer: {
187
- bottom: cx(74)
188
- },
189
- categoryList: {
190
- marginHorizontal: cx(24),
191
- marginBottom: cx(12),
192
- },
193
- })
194
-
195
- export default FixedTimeForPlugPage
181
+ export default withTheme(FixedTimeForPlugPage)
@@ -8,9 +8,11 @@ import {parseHour12} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
8
8
  import {FixedTimeItem} from "./FixedTimeForPlugActon";
9
9
 
10
10
  const {convertX: cx} = Utils.RatioUtils
11
+ const { withTheme } = Utils.ThemeUtils
11
12
  const {parseTimer} = Utils.TimeUtils
12
13
 
13
14
  export interface ItemCardProps {
15
+ theme?: any
14
16
  item: FixedTimeItem,
15
17
  is24Hour?: boolean,
16
18
  onSwitch: (enable: boolean) => void
@@ -19,8 +21,33 @@ export interface ItemCardProps {
19
21
 
20
22
  const ItemCard = (props: ItemCardProps) => {
21
23
  const {item, is24Hour, onSwitch, onPress} = props
22
- // 判断是否关闭
24
+ // 判断是否关闭
23
25
  const closed = getIsClosed(item)
26
+
27
+ const styles = StyleSheet.create({
28
+ itemCard: {
29
+ marginHorizontal: cx(24),
30
+ paddingHorizontal: cx(16),
31
+ },
32
+ switchLine: {
33
+ flexDirection: 'row',
34
+ alignItems: 'center',
35
+ },
36
+ time: {
37
+ flex: 1,
38
+ color: props.theme.global.fontColor,
39
+ fontSize: cx(16),
40
+ fontWeight: 'bold',
41
+ fontFamily: 'helvetica_neue_lt_std_bd',
42
+ },
43
+ switchBtn: {},
44
+ loopText: {
45
+ color: props.theme.global.fontColor,
46
+ fontSize: cx(14),
47
+ fontFamily: 'helvetica_neue_lt_std_roman',
48
+ },
49
+ })
50
+
24
51
  return (
25
52
  <Card style={styles.itemCard} onPress={onPress}>
26
53
  <Spacer height={cx(16)}/>
@@ -46,28 +73,4 @@ const ItemCard = (props: ItemCardProps) => {
46
73
  )
47
74
  }
48
75
 
49
- const styles = StyleSheet.create({
50
- itemCard: {
51
- marginHorizontal: cx(24),
52
- paddingHorizontal: cx(16),
53
- },
54
- switchLine: {
55
- flexDirection: 'row',
56
- alignItems: 'center',
57
- },
58
- time: {
59
- flex: 1,
60
- color: '#000',
61
- fontSize: cx(16),
62
- fontWeight: 'bold',
63
- fontFamily: 'helvetica_neue_lt_std_bd',
64
- },
65
- switchBtn: {},
66
- loopText: {
67
- color: '#000',
68
- fontSize: cx(14),
69
- fontFamily: 'helvetica_neue_lt_std_roman',
70
- },
71
- })
72
-
73
- export default ItemCard
76
+ export default withTheme(ItemCard)