react-native-timacare 3.3.48 → 3.3.50

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 (31) hide show
  1. package/lib/commonjs/screens/detail-loan/ShowQrCode.js +1 -1
  2. package/lib/commonjs/screens/detail-loan/ShowQrCode.js.flow +7 -1
  3. package/lib/commonjs/screens/detail-loan/ShowQrCode.js.map +1 -1
  4. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js +1 -1
  5. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.flow +1 -1
  6. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.map +1 -1
  7. package/lib/commonjs/screens/home/Frame1000013403.png +0 -0
  8. package/lib/commonjs/screens/home/index.js +1 -1
  9. package/lib/commonjs/screens/home/index.js.flow +209 -1
  10. package/lib/commonjs/screens/home/index.js.map +1 -1
  11. package/lib/commonjs/services/api/api.js +1 -1
  12. package/lib/commonjs/services/api/api.js.flow +20 -0
  13. package/lib/commonjs/services/api/api.js.map +1 -1
  14. package/lib/module/screens/detail-loan/ShowQrCode.js +1 -1
  15. package/lib/module/screens/detail-loan/ShowQrCode.js.map +1 -1
  16. package/lib/module/screens/detail-loan-tima/InforLoan.js +1 -1
  17. package/lib/module/screens/detail-loan-tima/InforLoan.js.map +1 -1
  18. package/lib/module/screens/home/Frame1000013403.png +0 -0
  19. package/lib/module/screens/home/index.js +1 -1
  20. package/lib/module/screens/home/index.js.map +1 -1
  21. package/lib/module/services/api/api.js +1 -1
  22. package/lib/module/services/api/api.js.map +1 -1
  23. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  24. package/lib/typescript/services/api/api.d.ts +16 -0
  25. package/lib/typescript/services/api/api.d.ts.map +1 -1
  26. package/package.json +1 -1
  27. package/src/screens/detail-loan/ShowQrCode.tsx +7 -1
  28. package/src/screens/detail-loan-tima/InforLoan.tsx +1 -1
  29. package/src/screens/home/Frame1000013403.png +0 -0
  30. package/src/screens/home/index.tsx +209 -1
  31. package/src/services/api/api.ts +20 -0
@@ -33,7 +33,10 @@ import {
33
33
  AddInfo,
34
34
  AddInfoDisable,
35
35
  Call,
36
+ CheckBox,
37
+ CheckBoxActive,
36
38
  CIMBSmall,
39
+ Close2Icon,
37
40
  CloseIcon,
38
41
  Contract,
39
42
  ContractActive,
@@ -76,6 +79,7 @@ import {
76
79
  } from 'react-native-permissions';
77
80
  import appStore from '../../AppStore';
78
81
  import Modal from 'react-native-modal';
82
+ import Pdf from 'react-native-pdf';
79
83
  import { Api } from '../../services/api';
80
84
  import { load, save } from '../../utils/storage';
81
85
  import SkeletonLoanList, {
@@ -143,6 +147,7 @@ const MODAL = {
143
147
  SUGGEST: 'SUGGEST', // showModal4
144
148
  ALERT: 'ALERT', // showModal5
145
149
  DIGITAL_SUGGEST: 'DIGITAL_SUGGEST', // showModal6
150
+ TCCIMB: 'TCCIMB', // popup xác nhận chia sẻ dữ liệu CIMB
146
151
  };
147
152
 
148
153
  export const Home = observer(function Home() {
@@ -157,6 +162,12 @@ export const Home = observer(function Home() {
157
162
  const [loanCimb, setLoanCimb] = useState(null);
158
163
  const [loan, setLoan] = useState(null);
159
164
  const [dataSuggest, setDataSuggest] = useState<any>();
165
+ // Popup xác nhận chia sẻ dữ liệu CIMB (isShowPopupTCCIMB)
166
+ const [loanTCCIMB, setLoanTCCIMB] = useState<any>(null);
167
+ const [checkTCCIMB, setCheckTCCIMB] = useState(false);
168
+ const [isConfirmingTCCIMB, setIsConfirmingTCCIMB] = useState(false);
169
+ // Modal full màn hình hiển thị file điều kiện & điều khoản CIMB (PDF)
170
+ const [showPolicyCIMB, setShowPolicyCIMB] = useState(false);
160
171
  const insets = useSafeAreaInsets();
161
172
 
162
173
  // Chỉ mở modal khi chưa có modal nào đang mở -> không bao giờ stack 2 modal
@@ -268,11 +279,18 @@ export const Home = observer(function Home() {
268
279
  openModal(MODAL.ALERT);
269
280
  }, 300);
270
281
  }
282
+
283
+ // Hiển thị popup xác nhận chia sẻ dữ liệu CIMB
284
+ if (item?.isShowPopupTCCIMB === true) {
285
+ setLoanTCCIMB(item);
286
+ setTimeout(() => {
287
+ openModal(MODAL.TCCIMB);
288
+ }, 300);
289
+ }
271
290
  })
272
291
  );
273
292
  }
274
293
  } else {
275
- // Alert.alert('Thông báo', response?.data?.meta?.errorMessage);
276
294
  }
