@ledvance/group-ui-biz-bundle 1.0.110 → 1.0.112
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
|
@@ -10,7 +10,7 @@ import { useReactive, useUpdateEffect } from "ahooks";
|
|
|
10
10
|
import { cloneDeep } from "lodash";
|
|
11
11
|
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
12
12
|
|
|
13
|
-
const { convertX: cx, height } = Utils.RatioUtils
|
|
13
|
+
const { convertX: cx, height, statusBarHeight } = Utils.RatioUtils
|
|
14
14
|
const { withTheme } = Utils.ThemeUtils
|
|
15
15
|
|
|
16
16
|
export const UnitList = [
|
|
@@ -57,23 +57,44 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
const getDescription = (string: string) => {
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
// 首先提取URL
|
|
61
|
+
const urlRegex = /(https?:\/\/[^\s]+)$/;
|
|
62
|
+
const urlMatch = string.match(urlRegex);
|
|
63
|
+
const url = urlMatch ? urlMatch[0] : '';
|
|
64
|
+
|
|
65
|
+
// 移除URL部分以处理正文文本
|
|
66
|
+
const textWithoutUrl = urlMatch
|
|
67
|
+
? string.slice(0, string.lastIndexOf(url)).trim()
|
|
68
|
+
: string;
|
|
69
|
+
|
|
70
|
+
// 分割文本但保留分隔符
|
|
71
|
+
const sentences:string[] = [];
|
|
72
|
+
const parts = textWithoutUrl.split(/([.:])/);
|
|
73
|
+
|
|
74
|
+
for (let i = 0; i < parts.length - 1; i += 2) {
|
|
75
|
+
if (i + 1 < parts.length) {
|
|
76
|
+
sentences.push(parts[i] + parts[i + 1]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<View>
|
|
82
|
+
{sentences.map((sentence, index) => (
|
|
83
|
+
<View key={index}>
|
|
84
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{sentence.trim()}</Text>
|
|
85
|
+
<Spacer />
|
|
86
|
+
</View>
|
|
87
|
+
))}
|
|
88
|
+
{url && (
|
|
89
|
+
<Text
|
|
90
|
+
style={{ textDecorationLine: 'underline', color: props.theme?.button.primary }}
|
|
91
|
+
onPress={() => openLink(url)}
|
|
92
|
+
>
|
|
93
|
+
{url}
|
|
94
|
+
</Text>
|
|
95
|
+
)}
|
|
96
|
+
</View>
|
|
97
|
+
);
|
|
77
98
|
}
|
|
78
99
|
|
|
79
100
|
useUpdateEffect(() =>{
|
|
@@ -224,7 +245,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
224
245
|
</View>
|
|
225
246
|
),
|
|
226
247
|
wrapperStyle: {
|
|
227
|
-
height: height - cx(40),
|
|
248
|
+
height: height - statusBarHeight - cx(40),
|
|
228
249
|
backgroundColor: props.theme?.global.background
|
|
229
250
|
},
|
|
230
251
|
footer: (<View style={{ backgroundColor: props.theme?.global.background}}></View>),
|
|
@@ -286,7 +307,7 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
286
307
|
<Text style={{ color: props.theme?.button.primary, fontSize: cx(16) }}>{props.confirmText}</Text>
|
|
287
308
|
</TouchableOpacity>
|
|
288
309
|
</View>
|
|
289
|
-
<View style={{ height: height - cx(100), paddingHorizontal: cx(16), backgroundColor: props.theme?.global.background }}>
|
|
310
|
+
<View style={{ height: height - statusBarHeight - cx(100), paddingHorizontal: cx(16), backgroundColor: props.theme?.global.background }}>
|
|
290
311
|
{getContent()}
|
|
291
312
|
</View>
|
|
292
313
|
</ScrollView>
|