react-native-timacare 3.3.19 → 3.3.20

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 (99) hide show
  1. package/lib/commonjs/components/keyboardspace/index.js +1 -1
  2. package/lib/commonjs/components/keyboardspace/index.js.flow +0 -2
  3. package/lib/commonjs/components/keyboardspace/index.js.map +1 -1
  4. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js +1 -1
  5. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.flow +29 -4
  6. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.map +1 -1
  7. package/lib/commonjs/screens/detail-loan/Info.js +1 -1
  8. package/lib/commonjs/screens/detail-loan/Info.js.flow +16 -8
  9. package/lib/commonjs/screens/detail-loan/Info.js.map +1 -1
  10. package/lib/commonjs/screens/detail-loan/Payment.js +1 -1
  11. package/lib/commonjs/screens/detail-loan/Payment.js.flow +19 -7
  12. package/lib/commonjs/screens/detail-loan/Payment.js.map +1 -1
  13. package/lib/commonjs/screens/detail-loan/PaymentAll.js +1 -1
  14. package/lib/commonjs/screens/detail-loan/PaymentAll.js.flow +49 -9
  15. package/lib/commonjs/screens/detail-loan/PaymentAll.js.map +1 -1
  16. package/lib/commonjs/screens/detail-loan/PaymentInfo.js +1 -1
  17. package/lib/commonjs/screens/detail-loan/PaymentInfo.js.flow +735 -85
  18. package/lib/commonjs/screens/detail-loan/PaymentInfo.js.map +1 -1
  19. package/lib/commonjs/screens/detail-loan/ShowQrCode.js +1 -1
  20. package/lib/commonjs/screens/detail-loan/ShowQrCode.js.flow +372 -68
  21. package/lib/commonjs/screens/detail-loan/ShowQrCode.js.map +1 -1
  22. package/lib/commonjs/screens/detail-loan/index.js +1 -1
  23. package/lib/commonjs/screens/detail-loan/index.js.flow +37 -33
  24. package/lib/commonjs/screens/detail-loan/index.js.map +1 -1
  25. package/lib/commonjs/screens/guide-transfer-bank/TransferDetail.js +1 -1
  26. package/lib/commonjs/screens/guide-transfer-bank/TransferDetail.js.flow +41 -12
  27. package/lib/commonjs/screens/guide-transfer-bank/TransferDetail.js.map +1 -1
  28. package/lib/commonjs/screens/guide-transfer-bank/index.js +1 -1
  29. package/lib/commonjs/screens/guide-transfer-bank/index.js.flow +228 -237
  30. package/lib/commonjs/screens/guide-transfer-bank/index.js.map +1 -1
  31. package/lib/commonjs/screens/home/Store.js +1 -1
  32. package/lib/commonjs/screens/home/Store.js.flow +4 -1
  33. package/lib/commonjs/screens/home/Store.js.map +1 -1
  34. package/lib/commonjs/screens/home/index.js +1 -1
  35. package/lib/commonjs/screens/home/index.js.flow +15 -30
  36. package/lib/commonjs/screens/home/index.js.map +1 -1
  37. package/lib/commonjs/screens/liveness-v2/index.js +1 -1
  38. package/lib/commonjs/screens/liveness-v2/index.js.flow +4 -4
  39. package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
  40. package/lib/commonjs/services/api/api.js +1 -1
  41. package/lib/commonjs/services/api/api.js.flow +16 -0
  42. package/lib/commonjs/services/api/api.js.map +1 -1
  43. package/lib/module/components/keyboardspace/index.js +1 -1
  44. package/lib/module/components/keyboardspace/index.js.map +1 -1
  45. package/lib/module/screens/detail-loan/DetailLoanTima.js +1 -1
  46. package/lib/module/screens/detail-loan/DetailLoanTima.js.map +1 -1
  47. package/lib/module/screens/detail-loan/Info.js +1 -1
  48. package/lib/module/screens/detail-loan/Info.js.map +1 -1
  49. package/lib/module/screens/detail-loan/Payment.js +1 -1
  50. package/lib/module/screens/detail-loan/Payment.js.map +1 -1
  51. package/lib/module/screens/detail-loan/PaymentAll.js +1 -1
  52. package/lib/module/screens/detail-loan/PaymentAll.js.map +1 -1
  53. package/lib/module/screens/detail-loan/PaymentInfo.js +1 -1
  54. package/lib/module/screens/detail-loan/PaymentInfo.js.map +1 -1
  55. package/lib/module/screens/detail-loan/ShowQrCode.js +1 -1
  56. package/lib/module/screens/detail-loan/ShowQrCode.js.map +1 -1
  57. package/lib/module/screens/detail-loan/index.js +1 -1
  58. package/lib/module/screens/detail-loan/index.js.map +1 -1
  59. package/lib/module/screens/guide-transfer-bank/TransferDetail.js +1 -1
  60. package/lib/module/screens/guide-transfer-bank/TransferDetail.js.map +1 -1
  61. package/lib/module/screens/guide-transfer-bank/index.js +1 -1
  62. package/lib/module/screens/guide-transfer-bank/index.js.map +1 -1
  63. package/lib/module/screens/home/Store.js +1 -1
  64. package/lib/module/screens/home/Store.js.map +1 -1
  65. package/lib/module/screens/home/index.js +1 -1
  66. package/lib/module/screens/home/index.js.map +1 -1
  67. package/lib/module/screens/liveness-v2/index.js +1 -1
  68. package/lib/module/screens/liveness-v2/index.js.map +1 -1
  69. package/lib/module/services/api/api.js +1 -1
  70. package/lib/module/services/api/api.js.map +1 -1
  71. package/lib/typescript/components/keyboardspace/index.d.ts.map +1 -1
  72. package/lib/typescript/screens/detail-loan/DetailLoanTima.d.ts.map +1 -1
  73. package/lib/typescript/screens/detail-loan/Info.d.ts.map +1 -1
  74. package/lib/typescript/screens/detail-loan/Payment.d.ts.map +1 -1
  75. package/lib/typescript/screens/detail-loan/PaymentAll.d.ts.map +1 -1
  76. package/lib/typescript/screens/detail-loan/PaymentInfo.d.ts.map +1 -1
  77. package/lib/typescript/screens/detail-loan/ShowQrCode.d.ts.map +1 -1
  78. package/lib/typescript/screens/detail-loan/index.d.ts.map +1 -1
  79. package/lib/typescript/screens/guide-transfer-bank/TransferDetail.d.ts.map +1 -1
  80. package/lib/typescript/screens/guide-transfer-bank/index.d.ts.map +1 -1
  81. package/lib/typescript/screens/home/Store.d.ts.map +1 -1
  82. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  83. package/lib/typescript/services/api/api.d.ts +16 -0
  84. package/lib/typescript/services/api/api.d.ts.map +1 -1
  85. package/package.json +2 -1
  86. package/src/components/keyboardspace/index.tsx +0 -2
  87. package/src/screens/detail-loan/DetailLoanTima.tsx +29 -4
  88. package/src/screens/detail-loan/Info.tsx +16 -8
  89. package/src/screens/detail-loan/Payment.tsx +19 -7
  90. package/src/screens/detail-loan/PaymentAll.tsx +49 -9
  91. package/src/screens/detail-loan/PaymentInfo.tsx +735 -85
  92. package/src/screens/detail-loan/ShowQrCode.tsx +372 -68
  93. package/src/screens/detail-loan/index.tsx +37 -33
  94. package/src/screens/guide-transfer-bank/TransferDetail.tsx +41 -12
  95. package/src/screens/guide-transfer-bank/index.tsx +228 -237
  96. package/src/screens/home/Store.tsx +4 -1
  97. package/src/screens/home/index.tsx +15 -30
  98. package/src/screens/liveness-v2/index.tsx +4 -4
  99. package/src/services/api/api.ts +16 -0
