react-native-timacare 3.1.6-beta → 3.1.7-beta

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 (65) hide show
  1. package/lib/commonjs/assets/svgs/index.js +1 -1
  2. package/lib/commonjs/assets/svgs/index.js.flow +2 -0
  3. package/lib/commonjs/assets/svgs/index.js.map +1 -1
  4. package/lib/commonjs/assets/svgs/upload.svg +3 -0
  5. package/lib/commonjs/screens/toan-trinh-so/OCR.js +1 -1
  6. package/lib/commonjs/screens/toan-trinh-so/OCR.js.flow +66 -0
  7. package/lib/commonjs/screens/toan-trinh-so/OCR.js.map +1 -1
  8. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js +1 -1
  9. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.flow +4 -1
  10. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  11. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js +1 -1
  12. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.flow +63 -64
  13. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
  14. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  15. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.flow +15 -3
  16. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  17. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js +1 -1
  18. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.flow +10 -4
  19. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  20. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js +1 -1
  21. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.flow +118 -75
  22. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
  23. package/lib/commonjs/screens/toan-trinh-so/store.js +1 -1
  24. package/lib/commonjs/screens/toan-trinh-so/store.js.flow +18 -0
  25. package/lib/commonjs/screens/toan-trinh-so/store.js.map +1 -1
  26. package/lib/commonjs/services/api/api.js.flow +2 -0
  27. package/lib/module/assets/svgs/index.js +1 -1
  28. package/lib/module/assets/svgs/index.js.map +1 -1
  29. package/lib/module/assets/svgs/upload.svg +3 -0
  30. package/lib/module/screens/toan-trinh-so/OCR.js +1 -1
  31. package/lib/module/screens/toan-trinh-so/OCR.js.map +1 -1
  32. package/lib/module/screens/toan-trinh-so/RegisterCamera.js +1 -1
  33. package/lib/module/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  34. package/lib/module/screens/toan-trinh-so/ReviewInformation.js +1 -1
  35. package/lib/module/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
  36. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  37. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  38. package/lib/module/screens/toan-trinh-so/ReviewLoan.js +1 -1
  39. package/lib/module/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  40. package/lib/module/screens/toan-trinh-so/VehicleCamera.js +1 -1
  41. package/lib/module/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
  42. package/lib/module/screens/toan-trinh-so/store.js +1 -1
  43. package/lib/module/screens/toan-trinh-so/store.js.map +1 -1
  44. package/lib/typescript/assets/svgs/index.d.ts +2 -1
  45. package/lib/typescript/assets/svgs/index.d.ts.map +1 -1
  46. package/lib/typescript/screens/toan-trinh-so/OCR.d.ts.map +1 -1
  47. package/lib/typescript/screens/toan-trinh-so/RegisterCamera.d.ts.map +1 -1
  48. package/lib/typescript/screens/toan-trinh-so/ReviewInformation.d.ts.map +1 -1
  49. package/lib/typescript/screens/toan-trinh-so/ReviewInformationOther.d.ts.map +1 -1
  50. package/lib/typescript/screens/toan-trinh-so/ReviewLoan.d.ts.map +1 -1
  51. package/lib/typescript/screens/toan-trinh-so/VehicleCamera.d.ts.map +1 -1
  52. package/lib/typescript/screens/toan-trinh-so/store.d.ts +2 -0
  53. package/lib/typescript/screens/toan-trinh-so/store.d.ts.map +1 -1
  54. package/lib/typescript/services/api/api.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/src/assets/svgs/index.tsx +2 -0
  57. package/src/assets/svgs/upload.svg +3 -0
  58. package/src/screens/toan-trinh-so/OCR.tsx +66 -0
  59. package/src/screens/toan-trinh-so/RegisterCamera.tsx +4 -1
  60. package/src/screens/toan-trinh-so/ReviewInformation.tsx +63 -64
  61. package/src/screens/toan-trinh-so/ReviewInformationOther.tsx +15 -3
  62. package/src/screens/toan-trinh-so/ReviewLoan.tsx +10 -4
  63. package/src/screens/toan-trinh-so/VehicleCamera.tsx +118 -75
  64. package/src/screens/toan-trinh-so/store.ts +18 -0
  65. package/src/services/api/api.ts +2 -0
@@ -465,6 +465,13 @@ export default function ReviewLoan(props: any) {
465
465
  : appStore.listLoanTime,
466
466
  callback: (value) => {
467
467
  setFieldValue('loanTime', value?.id);
468
+ getInfoInsurence(
469
+ values.loanAmount,
470
+ value?.id,
471
+ values?.rateTypeId,
472
+ values.timeInsurenceCustomer?.id,
473
+ values.timeInsuranceProperty?.id
474
+ );
468
475
  },
469
476
  });
470
477
  }}
@@ -586,7 +593,7 @@ export default function ReviewLoan(props: any) {
586
593
  }}
