react-native-timacare 3.1.14-beta → 3.1.16-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 (73) hide show
  1. package/lib/commonjs/assets/svgs/edit_disable.svg +15 -0
  2. package/lib/commonjs/assets/svgs/edit_success.svg +9 -6
  3. package/lib/commonjs/assets/svgs/ekyc_success.svg +6 -3
  4. package/lib/commonjs/assets/svgs/index.js +1 -1
  5. package/lib/commonjs/assets/svgs/index.js.flow +2 -0
  6. package/lib/commonjs/assets/svgs/index.js.map +1 -1
  7. package/lib/commonjs/assets/svgs/orc_success.svg +16 -11
  8. package/lib/commonjs/assets/svgs/sign_success.svg +8 -5
  9. package/lib/commonjs/screens/home/index.js +1 -1
  10. package/lib/commonjs/screens/home/index.js.flow +239 -32
  11. package/lib/commonjs/screens/home/index.js.map +1 -1
  12. package/lib/commonjs/screens/liveness-v2/index.js +1 -1
  13. package/lib/commonjs/screens/liveness-v2/index.js.flow +9 -1
  14. package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
  15. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  16. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.flow +3 -4
  17. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  18. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js +1 -1
  19. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.flow +3 -3
  20. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  21. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js +1 -1
  22. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js.flow +3 -0
  23. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js.map +1 -1
  24. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js +1 -1
  25. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.flow +10 -6
  26. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
  27. package/lib/commonjs/services/api/api.js +1 -1
  28. package/lib/commonjs/services/api/api.js.flow +16 -0
  29. package/lib/commonjs/services/api/api.js.map +1 -1
  30. package/lib/module/assets/svgs/edit_disable.svg +15 -0
  31. package/lib/module/assets/svgs/edit_success.svg +9 -6
  32. package/lib/module/assets/svgs/ekyc_success.svg +6 -3
  33. package/lib/module/assets/svgs/index.js +1 -1
  34. package/lib/module/assets/svgs/index.js.map +1 -1
  35. package/lib/module/assets/svgs/orc_success.svg +16 -11
  36. package/lib/module/assets/svgs/sign_success.svg +8 -5
  37. package/lib/module/screens/home/index.js +1 -1
  38. package/lib/module/screens/home/index.js.map +1 -1
  39. package/lib/module/screens/liveness-v2/index.js +1 -1
  40. package/lib/module/screens/liveness-v2/index.js.map +1 -1
  41. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  42. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  43. package/lib/module/screens/toan-trinh-so/ReviewLoan.js +1 -1
  44. package/lib/module/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  45. package/lib/module/screens/toan-trinh-so/TTSOTP.js +1 -1
  46. package/lib/module/screens/toan-trinh-so/TTSOTP.js.map +1 -1
  47. package/lib/module/screens/toan-trinh-so/TTSSignLoan.js +1 -1
  48. package/lib/module/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
  49. package/lib/module/services/api/api.js +1 -1
  50. package/lib/module/services/api/api.js.map +1 -1
  51. package/lib/typescript/assets/svgs/index.d.ts +2 -1
  52. package/lib/typescript/assets/svgs/index.d.ts.map +1 -1
  53. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  54. package/lib/typescript/screens/liveness-v2/index.d.ts.map +1 -1
  55. package/lib/typescript/screens/toan-trinh-so/ReviewInformationOther.d.ts.map +1 -1
  56. package/lib/typescript/screens/toan-trinh-so/TTSOTP.d.ts.map +1 -1
  57. package/lib/typescript/screens/toan-trinh-so/TTSSignLoan.d.ts.map +1 -1
  58. package/lib/typescript/services/api/api.d.ts +16 -0
  59. package/lib/typescript/services/api/api.d.ts.map +1 -1
  60. package/package.json +1 -1
  61. package/src/assets/svgs/edit_disable.svg +15 -0
  62. package/src/assets/svgs/edit_success.svg +9 -6
  63. package/src/assets/svgs/ekyc_success.svg +6 -3
  64. package/src/assets/svgs/index.tsx +2 -0
  65. package/src/assets/svgs/orc_success.svg +16 -11
  66. package/src/assets/svgs/sign_success.svg +8 -5
  67. package/src/screens/home/index.tsx +239 -32
  68. package/src/screens/liveness-v2/index.tsx +9 -1
  69. package/src/screens/toan-trinh-so/ReviewInformationOther.tsx +3 -4
  70. package/src/screens/toan-trinh-so/ReviewLoan.tsx +3 -3
  71. package/src/screens/toan-trinh-so/TTSOTP.tsx +3 -0
  72. package/src/screens/toan-trinh-so/TTSSignLoan.tsx +10 -6
  73. package/src/services/api/api.ts +16 -0