@@ -1,25 +1,25 @@
1
- //@ts-nocheck
1
+ // @ts-nocheck
2
2
  import { observer } from 'mobx-react-lite';
3
- import React, { useEffect, useState } from 'react';
3
+ import React, { useEffect, useRef, useState } from 'react';
4
4
  import {
5
5
  Alert,
6
6
  Clipboard,
7
7
  Dimensions,
8
8
  Image,
9
- SafeAreaView,
9
+ Platform,
10
10
  ScrollView,
11
+ StatusBar,
11
12
  TouchableOpacity,
12
13
  View,
13
14
  ViewStyle,
14
15
  } from 'react-native';
15
- import { commonStyles } from '../CommonStyles';
16
16
  import {
17
+ CloseIcon,
17
18
  IconBack,
18
19
  IconCopy,
19
20
  IconDownload,
20
21
  TimaSmall,
21
22
  } from '../../assets/icons';
22
- import { color } from '../../theme';
23
23
  import { MText } from '../../components/MText';
24
24
  import { useNavigation } from '@react-navigation/native';
25
25
  import { Api } from '../../services/api';
@@ -31,19 +31,70 @@ import MHeader from '../../components/MHeader';
31
31
  import ReactNativeModal from 'react-native-modal';
32
32
  import LinearGradient from 'react-native-linear-gradient';