587
594
  >
588
595
  <MText style={{ fontSize: 12, color: '#333333' }}>
589
- {values.timeInsurenceCustomer?.name}
596
+ {values.timeInsurenceCustomer?.name ?? 'Chọn thời gian'}
590
597
  </MText>
591
598
  <DropDown2 />
592
599
  </TouchableOpacity>
@@ -679,7 +686,7 @@ export default function ReviewLoan(props: any) {
679
686
  }}
680
687
  >
681
688
  <MText style={{ fontSize: 12, color: '#333333' }}>
682
- {values.timeInsuranceProperty?.name}
689
+ {values.timeInsuranceProperty?.name ?? 'Chọn thời gian'}
683
690
  </MText>
684
691
  <DropDown2 />
685
692
  </TouchableOpacity>
@@ -1116,11 +1123,10 @@ export default function ReviewLoan(props: any) {
1116
1123
  </MText>
1117
1124
  </LinearGradient>
1118
1125
  </MButton>
1119
-
1120
- <KeyboardSpacer />
1121
1126
  </ScrollView>
1122
1127
  )}
1123
1128
  </Formik>
1129
+ <KeyboardSpacer />
1124
1130
  </View>
1125
1131
  </View>
1126
1132
  <Loading isLoading={isLoading} />
@@ -33,6 +33,8 @@ import { RNCamera } from 'react-native-camera';
33
33
  import { commonStyles } from '../CommonStyles';
34
34
  import { ScreenNames } from '../../navigation';
35
35
  import { load, OCR_V2, save } from '../../utils/storage';
36
+ import { IconUpload } from '../../assets/svgs';
37
+ import ImagePicker from 'react-native-image-crop-picker';
36
38
 
37
39
  export default function VehicleCamera(props: any) {
38
40
  const navigation = useNavigation();
@@ -173,6 +175,25 @@ export default function VehicleCamera(props: any) {
173
175
  loadIntro();
174
176
  }, []);
175
177
 
178
+ const pickImageFromGallery = async () => {
179
+ ImagePicker.openPicker({}).then((image) => {
180
+ if (props?.route?.params?.front) {
181
+ navigation.push(ScreenNames.VehicleRegistrationFront, {
182
+ uri: image?.sourceURL,
183
+ loan: props?.route?.params?.loan,
184
+ });
185
+ } else if (props.route?.params?.callback) {
186
+ navigation.goBack();
187
+ props.route?.params?.callback(image?.sourceURL);
188
+ } else {
189
+ navigation.push(ScreenNames.VehicleRegistrationBack, {
190
+ uri: image?.sourceURL,
191
+ loan: props?.route?.params?.loan,
192
+ });
193
+ }
194
+ });
195
+ };
196
+
176
197
  return (
177
198
  <View
178
199
  style={[$flex, { backgroundColor: 'black' }]}
@@ -211,96 +232,115 @@ export default function VehicleCamera(props: any) {
211
232
  if (status !== 'READY') return <ActivityIndicator />;
212
233
  }}
213
234
  </RNCamera>
235
+ <TouchableOpacity
236
+ onPress={() => {
237
+ pickImageFromGallery();
238
+ }}
239
+ style={{
240
+ flexDirection: 'row',
241
+ alignItems: 'center',
242
+ gap: 8,
243
+ marginTop: 16,
244
+ }}
245
+ >
246
+ <IconUpload />
247
+ <MText
248
+ style={{
249
+ color: 'white',
250
+ fontSize: 12,
251
+ }}
252
+ >
253
+ Tải ảnh từ thư viện
254
+ </MText>
255
+ </TouchableOpacity>
214
256
  </View>
215
257
  )}
216
258
 
