react-native-timacare 3.1.38 → 3.1.39

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 (62) hide show
  1. package/lib/commonjs/navigation/primary-navigator.js +1 -1
  2. package/lib/commonjs/navigation/primary-navigator.js.flow +6 -0
  3. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  4. package/lib/commonjs/screens/camera/CCCDCameraScreen.js +2 -0
  5. package/lib/commonjs/screens/camera/CCCDCameraScreen.js.flow +273 -0
  6. package/lib/commonjs/screens/camera/CCCDCameraScreen.js.map +1 -0
  7. package/lib/commonjs/screens/camera/index.js +1 -1
  8. package/lib/commonjs/screens/camera/index.js.flow +59 -78
  9. package/lib/commonjs/screens/camera/index.js.map +1 -1
  10. package/lib/commonjs/screens/home/index.js +1 -1
  11. package/lib/commonjs/screens/home/index.js.flow +2078 -2132
  12. package/lib/commonjs/screens/home/index.js.map +1 -1
  13. package/lib/commonjs/screens/nationalID/index.js +1 -1
  14. package/lib/commonjs/screens/nationalID/index.js.flow +25 -45
  15. package/lib/commonjs/screens/nationalID/index.js.map +1 -1
  16. package/lib/commonjs/screens/nationalIDBack/index.js +1 -1
  17. package/lib/commonjs/screens/nationalIDBack/index.js.flow +24 -45
  18. package/lib/commonjs/screens/nationalIDBack/index.js.map +1 -1
  19. package/lib/commonjs/screens/register/index.js +1 -1
  20. package/lib/commonjs/screens/register/index.js.flow +1 -1
  21. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js +1 -1
  22. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.flow +0 -1
  23. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  24. package/lib/commonjs/services/api/api-config.js +1 -1
  25. package/lib/commonjs/services/api/api-config.js.flow +1 -1
  26. package/lib/commonjs/services/api/api-config.js.map +1 -1
  27. package/lib/module/navigation/primary-navigator.js +1 -1
  28. package/lib/module/navigation/primary-navigator.js.map +1 -1
  29. package/lib/module/screens/camera/CCCDCameraScreen.js +2 -0
  30. package/lib/module/screens/camera/CCCDCameraScreen.js.map +1 -0
  31. package/lib/module/screens/camera/index.js +1 -1
  32. package/lib/module/screens/camera/index.js.map +1 -1
  33. package/lib/module/screens/home/index.js +1 -1
  34. package/lib/module/screens/home/index.js.map +1 -1
  35. package/lib/module/screens/nationalID/index.js +1 -1
  36. package/lib/module/screens/nationalID/index.js.map +1 -1
  37. package/lib/module/screens/nationalIDBack/index.js +1 -1
  38. package/lib/module/screens/nationalIDBack/index.js.map +1 -1
  39. package/lib/module/screens/register/index.js +1 -1
  40. package/lib/module/screens/toan-trinh-so/RegisterCamera.js +1 -1
  41. package/lib/module/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  42. package/lib/module/services/api/api-config.js +1 -1
  43. package/lib/module/services/api/api-config.js.map +1 -1
  44. package/lib/typescript/navigation/primary-navigator.d.ts +1 -0
  45. package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
  46. package/lib/typescript/screens/camera/CCCDCameraScreen.d.ts +2 -0
  47. package/lib/typescript/screens/camera/CCCDCameraScreen.d.ts.map +1 -0
  48. package/lib/typescript/screens/camera/index.d.ts.map +1 -1
  49. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  50. package/lib/typescript/screens/nationalID/index.d.ts.map +1 -1
  51. package/lib/typescript/screens/nationalIDBack/index.d.ts.map +1 -1
  52. package/lib/typescript/screens/toan-trinh-so/RegisterCamera.d.ts.map +1 -1
  53. package/package.json +2 -1
  54. package/src/navigation/primary-navigator.tsx +6 -0
  55. package/src/screens/camera/CCCDCameraScreen.tsx +273 -0
  56. package/src/screens/camera/index.tsx +59 -78
  57. package/src/screens/home/index.tsx +2078 -2132
  58. package/src/screens/nationalID/index.tsx +25 -45
  59. package/src/screens/nationalIDBack/index.tsx +24 -45
  60. package/src/screens/register/index.tsx +1 -1
  61. package/src/screens/toan-trinh-so/RegisterCamera.tsx +0 -1
  62. package/src/services/api/api-config.ts +1 -1
@@ -21,6 +21,7 @@ import {
21
21
  } from '@react-navigation/native';
22
22
  import { observer, Observer } from 'mobx-react-lite';
23
23
  import { commonStyles } from '../CommonStyles';
24
+ import KeyboardSpacer from '../../components/keyboardspace';
24
25
  import MButton from '../../components/MButton';
25
26
  import { color } from '../../theme';
26
27
  import { ScreenNames } from '../../navigation';
@@ -45,7 +46,6 @@ import { toJS } from 'mobx';
45
46
  import Loading from '../../components/Loading';