33
33
  import moment from 'moment';
34
+ import {
35
+ TourGuideProvider, // Main provider
36
+ TourGuideZone, // Main wrapper of highlight component
37
+ useTourGuideController, // hook to start, etc.
38
+ } from 'rn-tourguide';
34
39
 
35
40
  export const ShowQrCode = observer(function ShowQrCode(props: any) {
41
+ return (
42
+ <TourGuideProvider
43
+ borderRadius={8}
44
+ maskOffset={4}
45
+ tooltipComponent={TransferContentTooltip}
46
+ tooltipStyle={$tourTooltipPosition}
47
+ backdropColor="rgba(0, 0, 0, 0.35)"
48
+ androidStatusBarVisible={true}
49
+ verticalOffset={
50
+ Platform.OS === 'android' ? StatusBar.currentHeight - 25 : 0
51
+ }
52
+ >
53
+ <ShowQrCodeContent {...props} />
54
+ </TourGuideProvider>
55
+ );
56
+ });
57
+
58
+ const TransferContentTooltip = ({ currentStep, handleStop }: any) => {
59
+ return (
60
+ <View style={$tourTooltip}>
61
+ <MText style={$tourTooltipText}>{currentStep?.text}</MText>
62
+ <TouchableOpacity onPress={handleStop} style={$tourTooltipButton}>
63
+ <MText style={$tourTooltipButtonText}>Đồng ý</MText>
64
+ </TouchableOpacity>
65
+ <View style={$tourTooltipArrow} />
66
+ </View>
67
+ );
68
+ };
69
+
70
+ const ShowQrCodeContent = observer(function ShowQrCodeContent(props: any) {
36
71
  const navigation = useNavigation();
72
+ const scrollViewRef = useRef<ScrollView>(null);
73
+ const transferContentRef = useRef<View>(null);
74
+ const transferContentY = useRef(0);
75
+ const transferContentHeight = useRef(0);
76
+ const scrollViewHeight = useRef(0);
77
+ const scrollContentHeight = useRef(0);
78
+ const startGuideTimeout = useRef<NodeJS.Timeout>();
37
79
  const [linkImage, setLinkImage] = useState<string>();
38
80
  const [isLoading, setIsLoading] = useState(false);
39
81
  const [showGuide, setShowGuide] = useState(false);
82
+ const [shouldStartGuide, setShouldStartGuide] = useState(false);
83
+ const [isGuideRunning, setIsGuideRunning] = useState(false);
84
+ const {
85
+ canStart, // a boolean indicate if you can start tour guide
86
+ start, // a function to start the tourguide
87
+ eventEmitter,
88
+ } = useTourGuideController();
40
89
  const getData = () => {
41
90
  setIsLoading(true);
42
91
  Api.getInstance()
43
92
  .getQrPayment({
44
93
  LoanBriefId: props?.route?.params?.id,
45
- TypeCloseLoan: 0, // đóng tiền kỳ
46
- Money: Number(props?.route?.params?.item?.payMoney) || 0,
94
+ TypeCloseLoan: props?.route?.params?.isFullPayment ? 1 : 0, // đóng tiền kỳ
95
+ Money: props?.route?.params?.isFullPayment
96
+ ? props?.route?.params?.totalMoney
97
+ : props?.route?.params?.item?.payMoney,
47
98
  })
48
99
  .then((response) => {
49
100
  setIsLoading(false);
@@ -60,6 +111,12 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
60
111
  .catch((err) => {
61
112
  Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau');
62
113
  setIsLoading(false);
114
+ })
115
+ .finally(() => {
116
+ setShouldStartGuide(true);
117
+ if (props?.route?.params?.isFullPayment) {
118
+ setShowGuide(true);
119
+ }
63
120
  });
64
121
  };
65
122
 
@@ -67,6 +124,72 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
67
124
  getData();
68
125
  }, []);
69
126
 
127
+ useEffect(() => {
128
+ const handleStartGuide = () => setIsGuideRunning(true);
129
+ const handleStopGuide = () => setIsGuideRunning(false);
130
+ eventEmitter?.on('start', handleStartGuide);
131
+ eventEmitter?.on('stop', handleStopGuide);
132
+ return () => {
133
+ eventEmitter?.off('start', handleStartGuide);
134
+ eventEmitter?.off('stop', handleStopGuide);
135
+ };
136
+ }, [eventEmitter]);
137
+
138
+ const scrollToTransferContent = () => {
139
+ const scrollToY = (
140
+ y: number,
141
+ targetHeight = transferContentHeight.current
142
+ ) => {
143
+ const viewportHeight =
144
+ scrollViewHeight.current || Dimensions.get('window').height;
145
+ const contentHeight = scrollContentHeight.current || viewportHeight;
146
+ const maxScrollY = Math.max(contentHeight - viewportHeight, 0);
147
+ const minTopForTooltip = 120;
148
+ const bottomGap = 80;
149
+ const preferredTargetTop = Math.min(
150
+ Math.max(viewportHeight * 0.42, minTopForTooltip),
151
+ Math.max(viewportHeight - targetHeight - bottomGap, minTopForTooltip)
152
+ );
153
+ const nextScrollY = Math.min(
154
+ Math.max(y - preferredTargetTop, 0),
155
+ maxScrollY
156
+ );
157
+
158
+ scrollViewRef.current?.scrollTo({
159
+ y: nextScrollY,
160
+ animated: true,
161
+ });
162
+ };
163
+
164
+ const innerViewNode = scrollViewRef.current?.getInnerViewNode?.();
165
+
166
+ if (innerViewNode && transferContentRef.current?.measureLayout) {
167
+ transferContentRef.current.measureLayout(
168
+ innerViewNode,
169
+ (_x, y, _width, height) => scrollToY(y, height),
170
+ () => scrollToY(transferContentY.current)
171
+ );
172
+ } else {
173
+ scrollToY(transferContentY.current);
174
+ }
175
+ };
176
+
177
+ useEffect(() => {
178
+ if (!props?.route?.params?.isFullPayment && shouldStartGuide && canStart) {
179
+ scrollToTransferContent();
180
+ startGuideTimeout.current = setTimeout(() => {
181
+ start(1);
182
+ setShouldStartGuide(false);
183
+ }, 450);
184
+ }
185
+
186
+ return () => {
187
+ if (startGuideTimeout.current) {
188
+ clearTimeout(startGuideTimeout.current);
189
+ }
190
+ };
191
+ }, [canStart, shouldStartGuide, start]);
192
+
70
193
  return (
71
194
  <View style={{ flex: 1, backgroundColor: 'rgba(244, 244, 244, 1)' }}>
72
195
  <MHeader title={`Vay trực tuyến 24/7`} />
@@ -85,14 +208,25 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
85
208
  fontFamily: 'BeVietnamPro-SemiBold',
86
209
  }}
87
210
  >
88
- THANH TOÁN KỲ
211
+ {props?.route?.params?.isFullPayment
212
+ ? 'TẤT TOÁN HỢP ĐỒNG'
213
+ : 'THANH TOÁN KỲ'}
89
214
  </MText>
90
215
  </View>
91
- <ScrollView>
216
+ <ScrollView
217
+ ref={scrollViewRef}
218
+ scrollEnabled={!isGuideRunning}
219
+ onLayout={(event) => {
220
+ scrollViewHeight.current = event.nativeEvent.layout.height;
221
+ }}
222
+ onContentSizeChange={(_width, height) => {
223
+ scrollContentHeight.current = height;
224
+ }}
225
+ >
92
226
  <View
93
227
  style={{
94
228
  backgroundColor: 'white',
95
- margin: 16,
229
+ marginHorizontal: 16,
96
230
  borderRadius: 16,
97
231
  padding: 16,
98
232
  }}
@@ -137,8 +271,8 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
137
271
  uri: linkImage,
138
272
  }}
