@aks-dev/easyui 1.0.192 → 1.0.194

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.

Potentially problematic release.


This version of @aks-dev/easyui might be problematic. Click here for more details.

Files changed (73) hide show
  1. package/dist/components/AnimationModal/AnimationModal.js +36 -15
  2. package/dist/components/Badge/Badge.js +16 -7
  3. package/dist/components/DottedLine/DottedLine.js +13 -14
  4. package/dist/components/Echarts/EchartsView.js +73 -30
  5. package/dist/components/Echarts/helper.js +16 -1
  6. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +60 -43
  7. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +30 -23
  8. package/dist/components/Hud/AlertView/AlertView.js +62 -46
  9. package/dist/components/Hud/Hud.js +19 -8
  10. package/dist/components/Hud/Loading/Loading.js +16 -4
  11. package/dist/components/Hud/PopoverView/PopoverView.js +13 -2
  12. package/dist/components/Hud/Scanner/Scanner.js +86 -55
  13. package/dist/components/Hud/Toast/Toast.js +15 -5
  14. package/dist/components/MenuView/MenuView.js +61 -33
  15. package/dist/components/Modal/Modal.js +7 -0
  16. package/dist/components/MutiPictureView/MutiPictureView.js +47 -27
  17. package/dist/components/PictureViewer/PictureViewer.js +24 -8
  18. package/dist/components/RefreshList/RefreshList.js +52 -41
  19. package/dist/components/RichText/RichText.js +22 -21
  20. package/dist/components/StickHeaderView/StickHeaderView.js +12 -2
  21. package/dist/components/TableCell/TableCell.js +51 -37
  22. package/dist/components/TextInputArea/TextInputArea.js +28 -21
  23. package/dist/components/WithLoadingContainer/WithLoadingContainer.js +31 -14
  24. package/dist/index.js +11 -0
  25. package/dist/jsbridge/RNEasyui.js +25 -0
  26. package/dist/jsbridge/UpgradeModule.js +19 -9
  27. package/dist/jsbridge/index.js +7 -0
  28. package/dist/screen/index.js +8 -0
  29. package/dist/screen/px2dp.js +25 -2
  30. package/dist/screen/px2sp.js +35 -5
  31. package/dist/screen/text-fit.js +13 -2
  32. package/dist/utils/index.js +7 -0
  33. package/dist/utils/lazy.js +67 -12
  34. package/dist/utils/mode.js +21 -0
  35. package/package.json +16 -8
  36. package/types/components/AnimationModal/AnimationModal.d.ts +8 -0
  37. package/types/components/AnimationModal/AnimationModal.d.ts.map +1 -1
  38. package/types/components/Echarts/helper.d.ts +5 -0
  39. package/types/components/Echarts/helper.d.ts.map +1 -1
  40. package/types/components/MutiPictureView/MutiPictureView.d.ts +9 -0
  41. package/types/components/MutiPictureView/MutiPictureView.d.ts.map +1 -1
  42. package/types/components/StickHeaderView/StickHeaderView.d.ts +6 -0
  43. package/types/components/StickHeaderView/StickHeaderView.d.ts.map +1 -1
  44. package/types/components/TextInputArea/TextInputArea.d.ts +1 -0
  45. package/types/components/TextInputArea/TextInputArea.d.ts.map +1 -1
  46. package/types/jsbridge/RNEasyui.d.ts +18 -0
  47. package/types/jsbridge/RNEasyui.d.ts.map +1 -1
  48. package/types/jsbridge/UpgradeModule.d.ts +15 -0
  49. package/types/jsbridge/UpgradeModule.d.ts.map +1 -1
  50. package/types/screen/px2dp.d.ts +11 -0
  51. package/types/screen/px2dp.d.ts.map +1 -1
  52. package/types/screen/text-fit.d.ts +3 -0
  53. package/types/screen/text-fit.d.ts.map +1 -1
  54. package/types/utils/lazy.d.ts +33 -0
  55. package/types/utils/lazy.d.ts.map +1 -1
  56. package/types/utils/mode.d.ts +14 -0
  57. package/types/utils/mode.d.ts.map +1 -1
  58. package/dist/components/Echarts/demo.js +0 -201
  59. package/dist/components/RefreshList/demo.js +0 -9
  60. package/dist/components/RefreshList/demo1.js +0 -27
  61. package/dist/components/RefreshList/demo2.js +0 -9
  62. package/dist/components/StickHeaderView/demo.js +0 -37
  63. package/i.sh +0 -25
  64. package/types/components/Echarts/demo.d.ts +0 -4
  65. package/types/components/Echarts/demo.d.ts.map +0 -1
  66. package/types/components/RefreshList/demo.d.ts +0 -2
  67. package/types/components/RefreshList/demo.d.ts.map +0 -1
  68. package/types/components/RefreshList/demo1.d.ts +0 -2
  69. package/types/components/RefreshList/demo1.d.ts.map +0 -1
  70. package/types/components/RefreshList/demo2.d.ts +0 -2
  71. package/types/components/RefreshList/demo2.d.ts.map +0 -1
  72. package/types/components/StickHeaderView/demo.d.ts +0 -4
  73. package/types/components/StickHeaderView/demo.d.ts.map +0 -1