46
47
  import LinearGradient from 'react-native-linear-gradient';
47
48
  import MHeader from '../../components/MHeader';
48
- import ImageEditor from '@react-native-community/image-editor';
49
49
 
50
50
  const logoView: ImageStyle = {
51
51
  position: 'absolute',
@@ -53,17 +53,15 @@ const logoView: ImageStyle = {
53
53
  height: '100%',
54
54
  resizeMode: 'cover',
55
55
  };
56
-
57
- const screenWidth = Dimensions.get('window').width;
58
- const screenHeight = Dimensions.get('window').height;
59
-
56
+ const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
60
57
  const frameWidth = screenWidth * 0.85;
61
- const frameHeight = screenWidth * 0.54;
58
+ const frameHeight = frameWidth * 0.63; // tỷ lệ giống CCCD
62
59
 
63
60
  export const NationalID = observer(function NationalID(props: any) {
64
61
  const navigation = useNavigation();
65
62
  const [isLoading, setIsLoading] = useState(false);
66
63
  const [photo, setPhoto] = useState(null);
64
+ const [base64, setBase64] = useState(null);
67
65
  const loan = toJS(props.route.params?.loan);
68
66
 
69
67
  const nextStep = () => {
@@ -97,39 +95,13 @@ export const NationalID = observer(function NationalID(props: any) {
97
95
 
98
96
  const takePhoto = () => {
99
97
  //@ts-ignore
100
- navigation.push(ScreenNames.Camera, {
98
+ navigation.push(ScreenNames.CCCDCameraScreen, {
101
99
  front: false,
102
100
  callback: (photo) => {
103
- Image.getSize(photo, async (imgWidth, imgHeight) => {
104
- const scaleFactor = 0.68; // Tỉ lệ thu phóng khung hình
105
- const widthRatio = imgWidth / screenWidth;
106
- const heightRatio = imgHeight / ((screenWidth * 4) / 3); // nếu preview là 4:3
107
- const frameLeft = (screenWidth - frameWidth) / 2;
108
- const frameTop = ((screenWidth * 4) / 3 - frameHeight) / 2;
109
- const cropData = {
110
- offset: {
111
- x:
112
- (frameLeft - (frameWidth * (scaleFactor - 1)) / 2) * widthRatio,
113
- y:
114
- (frameTop - (frameHeight * (scaleFactor - 1)) / 2) *
115
- heightRatio,
116
- },
117
- size: {
118
- width: frameWidth * widthRatio * scaleFactor,
119
- height: frameHeight * heightRatio * scaleFactor,
120
- },
121
- resizeMode: 'contain',
122
- };
123
- try {
124
- const croppedImageUri = await ImageEditor.cropImage(
125
- photo,
126
- cropData
127
- );
128
- setPhoto(croppedImageUri.uri);
129
- } catch (error) {
130
- console.error('Crop error:', error);
131
- }
132
- });
101
+ setPhoto(photo);
102
+ },
103
+ base64: (data) => {
104
+ setBase64(data);
133
105
  },
134
106
  });
135
107
  };
@@ -164,21 +136,28 @@ export const NationalID = observer(function NationalID(props: any) {
164
136
  Chụp CMND/ CCCD mặt trước
165
137
  </MText>
166
138
  </View>
167
- <Image
168
- source={
169
- photo
170
- ? { uri: photo }
171
- : require('../../assets/img/national_id.png')
172
- }
139
+ <View
173
140
  style={{
174
- width: frameWidth,
141
+ width: '100%',
175
142
  height: frameHeight,
176
143
  borderWidth: 8,
177
144
  borderRadius: 6,
178
145
  borderColor: '#FFFFFF',
179
146
  marginTop: 16,
180
147
  }}
181
- />
148
+ >
149
+ <Image
150
+ source={
151
+ photo
152
+ ? { uri: photo }
153
+ : require('../../assets/img/national_id.png')
154
+ }
155
+ style={{
156
+ width: '100%',
157
+ height: '100%',
158
+ }}
159
+ />
160
+ </View>
182
161
  <View style={{ marginTop: 24 }}>
183
162
  <MText style={[commonStyles.textNormalBold, { fontSize: 16 }]}>
184
163
  Lưu ý chụp CMND/ CCCD
@@ -298,6 +277,7 @@ export const NationalID = observer(function NationalID(props: any) {
298
277
  <CIMBBank />
299
278
  </View>
300
279
  )}
280
+ <KeyboardSpacer />
301
281
  </SafeAreaView>
302
282
  <Loading isLoading={isLoading} />
303
283
  </View>
@@ -30,7 +30,6 @@ import nationalIDStore from './Store';
30
30
  import Loading from '../../components/Loading';
31
31
  import LinearGradient from 'react-native-linear-gradient';
32
32
  import MHeader from '../../components/MHeader';
33
- import ImageEditor from '@react-native-community/image-editor';
34
33
 
35
34
  const logoView: ImageStyle = {
36
35
  position: 'absolute',
@@ -39,16 +38,15 @@ const logoView: ImageStyle = {
39
38
  resizeMode: 'cover',
40
39
  };
41
40
 
42
- const screenWidth = Dimensions.get('window').width;
43
- const screenHeight = Dimensions.get('window').height;
44
-
41
+ const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
45
42
  const frameWidth = screenWidth * 0.85;
46
- const frameHeight = screenWidth * 0.54;
43
+ const frameHeight = frameWidth * 0.63; // tỷ lệ giống CCCD
47
44
 
48
45
  export const NationalIDBack = observer(function NationalIDBack(props: any) {
49
46
  const navigation = useNavigation();
50
47
  const [photo, setPhoto] = useState(null);
51
48
  const loan = props.route.params?.loan;
49
+ const [base64, setBase64] = useState(null);
52
50
  const [isLoading, setIsLoading] = useState(false);
53
51
 
54
52
  const nextStep = (values) => {
@@ -76,39 +74,14 @@ export const NationalIDBack = observer(function NationalIDBack(props: any) {
76
74
  };
77
75
 
78
76
  const takePhoto = () => {
79
- navigation.push(ScreenNames.Camera, {
77
+ //@ts-ignore
78
+ navigation.push(ScreenNames.CCCDCameraScreen, {
80
79
  front: false,
81
80
  callback: (photo) => {
82
- Image.getSize(photo, async (imgWidth, imgHeight) => {
83
- const scaleFactor = 0.68; // Tỉ lệ thu phóng khung hình
84
- const widthRatio = imgWidth / screenWidth;
85
- const heightRatio = imgHeight / ((screenWidth * 4) / 3); // nếu preview là 4:3
86
- const frameLeft = (screenWidth - frameWidth) / 2;
87
- const frameTop = ((screenWidth * 4) / 3 - frameHeight) / 2;
88
- const cropData = {
89
- offset: {
90
- x:
91
- (frameLeft - (frameWidth * (scaleFactor - 1)) / 2) * widthRatio,
92
- y:
93
- (frameTop - (frameHeight * (scaleFactor - 1)) / 2) *
94
- heightRatio,
95
- },
96
- size: {
97
- width: frameWidth * widthRatio * scaleFactor,
98
- height: frameHeight * heightRatio * scaleFactor,
99
- },
100
- resizeMode: 'contain',
101
- };
102
- try {
103
- const croppedImageUri = await ImageEditor.cropImage(
104
- photo,
105
- cropData
106
- );
107
- setPhoto(croppedImageUri.uri);
108
- } catch (error) {
109
- console.error('Crop error:', error);
110
- }
111
- });
81
+ setPhoto(photo);
82
+ },
83
+ base64: (data) => {
84
+ setBase64(data);
112
85
  },
113
86
  });
114
87
  };
@@ -143,22 +116,28 @@ export const NationalIDBack = observer(function NationalIDBack(props: any) {
143
116
  Chụp CMND/ CCCD mặt sau
144
117
  </MText>
145
118
  </View>
146
-
147
- <Image
148
- source={
149
- photo
150
- ? { uri: photo }
151
- : require('../../assets/img/national_id_back.png')
152
- }
119
+ <View
153
120
  style={{
154
- width: frameWidth,
121
+ width: '100%',
155
122
  height: frameHeight,
156
123
  borderWidth: 8,
157
124
  borderRadius: 6,
158
125
  borderColor: '#FFFFFF',
159
126
  marginTop: 16,
160
127
  }}
161
- />
128
+ >
129
+ <Image
130
+ source={
131
+ photo
132
+ ? { uri: photo }
133
+ : require('../../assets/img/national_id_back.png')
134
+ }
135
+ style={{
136
+ width: '100%',
137
+ height: '100%',
138
+ }}
139
+ />
140
+ </View>
162
141
  <View style={{ marginTop: 24 }}>
163
142
  <MText style={[commonStyles.textNormalBold, { fontSize: 16 }]}>
164
143
  Lưu ý chụp CMND/ CCCD
@@ -184,7 +184,7 @@ export const Register = observer(function Register() {
184
184
  <View style={{ marginTop: 50 }}>
185
185
  <Formik
186
186
  initialValues={{
187
- phone: __DEV__ ? '0339223176' : '',
187
+ phone: __DEV__ ? '0839621640' : '',
188
188
  terms: true,
189
189
  }}
190
190
  onSubmit={(values) => {
@@ -149,7 +149,6 @@ export default function RegisterCamera(props: any) {
149
149
 
150
150
  useEffect(() => {
151
151
  let timeout: NodeJS.Timeout;
152
-
153
152
  if (isFocused) {
154
153
  // Delay mounting camera to give Android time to release the previous one
155
154
  timeout = setTimeout(() => {
@@ -1,5 +1,5 @@
1
1
  // const API_URL = 'https://apiapplos.tima.vn/'
2
- const API_URL = __DEV__ ? 'https://apidevlos.tima.vn/' : 'https://apiapplos.tima.vn/'
2
+ const API_URL = 'https://apidevlos.tima.vn/'
3
3
  export interface ApiConfig {
4
4
  url: string
5
5
  timeout: number