139
273
  style={{
140
- width: Dimensions.get('window').width - 50,
141
- height: Dimensions.get('window').width - 50,
274
+ width: Dimensions.get('window').width - 100,
275
+ height: Dimensions.get('window').width - 100,
142
276
  resizeMode: 'contain',
143
277
  }}
144
278
  />
@@ -258,74 +392,127 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
258
392
  >
259
393
  {props.route.params?.data?.accountName}
260
394
  </MText>
261
- <MText
262
- style={{
263
- fontSize: 12,
264
- color: 'rgba(51, 51, 51, 1)',
265
- fontWeight: '300',
266
- marginTop: 16,
267
- }}
268
- >
269
- Số tiền phải trả
270
- </MText>
271
- <MText
272
- style={{
273
- fontSize: 16,
274
- fontWeight: '600',
275
- fontFamily: 'BeVietnamPro-SemiBold',
276
- }}
277
- >
278
- {formatMoney(props?.route?.params?.item?.payMoney)} đ
279
- </MText>
280
- <MText
281
- style={{ color: '#828282', fontSize: 10, fontStyle: 'italic' }}
282
- >
283
- Số tiền được tính đến ngày {moment().format('DD/MM/YYYY')}
284
- </MText>
285
- <MText
286
- style={{
287
- fontSize: 12,
288
- color: 'rgba(51, 51, 51, 1)',
289
- fontWeight: '300',
290
- marginTop: 16,
291
- }}
292
- >
293
- Nội dung chuyển khoản{' '}
395
+
396
+ <View>
294
397
  <MText
