@ledvance/ui-biz-bundle 1.1.136 → 1.1.137
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
CHANGED
|
@@ -206,7 +206,6 @@ export function dp2Obj(dp: string): BiorhythmBean {
|
|
|
206
206
|
enabled: p === '1',
|
|
207
207
|
}
|
|
208
208
|
})
|
|
209
|
-
repeatPeriod.sort((a, b) => a.index - b.index)
|
|
210
209
|
dpCopy = dpCopy.slice(2)
|
|
211
210
|
// 节点个数 (每个节点长度18),最多8个节点
|
|
212
211
|
hex2Int(dpCopy.slice(0, 2))
|
|
@@ -371,9 +370,8 @@ function obj2Dp(obj: BiorhythmBean): string {
|
|
|
371
370
|
const versionHex = '00'
|
|
372
371
|
const enableHex = obj.enable ? '01' : '00'
|
|
373
372
|
const gradientHex = obj.gradient === BiorhythmGradientType.EntireGradient ? '00' : '0F'
|
|
374
|
-
const newRepeatPeriod = [obj.repeatPeriod[obj.repeatPeriod.length - 1], ...obj.repeatPeriod.slice(0, -1)]
|
|
375
373
|
const repeatPeriodHex = parseInt(
|
|
376
|
-
|
|
374
|
+
obj.repeatPeriod
|
|
377
375
|
.map(p => (p.enabled ? '1' : '0'))
|
|
378
376
|
.reverse()
|
|
379
377
|
.join(''),
|
|
@@ -21,6 +21,7 @@ import I18n from '@ledvance/base/src/i18n'
|
|
|
21
21
|
import res from '@ledvance/base/src/res'
|
|
22
22
|
import { ui_biz_routerKey } from "../../navigation/Routers";
|
|
23
23
|
import { cctToColor } from '@ledvance/base/src/utils/cctUtils'
|
|
24
|
+
import { setDataSource } from '@ledvance/base/src/components/weekSelect'
|
|
24
25
|
import { BiorhythmEditPageParams } from './BiorhythmEditPage'
|
|
25
26
|
import { useBiorhythm } from './BiorhythmActions'
|
|
26
27
|
import { convertMinutesTo12HourFormat, showDialog as showCommonDialog } from '@ledvance/base/src/utils/common'
|
|
@@ -189,7 +190,11 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
useEffect(() => {
|
|
192
|
-
const weeks =
|
|
193
|
+
const weeks: string[] = setDataSource(
|
|
194
|
+
biorhythm.repeatPeriod.map(item => {
|
|
195
|
+
return item?.enabled ? 1 : 0
|
|
196
|
+
})).filter(item => item.enabled)
|
|
197
|
+
.map(item => item.title)
|
|
193
198
|
|
|
194
199
|
if (weeks.length > 0) {
|
|
195
200
|
if (weeks.length === 7) {
|
|
@@ -232,21 +237,20 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
232
237
|
const sunHomeText = string => {
|
|
233
238
|
const text = string.split('SUN@HOME')
|
|
234
239
|
return text?.length === 1 && <Text style={{ fontSize: cx(14), color: props.theme?.global.fontColor }}>{text[0]}</Text> ||
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
</Text>
|
|
240
|
+
<Text style={{
|
|
241
|
+
fontSize: cx(14),
|
|
242
|
+
flexDirection: 'row',
|
|
243
|
+
}}>
|
|
244
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{text[0]}</Text>
|
|
245
|
+
<Text onPress={openLink}
|
|
246
|
+
style={{
|
|
247
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
248
|
+
color: props.theme?.button.primary,
|
|
249
|
+
textDecorationLine: 'underline',
|
|
250
|
+
flexWrap: 'wrap',
|
|
251
|
+
}}>SUN@HOME</Text>
|
|
252
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{text[1]}</Text>
|
|
253
|
+
</Text>
|
|
250
254
|
}
|
|
251
255
|
|
|
252
256
|
const randomIcon = () => {
|
|
@@ -448,66 +452,66 @@ const BiorhythmPage = (props: { theme?: ThemeType }) => {
|
|
|
448
452
|
marginTop: cx(26),
|
|
449
453
|
}}>
|
|
450
454
|
{state.planList.length === 8 && <View
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
455
|
+
style={{ marginVertical: cx(10), flexDirection: 'row', alignItems: 'center', width: width - cx(48) }}>
|
|
456
|
+
<Image style={{ width: cx(16), height: cx(16), tintColor: props.theme?.global.warning }} source={{ uri: res.ic_warning_amber }} />
|
|
457
|
+
<Text
|
|
458
|
+
style={{
|
|
459
|
+
flexWrap: 'wrap',
|
|
460
|
+
fontSize: cx(12),
|
|
461
|
+
color: props.theme?.global.fontColor
|
|
462
|
+
}}>{I18n.getLang('add_new_trigger_time_warning_max_number_text')}</Text>
|
|
459
463
|
</View>}
|
|
460
464
|
{state.planList.length < 8 &&
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
465
|
+
<>
|
|
466
|
+
<Text
|
|
467
|
+
style={{
|
|
468
|
+
fontSize: cx(16),
|
|
469
|
+
fontWeight: 'bold',
|
|
470
|
+
color: props.theme?.global.fontColor,
|
|
471
|
+
}}>{I18n.getLang('bio_ryhthm_default_subheadline_text')}</Text>
|
|
472
|
+
<TouchableOpacity
|
|
473
|
+
onPress={() => {
|
|
474
|
+
const ids: number[] = state.planList.map(p => p.index)
|
|
475
|
+
const newPlan: Plan = {
|
|
476
|
+
index: Math.max(...ids) + 1,
|
|
477
|
+
icon: res.rhythm_icon1,
|
|
478
|
+
time: 0,
|
|
479
|
+
name: '',
|
|
480
|
+
colorTemperature: 0,
|
|
481
|
+
brightness: 100,
|
|
482
|
+
action: [
|
|
483
|
+
{
|
|
484
|
+
uri: 'model/attribute/set/LightCtrl/ColorTemperature',
|
|
485
|
+
startValue: `${colorTemperatureValue(0)}`,
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
uri: 'model/attribute/set/LightCtrl/Brightness',
|
|
489
|
+
startValue: '100',
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
enable: true,
|
|
493
|
+
iconId: randomIcon(),
|
|
494
|
+
}
|
|
495
|
+
const editPageParams: BiorhythmEditPageParams = {
|
|
496
|
+
planData: newPlan,
|
|
497
|
+
isAdd: true,
|
|
498
|
+
onPlanEdited,
|
|
499
|
+
onPlanDelete,
|
|
500
|
+
minimumEnable,
|
|
501
|
+
nameRepeat,
|
|
502
|
+
iconIdList: state.planList?.map(item => {
|
|
503
|
+
return item.iconId
|
|
504
|
+
}),
|
|
505
|
+
isMixRGBWLamp: !!params.isMixLight,
|
|
506
|
+
isSupportTemperature: params.isSupportTemperature,
|
|
507
|
+
isSupportBrightness: params.isSupportBrightness,
|
|
508
|
+
showDeleteBtn
|
|
509
|
+
}
|
|
510
|
+
navigation.navigate(ui_biz_routerKey.bi_biz_biological_edit, editPageParams)
|
|
511
|
+
}}>
|
|
512
|
+
<Image source={{ uri: res.biorhythom_add }} style={{ height: cx(24), width: cx(24), tintColor: props.theme?.icon.primary }} />
|
|
513
|
+
</TouchableOpacity>
|
|
514
|
+
</>
|
|
511
515
|
}
|
|
512
516
|
</View>
|
|
513
517
|
<FlatList
|