@@ -1,12 +1,4 @@
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
- };
1
+ import { __awaiter } from "tslib";
10
2
  import * as React from "react";
11
3
  import { View, Text, StyleSheet, Platform, Modal, StatusBar, TouchableOpacity, Animated, Easing, } from "react-native";
12
4
  import { px2dp, deviceWidth } from "../../../screen/px2dp";
@@ -25,12 +17,14 @@ export default React.forwardRef((_, ref) => {
25
17
  setState(Object.assign({}, defaultState, { visible: true }, options));
26
18
  cancelCallbackRef.current = options.cancel;
27
19
  confirmCallbackRef.current = options.confirm;
20
+ // await sleep(50)
28
21
  startAnimate(1);
29
22
  }),
30
23
  hide,
31
24
  }), []);
32
25
  const hide = () => __awaiter(void 0, void 0, void 0, function* () {
33
26
  startAnimate(0.3);
27
+ // await sleep(50)
34
28
  setState(defaultState);
35
29
  });
36
30
  let scale_anim = React.useRef(new Animated.Value(0.3)).current;
@@ -54,49 +48,67 @@ export default React.forwardRef((_, ref) => {
54
48
  }
55
49
  }
56
50
  }, [state.visible]);
57
- return (React.createElement(Modal, { visible: state.visible, transparent: true, animationType: "fade", onRequestClose: () => {
58
- } },
59
- React.createElement(View, { style: styles.container },
60
- React.createElement(Animated.View, { style: [
61
- styles.wrapper,
62
- state.wrapperStyle,
63
- { transform: [{ scale: scale_anim }] },
64
- ] },
65
- state.title && React.createElement(Text, { style: styles.titleText }, state.title),
66
- (() => {
67
- if (typeof state.content == "string")
68
- return React.createElement(Text, { style: styles.contentText }, state.content);
69
- if (React.isValidElement(state.content))
70
- return state.content;
71
- return React.createElement(View, null);
72
- })(),
73
- (state.cancelText || state.confirmText) && (React.createElement(View, { style: styles.action },
74
- state.cancelText && (React.createElement(TouchableOpacity, { style: [
75
- styles.cancel,
76
- { marginRight: state.confirmText ? px2dp(15) : 0 },
77
- state.cancelContainerStyle,
78
- ], activeOpacity: 0.8, disabled: state.cancelDisabled, onPress: () => {
79
- hide();
80
- cancelCallbackRef.current && cancelCallbackRef.current();
81
- cancelCallbackRef.current = undefined;
82
- } },
83
- React.createElement(Text, { style: [styles.cancelText, state.cancelTextStyle] }, state.cancelText))),
84
- state.confirmText && (React.createElement(TouchableOpacity, { style: [
85
- styles.confirm,
86
- { marginLeft: state.cancelText ? px2dp(15) : 0 },
87
- state.confirmContainerStyle,
88
- ], activeOpacity: 0.8, onPress: () => {
89
- hide();
90
- confirmCallbackRef.current && confirmCallbackRef.current();
91
- confirmCallbackRef.current = undefined;
92
- } },
93
- React.createElement(Text, { style: [styles.confirmText, state.confirmTextStyle] }, state.confirmText)))))))));
51
+ return (<Modal visible={state.visible} transparent animationType="fade" onRequestClose={() => {
52
+ // hide()
53
+ }}>
54
+ <View style={styles.container}>
55
+ <Animated.View style={[
56
+ styles.wrapper,
57
+ state.wrapperStyle,
58
+ { transform: [{ scale: scale_anim }] },
59
+ ]}>
60
+ {state.title && <Text style={styles.titleText}>{state.title}</Text>}
61
+ {(() => {
62
+ if (typeof state.content == "string")
63
+ return <Text style={styles.contentText}>{state.content}</Text>;
64
+ if (React.isValidElement(state.content))
65
+ return state.content;
66
+ return <View />;
67
+ })()}
68
+
69
+ {(state.cancelText || state.confirmText) && (<View style={styles.action}>
70
+ {state.cancelText && (<TouchableOpacity style={[
71
+ styles.cancel,
72
+ { marginRight: state.confirmText ? px2dp(15) : 0 },
73
+ state.cancelContainerStyle,
74
+ ]} activeOpacity={0.8} disabled={state.cancelDisabled} onPress={() => {
75
+ hide();
76
+ cancelCallbackRef.current && cancelCallbackRef.current();
77
+ cancelCallbackRef.current = undefined;
78
+ }}>
79
+ <Text style={[styles.cancelText, state.cancelTextStyle]}>
80
+ {state.cancelText}
81
+ </Text>
82
+ </TouchableOpacity>)}
83
+
84
+ {state.confirmText && (<TouchableOpacity style={[
85
+ styles.confirm,
86
+ { marginLeft: state.cancelText ? px2dp(15) : 0 },
87
+ state.confirmContainerStyle,
88
+ ]} activeOpacity={0.8} onPress={() => {
89
+ hide();
90
+ confirmCallbackRef.current && confirmCallbackRef.current();
91
+ confirmCallbackRef.current = undefined;
92
+ }}>
93
+ <Text style={[styles.confirmText, state.confirmTextStyle]}>
94
+ {state.confirmText}
95
+ </Text>
96
+ </TouchableOpacity>)}
97
+ </View>)}
98
+ </Animated.View>
99
+ </View>
100
+ </Modal>);
94
101
  });