295
398
  style={{
296
399
  fontSize: 12,
297
- color: '#EB5757',
400
+ color: 'rgba(51, 51, 51, 1)',
298
401
  fontWeight: '300',
402
+ marginTop: 16,
299
403
  }}
300
404
  >
301
- (Bắt buộc)
405
+ Số tiền phải trả
302
406
  </MText>
303
- </MText>
304
- <View
305
- style={{
306
- flexDirection: 'row',
307
- alignItems: 'center',
308
- justifyContent: 'space-between',
309
- }}
310
- >
407
+ <View
408
+ style={{
409
+ flexDirection: 'row',
410
+ alignItems: 'center',
411
+ justifyContent: 'space-between',
412
+ }}
413
+ >
414
+ <MText
415
+ style={{
416
+ fontSize: 16,
417
+ fontWeight: '600',
418
+ fontFamily: 'BeVietnamPro-SemiBold',
419
+ }}
420
+ >
421
+ {formatMoney(
422
+ props?.route?.params?.isFullPayment
423
+ ? props?.route?.params?.totalMoney
424
+ : props?.route?.params?.item?.payMoney
425
+ )}{' '}
426
+ đ
427
+ </MText>
428
+ <TouchableOpacity
429
+ onPress={() =>
430
+ Clipboard.setString(
431
+ props?.route?.params?.isFullPayment
432
+ ? props?.route?.params?.totalMoney
433
+ : props?.route?.params?.item?.payMoney
434
+ )
435
+ }
436
+ >
437
+ <IconCopy />
438
+ </TouchableOpacity>
439
+ </View>
311
440
  <MText
312
441
  style={{
313
- color: 'rgba(61, 61, 61, 1)',
314
- fontWeight: '600',
315
- fontSize: 16,
316
- fontFamily: 'BeVietnamPro-SemiBold',
442
+ color: '#828282',
443
+ fontSize: 10,
444
+ fontStyle: 'italic',
317
445
  }}
318
446
  >
319
- TC{props.route.params?.codeId}
447
+ Số tiền được tính đến ngày {moment().format('DD/MM/YYYY')}
320
448
  </MText>
321
- <TouchableOpacity
322
- onPress={() =>
323
- Clipboard.setString(`TC${props.route.params?.codeId}`)
324
- }
325
- >
326
- <IconCopy />
327
- </TouchableOpacity>
328
449
  </View>
