@ledvance/group-ui-biz-bundle 1.0.95 → 1.0.96

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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/group-ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.0.95",
7
+ "version": "1.0.96",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -243,7 +243,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
243
243
  <Image
244
244
  source={res.energy_consumption_cash}
245
245
  resizeMode="contain"
246
- style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.active }}
246
+ style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.primary }}
247
247
  />
248
248
  </View>
249
249
  <View style={styles.priceNum}>
@@ -273,7 +273,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
273
273
  <Image
274
274
  source={res.energy_consumption_cash}
275
275
  resizeMode="contain"
276
- style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.active }}
276
+ style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.primary }}
277
277
  />
278
278
  </View>
279
279
  <View>
@@ -378,7 +378,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
378
378
  style={{
379
379
  height: cx(20),
380
380
  width: cx(20),
381
- tintColor: props.theme?.button.active,
381
+ tintColor: props.theme?.button.primary,
382
382
  }}
383
383
  />
384
384
  </View>
@@ -401,7 +401,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
401
401
  style={{
402
402
  height: cx(20),
403
403
  width: cx(20),
404
- tintColor: props.theme?.button.active,
404
+ tintColor: props.theme?.button.primary,
405
405
  }}
406
406
  />
407
407
  </TouchableOpacity>
@@ -420,7 +420,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
420
420
  <Image
421
421
  source={res.energy_consumption_cash}
422
422
  resizeMode="contain"
423
- style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.active }}
423
+ style={{ height: cx(20), width: cx(20), tintColor: props.theme?.button.primary }}
424
424
  />
425
425
  </View>
426
426
  <View>
@@ -59,7 +59,7 @@ const EnergyModal = (props: EnergyModalProps) => {
59
59
  <Text style={{ color: props.theme?.global.fontColor }}>{text[length - 4] + text[length - 3] + ':'}</Text>
60
60
  <Spacer />
61
61
  <Text
62
- style={{ textDecorationLine: 'underline', color: props.theme?.button.active }}
62
+ style={{ textDecorationLine: 'underline', color: props.theme?.button.primary }}
63
63
  onPress={() => openLink(`${text[length - 2]}:${text[length - 1]}${text[length]}`)}
64
64
  >
65
65
  {`${text[length - 2]}:${text[length - 1]}${text[length]}`}
@@ -47,6 +47,9 @@ export const useDreamMusicData = (musicOption: MusicPageParams) => {
47
47
  }
48
48
  dps[musicOption.workModeDp] = WorkMode.Music
49
49
  dps[musicOption.switchLedDp] = true
50
+ if (musicOption.colourLedDp && musicOption.isCeilingLight){
51
+ dps[musicOption.colourLedDp] = true
52
+ }
50
53
  }else{
51
54
  dps[musicOption.workModeDp] = v.lastWorkMode
52
55
  }
@@ -30,6 +30,8 @@ export interface MusicPageParams {
30
30
  musicDataDp: string
31
31
  dreamMusicDp?: string
32
32
  isMixLight?: boolean
33
+ isCeilingLight?: boolean
34
+ colourLedDp?: string
33
35
  }
34
36
 
