react-native-timacare 3.3.43 → 3.3.45

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 (80) hide show
  1. package/lib/commonjs/assets/icons/gui.svg +102 -0
  2. package/lib/commonjs/assets/icons/index.js +1 -1
  3. package/lib/commonjs/assets/icons/index.js.flow +6 -0
  4. package/lib/commonjs/assets/icons/index.js.map +1 -1
  5. package/lib/commonjs/assets/icons/layer1.svg +15 -0
  6. package/lib/commonjs/assets/icons/not_found.svg +135 -0
  7. package/lib/commonjs/components/SkeletonLoanCard.js +2 -0
  8. package/lib/commonjs/components/SkeletonLoanCard.js.flow +246 -0
  9. package/lib/commonjs/components/SkeletonLoanCard.js.map +1 -0
  10. package/lib/commonjs/index.js +1 -1
  11. package/lib/commonjs/index.js.flow +2 -1
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/navigation/index.js +1 -1
  14. package/lib/commonjs/navigation/index.js.flow +1 -0
  15. package/lib/commonjs/navigation/index.js.map +1 -1
  16. package/lib/commonjs/navigation/navigationRef.js +2 -0
  17. package/lib/commonjs/navigation/navigationRef.js.flow +66 -0
  18. package/lib/commonjs/navigation/navigationRef.js.map +1 -0
  19. package/lib/commonjs/navigation/primary-navigator.js +1 -1
  20. package/lib/commonjs/navigation/primary-navigator.js.flow +38 -0
  21. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  22. package/lib/commonjs/screens/home/BoxGuidline.js +2 -0
  23. package/lib/commonjs/screens/home/BoxGuidline.js.flow +58 -0
  24. package/lib/commonjs/screens/home/BoxGuidline.js.map +1 -0
  25. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
  26. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +6 -5
  27. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.map +1 -1
  28. package/lib/commonjs/screens/home/index.js +1 -1
  29. package/lib/commonjs/screens/home/index.js.flow +211 -204
  30. package/lib/commonjs/screens/home/index.js.map +1 -1
  31. package/lib/module/assets/icons/gui.svg +102 -0
  32. package/lib/module/assets/icons/index.js +1 -1
  33. package/lib/module/assets/icons/index.js.map +1 -1
  34. package/lib/module/assets/icons/layer1.svg +15 -0
  35. package/lib/module/assets/icons/not_found.svg +135 -0
  36. package/lib/module/components/SkeletonLoanCard.js +2 -0
  37. package/lib/module/components/SkeletonLoanCard.js.map +1 -0
  38. package/lib/module/index.js +1 -1
  39. package/lib/module/index.js.map +1 -1
  40. package/lib/module/navigation/index.js +1 -1
  41. package/lib/module/navigation/index.js.map +1 -1
  42. package/lib/module/navigation/navigationRef.js +2 -0
  43. package/lib/module/navigation/navigationRef.js.map +1 -0
  44. package/lib/module/navigation/primary-navigator.js +1 -1
  45. package/lib/module/navigation/primary-navigator.js.map +1 -1
  46. package/lib/module/screens/home/BoxGuidline.js +2 -0
  47. package/lib/module/screens/home/BoxGuidline.js.map +1 -0
  48. package/lib/module/screens/home/ItemMotoBikeLoan.js +1 -1
  49. package/lib/module/screens/home/ItemMotoBikeLoan.js.map +1 -1
  50. package/lib/module/screens/home/index.js +1 -1
  51. package/lib/module/screens/home/index.js.map +1 -1
  52. package/lib/typescript/assets/icons/index.d.ts +4 -1
  53. package/lib/typescript/assets/icons/index.d.ts.map +1 -1
  54. package/lib/typescript/components/SkeletonLoanCard.d.ts +7 -0
  55. package/lib/typescript/components/SkeletonLoanCard.d.ts.map +1 -0
  56. package/lib/typescript/index.d.ts +1 -0
  57. package/lib/typescript/index.d.ts.map +1 -1
  58. package/lib/typescript/navigation/index.d.ts +1 -0
  59. package/lib/typescript/navigation/index.d.ts.map +1 -1
  60. package/lib/typescript/navigation/navigationRef.d.ts +14 -0
  61. package/lib/typescript/navigation/navigationRef.d.ts.map +1 -0
  62. package/lib/typescript/navigation/primary-navigator.d.ts +15 -0
  63. package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
  64. package/lib/typescript/screens/home/BoxGuidline.d.ts +2 -0
  65. package/lib/typescript/screens/home/BoxGuidline.d.ts.map +1 -0
  66. package/lib/typescript/screens/home/ItemMotoBikeLoan.d.ts.map +1 -1
  67. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  68. package/package.json +1 -1
  69. package/src/assets/icons/gui.svg +102 -0
  70. package/src/assets/icons/index.tsx +6 -0
  71. package/src/assets/icons/layer1.svg +15 -0
  72. package/src/assets/icons/not_found.svg +135 -0
  73. package/src/components/SkeletonLoanCard.tsx +246 -0
  74. package/src/index.tsx +2 -1
  75. package/src/navigation/index.ts +1 -0
  76. package/src/navigation/navigationRef.ts +66 -0
  77. package/src/navigation/primary-navigator.tsx +38 -0
  78. package/src/screens/home/BoxGuidline.tsx +58 -0
  79. package/src/screens/home/ItemMotoBikeLoan.tsx +6 -5
  80. package/src/screens/home/index.tsx +211 -204