@@ -92,6 +92,7 @@ import {
92
92
  IconExpandUp,
93
93
  IconSignSuccess,
94
94
  IconMoney2,
95
+ IconEditDisable,
95
96
  } from '../../assets/svgs';
96
97
  import { o } from 'ramda';
97
98
 
@@ -124,15 +125,16 @@ export const Home = observer(function Home() {
124
125
  setExpandedId((prev) => (prev === id ? null : id));
125
126
  };
126
127
 
127
- const onRefresh = () => {
128
+ const onRefresh = async () => {
128
129
  setIsLoading(true);
129
- homeStore.getListLoan();
130
- homeStore.getListLoanPending(
131
- async (res) => {
132
- setListLoan(res);
133
- if (res) {
130
+ try {
131
+ const response = await Api.getInstance().listLoanPending();
132
+ setIsLoading(false);
133
+ if (response.kind === 'ok') {
134
+ if (response.data?.meta?.errorCode === 200) {
135
+ setListLoan(response.data?.data);
134
136
  Promise.all(
135
- res?.map(async (item) => {
137
+ response.data?.data?.map(async (item) => {
136
138
  homeStore.getCheckEKYC(
137
139
  { loanBriefId: item.id },
138
140
  (response) => {}
@@ -165,13 +167,62 @@ export const Home = observer(function Home() {
165
167
  }
166
168
  })
167
169
  );
170
+ } else {
171
+ Alert.alert('Thông báo', response?.data?.meta?.errorMessage);
168
172
  }
169
- setIsLoading(false);
170
- },
171
- () => {
172
- setIsLoading(false);
173
+ } else {
174
+ Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau');
173
175
  }
174
- );
176
+ } catch (error) {
177
+ console.log(error);
178
+ setIsLoading(false);
179
+ }
180
+
181
+ // homeStore.getListLoanPending(
182
+ // async (res) => {
183
+ // setListLoan(res);
184
+ // if (res) {
185
+ // Promise.all(
186
+ // res?.map(async (item) => {
187
+ // homeStore.getCheckEKYC(
188
+ // { loanBriefId: item.id },
189
+ // (response) => {}
190
+ // );
191
+ // if (item?.productId !== 8) {
192
+ // if (item?.messageErrorCIMB && item.messageErrorCIMB !== '') {
193
+ // setLoanCimb(item);
194
+ // setTimeout(() => {
195
+ // setShowModal(true);
196
+ // }, 200);
197
+ // }
198
+ // if (
199
+ // (item?.typeLoan === 4 || item?.typeLoan === 2) &&
200
+ // item?.isCimbApproveFull !== null
201
+ // ) {
202
+ // const checkShow = await load(`SHOW_${item?.id}`);
203
+ // if (!checkShow || checkShow !== true) {
204
+ // setLoanCimb(item);
205
+ // setTimeout(() => {
206
+ // setShowModal2(true);
207
+ // }, 200);
208
+ // }
209
+ // }
210
+ // }
211
+ // if (item?.typeLoan === 5 && item.step === 5) {
212
+ // setLoan(item);
213
+ // setTimeout(() => {
214
+ // setShowModal3(true);
215
+ // }, 300);
216
+ // }
217
+ // })
218
+ // );
219
+ // }
220
+ // setIsLoading(false);
221
+ // },
222
+ // () => {
223
+ // setIsLoading(false);
224
+ // }
225
+ // );
175
226
  };
176
227
 
177
228
  useEffect(() => {
@@ -181,11 +232,12 @@ export const Home = observer(function Home() {
181
232
  useEffect(() => {
182
233
  navigation.addListener('focus', () => {
183
234
  onRefresh();
235
+ homeStore.getListLoan();
184
236
  getLocation();
185
237
  });
186
238
  }, [navigation]);
187
239
 
188
- useEffect(async () => {
240
+ useEffect(() => {
189
241
  setTimeout(() => {
190
242
  FullSubmitStore.getTypeMerried();
191
243
  FullSubmitStore.getListBank();
@@ -457,7 +509,12 @@ export const Home = observer(function Home() {
457
509
  }}
458
510
  >
459
511
  <LinearGradient
460
- colors={['#FF8E4F', '#EF592E']}
512
+ colors={
513
+ item?.listLoanAllAutoDE &&
514
+ item?.listLoanAllAutoDE.length > 0
515
+ ? ['#4CBA3D', '#98D788']
516
+ : ['#FF8E4F', '#EF592E']
517
+ }
461
518
  style={{
462
519
  borderTopLeftRadius: 8,
463
520
  borderTopRightRadius: 8,
@@ -516,7 +573,7 @@ export const Home = observer(function Home() {
516
573
  <View
517
574
  style={{
518
575
  marginHorizontal: -16,
519
- backgroundColor: '#FFF3E9',
576
+ backgroundColor: '#ECFFE8',
520
577
  paddingHorizontal: 16,
521
578
  paddingVertical: 8,
522
579
  marginTop: 16,
@@ -622,6 +679,7 @@ export const Home = observer(function Home() {
622
679
  item?.listLoanAllAutoDE.length > 0
623
680
  ? 16
624
681
  : 32,
682
+ paddingHorizontal: 24,
625
683
  }}
626
684
  >
627
685
  <TouchableOpacity
@@ -680,8 +738,10 @@ export const Home = observer(function Home() {
680
738
  >
681
739
  {item.step > 3 ? (
682
740
  <IconEditSuccess />
683
- ) : (
741
+ ) : item.step === 3 ? (
684
742
  <IconEdit />
743
+ ) : (
744
+ <IconEditDisable />
685
745
  )}
686
746
  <MText
687
747
  style={{
@@ -703,7 +763,7 @@ export const Home = observer(function Home() {
703
763
  style={$action}
704
764
  disabled={item?.step === 6 ? false : true}
705
765
  >
706
- {item?.step === 7 ? (
766
+ {item?.step <= 8 ? (
707
767
  <IconEkycSuccess />
708
768
  ) : item?.step <= 5 ? (
709
769
  <IconEkycDisable />
@@ -734,7 +794,7 @@ export const Home = observer(function Home() {
734
794
  });
735
795
  }}
736
796
  >
737
- {item?.step < 6 ? (
797
+ {item?.step <= 6 ? (
738
798
  <IconSignDisable />
739
799
  ) : item?.step === 8 ? (
740
800
  <IconSignSuccess />
@@ -775,25 +835,172 @@ export const Home = observer(function Home() {
775
835
  marginTop: 16,
776
836
  backgroundColor: '#FFF2F2',
777
837
  paddingHorizontal: 10,
778
- paddingVertical: 6,
838
+ paddingVertical: 10,
779
839
  borderRadius: 4,
840
+ justifyContent: 'space-between',
780
841
  }}
781
842
  >
782
- <Info />
783
- <MText
843
+ <View
784
844
  style={{
785
- color: '#E40010',
786
- fontSize: 10,
845
+ flexDirection: 'row',
846
+ alignItems: 'center',
847
+ gap: 8,
787
848
  }}
788
849
  >
789
- {item?.step < 3
790
- ? 'OCR chứng từ để được giải ngân nhanh nhất'
791
- : item?.step === 3
792
- ? 'Tiếp tục Cập nhật thông tin để giải ngân nhanh nhất'
793
- : item?.step === 6 || item?.step === 7
794
- ? 'Tiếp tục eKYC và Ký hợp đồng để giải ngân nhanh nhất'
795
- : 'Đơn vay đang trong quá trình xử lý'}
796
- </MText>
850
+ <Info />
851
+ <MText
852
+ style={{
853
+ color: '#E40010',
854
+ fontSize: 10,
855
+ }}
856
+ >
857
+ {item?.step < 3
858
+ ? 'OCR chứng từ để được giải ngân'
859
+ : item?.step === 3
860
+ ? `Tiếp tục Cập nhật thông tin để${'\n'}giải ngân nhanh nhất`
861
+ : item?.step === 6 || item?.step === 7
862
+ ? `Tiếp tục eKYC và Ký hợp đồng để${'\n'}giải ngân nhanh nhất`
863
+ : 'Đơn vay đang trong quá trình xử lý'}
864
+ </MText>
865
+ </View>
866
+ {item?.step < 3 ? (
867
+ <TouchableOpacity
868
+ onPress={() => {
869
+ if (item?.step === 0) {
870
+ navigation.push(ScreenNames.OCR, {
871
+ loan: item,
872
+ front: true,
873
+ });
874
+ } else if (item?.step === 1) {
875
+ navigation.push(
876
+ ScreenNames.VehicleCamera,
877
+ {
878
+ loan: item,
879
+ front: true,
880
+ }
881
+ );
882
+ } else if (item?.step === 2) {
883
+ navigation.push(
884
+ ScreenNames.RegisterCamera,
885
+ {
886
+ loan: item,
887
+ }
888
+ );
889
+ }
890
+ }}
891
+ >
892
+ <LinearGradient
893
+ colors={['#FF8E4F', '#EF592E']}
894
+ style={{
895
+ height: 24,
896
+ alignItems: 'center',
897
+ justifyContent: 'center',
898
+ borderRadius: 24,
899
+ paddingHorizontal: 10,
900
+ }}
901
+ >
902
+ <MText
903
+ style={{
904
+ color: 'white',
905
+ fontSize: 10,
906
+ }}
907
+ >
908
+ Đi tới OCR
909
+ </MText>
910
+ </LinearGradient>
911
+ </TouchableOpacity>
912
+ ) : item?.step === 3 ? (
913
+ <TouchableOpacity
914
+ onPress={() => {
915
+ if (item?.step === 3) {
916
+ navigation.push(
917
+ ScreenNames.ReviewInformation,
918
+ {
919
+ loan: item,
920
+ }
921
+ );
922
+ }
923
+ }}
924
+ >
925
+ <LinearGradient
926
+ colors={['#FF8E4F', '#EF592E']}
927
+ style={{
928
+ height: 24,
929
+ alignItems: 'center',
930
+ justifyContent: 'center',
931
+ borderRadius: 24,
932
+ paddingHorizontal: 10,
933
+ }}
934
+ >
935
+ <MText
936
+ style={{
937
+ color: 'white',
938
+ fontSize: 10,
939
+ }}
940
+ >
941
+ Cập nhật thông tin
942
+ </MText>
943
+ </LinearGradient>
944
+ </TouchableOpacity>
945
+ ) : item?.step === 6 ? (
946
+ <TouchableOpacity
947
+ onPress={() => {
948
+ navigation.push(ScreenNames.LivenessV2, {
949
+ loan: item,
950
+ });
951
+ }}
952
+ >
953
+ <LinearGradient
954
+ colors={['#FF8E4F', '#EF592E']}
955
+ style={{
956
+ height: 24,
957
+ alignItems: 'center',
958
+ justifyContent: 'center',
959
+ borderRadius: 24,
960
+ paddingHorizontal: 10,
961
+ }}
962
+ >
963
+ <MText
964
+ style={{
965
+ color: 'white',
966
+ fontSize: 10,
967
+ }}
968
+ >
969
+ Đi tới EKYC
970
+ </MText>
971
+ </LinearGradient>
972
+ </TouchableOpacity>
973
+ ) : item?.step === 7 ? (
974
+ <TouchableOpacity
975
+ onPress={() => {
976
+ navigation.push(ScreenNames.TTSSignLoan, {
977
+ loan: item,
978
+ });
979
+ }}
980
+ >
981
+ <LinearGradient
982
+ colors={['#FF8E4F', '#EF592E']}
983
+ style={{
984
+ height: 24,
985
+ alignItems: 'center',
986
+ justifyContent: 'center',
987
+ borderRadius: 24,
988
+ paddingHorizontal: 10,
989
+ }}
990
+ >
991
+ <MText
992
+ style={{
993
+ color: 'white',
994
+ fontSize: 10,
995
+ }}
996
+ >
997
+ Ký hợp đồng
998
+ </MText>
999
+ </LinearGradient>
1000
+ </TouchableOpacity>
1001
+ ) : (
1002
+ <></>
1003
+ )}
797
1004
  </View>
798
1005
  )}
799
1006
  <View
@@ -838,7 +1045,7 @@ export const Home = observer(function Home() {
838
1045
  color: '#333333',
839
1046
  }}
840
1047
  >
841
- Danh sách đơn đồng
1048
+ Danh sách đơn chia nhỏ
842
1049
  </MText>
843
1050
  {item?.listLoanAllAutoDE.map((x, index) => (
844
1051
  <View