35
37
  const MusicPage = (props: { theme?: ThemeType }) => {
@@ -24,10 +24,11 @@ export interface ItemCardProps<T> {
24
24
  is24Hour?: boolean,
25
25
  onSwitch: (enable: boolean) => void
26
26
  onPress: () => void
27
+ onLongPress: () => void
27
28
  }
28
29
 
29
30
  const ItemCard = <T, >(props: ItemCardProps<T>) => {
30
- const {item, is24Hour, onSwitch, onPress} = props
31
+ const {item, is24Hour, onSwitch, onPress, onLongPress} = props
31
32
  // 判断是否关闭
32
33
  const closed = getIsClosed(item)
33
34
 
@@ -56,7 +57,7 @@ const ItemCard = <T, >(props: ItemCardProps<T>) => {
56
57
  })
57
58
 
58
59
  return (
59
- <Card style={styles.itemCard} onPress={onPress}>
60
+ <Card style={styles.itemCard} onPress={onPress} onLongPress={onLongPress}>
60
61
  <Spacer height={cx(16)}/>
61
62
  <View style={styles.switchLine}>
62
63
  <Text style={styles.time}>
@@ -49,7 +49,7 @@ const SleepWakeUpPage = (props: {theme?: ThemeType}) => {
49
49
  sleepScheduleList: cloneDeep(sleepList),
50
50
  wakeUpScheduleList: cloneDeep(wakeUpList),
51
51
  filteredScheduleList: [] as any[],
52
- loading: false
52
+ loading: false
53
53
  })
54
54
 
55
55
  const isMaxNum = useMemo(() => {
@@ -193,7 +193,7 @@ const SleepWakeUpPage = (props: {theme?: ThemeType}) => {
193
193
  alignItems: 'center'
194
194
  },
195
195
  emptyBtn: {
196
- backgroundColor: props.theme?.button.active,
196
+ backgroundColor: props.theme?.button.primary,
197
197
  borderRadius: cx(5),
198
198
  paddingHorizontal: cx(15),
199
199
  paddingVertical: cx(10)
@@ -21,6 +21,7 @@ import ScheduleCard from './components/ScheduleCard';
21
21
  import { ui_biz_routerKey } from "../../navigation/Routers";
22
22
  import { ApplyForItem } from '@ledvance/base/src/utils/interface';
23
23
  import ThemeType from '@ledvance/base/src/config/themeType'
24
+ import { showDialog } from '@ledvance/base/src/utils/common';
24
25
 
25
26
  const { convertX: cx } = Utils.RatioUtils;
26
27
  const { withTheme } = Utils.ThemeUtils
@@ -186,6 +187,20 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
186
187
  onPress={() => {
187
188
  navigateToEdit('edit', item);
188
189
  }}
190
+ onLongPress={() =>{
191
+ showDialog({
192
+ method: 'confirm',
193
+ title: I18n.getLang('cancel_dialog_delete_item_timeschedule_titel'),
194
+ subTitle: I18n.getLang('cancel_dialog_delete_item_timeschedule_description'),
195
+ onConfirm: async (_, { close }) => {
196
+ state.loading = true;
197
+ close();
198
+ await modDeleteTimeSchedule('del', {...item, status: 2}, item.id.toString());
199
+ state.flag = Symbol()
200
+ state.loading = false;
201
+ },
202
+ });
203
+ }}
189
204
  />
190
205
  )}
191
206
  keyExtractor={item => item.id.toString()}
@@ -1,5 +1,13 @@
1
1
  import React, { memo, useMemo } from 'react';
2
- import { CeilingLightData, DeviceType, FanLightData, ManualSettingProps, StripLightData, directOptions, modeOptions } from '../Interface';
2
+ import {
3
+ CeilingLightData,
4
+ DeviceType,
5
+ FanLightData,
6
+ ManualSettingProps,
7
+ StripLightData,
8
+ directOptions,
9
+ modeOptions,
10
+ } from '../Interface';
3
11
  import { View } from 'react-native';
4
12
  import Card from '@ledvance/base/src/components/Card';
5
13
  import LampAdjustView from '@ledvance/base/src/components/LampAdjustView';
@@ -17,7 +25,7 @@ import { cloneDeep } from 'lodash';
17
25
  import { FanAdjustViewContent } from '@ledvance/base/src/components/FanAdjustView';
18
26
  import { cctToColor } from '@ledvance/base/src/utils/cctUtils';
19
27
  import {hsv2Hex, mapFloatToRange } from '@ledvance/base/src/utils';
20
- import { AdjustType } from '@ledvance/base/src/utils/interface';
28
+ import { AdjustType, ApplyForItem } from '@ledvance/base/src/utils/interface';
21
29
  const { convertX: cx } = Utils.RatioUtils;
22
30
  const { withTheme } = Utils.ThemeUtils
23
31
 
@@ -69,11 +77,13 @@ function ManualSettings(props: ManualSettingProps) {
69
77
 
70
78
  const lightSourceCard = useMemo(() => {
71
79
  const { deviceData } = state;
72
- const getBlockColor = () => {
73
- if (!deviceData.isColorMode) return cctToColor(deviceData.temperature)
74
- if (deviceData.isColorMode) {
75
- const s = Math.round(mapFloatToRange(deviceData.s / 100, 30, 100))
76
- return hsv2Hex(deviceData.h, s, 100)
80
+ const getBlockColor = (item: ApplyForItem) => {
81
+ if (['light', 'mainLight', 'secondaryLight'].includes(item.type)) {
82
+ if (!deviceData.isColorMode) return cctToColor(deviceData.temperature)
83
+ if (deviceData.isColorMode) {
84
+ const s = Math.round(mapFloatToRange(deviceData.s / 100, 30, 100))
85
+ return hsv2Hex(deviceData.h, s, 100)
86
+ }
77
87
  }
78
88
  return props.theme?.card?.background
79
89
  };
@@ -84,7 +94,7 @@ function ManualSettings(props: ManualSettingProps) {
84
94
  <Card style={{ marginHorizontal: cx(24) }}>
85
95
  <LdvSwitch
86
96
  title={item.name || item.key}
87
- color={getBlockColor()}
97
+ color={getBlockColor(item)}
88
98
  colorAlpha={1}
89
99
  enable={item.enable}
90
100
  setEnable={(enable: boolean) => {