@aks-dev/easyui 1.0.190 → 1.0.192

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 (72) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +23 -41
  2. package/dist/components/Badge/Badge.js +7 -16
  3. package/dist/components/DottedLine/DottedLine.js +15 -20
  4. package/dist/components/Echarts/EchartsView.js +40 -77
  5. package/dist/components/Echarts/demo.js +201 -0
  6. package/dist/components/Echarts/helper.js +1 -16
  7. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +49 -64
  8. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +30 -34
  9. package/dist/components/Hud/AlertView/AlertView.js +52 -66
  10. package/dist/components/Hud/Hud.js +8 -19
  11. package/dist/components/Hud/Loading/Loading.js +7 -25
  12. package/dist/components/Hud/PopoverView/PopoverView.js +5 -20
  13. package/dist/components/Hud/Scanner/Scanner.js +71 -99
  14. package/dist/components/Hud/Toast/Toast.js +6 -16
  15. package/dist/components/MenuView/MenuView.js +32 -73
  16. package/dist/components/Modal/Modal.js +0 -7
  17. package/dist/components/MutiPictureView/MutiPictureView.js +78 -88
  18. package/dist/components/PictureViewer/PictureViewer.js +11 -32
  19. package/dist/components/RefreshList/RefreshList.js +43 -52
  20. package/dist/components/RefreshList/demo.js +9 -0
  21. package/dist/components/RefreshList/demo1.js +27 -0
  22. package/dist/components/RefreshList/demo2.js +9 -0
  23. package/dist/components/RichText/RichText.js +23 -23
  24. package/dist/components/StickHeaderView/StickHeaderView.js +2 -12
  25. package/dist/components/StickHeaderView/demo.js +37 -0
  26. package/dist/components/TableCell/TableCell.js +37 -53
  27. package/dist/components/TextInputArea/TextInputArea.js +22 -31
  28. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +14 -31
  29. package/dist/index.js +0 -11
  30. package/dist/jsbridge/RNEasyui.js +1 -26
  31. package/dist/jsbridge/UpgradeModule.js +12 -21
  32. package/dist/jsbridge/index.js +0 -7
  33. package/dist/screen/index.js +0 -8
  34. package/dist/screen/px2dp.js +2 -25
  35. package/dist/screen/px2sp.js +5 -35
  36. package/dist/screen/text-fit.js +5 -21
  37. package/dist/utils/index.js +0 -7
  38. package/dist/utils/lazy.js +19 -71
  39. package/dist/utils/mode.js +0 -21
  40. package/package.json +3 -7
  41. package/types/components/AnimationModal/AnimationModal.d.ts +0 -8
  42. package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -1
  43. package/types/components/Echarts/demo.d.ts +4 -0
  44. package/types/components/Echarts/demo.d.ts.map +1 -0
  45. package/types/components/Echarts/helper.d.ts +0 -5
  46. package/types/components/Echarts/helper.d.ts.map +1 -1
  47. package/types/components/MutiPictureView/MutiPictureView.d.ts +0 -9
  48. package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -1
  49. package/types/components/RefreshList/demo.d.ts +2 -0
  50. package/types/components/RefreshList/demo.d.ts.map +1 -0
  51. package/types/components/RefreshList/demo1.d.ts +2 -0
  52. package/types/components/RefreshList/demo1.d.ts.map +1 -0
  53. package/types/components/RefreshList/demo2.d.ts +2 -0
  54. package/types/components/RefreshList/demo2.d.ts.map +1 -0
  55. package/types/components/StickHeaderView/StickHeaderView.d.ts +0 -6
  56. package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -1
  57. package/types/components/StickHeaderView/demo.d.ts +4 -0
  58. package/types/components/StickHeaderView/demo.d.ts.map +1 -0
  59. package/types/components/TextInputArea/TextInputArea.d.ts +0 -1
  60. package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -1
  61. package/types/jsbridge/RNEasyui.d.ts +0 -18
  62. package/types/jsbridge/RNEasyui.d.ts.map +1 -1
  63. package/types/jsbridge/UpgradeModule.d.ts +0 -15
  64. package/types/jsbridge/UpgradeModule.d.ts.map +1 -1
  65. package/types/screen/px2dp.d.ts +0 -11
  66. package/types/screen/px2dp.d.ts.map +1 -1
  67. package/types/screen/text-fit.d.ts +0 -3
  68. package/types/screen/text-fit.d.ts.map +1 -1
  69. package/types/utils/lazy.d.ts +0 -33
  70. package/types/utils/lazy.d.ts.map +1 -1
  71. package/types/utils/mode.d.ts +0 -14
  72. package/types/utils/mode.d.ts.map +1 -1