450
+ <TourGuideZone
451
+ zone={1}
452
+ text={
453
+ 'Để hệ thống ghi nhận chính xác khoản thanh toán, bạn đừng quên sao chép đúng nội dung chuyển khoản nhé!'
454
+ }
455
+ tooltipBottomOffset={-45}
456
+ style={$transferGuideZone}
457
+ >
458
+ <View>
459
+ <MText
460
+ style={{
461
+ fontSize: 12,
462
+ color: 'rgba(51, 51, 51, 1)',
463
+ fontWeight: '300',
464
+ }}
465
+ >
466
+ Nội dung chuyển khoản{' '}
467
+ <MText
468
+ style={{
469
+ fontSize: 12,
470
+ color: '#EB5757',
471
+ fontWeight: '300',
472
+ }}
473
+ >
474
+ (Bắt buộc)
475
+ </MText>
476
+ </MText>
477
+ <View
478
+ ref={transferContentRef}
479
+ onLayout={(event) => {
480
+ transferContentY.current = event.nativeEvent.layout.y;
481
+ transferContentHeight.current =
482
+ event.nativeEvent.layout.height;
483
+ }}
484
+ style={{
485
+ flexDirection: 'row',
486
+ alignItems: 'center',
487
+ justifyContent: 'space-between',
488
+ }}
489
+ >
490
+ <MText
491
+ style={{
492
+ color: 'rgba(61, 61, 61, 1)',
493
+ fontWeight: '600',
494
+ fontSize: 16,
495
+ fontFamily: 'BeVietnamPro-SemiBold',
496
+ }}
497
+ >
498
+ {props?.route?.params?.isFullPayment
499
+ ? `Tat toan TC${props.route.params?.data?.codeId}`
500
+ : `TC${props.route.params?.data?.codeId}`}
501
+ </MText>
502
+ <TouchableOpacity
503
+ onPress={() =>
504
+ Clipboard.setString(
505
+ props?.route?.params?.isFullPayment
506
+ ? `Tat toan TC${props.route.params?.data?.codeId}`
507
+ : `TC${props.route.params?.data?.codeId}`
508
+ )
509
+ }
510
+ >
511
+ <IconCopy />
512
+ </TouchableOpacity>
513
+ </View>
514
+ </View>
515
+ </TourGuideZone>
329
516
  </View>
330
517
  <View
331
518
  style={{
@@ -370,10 +557,19 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
370
557
  alignItems: 'center',
371
558
  justifyContent: 'space-between',
372
559
  padding: 16,
560
+ marginBottom: 16,
373
561
  }}
374
562
  >
375
563
  <MText>Hướng dẫn chuyển tiền</MText>
376
- <TouchableOpacity onPress={() => setShowGuide(true)}>
564
+ <TouchableOpacity
565
+ onPress={() => {
566
+ if (props?.route?.params?.isFullPayment) {
567
+ setShowGuide(true);
568
+ } else {
569
+ navigation.push('GuideTransferBank');
570
+ }
571
+ }}
572
+ >
377
573
  <MText
378
574
  style={{ color: '#2F80ED', textDecorationLine: 'underline' }}
379
575
  >
@@ -382,6 +578,43 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
382
578
  </TouchableOpacity>
383
579
  </View>
384
580
  </ScrollView>
581
+ {props?.route?.params?.isFullPayment && (
582
+ <TouchableOpacity
583
+ style={{ margin: 16 }}
584
+ onPress={() => {
585
+ Alert.alert(
586
+ 'Xác nhận tất toán',
587
+ 'Bạn có chắc muốn gửi YÊU CẦU TẤT TOÁN hợp đồng không?',
588
+ [
589
+ {
590
+ text: 'Có',
591
+ },
592
+ {
593
+ text: 'Không',
594
+ },
595
+ ]
596
+ );
597
+ }}
598
+ >
599
+ <LinearGradient
600
+ colors={['#FF7A00', '#EF4123']}
601
+ style={{
602
+ alignItems: 'center',
603
+ borderRadius: 30,
604
+ height: 40,
605
+ justifyContent: 'center',
606
+ }}
607
+ >
608
+ <MText
609
+ style={{
610
+ color: 'white',
611
+ }}
612
+ >
613
+ Xác nhận tất toán
614
+ </MText>
615
+ </LinearGradient>
616
+ </TouchableOpacity>
617
+ )}
385
618
  </View>