277
295
  } else {
278
296
  Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau');
@@ -428,6 +446,36 @@ export const Home = observer(function Home() {
428
446
  );
429
447
  };
430
448
 
449
+ // Mở modal full màn hình điều kiện & điều khoản CIMB (hiển thị đè lên,
450
+ // KHÔNG đóng popup xác nhận TCCIMB)
451
+ const openPolicyCIMB = () => {
452
+ setShowPolicyCIMB(true);
453
+ };
454
+
455
+ // Xác nhận đồng ý chia sẻ dữ liệu CIMB
456
+ const confirmTCCIMB = async () => {
457
+ try {
458
+ setIsConfirmingTCCIMB(true);
459
+ const response = await Api.getInstance().confirmTCCIMB({
460
+ loanBriefId: loanTCCIMB?.id,
461
+ });
462
+ if (response.kind === 'ok' && response.data?.meta?.errorCode === 200) {
463
+ setCheckTCCIMB(false);
464
+ closeModalThen(() => onRefresh());
465
+ } else {
466
+ Alert.alert(
467
+ 'Thông báo',
468
+ response?.data?.meta?.errorMessage ||
469
+ 'Có lỗi xảy ra. Vui lòng thử lại sau'
470
+ );
471
+ }
472
+ } catch (error) {
473
+ Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau');
474
+ } finally {
475
+ setIsConfirmingTCCIMB(false);
476
+ }
477
+ };
478
+
431
479
  const checkTerm = (loan, action) => {
432
480
  if (loan?.isConfirmTimaRule && loan?.isConfirmTimaRule === true) {
433
481
  navigation.dispatch(StackActions.push(ScreenNames.Terms, loan));
@@ -2876,6 +2924,166 @@ export const Home = observer(function Home() {
2876
2924
  closeModal();
2877
2925
  }}
2878
2926
  />
2927
+
2928
+ {/* Popup xác nhận chia sẻ dữ liệu CIMB */}
2929
+ <Modal
2930
+ isVisible={activeModal === MODAL.TCCIMB}
2931
+ onModalHide={runPendingNav}
2932
+ style={{ margin: 0, justifyContent: 'center' }}
2933
+ {...modalSafeProps}
2934
+ >
2935
+ <View
2936
+ style={{
2937
+ marginHorizontal: 16,
2938
+ borderRadius: 12,
2939
+ backgroundColor: 'white',
2940
+ padding: 16,
2941
+ }}
2942
+ >
2943
+ <View style={{ flexDirection: 'row-reverse' }}>
2944
+ <TouchableOpacity
2945
+ onPress={() => closeModal()}
2946
+ style={{
2947
+ width: 30,
2948
+ height: 30,
2949
+ alignItems: 'center',
2950
+ justifyContent: 'center',
2951
+ }}
2952
+ >
2953
+ <Close2Icon />
2954
+ </TouchableOpacity>
2955
+ </View>
2956
+ <MText
2957
+ style={{
2958
+ fontSize: 16,
2959
+ fontWeight: '600',
2960
+ textAlign: 'center',
2961
+ fontFamily: 'BeVietnamPro-SemiBold',
2962
+ }}
2963
+ >
2964
+ Xác nhận chia sẻ dữ liệu
2965
+ </MText>
2966
+ <View
2967
+ style={{
2968
+ marginTop: 16,
2969
+ alignItems: 'center',
2970
+ }}
2971
+ >
2972
+ <Image
2973
+ source={require('./Frame1000013403.png')}
2974
+ style={{
2975
+ height: 46,
2976
+ resizeMode: 'contain',
2977
+ }}
2978
+ />
2979
+ </View>
2980
+ <MText
2981
+ style={{ color: '#828282', textAlign: 'center', marginTop: 16 }}
2982
+ >
2983
+ Tima sẽ chuyển thông tin của bạn đến Ngân hàng TNHH MTV CIMB Việt
2984
+ Nam (CIMB) để xem xét phê duyệt khoản vay. Khi chọn "Đồng ý & Tiếp
2985
+ tục", bạn đồng ý cho các bên liên quan thu thập, sử dụng, xử lý và
2986
+ chia sẻ dữ liệu cá nhân theo quy định của pháp luật. Sau khi
2987
+ chuyển giao dữ liệu, Tima là bên kiểm soát và xử lý dữ liệu cá
2988
+ nhân.
2989
+ </MText>
2990
+ <View
2991
+ style={{
2992
+ flexDirection: 'row',
2993
+ marginTop: 24,
2994
+ gap: 8,
2995
+ }}
2996
+ >
2997
+ <TouchableOpacity onPress={() => setCheckTCCIMB(!checkTCCIMB)}>
2998
+ {checkTCCIMB ? <CheckBoxActive /> : <CheckBox />}
2999
+ </TouchableOpacity>
3000
+ <MText style={{ flex: 1 }}>
3001
+ Tôi đã đọc và đồng ý với{' '}
3002
+ <MText
3003
+ style={{ color: '#2F80ED', textDecorationLine: 'underline' }}
3004
+ onPress={openPolicyCIMB}
3005
+ >
3006
+ Điều kiện và điều khoản
3007
+ </MText>{' '}
3008
+ xử lý dữ liệu của CIMB
3009
+ </MText>
3010
+ </View>
3011
+ <TouchableOpacity
3012
+ disabled={!checkTCCIMB || isConfirmingTCCIMB}
3013
+ onPress={() => confirmTCCIMB()}
3014
+ >
3015
+ <LinearGradient
3016
+ colors={
3017
+ checkTCCIMB ? ['#FF8E4F', '#EF592E'] : ['#E0E0E0', '#E0E0E0']
3018
+ }
3019
+ style={{
3020
+ height: 40,
3021
+ alignItems: 'center',
3022
+ justifyContent: 'center',
3023
+ borderRadius: 24,
3024
+ paddingHorizontal: 10,
3025
+ marginTop: 24,
3026
+ }}
3027
+ >
3028
+ {isConfirmingTCCIMB ? (
3029
+ <ActivityIndicator color="white" />
3030
+ ) : (
3031
+ <MText style={{ color: 'white', fontWeight: 'bold' }}>
3032
+ Đồng ý và tiếp tục
3033
+ </MText>
3034
+ )}
3035
+ </LinearGradient>
3036
+ </TouchableOpacity>
3037
+ </View>
3038
+
3039
+ {/* Overlay full màn hình hiển thị điều kiện & điều khoản CIMB (PDF).
3040
+ Lồng trong cùng modal để hiển thị đè lên popup xác nhận mà không
3041
+ phải stack 2 native modal (gây không mở được trên iOS) */}
3042
+ {showPolicyCIMB && (
3043
+ <View
3044
+ style={{
3045
+ position: 'absolute',
3046
+ top: 0,
3047
+ left: 0,
3048
+ right: 0,
3049
+ bottom: 0,
3050
+ backgroundColor: 'white',
3051
+ }}
3052
+ >
3053
+ <View
3054
+ style={{
3055
+ marginTop: insets.top,
3056
+ paddingVertical: 16,
3057
+ alignItems: 'center',
3058
+ justifyContent: 'center',
3059
+ flexDirection: 'row',
3060
+ }}
3061
+ >
3062
+ <TouchableOpacity
3063
+ onPress={() => setShowPolicyCIMB(false)}
3064
+ style={{ position: 'absolute', left: 16 }}
3065
+ >
3066
+ <Close2Icon />
3067
+ </TouchableOpacity>
3068
+ <MText style={{ fontWeight: 'bold' }}>
3069
+ ĐIỀU KIỆN VÀ ĐIỀU KHOẢN
3070
+ </MText>
3071
+ </View>
3072
+ <View style={{ flex: 1 }}>
3073
+ <Pdf
3074
+ trustAllCerts={false}
3075
+ source={{
3076
+ uri: 'https://cdn.tima.vn/file-pdf/policy_cimb.pdf',
3077
+ }}
3078
+ style={{
3079
+ flex: 1,
3080
+ width: Dimensions.get('window').width,
3081
+ }}
3082
+ />
3083
+ </View>
3084
+ </View>
3085
+ )}
3086
+ </Modal>
2879
3087
  </ScrollView>
2880
3088
  </View>
2881
3089
  );