@@ -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 Loading from '../../components/Loading';
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
- {listLoan?.length > 0 && (
552
- <MText
553
- style={{
554
- fontSize: 16,
555
- fontWeight: 'bold',
556
- marginTop: 10,
557
- marginBottom: 8,
558
- }}
559
- >
560
- Danh sách đơn mới
561
- </MText>
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
- fontSize: 16,
2209
- fontWeight: 'bold',
2220
+ fontWeight: '600',
2210
2221
  marginBottom: 8,
2211
- marginTop: 10,
2222
+ marginTop: 16,
2223
+ fontFamily: 'BeVietnamPro-SemiBold',
2212
2224
  }}
2213
2225
  >
2214
- Danh sách đơn đang vay
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
- <View key={index}>
2220
- <TouchableOpacity
2221
- style={{
2222
- backgroundColor: '#FFFFFF',
2223
- paddingHorizontal: 16,
2224
- paddingTop: 16,
2225
- borderRadius: 8,
2226
- borderWidth: 0.5,
2227
- borderColor: '#E0E0E0',
2228
- marginBottom: 16,
2229
- }}
2230
- onPress={() => {
2231
- if (loan?.disbursementPartner === 'CIMB') {
2232
- navigation.dispatch(
2233
- StackActions.push(ScreenNames.DetailLoan, {
2234
- loan,
2235
- })
2236
- );
2237
- } else {
2238
- navigation.dispatch(
2239
- StackActions.push(ScreenNames.DetailLoanTima, {
2240
- loan,
2241
- })
2242
- );
2243
- }
2244
- }}
2245
- >
2246
- <View
2247
- style={{ flexDirection: 'row', alignItems: 'center' }}
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
- <ContractActive />
2250
- <View style={{ flex: 1, paddingLeft: 8 }}>
2251
- <MText style={commonStyles.textNormalBold}>
2252
- HD-{loan?.id}
2253
- </MText>
2254
- <MText
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
- fontSize: 12,
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
- Số tiền vay (VND): {formatMoney(loan?.loanAmount)}{' '}
2260
- đ
2261
- </MText>
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
- </View>
2264
- <View
2265
- style={{
2266
- height: 1,
2267
- backgroundColor: '#E0E0E0',
2268
- marginVertical: 16,
2269
- }}
2270
- />
2271
- <View
2272
- style={{
2273
- flexDirection: 'row',
2274
- justifyContent: 'space-between',
2275
- }}
2276
- >
2277
- <MText style={commonStyles.textNormal}>
2278
- Ngày giải ngân
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
- {loan?.bankAccountNumber}
2349
- {'\n'}
2350
- {loan?.bankName}
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
- fontWeight: '300',
2371
- fontSize: 12,
2372
- fontStyle: 'italic',
2373
- color: '#333333',
2374
- marginLeft: 8,
2375
- },
2376
- ]}
2405
+ style={{
2406
+ fontSize: 14,
2407
+ color: '#333333',
2408
+ marginTop: 4,
2409
+ }}
2377
2410
  >
2378
- Thời gian tất toán còn lại là{' '}
2379
- {diffDays(new Date(), loan?.finalSettlementAt)} ngày
2411
+ {loan?.bankName} - {loan?.bankAccountNumber}
2380
2412
  </MText>
2381
- </View>
2382
- </TouchableOpacity>
2383
- </View>
2384
- ))}
2413
+ </TouchableOpacity>
2414
+ </View>
2415
+ );
2416
+ })}
2385
2417
  </View>
2386
2418
  )}
2387
2419
  </Observer>
@@ -2400,41 +2432,17 @@ export const Home = observer(function Home() {
2400
2432
  paddingVertical: 48,
2401
2433
  }}
2402
2434
  >
2403
- <Image
2404
- source={require('./not_found.png')}
2405
- style={{
2406
- width: 180,
2407
- height: 180,
2408
- resizeMode: 'contain',
2409
- }}
2410
- />
2435
+ <NotFoundSvg />
2411
2436
  <MText
2412
2437
  style={{
2413
2438
  marginTop: 16,
2414
2439
  fontSize: 14,
2415
- color: '#828282',
2440
+ color: '#999999',
2416
2441
  textAlign: 'center',
2417
2442
  }}
2418
2443
  >
2419
- Oops! Bạn chưa có khoản vay nào
2444
+ Hiện chưa có khoản vay nào đang hoạt động
2420
2445
  </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
2446
  </View>
2439
2447
  ) : (
2440
2448
  <View />
@@ -2869,7 +2877,6 @@ export const Home = observer(function Home() {
2869
2877
  }}
2870
2878
  />
2871
2879
  </ScrollView>
2872
- {/* <Loading isLoading={isLoading || homeStore.isLoading} /> */}
2873
2880
  </View>
2874
2881
  );
2875
2882
  });