386
619
  <Loading isLoading={isLoading} />
387
620
  <ReactNativeModal
@@ -574,6 +807,12 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
574
807
  </MText>
575
808
  </View>
576
809
  </View>
810
+ <TouchableOpacity
811
+ style={{ position: 'absolute', left: 16, top: 16 }}
812
+ onPress={() => setShowGuide(false)}
813
+ >
814
+ <CloseIcon />
815
+ </TouchableOpacity>
577
816
  </View>
578
817
  </ReactNativeModal>
579
818
  </View>
@@ -590,3 +829,68 @@ const $header: ViewStyle = {
590
829
  paddingVertical: 16,
591
830
  justifyContent: 'center',
592
831
  };
832
+
833
+ const $tourTooltipPosition: ViewStyle = {
834
+ alignItems: 'flex-end',
835
+ overflow: 'visible',
836
+ paddingHorizontal: 16,
837
+ paddingTop: 0,
838
+ paddingBottom: 0,
839
+ borderRadius: 0,
840
+ };
841
+
842
+ const $tourTooltip: ViewStyle = {
843
+ width: 224,
844
+ minHeight: 84,
845
+ backgroundColor: 'white',
846
+ borderRadius: 8,
847
+ paddingHorizontal: 12,
848
+ paddingTop: 10,
849
+ paddingBottom: 12,
850
+ shadowColor: '#000',
851
+ shadowOffset: { width: 0, height: 2 },
852
+ shadowOpacity: 0.18,
853
+ shadowRadius: 8,
854
+ elevation: 8,
855
+ };
856
+
857
+ const $tourTooltipText = {
858
+ color: '#333333',
859
+ fontSize: 10,
860
+ lineHeight: 16,
861
+ fontWeight: '400',
862
+ };
863
+
864
+ const $tourTooltipButton: ViewStyle = {
865
+ alignSelf: 'flex-end',
866
+ marginTop: 6,
867
+ };
868
+
869
+ const $tourTooltipButtonText = {
870
+ color: '#EF592E',
871
+ fontSize: 10,
872
+ lineHeight: 16,
873
+ textDecorationLine: 'underline',
874
+ };
875
+
876
+ const $tourTooltipArrow: ViewStyle = {
877
+ position: 'absolute',
878
+ right: 18,
879
+ bottom: -10,
880
+ width: 0,
881
+ height: 0,
882
+ borderLeftWidth: 8,
883
+ borderRightWidth: 8,
884
+ borderTopWidth: 10,
885
+ borderLeftColor: 'transparent',
886
+ borderRightColor: 'transparent',
887
+ borderTopColor: 'white',
888
+ };
889
+
890
+ const $transferGuideZone: ViewStyle = {
891
+ backgroundColor: 'white',
892
+ borderRadius: 8,
893
+ borderWidth: 2,
894
+ borderColor: 'white',
895
+ marginTop: 16,
896
+ };
@@ -1,24 +1,14 @@
1
- //@ts-nocheck
2
- import { CommonActions, useNavigation } from '@react-navigation/native';
1
+ // @ts-nocheck
2
+ import { useNavigation } from '@react-navigation/native';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import React, { useState } from 'react';
5
- import {
6
- Image,
7
- ImageStyle,
8
- SafeAreaView,
9
- TouchableOpacity,
10
- View,
11
- } from 'react-native';
12
- import LinearGradient from 'react-native-linear-gradient';
5
+ import { ImageStyle, TouchableOpacity, View } from 'react-native';
13
6
  import { IconBack } from '../../assets/icons';
14
- import MButton from '../../components/MButton';
15
7
  import { MText } from '../../components/MText';
16
- import { ScreenNames } from '../../navigation';
17
- import { color } from '../../theme';
18
- import { commonStyles } from '../CommonStyles';
19
8
  import { Info } from './Info';
20
9
  import { Payment } from './Payment';
