react-native-timacare 3.3.43 → 3.3.44
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.
- package/lib/commonjs/assets/icons/gui.svg +102 -0
- package/lib/commonjs/assets/icons/index.js +1 -1
- package/lib/commonjs/assets/icons/index.js.flow +6 -0
- package/lib/commonjs/assets/icons/index.js.map +1 -1
- package/lib/commonjs/assets/icons/layer1.svg +15 -0
- package/lib/commonjs/assets/icons/not_found.svg +135 -0
- package/lib/commonjs/components/SkeletonLoanCard.js +2 -0
- package/lib/commonjs/components/SkeletonLoanCard.js.flow +246 -0
- package/lib/commonjs/components/SkeletonLoanCard.js.map +1 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.flow +2 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigation/index.js +1 -1
- package/lib/commonjs/navigation/index.js.flow +1 -0
- package/lib/commonjs/navigation/index.js.map +1 -1
- package/lib/commonjs/navigation/navigationRef.js +2 -0
- package/lib/commonjs/navigation/navigationRef.js.flow +40 -0
- package/lib/commonjs/navigation/navigationRef.js.map +1 -0
- package/lib/commonjs/navigation/primary-navigator.js +1 -1
- package/lib/commonjs/navigation/primary-navigator.js.flow +30 -0
- package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
- package/lib/commonjs/screens/home/BoxGuidline.js +2 -0
- package/lib/commonjs/screens/home/BoxGuidline.js.flow +58 -0
- package/lib/commonjs/screens/home/BoxGuidline.js.map +1 -0
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +6 -5
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.map +1 -1
- package/lib/commonjs/screens/home/index.js +1 -1
- package/lib/commonjs/screens/home/index.js.flow +211 -205
- package/lib/commonjs/screens/home/index.js.map +1 -1
- package/lib/module/assets/icons/gui.svg +102 -0
- package/lib/module/assets/icons/index.js +1 -1
- package/lib/module/assets/icons/index.js.map +1 -1
- package/lib/module/assets/icons/layer1.svg +15 -0
- package/lib/module/assets/icons/not_found.svg +135 -0
- package/lib/module/components/SkeletonLoanCard.js +2 -0
- package/lib/module/components/SkeletonLoanCard.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/index.js +1 -1
- package/lib/module/navigation/index.js.map +1 -1
- package/lib/module/navigation/navigationRef.js +2 -0
- package/lib/module/navigation/navigationRef.js.map +1 -0
- package/lib/module/navigation/primary-navigator.js +1 -1
- package/lib/module/navigation/primary-navigator.js.map +1 -1
- package/lib/module/screens/home/BoxGuidline.js +2 -0
- package/lib/module/screens/home/BoxGuidline.js.map +1 -0
- package/lib/module/screens/home/ItemMotoBikeLoan.js +1 -1
- package/lib/module/screens/home/ItemMotoBikeLoan.js.map +1 -1
- package/lib/module/screens/home/index.js +1 -1
- package/lib/module/screens/home/index.js.map +1 -1
- package/lib/typescript/assets/icons/index.d.ts +4 -1
- package/lib/typescript/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/components/SkeletonLoanCard.d.ts +7 -0
- package/lib/typescript/components/SkeletonLoanCard.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/navigation/index.d.ts +1 -0
- package/lib/typescript/navigation/index.d.ts.map +1 -1
- package/lib/typescript/navigation/navigationRef.d.ts +8 -0
- package/lib/typescript/navigation/navigationRef.d.ts.map +1 -0
- package/lib/typescript/navigation/primary-navigator.d.ts +15 -0
- package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
- package/lib/typescript/screens/home/BoxGuidline.d.ts +2 -0
- package/lib/typescript/screens/home/BoxGuidline.d.ts.map +1 -0
- package/lib/typescript/screens/home/ItemMotoBikeLoan.d.ts.map +1 -1
- package/lib/typescript/screens/home/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/gui.svg +102 -0
- package/src/assets/icons/index.tsx +6 -0
- package/src/assets/icons/layer1.svg +15 -0
- package/src/assets/icons/not_found.svg +135 -0
- package/src/components/SkeletonLoanCard.tsx +246 -0
- package/src/index.tsx +2 -1
- package/src/navigation/index.ts +1 -0
- package/src/navigation/navigationRef.ts +40 -0
- package/src/navigation/primary-navigator.tsx +30 -0
- package/src/screens/home/BoxGuidline.tsx +58 -0
- package/src/screens/home/ItemMotoBikeLoan.tsx +6 -5
- package/src/screens/home/index.tsx +211 -205
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* Navigation bridge for the Timacare SDK.
|
|
4
|
+
*
|
|
5
|
+
* The host app already owns its <NavigationContainer ref={...}>, so instead of
|
|
6
|
+
* creating a second ref the host registers its existing one here once (typically
|
|
7
|
+
* right after the container mounts). The SDK then uses it to drive navigation
|
|
8
|
+
* imperatively from outside React — e.g. deep-linking into a loan detail via
|
|
9
|
+
* `goDetail()`.
|
|
10
|
+
*
|
|
11
|
+
* Accepts either form of ref:
|
|
12
|
+
* - the object returned by `createNavigationContainerRef()` /
|
|
13
|
+
* `useNavigationContainerRef()` (methods live directly on it), or
|
|
14
|
+
* - a plain `useRef()` passed to <NavigationContainer ref={ref}> (methods live
|
|
15
|
+
* on `ref.current`).
|
|
16
|
+
*/
|
|
17
|
+
let externalNavigationRef = null;
|
|
18
|
+
|
|
19
|
+
export const setNavigationRef = (ref) => {
|
|
20
|
+
externalNavigationRef = ref;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the registered ref down to the actual NavigationContainerRef,
|
|
25
|
+
* regardless of which ref form the host provided. Returns null when nothing is
|
|
26
|
+
* registered yet or the container isn't ready.
|
|
27
|
+
*/
|
|
28
|
+
export const getNavigation = () => {
|
|
29
|
+
const ref = externalNavigationRef;
|
|
30
|
+
if (!ref) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const nav = typeof ref.navigate === 'function' ? ref : ref.current;
|
|
35
|
+
if (!nav || (typeof nav.isReady === 'function' && !nav.isReady())) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return nav;
|
|
40
|
+
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import React, { useEffect } from 'react';
|
|
9
9
|
|
|
10
10
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
11
|
+
import { getNavigation } from './navigationRef';
|
|
11
12
|
import { OTP } from '../screens/otp';
|
|
12
13
|
import { NationalID } from '../screens/nationalID';
|
|
13
14
|
import { Selfie } from '../screens/selfie';
|
|
@@ -317,3 +318,32 @@ export function PrimaryNavigator(props) {
|
|
|
317
318
|
|
|
318
319
|
const exitRoutes = ['welcome'];
|
|
319
320
|
export const canExit = (routeName: string) => exitRoutes.includes(routeName);
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Imperatively navigate into a loan detail screen from outside React.
|
|
324
|
+
*
|
|
325
|
+
* Intended for the host app to deep-link the user straight into a loan detail
|
|
326
|
+
* (e.g. from a push notification or a list rendered outside the SDK). Requires
|
|
327
|
+
* the host to register its NavigationContainer ref once via `setNavigationRef()`.
|
|
328
|
+
*
|
|
329
|
+
* Accepts either a loan id or a partial loan object. The detail screen only
|
|
330
|
+
* needs `id` to fetch its data; `disbursementPartner` (when provided) selects
|
|
331
|
+
* the matching screen — 'CIMB' -> DetailLoan, otherwise -> DetailLoanTima.
|
|
332
|
+
*/
|
|
333
|
+
export function goDetail(
|
|
334
|
+
loan: number | { id: number; disbursementPartner?: string }
|
|
335
|
+
) {
|
|
336
|
+
const loanObj = typeof loan === 'number' ? { id: loan } : loan;
|
|
337
|
+
const navigation = getNavigation();
|
|
338
|
+
|
|
339
|
+
if (!loanObj?.id || !navigation) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const screen =
|
|
344
|
+
loanObj.disbursementPartner === 'CIMB'
|
|
345
|
+
? ScreenNames.DetailLoan
|
|
346
|
+
: ScreenNames.DetailLoanTima;
|
|
347
|
+
|
|
348
|
+
navigation.navigate(screen, { loan: loanObj });
|
|
349
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
5
|
+
import { MText } from '../../components/MText';
|
|
6
|
+
import { GuiSvg, Layer1Svg } from '../../assets/icons';
|
|
7
|
+
export default function BoxGuidline() {
|
|
8
|
+
return (
|
|
9
|
+
<LinearGradient colors={['#FFF8F2', '#FFFFFF']} style={styles.container}>
|
|
10
|
+
<MText
|
|
11
|
+
style={{
|
|
12
|
+
fontFamily: 'BeVietnamPro-SemiBold',
|
|
13
|
+
fontWeight: '600',
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
Chuẩn bị trước khi hoàn thiện đơn
|
|
17
|
+
</MText>
|
|
18
|
+
<View style={styles.row}>
|
|
19
|
+
<View style={{ flex: 1, flexDirection: 'column', gap: 6 }}>
|
|
20
|
+
<View style={styles.item}>
|
|
21
|
+
<Layer1Svg />
|
|
22
|
+
<MText style={{ fontSize: 12 }}>Giấy đăng ký xe rõ nét</MText>
|
|
23
|
+
</View>
|
|
24
|
+
<View style={styles.item}>
|
|
25
|
+
<Layer1Svg />
|
|
26
|
+
<MText style={{ fontSize: 12 }}>CCCD gắn chip bản gốc</MText>
|
|
27
|
+
</View>
|
|
28
|
+
<View style={styles.item}>
|
|
29
|
+
<Layer1Svg />
|
|
30
|
+
<MText style={{ fontSize: 12 }}>Không gian đủ ánh sáng</MText>
|
|
31
|
+
</View>
|
|
32
|
+
</View>
|
|
33
|
+
<View style={{ marginRight: 24 }}>
|
|
34
|
+
<GuiSvg />
|
|
35
|
+
</View>
|
|
36
|
+
</View>
|
|
37
|
+
</LinearGradient>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
borderWidth: 1,
|
|
44
|
+
borderColor: '#E5E5EA',
|
|
45
|
+
borderRadius: 8,
|
|
46
|
+
padding: 8,
|
|
47
|
+
},
|
|
48
|
+
row: {
|
|
49
|
+
flexDirection: 'row',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
gap: 16,
|
|
52
|
+
},
|
|
53
|
+
item: {
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
gap: 10,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -489,7 +489,7 @@ export default function ItemMotoBikeLoan({
|
|
|
489
489
|
<MText
|
|
490
490
|
style={{ fontSize: 16, fontWeight: 'bold', textAlign: 'center' }}
|
|
491
491
|
>
|
|
492
|
-
|
|
492
|
+
Xác nhận chia sẻ dữ liệu
|
|
493
493
|
</MText>
|
|
494
494
|
<View
|
|
495
495
|
style={{
|
|
@@ -508,10 +508,11 @@ export default function ItemMotoBikeLoan({
|
|
|
508
508
|
<MText
|
|
509
509
|
style={{ color: '#828282', textAlign: 'center', marginTop: 16 }}
|
|
510
510
|
>
|
|
511
|
-
Tima sẽ chuyển thông tin
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
511
|
+
Tima sẽ chuyển thông tin của bạn đến Công ty Cổ phần Kinh doanh F88
|
|
512
|
+
(F88) để xem xét phê duyệt khoản vay. Khi chọn "Đồng ý & Tiếp tục",
|
|
513
|
+
bạn đồng ý cho các bên liên quan thu thập, sử dụng, xử lý và chia sẻ
|
|
514
|
+
dữ liệu cá nhân theo quy định của pháp luật. Sau khi chuyển giao dữ
|
|
515
|
+
liệu, Tima là bên kiểm soát và xử lý dữ liệu cá nhân.
|
|
515
516
|
</MText>
|
|
516
517
|
<View
|
|
517
518
|
style={{
|
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
IconVideo,
|
|
49
49
|
Info,
|
|
50
50
|
LogoSmall,
|
|
51
|
+
NotFoundSvg,
|
|
51
52
|
OcrSvg,
|
|
52
53
|
SignDisable,
|
|
53
54
|
TimaNormal,
|
|
@@ -77,7 +78,9 @@ import appStore from '../../AppStore';
|
|
|
77
78
|
import Modal from 'react-native-modal';
|
|
78
79
|
import { Api } from '../../services/api';
|
|
79
80
|
import { load, save } from '../../utils/storage';
|
|
80
|
-
import
|
|
81
|
+
import SkeletonLoanList, {
|
|
82
|
+
SkeletonDisbursedList,
|
|
83
|
+
} from '../../components/SkeletonLoanCard';
|
|
81
84
|
import MButton from '../../components/MButton';
|
|
82
85
|
import ttsStore from '../toan-trinh-so/store';
|
|
83
86
|
import {
|
|
@@ -105,6 +108,7 @@ import DigitalTopupItem from './DigitalTopupItem';
|
|
|
105
108
|
import ModalOptionLoanDigital from '../../components/ModalOptionLoanDigital';
|
|
106
109
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
107
110
|
import ItemMotoBikeLoan from './ItemMotoBikeLoan';
|
|
111
|
+
import BoxGuidline from './BoxGuidline';
|
|
108
112
|
|
|
109
113
|
const listBanners = [
|
|
110
114
|
require('../../assets/img/banner1.png'),
|
|
@@ -156,8 +160,7 @@ export const Home = observer(function Home() {
|
|
|
156
160
|
const insets = useSafeAreaInsets();
|
|
157
161
|
|
|
158
162
|
// Chỉ mở modal khi chưa có modal nào đang mở -> không bao giờ stack 2 modal
|
|
159
|
-
const openModal = (name: string) =>
|
|
160
|
-
setActiveModal((prev) => prev ?? name);
|
|
163
|
+
const openModal = (name: string) => setActiveModal((prev) => prev ?? name);
|
|
161
164
|
const closeModal = () => setActiveModal(null);
|
|
162
165
|
// Đóng modal rồi điều hướng sau khi animation đóng hoàn tất (chống treo màn hình)
|
|
163
166
|
const closeModalThen = (fn?: () => void) => {
|
|
@@ -548,18 +551,25 @@ export const Home = observer(function Home() {
|
|
|
548
551
|
style={{ flex: 1, marginBottom: 16 }}
|
|
549
552
|
>
|
|
550
553
|
<View style={[commonStyles.fill, { paddingHorizontal: 16 }]}>
|
|
551
|
-
{
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
554
|
+
{/* Skeleton danh sách đơn mới: hiển thị khi đang tải, chưa có dữ liệu */}
|
|
555
|
+
{isLoading && (listLoan?.length ?? 0) === 0 ? (
|
|
556
|
+
<View style={{ marginTop: 10 }}>
|
|
557
|
+
<SkeletonLoanList count={1} />
|
|
558
|
+
</View>
|
|
559
|
+
) : null}
|
|
560
|
+
<View style={{ marginBottom: 8 }}>
|
|
561
|
+
{listLoan.length > 0 && (
|
|
562
|
+
<MText
|
|
563
|
+
style={{
|
|
564
|
+
fontWeight: '600',
|
|
565
|
+
marginTop: 10,
|
|
566
|
+
fontFamily: 'BeVietnamPro-SemiBold',
|
|
567
|
+
}}
|
|
568
|
+
>
|
|
569
|
+
Đơn vay chờ hoàn thiện
|
|
570
|
+
</MText>
|
|
571
|
+
)}
|
|
572
|
+
</View>
|
|
563
573
|
|
|
564
574
|
{listLoan?.map((item, index) => {
|
|
565
575
|
return (
|
|
@@ -2199,189 +2209,211 @@ export const Home = observer(function Home() {
|
|
|
2199
2209
|
</View>
|
|
2200
2210
|
);
|
|
2201
2211
|
})}
|
|
2212
|
+
|
|
2213
|
+
<BoxGuidline />
|
|
2202
2214
|
<Observer>
|
|
2203
2215
|
{() => (
|
|
2204
2216
|
<View>
|
|
2205
2217
|
{homeStore?.listLoan?.length > 0 && (
|
|
2206
2218
|
<MText
|
|
2207
2219
|
style={{
|
|
2208
|
-
|
|
2209
|
-
fontWeight: 'bold',
|
|
2220
|
+
fontWeight: '600',
|
|
2210
2221
|
marginBottom: 8,
|
|
2211
|
-
marginTop:
|
|
2222
|
+
marginTop: 16,
|
|
2223
|
+
fontFamily: 'BeVietnamPro-SemiBold',
|
|
2212
2224
|
}}
|
|
2213
2225
|
>
|
|
2214
|
-
|
|
2226
|
+
Đơn đang vay ({homeStore?.listLoan?.length})
|
|
2215
2227
|
</MText>
|
|
2216
2228
|
)}
|
|
2229
|
+
|
|
2230
|
+
{/* Skeleton danh sách giải ngân: hiển thị khi đang tải, chưa có dữ liệu */}
|
|
2231
|
+
{homeStore.isLoading &&
|
|
2232
|
+
(homeStore?.listLoan?.length ?? 0) === 0 ? (
|
|
2233
|
+
<View style={{ marginTop: 16 }}>
|
|
2234
|
+
<SkeletonDisbursedList count={2} />
|
|
2235
|
+
</View>
|
|
2236
|
+
) : null}
|
|
2237
|
+
|
|
2217
2238
|
{homeStore?.listLoan &&
|
|
2218
|
-
homeStore?.listLoan.map((loan, index) =>
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2239
|
+
homeStore?.listLoan.map((loan, index) => {
|
|
2240
|
+
const goDetail = () => {
|
|
2241
|
+
if (loan?.disbursementPartner === 'CIMB') {
|
|
2242
|
+
navigation.dispatch(
|
|
2243
|
+
StackActions.push(ScreenNames.DetailLoan, { loan })
|
|
2244
|
+
);
|
|
2245
|
+
} else {
|
|
2246
|
+
navigation.dispatch(
|
|
2247
|
+
StackActions.push(ScreenNames.DetailLoanTima, {
|
|
2248
|
+
loan,
|
|
2249
|
+
})
|
|
2250
|
+
);
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
// TODO(field): xác nhận tên field thực tế từ API list_loan_disbursed
|
|
2254
|
+
const overdueDays = loan?.overDay; // số ngày quá hạn
|
|
2255
|
+
const amountPayment = loan?.paymentNeedMoney; // số tiền thanh toán
|
|
2256
|
+
return (
|
|
2257
|
+
<View key={index}>
|
|
2258
|
+
<TouchableOpacity
|
|
2259
|
+
activeOpacity={0.9}
|
|
2260
|
+
style={{
|
|
2261
|
+
backgroundColor: '#FFFFFF',
|
|
2262
|
+
padding: 12,
|
|
2263
|
+
borderRadius: 8,
|
|
2264
|
+
borderWidth: 1,
|
|
2265
|
+
borderColor: '#DADADA',
|
|
2266
|
+
marginBottom: 16,
|
|
2267
|
+
shadowColor: '#000000',
|
|
2268
|
+
shadowOffset: { width: 0, height: 4 },
|
|
2269
|
+
shadowOpacity: 0.1,
|
|
2270
|
+
shadowRadius: 10,
|
|
2271
|
+
elevation: 4,
|
|
2272
|
+
}}
|
|
2273
|
+
onPress={goDetail}
|
|
2248
2274
|
>
|
|
2249
|
-
<
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2275
|
+
<View
|
|
2276
|
+
style={{
|
|
2277
|
+
flexDirection: 'row',
|
|
2278
|
+
alignItems: 'center',
|
|
2279
|
+
}}
|
|
2280
|
+
>
|
|
2281
|
+
<ContractActive width={24} height={24} />
|
|
2282
|
+
<View style={{ flex: 1, paddingLeft: 8 }}>
|
|
2283
|
+
<MText style={commonStyles.textNormalBold}>
|
|
2284
|
+
HD-{loan?.id}
|
|
2285
|
+
</MText>
|
|
2286
|
+
<MText style={{ fontSize: 12, color: '#333333' }}>
|
|
2287
|
+
Số tiền vay: {formatMoney(loan?.loanAmount)}đ
|
|
2288
|
+
</MText>
|
|
2289
|
+
</View>
|
|
2290
|
+
<View
|
|
2255
2291
|
style={{
|
|
2256
|
-
|
|
2292
|
+
width: 28,
|
|
2293
|
+
height: 28,
|
|
2294
|
+
borderRadius: 14,
|
|
2295
|
+
borderWidth: 1,
|
|
2296
|
+
borderColor: '#F2C2AC',
|
|
2297
|
+
backgroundColor: '#FFF3EC',
|
|
2298
|
+
alignItems: 'center',
|
|
2299
|
+
justifyContent: 'center',
|
|
2257
2300
|
}}
|
|
2258
2301
|
>
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2302
|
+
<MText
|
|
2303
|
+
style={{
|
|
2304
|
+
color: '#EF592E',
|
|
2305
|
+
fontSize: 16,
|
|
2306
|
+
lineHeight: 18,
|
|
2307
|
+
marginTop: -2,
|
|
2308
|
+
}}
|
|
2309
|
+
>
|
|
2310
|
+
›
|
|
2311
|
+
</MText>
|
|
2312
|
+
</View>
|
|
2262
2313
|
</View>
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
</MText>
|
|
2280
|
-
<MText style={commonStyles.textNormalBold}>
|
|
2281
|
-
{formatDDMMYYY(loan?.disbursedAt)}
|
|
2282
|
-
</MText>
|
|
2283
|
-
</View>
|
|
2284
|
-
<View
|
|
2285
|
-
style={{
|
|
2286
|
-
height: 0.5,
|
|
2287
|
-
backgroundColor: '#E0E0E0',
|
|
2288
|
-
marginVertical: 16,
|
|
2289
|
-
}}
|
|
2290
|
-
/>
|
|
2291
|
-
<View
|
|
2292
|
-
style={{
|
|
2293
|
-
flexDirection: 'row',
|
|
2294
|
-
justifyContent: 'space-between',
|
|
2295
|
-
}}
|
|
2296
|
-
>
|
|
2297
|
-
<MText style={commonStyles.textNormal}>
|
|
2298
|
-
Ngày kết thúc khoản vay
|
|
2299
|
-
</MText>
|
|
2300
|
-
<MText style={commonStyles.textNormalBold}>
|
|
2301
|
-
{formatDDMMYYY(loan?.finalSettlementAt)}
|
|
2302
|
-
</MText>
|
|
2303
|
-
</View>
|
|
2304
|
-
<View
|
|
2305
|
-
style={{
|
|
2306
|
-
height: 0.5,
|
|
2307
|
-
backgroundColor: '#E0E0E0',
|
|
2308
|
-
marginVertical: 16,
|
|
2309
|
-
}}
|
|
2310
|
-
/>
|
|
2311
|
-
<View
|
|
2312
|
-
style={{
|
|
2313
|
-
flexDirection: 'row',
|
|
2314
|
-
justifyContent: 'space-between',
|
|
2315
|
-
}}
|
|
2316
|
-
>
|
|
2317
|
-
<MText style={commonStyles.textNormal}>
|
|
2318
|
-
Ngày đến hạn tiếp theo
|
|
2319
|
-
</MText>
|
|
2320
|
-
<MText style={commonStyles.textNormalBold}>
|
|
2321
|
-
{formatDDMMYYY(loan?.nextPaymentAt)}
|
|
2322
|
-
</MText>
|
|
2323
|
-
</View>
|
|
2324
|
-
<View
|
|
2325
|
-
style={{
|
|
2326
|
-
height: 0.5,
|
|
2327
|
-
backgroundColor: '#E0E0E0',
|
|
2328
|
-
marginVertical: 16,
|
|
2329
|
-
}}
|
|
2330
|
-
/>
|
|
2331
|
-
<View
|
|
2332
|
-
style={{
|
|
2333
|
-
flexDirection: 'row',
|
|
2334
|
-
justifyContent: 'space-between',
|
|
2335
|
-
}}
|
|
2336
|
-
>
|
|
2337
|
-
<MText style={commonStyles.textNormal}>
|
|
2338
|
-
STK thanh toán
|
|
2339
|
-
</MText>
|
|
2340
|
-
<MText
|
|
2341
|
-
style={[
|
|
2342
|
-
commonStyles.textNormalBold,
|
|
2343
|
-
{
|
|
2344
|
-
textAlign: 'right',
|
|
2345
|
-
},
|
|
2346
|
-
]}
|
|
2314
|
+
|
|
2315
|
+
<View
|
|
2316
|
+
style={{
|
|
2317
|
+
// Vector 1219: đường kẻ ngang full content (align-self: stretch)
|
|
2318
|
+
alignSelf: 'stretch',
|
|
2319
|
+
height: 1,
|
|
2320
|
+
backgroundColor: '#DADADA',
|
|
2321
|
+
marginVertical: 12,
|
|
2322
|
+
}}
|
|
2323
|
+
/>
|
|
2324
|
+
|
|
2325
|
+
{/* 2 cột: số tiền thanh toán | kỳ thanh toán kế tiếp */}
|
|
2326
|
+
<View
|
|
2327
|
+
style={{
|
|
2328
|
+
flexDirection: 'row',
|
|
2329
|
+
}}
|
|
2347
2330
|
>
|
|
2348
|
-
{
|
|
2349
|
-
|
|
2350
|
-
|
|
2331
|
+
<View style={{ flex: 1, paddingRight: 8 }}>
|
|
2332
|
+
<MText style={{ fontSize: 12, color: '#828282' }}>
|
|
2333
|
+
Số tiền thanh toán
|
|
2334
|
+
</MText>
|
|
2335
|
+
<MText
|
|
2336
|
+
style={{
|
|
2337
|
+
fontSize: 14,
|
|
2338
|
+
color: '#EF592E',
|
|
2339
|
+
marginTop: 4,
|
|
2340
|
+
}}
|
|
2341
|
+
>
|
|
2342
|
+
{amountPayment != null
|
|
2343
|
+
? `${formatMoney(amountPayment)} đ`
|
|
2344
|
+
: '—'}
|
|
2345
|
+
</MText>
|
|
2346
|
+
</View>
|
|
2347
|
+
<View style={{ flex: 1, paddingLeft: 8 }}>
|
|
2348
|
+
<MText style={{ fontSize: 12, color: '#828282' }}>
|
|
2349
|
+
Kỳ thanh toán kế tiếp
|
|
2350
|
+
</MText>
|
|
2351
|
+
<MText
|
|
2352
|
+
style={{
|
|
2353
|
+
fontSize: 14,
|
|
2354
|
+
color: '#333333',
|
|
2355
|
+
marginTop: 4,
|
|
2356
|
+
}}
|
|
2357
|
+
>
|
|
2358
|
+
{formatDDMMYYY(loan?.nextPaymentAt)}
|
|
2359
|
+
</MText>
|
|
2360
|
+
{overdueDays > 0 && (
|
|
2361
|
+
<View
|
|
2362
|
+
style={{
|
|
2363
|
+
flexDirection: 'row',
|
|
2364
|
+
alignItems: 'center',
|
|
2365
|
+
marginTop: 4,
|
|
2366
|
+
}}
|
|
2367
|
+
>
|
|
2368
|
+
<View
|
|
2369
|
+
style={{
|
|
2370
|
+
width: 6,
|
|
2371
|
+
height: 6,
|
|
2372
|
+
borderRadius: 3,
|
|
2373
|
+
backgroundColor: '#EB5757',
|
|
2374
|
+
marginRight: 6,
|
|
2375
|
+
}}
|
|
2376
|
+
/>
|
|
2377
|
+
<MText
|
|
2378
|
+
style={{
|
|
2379
|
+
fontSize: 12,
|
|
2380
|
+
color: '#EB5757',
|
|
2381
|
+
}}
|
|
2382
|
+
>
|
|
2383
|
+
Quá hạn {overdueDays} ngày
|
|
2384
|
+
</MText>
|
|
2385
|
+
</View>
|
|
2386
|
+
)}
|
|
2387
|
+
</View>
|
|
2388
|
+
</View>
|
|
2389
|
+
|
|
2390
|
+
<View
|
|
2391
|
+
style={{
|
|
2392
|
+
// Vector 1219: đường kẻ ngang full content (align-self: stretch)
|
|
2393
|
+
alignSelf: 'stretch',
|
|
2394
|
+
height: 1,
|
|
2395
|
+
backgroundColor: '#DADADA',
|
|
2396
|
+
marginVertical: 12,
|
|
2397
|
+
}}
|
|
2398
|
+
/>
|
|
2399
|
+
|
|
2400
|
+
{/* Số tài khoản thanh toán */}
|
|
2401
|
+
<MText style={{ fontSize: 12, color: '#828282' }}>
|
|
2402
|
+
Số tài khoản thanh toán
|
|
2351
2403
|
</MText>
|
|
2352
|
-
</View>
|
|
2353
|
-
<View
|
|
2354
|
-
style={{
|
|
2355
|
-
flexDirection: 'row',
|
|
2356
|
-
alignItems: 'center',
|
|
2357
|
-
backgroundColor: '#EAF5E4',
|
|
2358
|
-
marginHorizontal: -16,
|
|
2359
|
-
paddingVertical: 8,
|
|
2360
|
-
marginTop: 16,
|
|
2361
|
-
borderBottomRightRadius: 8,
|
|
2362
|
-
borderBottomLeftRadius: 8,
|
|
2363
|
-
paddingHorizontal: 16,
|
|
2364
|
-
}}
|
|
2365
|
-
>
|
|
2366
|
-
<Info />
|
|
2367
2404
|
<MText
|
|
2368
|
-
style={
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
color: '#333333',
|
|
2374
|
-
marginLeft: 8,
|
|
2375
|
-
},
|
|
2376
|
-
]}
|
|
2405
|
+
style={{
|
|
2406
|
+
fontSize: 14,
|
|
2407
|
+
color: '#333333',
|
|
2408
|
+
marginTop: 4,
|
|
2409
|
+
}}
|
|
2377
2410
|
>
|
|
2378
|
-
|
|
2379
|
-
{diffDays(new Date(), loan?.finalSettlementAt)} ngày
|
|
2411
|
+
{loan?.bankName} - {loan?.bankAccountNumber}
|
|
2380
2412
|
</MText>
|
|
2381
|
-
</
|
|
2382
|
-
</
|
|
2383
|
-
|
|
2384
|
-
)
|
|
2413
|
+
</TouchableOpacity>
|
|
2414
|
+
</View>
|
|
2415
|
+
);
|
|
2416
|
+
})}
|
|
2385
2417
|
</View>
|
|
2386
2418
|
)}
|
|
2387
2419
|
</Observer>
|
|
@@ -2391,7 +2423,6 @@ export const Home = observer(function Home() {
|
|
|
2391
2423
|
{() =>
|
|
2392
2424
|
!isLoading &&
|
|
2393
2425
|
!homeStore.isLoading &&
|
|
2394
|
-
(listLoan?.length ?? 0) === 0 &&
|
|
2395
2426
|
(homeStore?.listLoan?.length ?? 0) === 0 ? (
|
|
2396
2427
|
<View
|
|
2397
2428
|
style={{
|
|
@@ -2400,41 +2431,17 @@ export const Home = observer(function Home() {
|
|
|
2400
2431
|
paddingVertical: 48,
|
|
2401
2432
|
}}
|
|
2402
2433
|
>
|
|
2403
|
-
<
|
|
2404
|
-
source={require('./not_found.png')}
|
|
2405
|
-
style={{
|
|
2406
|
-
width: 180,
|
|
2407
|
-
height: 180,
|
|
2408
|
-
resizeMode: 'contain',
|
|
2409
|
-
}}
|
|
2410
|
-
/>
|
|
2434
|
+
<NotFoundSvg />
|
|
2411
2435
|
<MText
|
|
2412
2436
|
style={{
|
|
2413
2437
|
marginTop: 16,
|
|
2414
2438
|
fontSize: 14,
|
|
2415
|
-
color: '#
|
|
2439
|
+
color: '#999999',
|
|
2416
2440
|
textAlign: 'center',
|
|
2417
2441
|
}}
|
|
2418
2442
|
>
|
|
2419
|
-
|
|
2443
|
+
Hiện chưa có khoản vay nào đang hoạt động
|
|
2420
2444
|
</MText>
|
|
2421
|
-
<TouchableOpacity
|
|
2422
|
-
onPress={() => onRefresh()}
|
|
2423
|
-
style={{
|
|
2424
|
-
marginTop: 16,
|
|
2425
|
-
borderWidth: 1,
|
|
2426
|
-
borderColor: '#EF592E',
|
|
2427
|
-
borderRadius: 30,
|
|
2428
|
-
paddingHorizontal: 32,
|
|
2429
|
-
height: 40,
|
|
2430
|
-
alignItems: 'center',
|
|
2431
|
-
justifyContent: 'center',
|
|
2432
|
-
}}
|
|
2433
|
-
>
|
|
2434
|
-
<MText style={{ color: '#EF592E', fontSize: 14 }}>
|
|
2435
|
-
Tải lại trang
|
|
2436
|
-
</MText>
|
|
2437
|
-
</TouchableOpacity>
|
|
2438
2445
|
</View>
|
|
2439
2446
|
) : (
|
|
2440
2447
|
<View />
|
|
@@ -2869,7 +2876,6 @@ export const Home = observer(function Home() {
|
|
|
2869
2876
|
}}
|
|
2870
2877
|
/>
|
|
2871
2878
|
</ScrollView>
|
|
2872
|
-
{/* <Loading isLoading={isLoading || homeStore.isLoading} /> */}
|
|
2873
2879
|
</View>
|
|
2874
2880
|
);
|
|
2875
2881
|
});
|