95
102
  export const alertViewRef = React.createRef();
96
103
  export const showAlertModal = (props) => {
97
104
  var _a;
98
105
  (_a = alertViewRef.current) === null || _a === void 0 ? void 0 : _a.show(props);
99
106
  };
107
+ // const sleep = (msec?: number) => {
108
+ // return new Promise(resolve => {
109
+ // setTimeout(resolve, msec || 350);
110
+ // });
111
+ // }
100
112
  const styles = StyleSheet.create({
101
113
  container: {
102
114
  display: "flex",
@@ -108,6 +120,7 @@ const styles = StyleSheet.create({
108
120
  wrapper: {
109
121
  flexGrow: 0,
110
122
  flexShrink: 0,
123
+ // minWidth: '70%',
111
124
  minWidth: deviceWidth - px2dp(60),
112
125
  backgroundColor: "white",
113
126
  overflow: "hidden",
@@ -119,6 +132,7 @@ const styles = StyleSheet.create({
119
132
  maxWidth: deviceWidth - px2dp(90),
120
133
  fontSize: px2sp(18),
121
134
  marginBottom: px2dp(20),
135
+ // backgroundColor: 'red',
122
136
  textAlign: "center",
123
137
  fontWeight: "bold",
124
138
  color: "#1A1A1A",
@@ -131,6 +145,7 @@ const styles = StyleSheet.create({
131
145
  flexShrink: 1,
132
146
  width: undefined,
133
147
  fontSize: px2sp(15),
148
+ // backgroundColor: 'red',
134
149
  color: "#1A1A1A",
135
150
  textAlign: "center",
136
151
  },
@@ -139,6 +154,7 @@ const styles = StyleSheet.create({
139
154
  flexDirection: "row",
140
155
  justifyContent: "space-between",
141
156
  alignItems: "center",
157
+ // backgroundColor:"red"
142
158
  },
143
159
  cancel: {
144
160
  width: "40%",
@@ -1,4 +1,12 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-24 14:10:04
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2023-03-23 11:13:55
6
+ * @FilePath: /aks-fire-app/node_modules/@aks-dev/easyui/lib/Hud/Hud.tsx
7
+ */
1
8
  import * as React from 'react';
9
+ // import { StyleSheet } from 'react-native'
2
10
  import { alertViewRef, default as AlertView, showAlertModal } from './AlertView/AlertView';
3
11
  import { alertBottomViewRef, default as AlertBottomView, showAlertBottomModal } from './AlertBottomView/AlertBottomView';
4
12
  import { alertSheetViewRef, default as AlertSheetView, showAlertSheetModal } from './AlertSheetView/AlertSheetView';
@@ -6,13 +14,16 @@ import { hideLoading, Loading, loadingRef, showLoading } from './Loading/Loading
6
14
  import { showToast, Toast, toastRef } from './Toast/Toast';
7
15
  import { showPopoverView, hidePopoverView, popoverViewRef, PopoverView } from './PopoverView/PopoverView';
8
16
  import { showScanner, hideScanner, scannerRef, Scanner } from './Scanner/Scanner';
9
- export const Hud = () => React.cloneElement(React.createElement(React.Fragment, null), {}, [
10
- React.createElement(Loading, { key: "hud-0", ref: loadingRef }),
11
- React.createElement(Toast, { key: "hud-1", ref: toastRef }),
12
- React.createElement(AlertView, { key: "hud-2", ref: alertViewRef }),
13
- React.createElement(AlertBottomView, { key: "hud-3-0", ref: alertBottomViewRef }),
14
- React.createElement(AlertSheetView, { key: "hud-3-1", ref: alertSheetViewRef }),
15
- React.createElement(PopoverView, { key: "hud-4", ref: popoverViewRef }),
16
- React.createElement(Scanner, { key: "hud-5", ref: scannerRef }),
17
+ export const Hud = () => React.cloneElement(<></>, {
18
+ // ...StyleSheet.absoluteFillObject,
19
+ // display: 'flex',
20
+ }, [
21
+ <Loading key="hud-0" ref={loadingRef}/>,
22
+ <Toast key="hud-1" ref={toastRef}/>,
23
+ <AlertView key="hud-2" ref={alertViewRef}/>,
24
+ <AlertBottomView key="hud-3-0" ref={alertBottomViewRef}/>,
25
+ <AlertSheetView key="hud-3-1" ref={alertSheetViewRef}/>,
26
+ <PopoverView key="hud-4" ref={popoverViewRef}/>,
27
+ <Scanner key="hud-5" ref={scannerRef}/>,
17
28
  ]);
18
29
  export { showAlertModal, showToast, showLoading, hideLoading, showAlertBottomModal, showAlertSheetModal, showPopoverView, hidePopoverView, showScanner, hideScanner, };
@@ -1,3 +1,10 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-24 14:27:02
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-09-09 10:55:48
6
+ * @FilePath: /@aks-dev/easyui/lib/Hud/Loading/Loading.tsx
7
+ */
1
8
  import React, { useImperativeHandle, useState } from "react";
2
9
  import { View, ActivityIndicator, StyleSheet, Text, Dimensions, TouchableOpacity, BackHandler, } from "react-native";
3
10
  export const Loading = React.forwardRef((_, ref) => {
@@ -6,6 +13,7 @@ export const Loading = React.forwardRef((_, ref) => {
6
13
  React.useEffect(() => {
7
14
  const onBackPress = () => show;
8
15
  BackHandler.addEventListener("hardwareBackPress", onBackPress);
16
+ // return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
9
17
  }, [show]);
10
18
  useImperativeHandle(ref, () => ({
11
19
  showLoading: (content) => {
@@ -18,10 +26,14 @@ export const Loading = React.forwardRef((_, ref) => {
18
26
  }), [show]);
19
27
  if (!show)
20
28
  return null;
21
- return (React.createElement(TouchableOpacity, { disabled: true, style: styles.container },
22
- React.createElement(View, { style: styles.warpper },
23
- React.createElement(ActivityIndicator, { color: "white", size: "large" }),
24
- React.createElement(Text, { numberOfLines: 5, style: styles.title }, tipText))));
29
+ return (<TouchableOpacity disabled style={styles.container}>
30
+ <View style={styles.warpper}>
31
+ <ActivityIndicator color="white" size="large"/>
32
+ <Text numberOfLines={5} style={styles.title}>
33
+ {tipText}
34
+ </Text>
35
+ </View>
36
+ </TouchableOpacity>);
25
37
  });
26
38
  export const loadingRef = React.createRef();
27
39
  export const showLoading = (content) => { var _a; return (_a = loadingRef.current) === null || _a === void 0 ? void 0 : _a.showLoading(content); };
@@ -1,3 +1,10 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2022-04-24 14:27:02
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-12-21 15:36:06
6
+ * @FilePath: /@aks-dev/easyui/lib/Hud/PopoverView/PopoverView.tsx
7
+ */
1
8
  import React, { useImperativeHandle, useState } from "react";
2
9
  import { StyleSheet, TouchableOpacity, BackHandler, } from "react-native";
3
10
  export const PopoverView = React.forwardRef((_, ref) => {
@@ -6,6 +13,7 @@ export const PopoverView = React.forwardRef((_, ref) => {
6
13
  React.useEffect(() => {
7
14
  const onBackPress = () => visible;
8
15
  BackHandler.addEventListener("hardwareBackPress", onBackPress);
16
+ // return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
9
17
  }, [visible]);
10
18
  useImperativeHandle(ref, () => ({
11
19
  showPopoverView: (options) => {
@@ -19,10 +27,13 @@ export const PopoverView = React.forwardRef((_, ref) => {
19
27
  }), [visible]);
20
28
  if (!visible)
21
29
  return null;
22
- return (React.createElement(TouchableOpacity, { activeOpacity: 1, style: [styles.container, options === null || options === void 0 ? void 0 : options.style], disabled: options === null || options === void 0 ? void 0 : options.disabled, onPress: (e) => {
30
+ return (<TouchableOpacity activeOpacity={1} style={[styles.container, options === null || options === void 0 ? void 0 : options.style]} disabled={options === null || options === void 0 ? void 0 : options.disabled} onPress={(e) => {
23
31
  setVisible(false);
24
32
  setOptions(undefined);
25
- } }, React.isValidElement(options === null || options === void 0 ? void 0 : options.content) && (options === null || options === void 0 ? void 0 : options.content)));
33
+ // e.stopPropagation()
34
+ }}>
35
+ {React.isValidElement(options === null || options === void 0 ? void 0 : options.content) && (options === null || options === void 0 ? void 0 : options.content)}
36
+ </TouchableOpacity>);
26
37
  });
27
38
  export const popoverViewRef = React.createRef();
28
39
  export const showPopoverView = (options) => { var _a; return (_a = popoverViewRef.current) === null || _a === void 0 ? void 0 : _a.showPopoverView(options); };
@@ -1,12 +1,11 @@
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
- };
1
+ import { __awaiter } from "tslib";
2
+ /*
3
+ * @Author: shiguo
4
+ * @Date: 2022-04-24 14:27:02
5
+ * @LastEditors: shiguo
6
+ * @LastEditTime: 2023-03-23 15:04:18
7
+ * @FilePath: /@aks-dev/easyui/lib/Hud/Scanner/Scanner.tsx
8
+ */
10
9
  import React, { useImperativeHandle, useState } from "react";
11
10
  import { Animated, BackHandler, Easing, Image, StyleSheet, Text, TouchableOpacity, View, } from "react-native";
12
11
  import { Camera, useCameraDevice, useCameraPermission, useCodeScanner, } from "react-native-vision-camera";
@@ -15,6 +14,11 @@ import { navigationBarHeight, px2dp, statusBarHeight, } from "../../../screen/px
15
14
  import { px2sp } from "../../../screen/px2sp";
16
15
  import * as utils from "../../../utils/lazy";
17
16
  import { showToast } from "../Toast/Toast";
17
+ // enum SCANNER_TYPE {
18
+ // DENIED = -1,//没有开始权限
19
+ // START = 0,//没有扫描结果,继续扫描
20
+ // SUCCESS = 1,//已有扫描结果,停止扫描
21
+ // }
18
22
  export const Scanner = React.forwardRef((_, ref) => {
19
23
  const [show, setShow] = useState(false);
20
24
  const moveAnim = React.useRef(new Animated.Value(0)).current;
@@ -32,6 +36,7 @@ export const Scanner = React.forwardRef((_, ref) => {
32
36
  return true;
33
37
  };
34
38
  BackHandler.addEventListener("hardwareBackPress", onBackPress);
39
+ // return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
35
40
  }, [show]);
36
41
  useImperativeHandle(ref, () => ({
37
42
  showScanner: _showScanner,
@@ -79,6 +84,7 @@ export const Scanner = React.forwardRef((_, ref) => {
79
84
  var _a;
80
85
  (_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.resumePreview();
81
86
  animation.start(({ finished }) => {
87
+ // console.log('animationStart finished', finished)
82
88
  if (finished) {
83
89
  animation.reset();
84
90
  animation.start();
@@ -105,53 +111,78 @@ export const Scanner = React.forwardRef((_, ref) => {
105
111
  if (!show)
106
112
  return null;
107
113
  if (!hasPermission)
108
- return React.createElement(Text, null, "PermissionsPage");
114
+ return <Text>PermissionsPage</Text>;
109
115
  if (device == null)
110
- return React.createElement(Text, null, "NoCameraDeviceError");
111
- return (React.createElement(TouchableOpacity, { disabled: true, style: StyleSheet.absoluteFillObject },
112
- React.createElement(Camera, { ref: cameraRef, style: styles.camera, device: device, codeScanner: codeScanner, isActive: true },
113
- React.createElement(View, { style: {
114
- display: "flex",
115
- justifyContent: "center",
116
- alignItems: "center",
117
- height: navigationBarHeight,
118
- marginTop: statusBarHeight,
119
- position: "relative",
120
- } },
121
- React.createElement(TouchableOpacity, { onPress: () => _hideScanner(), style: {
122
- height: navigationBarHeight,
123
- width: px2dp(50),
124
- paddingLeft: px2dp(15),
125
- position: "absolute",
126
- left: 0,
127
- display: "flex",
128
- justifyContent: "center",
129
- } },
130
- React.createElement(Image, { source: require("./assets/icon_back_white.png"), style: { width: px2dp(20), height: px2dp(20) }, resizeMode: "contain" })),
131
- React.createElement(Text, { style: {
132
- fontSize: px2sp(16),
133
- color: "white",
134
- fontWeight: "bold",
135
- } }, "\u626B\u4E00\u626B")),
136
- React.createElement(View, { style: styles.scanContainer },
137
- React.createElement(View, { style: styles.rectangle },
138
- React.createElement(View, { style: styles.rectangleLeft }),
139
- React.createElement(View, { style: styles.cameraBackground },
140
- React.createElement(Animated.View, { style: [
141
- styles.scanLine,
142
- { transform: [{ translateY: moveAnim }] },
143
- ] }),
144
- React.createElement(View, { style: styles.reactLineTopLeftX }),
145
- React.createElement(View, { style: styles.reactLineTopLeftY }),
146
- React.createElement(View, { style: styles.reactLineTopRightX }),
147
- React.createElement(View, { style: styles.reactLineTopRightY }),
148
- React.createElement(View, { style: styles.reactLineBottomLeftX }),
149
- React.createElement(View, { style: styles.reactLineBottomLeftY }),
150
- React.createElement(View, { style: styles.reactLineBottomRightX }),
151
- React.createElement(View, { style: styles.reactLineBottomRightY })),
152
- React.createElement(View, { style: styles.rectangleRight })),
153
- React.createElement(Text, { style: styles.rectangleText }, "\u5C06\u4E8C\u7EF4\u7801/\u6761\u7801\u653E\u5165\u6846\u5185\uFF0C\u5373\u53EF\u81EA\u52A8\u626B\u63CF")),
154
- React.createElement(View, { style: pointStyle }))));
116
+ return <Text>NoCameraDeviceError</Text>;
117
+ return (<TouchableOpacity disabled style={StyleSheet.absoluteFillObject}>
118
+ <Camera ref={cameraRef} style={styles.camera} device={device} codeScanner={codeScanner} isActive={true}>
119
+ {/* 导航栏 */}
120
+ <View style={{
121
+ display: "flex",
122
+ justifyContent: "center",
123
+ alignItems: "center",
124
+ height: navigationBarHeight,
125
+ marginTop: statusBarHeight,
126
+ position: "relative",
127
+ }}>
128
+ <TouchableOpacity onPress={() => _hideScanner()} style={{
129
+ height: navigationBarHeight,
130
+ width: px2dp(50),
131
+ paddingLeft: px2dp(15),
132
+ position: "absolute",
133
+ left: 0,
134
+ display: "flex",
135
+ justifyContent: "center",
136
+ }}>
137
+ <Image source={require("./assets/icon_back_white.png")} style={{ width: px2dp(20), height: px2dp(20) }} resizeMode="contain"/>
138
+ </TouchableOpacity>
139
+ <Text style={{
140
+ fontSize: px2sp(16),
141
+ color: "white",
142
+ fontWeight: "bold",
143
+ }}>
144
+ 扫一扫
145
+ </Text>
146
+ </View>
147
+
148
+ {/* 动画框 */}
149
+ <View style={styles.scanContainer}>
150
+ <View style={styles.rectangle}>
151
+ <View style={styles.rectangleLeft}/>
152
+ <View style={styles.cameraBackground}>
153
+ <Animated.View style={[
154
+ styles.scanLine,
155
+ { transform: [{ translateY: moveAnim }] },
156
+ ]}/>
157
+ <View style={styles.reactLineTopLeftX}/>
158
+ <View style={styles.reactLineTopLeftY}/>
159
+ <View style={styles.reactLineTopRightX}/>
160
+ <View style={styles.reactLineTopRightY}/>
161
+ <View style={styles.reactLineBottomLeftX}/>
162
+ <View style={styles.reactLineBottomLeftY}/>
163
+ <View style={styles.reactLineBottomRightX}/>
164
+ <View style={styles.reactLineBottomRightY}/>
165
+ </View>
166
+ <View style={styles.rectangleRight}/>
167
+ </View>
168
+
169
+ {/* <TouchableOpacity onPress={() => setTorchOn(!torchOn)}>
170
+ <Image
171
+ source={
172
+ torchOn
173
+ ? require("./assets/flashlight-blue.png")
174
+ : require("./assets/flashlight-white.png")
175
+ }
176
+ style={styles.flashlight}
177
+ />
178
+ </TouchableOpacity> */}
179
+ <Text style={styles.rectangleText}>
180
+ 将二维码/条码放入框内,即可自动扫描
181
+ </Text>
182
+ </View>
183
+ <View style={pointStyle}/>
184
+ </Camera>
185
+ </TouchableOpacity>);
155
186
  });
156
187
  const transparent = "#00000000";
157
188
  const lineColor = "#6ab3ff";
@@ -1,3 +1,10 @@
1
+ /*
2
+ * @Author: shiguo
3
+ * @Date: 2021-04-27 10:38:04
4
+ * @LastEditors: shiguo
5
+ * @LastEditTime: 2022-09-09 10:58:34
6
+ * @FilePath: /@aks-dev/easyui/lib/Hud/Toast/Toast.tsx
7
+ */
1
8
  import React, { useImperativeHandle, useState, useRef } from "react";
2
9
  import { View, StyleSheet, Text, Dimensions, Animated, Easing, } from "react-native";
3
10
  const errorMsg = "(^_^)∠※ 送你一束小花";
@@ -26,11 +33,13 @@ export const Toast = React.forwardRef((_, ref) => {
26
33
  fadeAnimation.start();
27
34
  },
28
35
  }));
29
- return (React.createElement(Animated.View, { style: Object.assign(Object.assign({}, styles.toastContainer), { opacity: fade }) },
30
- React.createElement(View, { style: styles.toastTipsContainer },
31
- React.createElement(Text, { numberOfLines: 5, style: Object.assign({}, styles.toastTitle) },
32
- tipText,
33
- " "))));
36
+ return (<Animated.View style={Object.assign(Object.assign({}, styles.toastContainer), { opacity: fade })}>
37
+ <View style={styles.toastTipsContainer}>
38
+ <Text numberOfLines={5} style={Object.assign({}, styles.toastTitle)}>
39
+ {tipText}{" "}
40
+ </Text>
41
+ </View>
42
+ </Animated.View>);
34
43
  });
35
44
  export const toastRef = React.createRef();
36
45
  export const showToast = (content) => { var _a; return (_a = toastRef.current) === null || _a === void 0 ? void 0 : _a.showToast(content); };
@@ -47,6 +56,7 @@ const styles = StyleSheet.create({
47
56
  position: "absolute",
48
57
  backgroundColor: "#00000088",
49
58
  padding: 10,
59
+ // paddingVertical: 4,
50
60
  borderRadius: 2,
51
61
  justifyContent: "center",
52
62
  alignItems: "center",