21
- import MHeader from '../../components/MHeader';
10
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
11
+
22
12
  const logoView: ImageStyle = {
23
13
  position: 'absolute',
24
14
  width: '100%',
@@ -27,30 +17,44 @@ const logoView: ImageStyle = {
27
17
  };
28
18
 
29
19
  export const DetailLoan = observer(function DetailLoan(props: any) {
20
+ const insets = useSafeAreaInsets();
30
21
  const navigation = useNavigation();
31
22
  const [tab, setTab] = useState(1);
32
23
 
33
24
  return (
34
25
  <View style={{ flex: 1, backgroundColor: '#FDFDFD' }}>
35
- <MHeader
36
- title={`Đơn vay ${props.route?.params?.loan?.id}`}
37
- onBack={() =>
38
- navigation.dispatch(
39
- CommonActions.reset({
40
- index: 1,
41
- routes: [{ name: ScreenNames.Main }],
42
- })
43
- )
44
- }
45
- />
46
- <SafeAreaView style={{ flex: 1 }}>
26
+ <View style={{ flex: 1, marginTop: insets.top }}>
27
+ <View
28
+ style={{
29
+ paddingHorizontal: 16,
30
+ paddingVertical: 12,
31
+ alignItems: 'center',
32
+ justifyContent: 'center',
33
+ }}
34
+ >
35
+ <TouchableOpacity
36
+ style={{ position: 'absolute', left: 16 }}
37
+ onPress={() => navigation.goBack()}
38
+ >
39
+ <IconBack onPress={() => navigation.goBack()} />
40
+ </TouchableOpacity>
41
+ <MText
42
+ style={{
43
+ fontFamily: 'BeVietnamPro-SemiBold',
44
+ fontWeight: '600',
45
+ fontSize: 16,
46
+ }}
47
+ >
48
+ HD-{props.route?.params?.loan?.id}
49
+ </MText>
50
+ </View>
47
51
  <View
48
52
  style={{
49
53
  flexDirection: 'row',
50
54
  backgroundColor: '#F2F2F2',
51
55
  borderRadius: 30,
52
56
  marginHorizontal: 16,
53
- marginTop: 16,
57
+ marginTop: 10,
54
58
  }}
55
59
  >
56
60
  <TouchableOpacity onPress={() => setTab(1)} style={{ flex: 1 }}>
@@ -60,13 +64,13 @@ export const DetailLoan = observer(function DetailLoan(props: any) {
60
64
  borderRadius: 30,
61
65
  paddingVertical: 10,
62
66
  borderWidth: 1,
63
- borderColor: tab === 1 ? '#FF7A00' : '#F2F2F2',
67
+ borderColor: tab === 1 ? '#EF4123' : '#F2F2F2',
64
68
  backgroundColor: tab === 1 ? '#FFFFFF' : '#F2F2F2',
65
69
  }}
66
70
  >
67
71
  <MText
68
72
  style={{
69
- color: tab === 1 ? '#FF7A00' : '#333333',
73
+ color: tab === 1 ? '#EF4123' : '#333333',
70
74
  fontWeight: tab === 1 ? 'bold' : '400',
71
75
  }}
72
76
  >
@@ -86,13 +90,13 @@ export const DetailLoan = observer(function DetailLoan(props: any) {
86
90
  borderRadius: 30,
87
91
  paddingVertical: 10,
88
92
  borderWidth: 1,
89
- borderColor: tab === 2 ? '#FF7A00' : '#F2F2F2',
93
+ borderColor: tab === 2 ? '#EF4123' : '#F2F2F2',
90
94
  backgroundColor: tab === 2 ? '#FFFFFF' : '#F2F2F2',
91
95
  }}
92
96
  >
93
97
  <MText
94
98
  style={{
95
- color: tab === 2 ? '#FF7A00' : '#333333',
99
+ color: tab === 2 ? '#EF4123' : '#333333',
96
100
  fontWeight: tab === 2 ? 'bold' : '400',
97
101
  }}
98
102
  >
@@ -106,7 +110,7 @@ export const DetailLoan = observer(function DetailLoan(props: any) {
106
110
  ) : (
107
111
  <Payment data={props?.route.params?.loan} />
108
112
  )}
109
- </SafeAreaView>
113
+ </View>
110
114
  </View>
111
115
  );
112
116
  });