@ledvance/ui-biz-bundle 1.1.83 → 1.1.85

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/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.83",
7
+ "version": "1.1.85",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Platform, View, StyleSheet, Image, Text } from "react-native";
2
+ import { Platform, View, StyleSheet, Image } from "react-native";
3
3
  import { useRoute } from '@react-navigation/core'
4
4
  import Page from "@ledvance/base/src/components/Page";
5
5
  import res from "@ledvance/base/src/res";
@@ -9,6 +9,7 @@ import BarChart from "./component/BarChart";
9
9
  import { exportFile } from "@ledvance/base/src/utils/common";
10
10
  import { OverviewItem } from "./EnergyConsumptionPage";
11
11
  import Spacer from "@ledvance/base/src/components/Spacer";
12
+ import InfoText from "@ledvance/base/src/components/InfoText";
12
13
 
13
14
  const { convertX: cx, height, width } = Utils.RatioUtils
14
15
 
@@ -23,12 +24,11 @@ export interface EnergyConsumptionChartProps {
23
24
  const EnergyConsumptionChart = () => {
24
25
  const props = useRoute().params as EnergyConsumptionChartProps
25
26
  const computeNum = Platform.OS === 'ios' && 180 || 130
26
-
27
27
  return (
28
28
  <Page
29
29
  backText={I18n.getLang('consumption_data_annual_bar_chart_system_back_text')}
30
30
  headlineText={props.headlineText}
31
- headlineIcon={props.chartData?.length && res.download_icon}
31
+ headlineIcon={props.chartData?.length ? res.download_icon : undefined}
32
32
  onHeadlineIconClick={() => {
33
33
  exportFile(props.chartData)
34
34
  }}
@@ -44,13 +44,11 @@ const EnergyConsumptionChart = () => {
44
44
  style={styles.listEmptyImage}
45
45
  source={{ uri: res.ldv_timer_empty }} />
46
46
  <Spacer height={cx(14)} />
47
- <View style={{ flexDirection: 'row', alignItems: 'center' }}>
48
- <Image style={styles.listEmptyTextIcon} source={{ uri: res.ic_info }} />
49
- <Spacer width={cx(4)} height={0} />
50
- <Text style={styles.listEmptyText}>
51
- {I18n.getLang('energyconsumption_hourlylimit')}
52
- </Text>
53
- </View>
47
+ <InfoText
48
+ text={I18n.getLang('energyconsumption_hourlylimit')}
49
+ icon={res.ic_info}
50
+ contentColor='#000'
51
+ />
54
52
  </View>
55
53
  ) : (
56
54
  <BarChart height={height - cx(computeNum)} data={props.chartData} width={width - cx(80)} />
@@ -13,7 +13,7 @@ import {getDataWithSpecified, getDpResultByHour} from "@ledvance/base/src/models
13
13
  import {useDeviceId, useEngergyGeneration, useTimeZoneCity} from "@ledvance/base/src/models/modules/NativePropsSlice";
14
14
  import {cloneDeep, isEmpty} from "lodash";
15
15
  import {OverviewItem, PopupType} from "./EnergyConsumptionPage";
16
- import {exchangeNumber, localeNumber, loopsText} from '@ledvance/base/src/utils/common'
16
+ import {exchangeNumber, exportFile, localeNumber, loopsText} from '@ledvance/base/src/utils/common'
17
17
  import dayjs from "dayjs";
18
18
  import {ui_biz_routerKey} from "../../navigation/Routers";
19
19
  import {EnergyConsumptionChartProps} from "./EnergyConsumptionChart";
@@ -188,8 +188,10 @@ const EnergyConsumptionDetail = (props: {theme?: any}) => {
188
188
  <Page
189
189
  backText={I18n.getLang('consumption_data_annual_bar_chart_system_back_text')}
190
190
  headlineText={params.curMonth.key}
191
- headlineIcon={res.download_icon}
192
- onHeadlineIconClick={() => { }}
191
+ headlineIcon={state.overviewList.length ? res.download_icon : undefined}
192
+ onHeadlineIconClick={() => {
193
+ exportFile(state.overviewList)
194
+ }}
193
195
  showGreenery={false}
194
196
  greeneryIcon={res.energy_consumption_greenery}
195
197
  loading={state.loading}
@@ -246,9 +246,11 @@ export function useSceneStatusId(params: MoodPageParams): [number, (moodId: numb
246
246
  const devId = useDeviceId();
247
247
  const [sceneStatusId, setSceneStatusId] = useState(-1);
248
248
  if (!params.isSupportSceneStatus) {
249
- const setEmpty = useCallback(() => {
250
- return new Promise<any>(() => {});
251
- }, [])
249
+ const setEmpty = useCallback((moodId: number) => {
250
+ return new Promise<any>((resolve, _reject) => {
251
+ resolve(moodId)
252
+ });
253
+ }, []);
252
254
  return [sceneStatusId, setEmpty]
253
255
  }
254
256
  useEffect(() => {
@@ -278,7 +278,7 @@ const MoodPage = () => {
278
278
  moodInfo.secondaryLamp.id === moodItem.secondaryLamp.id &&
279
279
  (mainWork === WorkMode.Scene || secondaryWork === WorkMode.Scene) && !flagMode.flagMode && switchLed
280
280
  );
281
- } else if (params.isSupportSceneStatus) {
281
+ } else if (params.isSupportSceneStatus && sceneStatusId !== -1) {
282
282
  return sceneStatusId === moodItem.id && mainWork === WorkMode.Scene && !flagMode.flagMode && switchLed
283
283
  } else {
284
284
  return moodInfo.id === moodItem.id && mainWork === WorkMode.Scene && !flagMode.flagMode && switchLed