217
- {!showModal && (
218
- <SafeAreaView
259
+ <SafeAreaView
260
+ style={[
261
+ commonStyles.fill,
262
+ { position: 'absolute', width: '100%', height: '100%' },
263
+ ]}
264
+ >
265
+ <View
219
266
  style={[
220
- commonStyles.fill,
221
- { position: 'absolute', width: '100%', height: '100%' },
267
+ commonStyles.row,
268
+ commonStyles.alignCenter,
269
+ { paddingVertical: 16 },
222
270
  ]}
223
271
  >
224
- <View
272
+ <MButton
273
+ onPress={() => {
274
+ navigation.goBack();
275
+ }}
225
276
  style={[
226
- commonStyles.row,
227
- commonStyles.alignCenter,
228
- { paddingVertical: 16 },
277
+ {
278
+ width: 48,
279
+ height: 48,
280
+ zIndex: 1000,
281
+ position: 'absolute',
282
+ left: 16,
283
+ top: 16,
284
+ },
229
285
  ]}
230
286
  >
231
- <MButton
232
- onPress={() => {
233
- navigation.goBack();
234
- }}
235
- style={[
236
- {
237
- width: 48,
238
- height: 48,
239
- zIndex: 1000,
240
- position: 'absolute',
241
- left: 16,
242
- top: 16,
243
- },
244
- ]}
245
- >
246
- <IconBackWhite />
247
- </MButton>
248
- <View style={{ flex: 1, alignItems: 'center' }}>
249
- <MText style={$title}>ĐĂNG KÝ XE</MText>
250
- </View>
287
+ <IconBackWhite />
288
+ </MButton>
289
+ <View style={{ flex: 1, alignItems: 'center' }}>
290
+ <MText style={$title}>ĐĂNG KÝ XE</MText>
251
291
  </View>
252
- <MText
253
- style={{
254
- color: 'white',
255
- textAlign: 'center',
256
- }}
257
- >
258
- {title}
259
- </MText>
260
- <View
261
- style={{
262
- position: 'absolute',
263
- bottom: 20,
264
- left: 0,
265
- right: 0,
266
- }}
267
- >
268
- {!taking && (
269
- <>
270
- <MText
271
- style={{
272
- color: 'white',
273
- textAlign: 'center',
274
- fontSize: 14,
275
- }}
276
- >
277
- Vui lòng đặt giấy tờ nằm vừa khung hình chữ nhật,{'\n'}chụp đủ
278
- ánh sáng nét.
279
- </MText>
280
- <View
281
- style={{
282
- alignItems: 'center',
283
- marginVertical: 24,
292
+ </View>
293
+ <MText
294
+ style={{
295
+ color: 'white',
296
+ textAlign: 'center',
297
+ }}
298
+ >
299
+ {title}
300
+ </MText>
301
+ <View
302
+ style={{
303
+ position: 'absolute',
304
+ bottom: 20,
305
+ left: 0,
306
+ right: 0,
307
+ }}
308
+ >
309
+ {!taking && (
310
+ <>
311
+ <MText
312
+ style={{
313
+ color: 'white',
314
+ textAlign: 'center',
315
+ fontSize: 14,
316
+ }}
317
+ >
318
+ Vui lòng đặt giấy tờ nằm vừa khung hình chữ nhật,{'\n'}chụp đủ
319
+ ánh sáng và rõ nét.
320
+ </MText>
321
+ <View
322
+ style={{
323
+ alignItems: 'center',
324
+ marginVertical: 24,
325
+ }}
326
+ >
327
+ <MButton
328
+ onPress={() => {
329
+ takePhoto();
284
330
  }}
285
331
  >
286
- <MButton
287
- onPress={() => {
288
- takePhoto();
289
- }}
290
- >
291
- <TakePhotoSvg />
292
- </MButton>
293
- </View>
294
- </>
295
- )}
296
- </View>
297
- </SafeAreaView>
298
- )}
332
+ <TakePhotoSvg />
333
+ </MButton>
334
+ </View>
335
+ </>
336
+ )}
337
+ </View>
338
+ </SafeAreaView>
299
339
  <Modal
300
340
  isVisible={showModal}
301
341
  style={$modal}
302
342
  backdropTransitionInTiming={0}
303
- nimationOutTiming={200}
343
+ animationOutTiming={200}
304
344
  animationInTiming={200}
305
345
  animationIn={'slideInUp'}
306
346
  animationOut={'fadeOutDown'}
@@ -311,7 +351,10 @@ export default function VehicleCamera(props: any) {
311
351
  <View style={$paddingV}>
312
352
  <TouchableOpacity
313
353
  onPress={() => {
314
- navigation.goBack();
354
+ setShowModal(false);
355
+ setTimeout(() => {
356
+ navigation.goBack();
357
+ }, 100);
315
358
  }}
316
359
  style={{
317
360
  width: 24,
@@ -15,6 +15,7 @@ class Store {
15
15
  listBrand = []
16
16
 
17
17
  listRelationship = []
18
+ listJob = []
18
19
 
19
20
  constructor() {
20
21
  makeAutoObservable(this);
@@ -231,6 +232,23 @@ class Store {
231
232
  }
232
233
  }
233
234
 
235
+
236
+ async getJob() {
237
+ try {
238
+ const response = await Api.getInstance().getJobTima();
239
+ if (response.kind === 'ok') {
240
+ if (response.data.meta.errorCode === 200) {
241
+ this.listJob = response.data.data;
242
+ } else {
243
+ Alert.alert('Thông báo', response.data.meta.errorMessage);
244
+ }
245
+ } else {
246
+ // Alert.alert('Thông báo', 'Không lấy được danh sách nghề nghi.');
247
+ }
248
+ } catch (error) {
249
+ console.log(error);
250
+ }
251
+ }
234
252
  }
235
253
 
236
254
  const ttsStore = new Store();
@@ -2862,4 +2862,6 @@ export class Api {
2862
2862
  return { kind: "bad-data" }
2863
2863
  }
2864
2864
  }
2865
+
2866
+
2865
2867
  }