@@ -1,16 +1,8 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-29 10:22:16
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-04-29 10:27:44
6
- * @FilePath: /@aks/easyui/lib/StickHeaderView/StickHeaderView.tsx
7
- */
8
1
  import * as React from "react";
9
2
  import { StyleSheet, Animated, } from "react-native";
10
3
  const App = (props) => {
11
4
  const { style, children, stickyHeaderY = -1, stickyScrollY = new Animated.Value(0), } = props;
12
5
  const [stickyLayoutY, setStickyLayoutY] = React.useState(0);
13
- // 兼容代码,防止没有传头部高度
14
6
  const _onLayout = (event) => {
15
7
  setStickyLayoutY(event.nativeEvent.layout.y);
16
8
  };
@@ -21,13 +13,11 @@ const App = (props) => {
21
13
  outputRange: [0, 0, 0, 1],
22
14
  });
23
15
  };
24
- return (<Animated.View onLayout={_onLayout} style={[
16
+ return (React.createElement(Animated.View, { onLayout: _onLayout, style: [
25
17
  style,
26
18
  styles.container,
27
19
  { transform: [{ translateY: translateY() }] },
28
- ]}>
29
- {children}
30
- </Animated.View>);
20
+ ] }, children));
31
21
  };
32
22
  const styles = StyleSheet.create({
33
23
  container: {
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import { View, StyleSheet, TouchableOpacity, Text, Animated, } from "react-native";
3
+ import { px2dp } from "../../screen/px2dp";
4
+ import { px2sp } from "../../screen/px2sp";
5
+ import StickHeaderView from "./StickHeaderView";
6
+ import WithLoadingContainer from "../WithLoadingContainer/WithLoadingContainer";
7
+ import { Status } from "../WithLoadingContainer/WithLoadingContainer";
8
+ export default ({}) => {
9
+ var _a;
10
+ const scrollY = React.useRef(new Animated.Value(0)).current;
11
+ const headHeight = React.useRef(-1);
12
+ return (React.createElement(View, { style: styles.container },
13
+ React.createElement(Animated.ScrollView, { style: { flex: 1 }, onScroll: Animated.event([
14
+ {
15
+ nativeEvent: { contentOffset: { y: scrollY } },
16
+ },
17
+ ]), scrollEventThrottle: 1 },
18
+ React.createElement(View, { onLayout: (e) => {
19
+ let { height } = e.nativeEvent.layout;
20
+ headHeight.current = height;
21
+ } }),
22
+ React.createElement(StickHeaderView, { stickyHeaderY: headHeight.current, stickyScrollY: scrollY },
23
+ React.createElement(View, null,
24
+ React.createElement(Text, { style: {
25
+ fontSize: px2sp(16),
26
+ color: "#333",
27
+ marginLeft: px2dp(30),
28
+ } }, "\u5F53\u65E5\u8BA1\u5212"))),
29
+ React.createElement(WithLoadingContainer, { status: Status.SUCCESS, emptyText: "今日无需巡检" }, (_a = Array(30)
30
+ .fill("")) === null || _a === void 0 ? void 0 : _a.map((i, index) => (React.createElement(Item, { key: `sg-item-${index}`, item: i, index: index })))))));
31
+ };
32
+ const Item = (props) => {
33
+ return React.createElement(TouchableOpacity, null);
34
+ };
35
+ const styles = StyleSheet.create({
36
+ container: {},
37
+ });
@@ -4,56 +4,43 @@ import { px2dp } from "../../screen/px2dp";
4
4
  import { px2sp } from "../../screen/px2sp";
5
5
  export default (props) => {
6
6
  const { showNav = false, activeOpacity = 0.8 } = props;
7
- return (<TouchableOpacity activeOpacity={props.onPress == undefined ? activeOpacity : 1} style={[styles.container, props.style]} disabled={props.onPress == undefined} onPress={() => props.onPress && props.onPress()}>
8
- <View style={[
9
- styles.warpper,
10
- props.showUnderline
11
- ? {
12
- borderBottomColor: "#f2f2f2",
13
- // borderBottomWidth: StyleSheet.hairlineWidth,
14
- borderBottomWidth: px2dp(1),
15
- ...props.underlineStyle,
16
- }
17
- : {},
18
- ]}>
19
- {props.icon && (<Image style={[
20
- { width: px2dp(20), height: px2dp(20), marginRight: px2dp(8) },
21
- props.iconStyle,
22
- ]} resizeMode="contain" source={props.icon}/>)}
23
- <View style={[styles.middle, props.middleContaierStyle]}>
24
- {/* 标题 */}
25
- {(() => {
26
- if (typeof props.title === "string" ||
27
- typeof props.title === "number") {
28
- return (<Text numberOfLines={1} {...props.titleOptions} style={[styles.title, props.titleOptions?.style]}>
29
- {props.title}
30
- </Text>);
31
- }
32
- if (React.isValidElement(props.title))
33
- return props.title;
34
- return <View style={styles.title}/>;
35
- })()}
36
-
37
- {(() => {
38
- if (typeof props.content === "string" ||
39
- typeof props.content === "number") {
40
- return (<Text numberOfLines={1} {...props.contentOptions} style={[styles.content, props.contentOptions?.style]}>
41
- {props.content}
42
- </Text>);
43
- }
44
- if (React.isValidElement(props.content))
45
- return props.content;
46
- return undefined;
47
- })()}
48
- </View>
49
- {showNav &&
50
- (props.nav || (<Image style={{
51
- width: px2dp(9),
52
- height: px2dp(16),
53
- marginLeft: px2dp(8),
54
- }} source={require("./assets/back.png")}/>))}
55
- </View>
56
- </TouchableOpacity>);
7
+ return (React.createElement(TouchableOpacity, { activeOpacity: props.onPress == undefined ? activeOpacity : 1, style: [styles.container, props.style], disabled: props.onPress == undefined, onPress: () => props.onPress && props.onPress() },
8
+ React.createElement(View, { style: [
9
+ styles.warpper,
10
+ props.showUnderline
11
+ ? Object.assign({ borderBottomColor: "#f2f2f2", borderBottomWidth: px2dp(1) }, props.underlineStyle) : {},
12
+ ] },
13
+ props.icon && (React.createElement(Image, { style: [
14
+ { width: px2dp(20), height: px2dp(20), marginRight: px2dp(8) },
15
+ props.iconStyle,
16
+ ], resizeMode: "contain", source: props.icon })),
17
+ React.createElement(View, { style: [styles.middle, props.middleContaierStyle] },
18
+ (() => {
19
+ var _a;
20
+ if (typeof props.title === "string" ||
21
+ typeof props.title === "number") {
22
+ return (React.createElement(Text, Object.assign({ numberOfLines: 1 }, props.titleOptions, { style: [styles.title, (_a = props.titleOptions) === null || _a === void 0 ? void 0 : _a.style] }), props.title));
23
+ }
24
+ if (React.isValidElement(props.title))
25
+ return props.title;
26
+ return React.createElement(View, { style: styles.title });
27
+ })(),
28
+ (() => {
29
+ var _a;
30
+ if (typeof props.content === "string" ||
31
+ typeof props.content === "number") {
32
+ return (React.createElement(Text, Object.assign({ numberOfLines: 1 }, props.contentOptions, { style: [styles.content, (_a = props.contentOptions) === null || _a === void 0 ? void 0 : _a.style] }), props.content));
33
+ }
34
+ if (React.isValidElement(props.content))
35
+ return props.content;
36
+ return undefined;
37
+ })()),
38
+ showNav &&
39
+ (props.nav || (React.createElement(Image, { style: {
40
+ width: px2dp(9),
41
+ height: px2dp(16),
42
+ marginLeft: px2dp(8),
43
+ }, source: require("./assets/back.png") }))))));
57
44
  };
58
45
  const styles = StyleSheet.create({
59
46
  container: {
@@ -77,17 +64,14 @@ const styles = StyleSheet.create({
77
64
  flexDirection: "row",
78
65
  alignItems: "center",
79
66
  justifyContent: "space-between",
80
- // backgroundColor: 'cyan'
81
67
  },
82
68
  title: {
83
- // backgroundColor: 'red',
84
69
  flexGrow: 0,
85
70
  flexShrink: 0,
86
71
  fontSize: px2sp(14),
87
72
  color: "#333333",
88
73
  },
89
74
  content: {
90
- // backgroundColor: 'yellow',
91
75
  flexGrow: 1,
92
76
  flexShrink: 1,
93
77
  fontSize: px2sp(14),
@@ -1,16 +1,20 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-24 13:56:47
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 10:59:38
6
- * @FilePath: /@aks-dev/easyui/lib/TextInputArea/TextInputArea.tsx
7
- */
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
8
12
  import React from "react";
9
13
  import { View, Text, TextInput, StyleSheet, } from "react-native";
10
14
  import { px2dp } from "../../screen/px2dp";
11
15
  import { px2sp } from "../../screen/px2sp";
12
16
  export default React.forwardRef((props, ref) => {
13
- const { defaultValue, placeholder, maxLength = 200, on, ...rest } = props;
17
+ const { defaultValue, placeholder, maxLength = 200, on } = props, rest = __rest(props, ["defaultValue", "placeholder", "maxLength", "on"]);
14
18
  const [value, setValue] = React.useState(defaultValue);
15
19
  React.useLayoutEffect(() => {
16
20
  setValue(defaultValue);
@@ -18,30 +22,20 @@ export default React.forwardRef((props, ref) => {
18
22
  React.useImperativeHandle(ref, () => ({
19
23
  value: value,
20
24
  }), [value]);
21
- return (<View style={[styles.container, rest.style]}>
22
- <TextInput {...rest} style={[styles.textInput, rest.textInputStyle]} value={value} onChangeText={(txt) => {
23
- setValue(txt);
24
- on && on(txt);
25
- }} multiline={true} textAlignVertical={"top"} maxLength={maxLength} placeholder={placeholder}/>
26
-
27
- <View style={styles.corner}>
28
- <Text style={styles.limit}>
29
- <Text style={{
30
- ...styles.limit,
31
- color: value && value?.length > maxLength - 5 ? "red" : "#AFAFAF",
32
- }}>
33
- {value?.length || 0}
34
- </Text>
35
- /{maxLength}
36
- </Text>
37
- </View>
38
- </View>);
25
+ return (React.createElement(View, { style: [styles.container, rest.style] },
26
+ React.createElement(TextInput, Object.assign({}, rest, { style: [styles.textInput, rest.textInputStyle], value: value, onChangeText: (txt) => {
27
+ setValue(txt);
28
+ on && on(txt);
29
+ }, multiline: true, textAlignVertical: "top", maxLength: maxLength, placeholder: placeholder })),
30
+ React.createElement(View, { style: styles.corner },
31
+ React.createElement(Text, { style: styles.limit },
32
+ React.createElement(Text, { style: Object.assign(Object.assign({}, styles.limit), { color: value && (value === null || value === void 0 ? void 0 : value.length) > maxLength - 5 ? "red" : "#AFAFAF" }) }, (value === null || value === void 0 ? void 0 : value.length) || 0),
33
+ "/",
34
+ maxLength))));
39
35
  });
40
36
  const styles = StyleSheet.create({
41
37
  container: {
42
- // backgroundColor: '#F5F5F5',
43
38
  minHeight: px2dp(200),
44
- // borderRadius: px2dp(10),
45
39
  backgroundColor: "white",
46
40
  },
47
41
  textInput: {
@@ -49,11 +43,8 @@ const styles = StyleSheet.create({
49
43
  margin: px2dp(15),
50
44
  marginBottom: px2dp(8),
51
45
  fontSize: px2sp(14),
52
- // backgroundColor: 'red'
53
46
  },
54
47
  corner: {
55
- // position: 'absolute',
56
- // backgroundColor:'cyan',
57
48
  marginHorizontal: px2dp(15),
58
49
  marginBottom: px2dp(8),
59
50
  },
@@ -1,10 +1,3 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-20 14:56:47
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-05-09 14:35:04
6
- * @FilePath: /@aks/easyui/lib/WithLoadingContainer/WithLoadingContainer.tsx
7
- */
8
1
  import React from "react";
9
2
  import { View, Image, Text, StyleSheet, TouchableOpacity, } from "react-native";
10
3
  const loading = require("./assets/loading.gif");
@@ -20,52 +13,42 @@ export var Status;
20
13
  })(Status || (Status = {}));
21
14
  export default (props) => {
22
15
  const { status = Status.NONE, renderFailComponent, renderEmptyComponent, renderNomoreComponent, reload, failText = "网络请求失败,点击重新加载~", emptyText = "暂无数据", nomoreText = "没有更多数据了~", } = props;
23
- return (<View style={props.style}>
24
- <>
25
- {(() => {
16
+ return (React.createElement(View, { style: props.style },
17
+ React.createElement(React.Fragment, null, (() => {
26
18
  switch (status) {
27
19
  case Status.NONE:
28
20
  return undefined;
29
21
  case Status.SUCCESS:
30
22
  return props.children;
31
23
  case Status.LOADING:
32
- return <Loading />;
24
+ return React.createElement(Loading, null);
33
25
  case Status.FAIL:
34
26
  if (renderFailComponent)
35
27
  return renderFailComponent();
36
- return (<TouchableOpacity disabled={!reload} onPress={reload} style={styles.container}>
37
- <Text style={styles.text}>{failText}</Text>
38
- </TouchableOpacity>);
28
+ return (React.createElement(TouchableOpacity, { disabled: !reload, onPress: reload, style: styles.container },
29
+ React.createElement(Text, { style: styles.text }, failText)));
39
30
  case Status.EMPTY:
40
31
  if (renderEmptyComponent)
41
32
  return renderEmptyComponent();
42
- return (<TouchableOpacity disabled={!reload} onPress={reload} style={styles.container}>
43
- <Text style={styles.text}>{emptyText}</Text>
44
- </TouchableOpacity>);
33
+ return (React.createElement(TouchableOpacity, { disabled: !reload, onPress: reload, style: styles.container },
34
+ React.createElement(Text, { style: styles.text }, emptyText)));
45
35
  case Status.NOMORE:
46
- return (<>
47
- {props.children}
48
- {renderNomoreComponent ? (renderNomoreComponent()) : (<Text style={styles.text}>{nomoreText}</Text>)}
49
- </>);
36
+ return (React.createElement(React.Fragment, null,
37
+ props.children,
38
+ renderNomoreComponent ? (renderNomoreComponent()) : (React.createElement(Text, { style: styles.text }, nomoreText))));
50
39
  default:
51
- return (<Text style={[styles.text, { lineHeight: 44 }]}>
52
- (^_^)∠※ 送你一束小花
53
- </Text>);
40
+ return (React.createElement(Text, { style: [styles.text, { lineHeight: 44 }] }, "(^_^)\u2220\u203B \u9001\u4F60\u4E00\u675F\u5C0F\u82B1"));
54
41
  }
55
- })()}
56
- </>
57
- </View>);
42
+ })())));
58
43
  };
59
44
  const Loading = () => {
60
- return (<View style={styles.container}>
61
- <Image source={loading3} style={{ width: 20, height: 20 }} resizeMode="contain"/>
62
- </View>);
45
+ return (React.createElement(View, { style: styles.container },
46
+ React.createElement(Image, { source: loading3, style: { width: 20, height: 20 }, resizeMode: "contain" })));
63
47
  };
64
48
  const styles = StyleSheet.create({
65
49
  text: {
66
50
  color: "#999999",
67
51
  fontSize: 14,
68
- // textAlign: 'center',
69
52
  },
70
53
  container: {
71
54
  display: "flex",
package/dist/index.js CHANGED
@@ -1,11 +1,3 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-13 12:47:34
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-23 15:26:14
6
- * @FilePath: /@aks-dev/easyui/src/index.ts
7
- */
8
- /// 组件
9
1
  export * from "./components/Badge/Badge";
10
2
  export { Hud, showLoading, hideLoading, showToast, showAlertModal, showAlertBottomModal, showAlertSheetModal, showPopoverView, hidePopoverView, showScanner, hideScanner, } from "./components/Hud/Hud";
11
3
  export * from "./components/Modal/Modal";
@@ -21,10 +13,7 @@ export { default as RichText } from "./components/RichText/RichText";
21
13
  export { default as DottedLine } from "./components/DottedLine/DottedLine";
22
14
  export { default as MenuView } from "./components/MenuView/MenuView";
23
15
  export { AnimationModal } from "./components/AnimationModal/AnimationModal";
24
- /// 全局适配
25
16
  export * from "./screen";
26
- /// 工具
27
17
  import * as utils from "./utils";
28
- ///  桥接
29
18
  import * as jsbridge from "./jsbridge";
30
19
  export { utils, jsbridge };
@@ -1,22 +1,6 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-19 10:23:01
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-10 14:05:17
6
- * @FilePath: /@aks-dev/easyui/jsbridge/RNEasyui.ts
7
- */
8
1
  import { Dimensions, NativeModules, Platform } from "react-native";
9
2
  const { RNEasyui } = NativeModules;
10
- /**
11
- * @description: 获取设备品牌
12
- * @return {*}
13
- */
14
3
  export const getDeviceBrand = () => RNEasyui.getDeviceBrand();
15
- /**
16
- * @deprecated 测量不准确,已放弃
17
- * @description: 获取status_bar_height
18
- * @return {*}
19
- */
20
4
  export const getStatusBarHeight = () => {
21
5
  if (Platform.OS == "android")
22
6
  return RNEasyui.getStatusBarHeight();
@@ -26,21 +10,12 @@ export const getStatusBarHeight = () => {
26
10
  return Promise.resolve(44);
27
11
  return Promise.resolve(20);
28
12
  };
29
- /**
30
- * @deprecated 测量不准确,已放弃
31
- * @description: 获取navigation_bar_height
32
- * @return {*}
33
- */
34
13
  export const getNavigationBarHeight = () => {
35
14
  if (Platform.OS == "android")
36
15
  return RNEasyui.getNavigationBarHeight();
37
16
  return Promise.resolve(44);
38
17
  };
39
- /**
40
- * only android
41
- * 返回桌面
42
- */
43
18
  export const gotoDesktop = () => {
44
19
  if (Platform.OS == "android")
45
- RNEasyui?.gotoDesktop();
20
+ RNEasyui === null || RNEasyui === void 0 ? void 0 : RNEasyui.gotoDesktop();
46
21
  };
@@ -1,30 +1,21 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-05-05 14:19:39
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-23 15:15:06
6
- * @FilePath: /@aks-dev/easyui/jsbridge/UpgradeModule.ts
7
- */
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
8
10
  import { NativeModules, PermissionsAndroid, Platform } from "react-native";
9
11
  const { UpgradeModule } = NativeModules;
10
- /**
11
- * @description: 获取App版本号
12
- * @param {*}
13
- * @return {*}
14
- */
15
12
  export const getAppVersion = () => UpgradeModule.getAppVersion();
16
- /**
17
- * @description: 获取操作系统版本
18
- *
19
- react-native-device-info
20
- * @return {*}
21
- */
22
13
  export const getOSVersion = () => UpgradeModule.getOSVersion();
23
- export const upgrade = async (options) => {
14
+ export const upgrade = (options) => __awaiter(void 0, void 0, void 0, function* () {
24
15
  const { title = "提示" } = options;
25
16
  if (Platform.OS == "android") {
26
17
  try {
27
- const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, {
18
+ const granted = yield PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, {
28
19
  title: "提示",
29
20
  message: "应用升级需要获取APP的写入权限",
30
21
  buttonNeutral: "稍后再询问",
@@ -41,4 +32,4 @@ export const upgrade = async (options) => {
41
32
  }
42
33
  }
43
34
  return UpgradeModule.upgrade(options);
44
- };
35
+ });
@@ -1,9 +1,2 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-19 10:23:01
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-23 15:14:55
6
- * @FilePath: /@aks-dev/easyui/jsbridge/index.ts
7
- */
8
1
  export * from './RNEasyui';
9
2
  export * from './UpgradeModule';
@@ -1,10 +1,2 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-19 10:25:14
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2023-03-23 15:09:24
6
- * @FilePath: /@aks-dev/easyui/screen/index.ts
7
- */
8
- /// 全局适配
9
1
  export * from '../screen/px2dp';
10
2
  export * from '../screen/px2sp';
@@ -1,31 +1,13 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2022-04-18 14:32:25
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-09-09 10:35:02
6
- * @FilePath: /@aks-dev/easyui/screen/px2dp.ts
7
- */
8
1
  import { Dimensions, Platform, StatusBar } from "react-native";
9
- /**设备宽度,单位 dp */
10
- export const deviceWidth = Dimensions.get("screen").width; //设备的宽度
11
- export const deviceHeight = Dimensions.get("screen").height; //设备的高度
2
+ export const deviceWidth = Dimensions.get("screen").width;
3
+ export const deviceHeight = Dimensions.get("screen").height;
12
4
  export const isAndroid = Platform.OS === "android";
13
5
  export const isIos = Platform.OS === "ios";
14
6
  export const isiPhoneX = isIos && deviceHeight > 736;
15
- /**
16
- * 375px/667px
17
- * */
18
7
  const uiWidthPx = 375;
19
- // const pixelRatio = PixelRatio.get()
20
- // const deviceWidthPx = PixelRatio.getPixelSizeForLayoutSize(deviceWidth);
21
8
  export const px2dp = (uiElePx) => {
22
9
  return Math.round((uiElePx * deviceWidth) / uiWidthPx);
23
10
  };
24
- /**
25
- * @description: 状态栏的高度
26
- * @param {*}
27
- * @return {*}
28
- */
29
11
  export const statusBarHeight = (() => {
30
12
  if (isAndroid)
31
13
  return StatusBar.currentHeight || 24;
@@ -33,11 +15,6 @@ export const statusBarHeight = (() => {
33
15
  return 44;
34
16
  return 20;
35
17
  })();
36
- /**
37
- * @description: 顶部导航条的高度,高度不包含statusBarHeight
38
- * @param {*}
39
- * @return {*}
40
- */
41
18
  export const navigationBarHeight = (() => {
42
19
  if (isAndroid)
43
20
  return 56;
@@ -1,73 +1,43 @@
1
- /*
2
- * @Author: shiguo
3
- * @Date: 2021-04-27 10:40:36
4
- * @LastEditors: shiguo
5
- * @LastEditTime: 2022-10-28 17:14:14
6
- * @FilePath: /@aks-dev/easyui/screen/px2sp.ts
7
- */
8
1
  import { Dimensions, PixelRatio } from 'react-native';
9
2
  const pixelRatio = PixelRatio.get();
10
- const width = Dimensions.get('window').width; //设备的宽度
11
- const height = Dimensions.get('window').height; //设备的高度
3
+ const width = Dimensions.get('window').width;
4
+ const height = Dimensions.get('window').height;
12
5
  export const px2sp = (size) => {
13
- // console.log({
14
- // pixelRatio,
15
- // width,
16
- // height
17
- // })
18
6
  if (pixelRatio === 2) {
19
- // iphone 5s and older Androids
20
7
  if (width < 360) {
21
8
  return size * 0.95;
22
9
  }
23
- // iphone 5
24
10
  if (height < 667) {
25
11
  return size;
26
- // iphone 6-6s
27
12
  }
28
13
  else if (height >= 667 && height <= 735) {
29
14
  return size * 1.15;
30
15
  }
31
- // older phablets
32
16
  return size * 1.25;
33
17
  }
34
18
  if (pixelRatio === 3) {
35
- // catch Android font scaling on small machines
36
- // where pixel ratio / font scale ratio => 3:3
37
19
  if (width <= 360) {
38
20
  return size;
39
21
  }
40
- // Catch other weird android width sizings
41
22
  if (height < 667) {
42
23
  return size * 1.15;
43
- // catch in-between size Androids and scale font up
44
- // a tad but not too much
45
24
  }
46
25
  if (height >= 667 && height <= 735) {
47
26
  return size * 1.2;
48
27
  }
49
- // catch larger devices
50
- // ie iphone 6s plus / 7 plus / mi note 等等
51
28
  return size * 1.27;
52
29
  }
53
30
  if (pixelRatio === 3.5) {
54
- // catch Android font scaling on small machines
55
- // where pixel ratio / font scale ratio => 3:3
56
31
  if (width <= 360) {
57
32
  return size;
58
- // Catch other smaller android height sizings
59
33
  }
60
34
  if (height < 667) {
61
- return size * 1.15; //older:1.20
62
- // catch in-between size Androids and scale font up
63
- // a tad but not too much
35
+ return size * 1.15;
64
36
  }
65
37
  if (height >= 667 && height <= 735) {
66
- return size * 1.20; //older:1.25
38
+ return size * 1.20;
67
39
  }
68
- // catch larger phablet devices
69
- return size * 1.25; //older:1.30
40
+ return size * 1.25;
70
41
  }
71
- // if older device ie pixelRatio !== 2 || 3 || 3.5
72
42
  return size;
73
43
  };