react-native-timacare 3.3.45 → 3.3.47

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 (82) hide show
  1. package/lib/commonjs/assets/svgs/question.svg +1 -7
  2. package/lib/commonjs/components/ItemTimaOneV3.js +1 -1
  3. package/lib/commonjs/components/ItemTimaOneV3.js.flow +29 -29
  4. package/lib/commonjs/components/ItemTimaOneV3.js.map +1 -1
  5. package/lib/commonjs/components/SkeletonLoanCard.js +1 -1
  6. package/lib/commonjs/components/SkeletonLoanCard.js.flow +58 -0
  7. package/lib/commonjs/components/SkeletonLoanCard.js.map +1 -1
  8. package/lib/commonjs/navigation/navigationRef.js +1 -1
  9. package/lib/commonjs/navigation/navigationRef.js.flow +65 -33
  10. package/lib/commonjs/navigation/navigationRef.js.map +1 -1
  11. package/lib/commonjs/navigation/primary-navigator.js +1 -1
  12. package/lib/commonjs/navigation/primary-navigator.js.flow +46 -7
  13. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  14. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js +2 -0
  15. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.flow +199 -0
  16. package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.map +1 -0
  17. package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js +2 -0
  18. package/lib/commonjs/screens/{detail-loan/DetailLoanTima.js.flow → detail-loan-tima/PaymentSchedule.js.flow} +107 -118
  19. package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js.map +1 -0
  20. package/lib/commonjs/screens/detail-loan-tima/index.js +2 -0
  21. package/lib/commonjs/screens/detail-loan-tima/index.js.flow +109 -0
  22. package/lib/commonjs/screens/detail-loan-tima/index.js.map +1 -0
  23. package/lib/commonjs/screens/home/DigitalTopupItem.js +1 -1
  24. package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +2 -2
  25. package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -1
  26. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
  27. package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +2 -2
  28. package/lib/commonjs/services/api/api.js +1 -1
  29. package/lib/commonjs/services/api/api.js.flow +33 -7
  30. package/lib/commonjs/services/api/api.js.map +1 -1
  31. package/lib/module/assets/svgs/question.svg +1 -7
  32. package/lib/module/components/ItemTimaOneV3.js +1 -1
  33. package/lib/module/components/ItemTimaOneV3.js.map +1 -1
  34. package/lib/module/components/SkeletonLoanCard.js +1 -1
  35. package/lib/module/components/SkeletonLoanCard.js.map +1 -1
  36. package/lib/module/navigation/navigationRef.js +1 -1
  37. package/lib/module/navigation/navigationRef.js.map +1 -1
  38. package/lib/module/navigation/primary-navigator.js +1 -1
  39. package/lib/module/navigation/primary-navigator.js.map +1 -1
  40. package/lib/module/screens/detail-loan-tima/InforLoan.js +2 -0
  41. package/lib/module/screens/detail-loan-tima/InforLoan.js.map +1 -0
  42. package/lib/module/screens/detail-loan-tima/PaymentSchedule.js +2 -0
  43. package/lib/module/screens/detail-loan-tima/PaymentSchedule.js.map +1 -0
  44. package/lib/module/screens/detail-loan-tima/index.js +2 -0
  45. package/lib/module/screens/detail-loan-tima/index.js.map +1 -0
  46. package/lib/module/screens/home/DigitalTopupItem.js +1 -1
  47. package/lib/module/screens/home/DigitalTopupItem.js.map +1 -1
  48. package/lib/module/screens/home/ItemMotoBikeLoan.js +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/components/SkeletonLoanCard.d.ts +3 -0
  52. package/lib/typescript/components/SkeletonLoanCard.d.ts.map +1 -1
  53. package/lib/typescript/navigation/navigationRef.d.ts +47 -8
  54. package/lib/typescript/navigation/navigationRef.d.ts.map +1 -1
  55. package/lib/typescript/navigation/primary-navigator.d.ts +9 -2
  56. package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
  57. package/lib/typescript/screens/detail-loan-tima/InforLoan.d.ts +4 -0
  58. package/lib/typescript/screens/detail-loan-tima/InforLoan.d.ts.map +1 -0
  59. package/lib/typescript/screens/detail-loan-tima/PaymentSchedule.d.ts +2 -0
  60. package/lib/typescript/screens/detail-loan-tima/PaymentSchedule.d.ts.map +1 -0
  61. package/lib/typescript/screens/detail-loan-tima/index.d.ts +2 -0
  62. package/lib/typescript/screens/detail-loan-tima/index.d.ts.map +1 -0
  63. package/lib/typescript/services/api/api.d.ts +16 -0
  64. package/lib/typescript/services/api/api.d.ts.map +1 -1
  65. package/package.json +1 -1
  66. package/src/assets/svgs/question.svg +1 -7
  67. package/src/components/ItemTimaOneV3.tsx +29 -29
  68. package/src/components/SkeletonLoanCard.tsx +58 -0
  69. package/src/navigation/navigationRef.ts +65 -33
  70. package/src/navigation/primary-navigator.tsx +46 -7
  71. package/src/screens/detail-loan-tima/InforLoan.tsx +199 -0
  72. package/src/screens/{detail-loan/DetailLoanTima.tsx → detail-loan-tima/PaymentSchedule.tsx} +107 -118
  73. package/src/screens/detail-loan-tima/index.tsx +109 -0
  74. package/src/screens/home/DigitalTopupItem.tsx +2 -2
  75. package/src/screens/home/ItemMotoBikeLoan.tsx +2 -2
  76. package/src/services/api/api.ts +33 -7
  77. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js +0 -2
  78. package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.map +0 -1
  79. package/lib/module/screens/detail-loan/DetailLoanTima.js +0 -2
  80. package/lib/module/screens/detail-loan/DetailLoanTima.js.map +0 -1
  81. package/lib/typescript/screens/detail-loan/DetailLoanTima.d.ts +0 -2
  82. package/lib/typescript/screens/detail-loan/DetailLoanTima.d.ts.map +0 -1
@@ -0,0 +1,199 @@
1
+ //@ts-nocheck
2
+ import React, { useEffect, useState } from 'react';
3
+ import { Alert, ScrollView, TouchableOpacity, View } from 'react-native';
4
+ import { MText } from '../../components/MText';
5
+ import { IconArrowDown } from '../../assets/icons';
6
+ import { formatDDMMYYY, formatMoney } from '../../utils';
7
+ import { Api } from '../../services/api';
8
+ import { color } from '../../theme';
9
+ import { SkeletonDisbursedList } from '../../components/SkeletonLoanCard';
10
+
11
+ const cardStyle = {
12
+ backgroundColor: '#FFFFFF',
13
+ borderRadius: 12,
14
+ borderWidth: 1,
15
+ borderColor: '#E0E0E0',
16
+ marginHorizontal: 16,
17
+ paddingHorizontal: 16,
18
+ paddingVertical: 8,
19
+ };
20
+
21
+ // Một dòng "Nhãn ... Giá trị" trong thẻ thông tin
22
+ const InfoRow = ({ label, value, valueColor = '#1A1A1A' }) => (
23
+ <View
24
+ style={{
25
+ flexDirection: 'row',
26
+ alignItems: 'center',
27
+ justifyContent: 'space-between',
28
+ paddingVertical: 12,
29
+ }}
30
+ >
31
+ <MText style={{ fontSize: 14, color: '#4F4F4F' }}>{label}</MText>
32
+ <MText
33
+ style={{
34
+ fontSize: 14,
35
+ fontWeight: '600',
36
+ fontFamily: 'BeVietnamPro-SemiBold',
37
+ color: valueColor,
38
+ }}
39
+ >
40
+ {value}
41
+ </MText>
42
+ </View>
43
+ );
44
+
45
+ export default function InforLoan({ id }: { id: number }) {
46
+ const [isLoading, setIsLoading] = useState(false);
47
+ const [data, setData] = useState<any>();
48
+ const [expanded, setExpanded] = useState(false);
49
+
50
+ const getData = async () => {
51
+ try {
52
+ setIsLoading(true);
53
+ const response = await Api.getInstance().get_detail_loan_tima(id);
54
+ if (response.kind === 'ok') {
55
+ if (response.data?.meta?.errorCode === 200) {
56
+ setData(response.data?.data);
57
+ } else {
58
+ Alert.alert('Thông báo', response?.data?.meta?.errorMessage);
59
+ }
60
+ } else {
61
+ Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau');
62
+ }
63
+ } catch (error) {
64
+ Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau');
65
+ } finally {
66
+ setIsLoading(false);
67
+ }
68
+ };
69
+
70
+ useEffect(() => {
71
+ getData();
72
+ }, []);
73
+
74
+ if (isLoading && !data) {
75
+ return (
76
+ <ScrollView style={{ flex: 1, paddingTop: 16 }}>
77
+ <SkeletonDisbursedList count={2} />
78
+ </ScrollView>
79
+ );
80
+ }
81
+
82
+ return (
83
+ <ScrollView
84
+ style={{ flex: 1 }}
85
+ contentContainerStyle={{ paddingVertical: 16 }}
86
+ >
87
+ {/* Thẻ thông tin hợp đồng giải ngân */}
88
+ <View style={cardStyle}>
89
+ <InfoRow label="Mã HĐ giải ngân" value={data?.contractCode || ''} />
90
+ <InfoRow
91
+ label="Số tiền giải ngân"
92
+ value={`${formatMoney(data?.totalMoneyDisbursement || 0)} đ`}
93
+ />
94
+ <InfoRow
95
+ label="Thời hạn"
96
+ value={data?.loanTime ? `${data?.loanTime} tháng` : ''}
97
+ />
98
+ <InfoRow
99
+ label="Ngày giải ngân"
100
+ value={data?.fromDate ? formatDDMMYYY(data?.fromDate) : ''}
101
+ />
102
+ <InfoRow
103
+ label="Ngày đến hạn tiếp theo"
104
+ value={data?.nextDate ? formatDDMMYYY(data?.nextDate) : ''}
105
+ />
106
+ <InfoRow label="Trạng thái Hợp đồng" value={data?.statusName || ''} />
107
+ </View>
108
+
109
+ {/* Thẻ tổng phải trả + trạng thái thanh toán */}
110
+ <View
111
+ style={[
112
+ {
113
+ marginTop: 16,
114
+ marginHorizontal: 16,
115
+ paddingHorizontal: 16,
116
+ paddingVertical: 8,
117
+ borderRadius: 12,
118
+ borderWidth: 1,
119
+ borderColor: '#E0E0E0',
120
+ },
121
+ ]}
122
+ >
123
+ <TouchableOpacity
124
+ activeOpacity={0.8}
125
+ onPress={() => setExpanded((prev) => !prev)}
126
+ style={{
127
+ flexDirection: 'row',
128
+ alignItems: 'center',
129
+ justifyContent: 'space-between',
130
+ paddingVertical: 12,
131
+ }}
132
+ >
133
+ <MText style={{ fontSize: 14, color: '#4F4F4F' }}>
134
+ Tổng phải trả
135
+ </MText>
136
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
137
+ <MText
138
+ style={{
139
+ fontSize: 14,
140
+ fontWeight: '600',
141
+ fontFamily: 'BeVietnamPro-SemiBold',
142
+ color: color.primary,
143
+ marginRight: 8,
144
+ }}
145
+ >
146
+ {formatMoney(data?.totalMoneyNeedPay || 0)} đ
147
+ </MText>
148
+ <View
149
+ style={{
150
+ transform: [{ rotate: expanded ? '180deg' : '0deg' }],
151
+ }}
152
+ >
153
+ <IconArrowDown width={14} height={14} fill="#828282" />
154
+ </View>
155
+ </View>
156
+ </TouchableOpacity>
157
+ {/* Chi tiết kỳ thanh toán khi mở rộng */}
158
+ {expanded &&
159
+ data?.schedules?.map((item, index) => (
160
+ <View
161
+ key={item?.paymentScheduleID || index}
162
+ style={{
163
+ flexDirection: 'row',
164
+ alignItems: 'center',
165
+ justifyContent: 'space-between',
166
+ paddingVertical: 8,
167
+ paddingHorizontal: 24,
168
+ }}
169
+ >
170
+ <MText style={{ fontSize: 13, color: '#828282' }}>
171
+ {formatDDMMYYY(item?.payDate)}
172
+ </MText>
173
+ <MText
174
+ style={{
175
+ fontSize: 13,
176
+ color: '#828282',
177
+ }}
178
+ >
179
+ {formatMoney(item?.moneyNeedPay || 0)} đ
180
+ </MText>
181
+ </View>
182
+ ))}
183
+ {expanded && (
184
+ <View
185
+ style={{
186
+ height: 1,
187
+ backgroundColor: '#E0E0E0',
188
+ }}
189
+ />
190
+ )}
191
+ <InfoRow
192
+ label="Trạng thái"
193
+ value={data?.paymentStatusName || ''}
194
+ valueColor={data?.isPaid ? '#27AE60' : color.primary}
195
+ />
196
+ </View>
197
+ </ScrollView>
198
+ );
199
+ }
@@ -15,11 +15,15 @@ import { formatDDMMYYY, formatMoney } from '../../utils';
15
15
  import { Api } from '../../services/api';
16
16
  import { color } from '../../theme';
17
17
  import { commonStyles } from '../CommonStyles';
18
- import Loading from '../../components/Loading';
18
+ import { SkeletonPaymentScheduleList } from '../../components/SkeletonLoanCard';
19
19
  import MHeader from '../../components/MHeader';
20
20
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
21
21
 
22
- export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
22
+ export const PaymentSchedule = observer(function PaymentSchedule({
23
+ id,
24
+ }: {
25
+ id: number;
26
+ }) {
23
27
  const insets = useSafeAreaInsets();
24
28
  const navigation = useNavigation();
25
29
  const [isLoading, setIsLoading] = useState(false);
@@ -29,7 +33,7 @@ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
29
33
  const getData = async () => {
30
34
  setIsLoading(true);
31
35
  Api.getInstance()
32
- .getPaymentScheduleTima(props.route?.params?.loan?.id)
36
+ .getPaymentScheduleTima(id)
33
37
  .then((response) => {
34
38
  setIsLoading(false);
35
39
  if (response.kind === 'ok') {
@@ -51,9 +55,7 @@ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
51
55
  const getMoneyCloseLoan = async () => {
52
56
  try {
53
57
  setIsLoading(true);
54
- const response = await Api.getInstance().getMoneyCloseLoan(
55
- props.route?.params?.loan?.id
56
- );
58
+ const response = await Api.getInstance().getMoneyCloseLoan(id);
57
59
  if (response.kind === 'ok' && response.data.meta.errorCode === 200) {
58
60
  setMoneyCloseLoan(response.data?.data?.totalMoneyCloseLoan);
59
61
  } else {
@@ -71,25 +73,7 @@ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
71
73
 
72
74
  return (
73
75
  <View style={{ flex: 1, backgroundColor: '#FDFDFD' }}>
74
- <MHeader title={`Vay trực tuyến 24/7`} />
75
76
  <View style={{ flex: 1 }}>
76
- <View style={$header}>
77
- <TouchableOpacity
78
- style={$backButton}
79
- onPress={() => navigation.goBack()}
80
- >
81
- <IconBack />
82
- </TouchableOpacity>
83
- <MText
84
- style={{
85
- fontSize: 16,
86
- fontWeight: '600',
87
- fontFamily: 'BeVietnamPro-SemiBold',
88
- }}
89
- >
90
- HD-{props.route?.params?.loan?.id}
91
- </MText>
92
- </View>
93
77
  <View
94
78
  style={{
95
79
  backgroundColor: '#ECFFE8',
@@ -98,6 +82,7 @@ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
98
82
  paddingHorizontal: 16,
99
83
  paddingVertical: 8,
100
84
  justifyContent: 'space-between',
85
+ marginTop: 16,
101
86
  }}
102
87
  >
103
88
  <MText
@@ -122,7 +107,8 @@ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
122
107
  flexDirection: 'row',
123
108
  alignItems: 'center',
124
109
  paddingHorizontal: 16,
125
- marginTop: 16,
110
+ backgroundColor: '#FFF3E9',
111
+ paddingVertical: 16,
126
112
  }}
127
113
  >
128
114
  <MText
@@ -147,118 +133,121 @@ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
147
133
  Số tiền thanh toán
148
134
  </MText>
149
135
  </View>
150
- <ScrollView style={{ flex: 1, paddingHorizontal: 16, marginTop: 16 }}>
151
- {data?.paymentSchedule?.map((item, index) => (
152
- <View
153
- key={index}
154
- style={{
155
- flexDirection: 'row',
156
- paddingVertical: 16,
157
- borderBottomWidth: 1,
158
- borderColor: color.border,
159
- }}
160
- >
161
- <MText
162
- style={[
163
- {
164
- width: '35%',
165
- },
166
- ]}
167
- >
168
- {item?.daysPayable ? formatDDMMYYY(item?.daysPayable) : ''}
169
- </MText>
136
+ {isLoading && !data ? (
137
+ <SkeletonPaymentScheduleList />
138
+ ) : (
139
+ <ScrollView style={{ flex: 1, paddingHorizontal: 16 }}>
140
+ {data?.paymentSchedule?.map((item, index) => (
170
141
  <View
142
+ key={index}
171
143
  style={{
172
- width: '40%',
173
- alignItems: 'center',
144
+ flexDirection: 'row',
145
+ paddingVertical: 16,
146
+ borderBottomWidth: 1,
147
+ borderColor: color.border,
174
148
  }}
175
149
  >
176
- <MText>{formatMoney(item?.payMoney)} VNĐ</MText>
177
150
  <MText
178
151
  style={[
179
152
  {
180
- color: !item?.done ? '#F05123' : '#27AE60',
181
- marginTop: 4,
182
- fontSize: 12,
153
+ width: '35%',
183
154
  },
184
155
  ]}
185
156
  >
186
- {!item?.done ? 'Chưa thanh toán' : 'Đã thanh toán'}
157
+ {item?.daysPayable ? formatDDMMYYY(item?.daysPayable) : ''}
187
158
  </MText>
188
- </View>
189
-
190
- <View
191
- style={{
192
- flexDirection: 'row',
193
- justifyContent: 'flex-end',
194
- }}
195
- >
196
- {!item?.done && (
197
- <TouchableOpacity
198
- disabled={item?.done}
199
- style={{
200
- borderRadius: 8,
201
- height: 30,
202
- paddingHorizontal: 8,
203
- alignItems: 'center',
204
- justifyContent: 'center',
205
- borderWidth: 1,
206
- borderColor: !item?.done ? color.primary : '#333333',
207
- }}
208
- onPress={() =>
209
- navigation.navigate('ShowQrCode', {
210
- item,
211
- data,
212
- id: props.route?.params?.loan?.id,
213
- })
214
- }
159
+ <View
160
+ style={{
161
+ width: '40%',
162
+ alignItems: 'center',
163
+ }}
164
+ >
165
+ <MText>{formatMoney(item?.payMoney)} đ</MText>
166
+ <MText
167
+ style={[
168
+ {
169
+ color: !item?.done ? '#EB5757' : '#27AE60',
170
+ marginTop: 4,
171
+ fontSize: 12,
172
+ },
173
+ ]}
215
174
  >
216
- <MText
175
+ {!item?.done ? 'Chưa thanh toán' : 'Đã thanh toán'}
176
+ </MText>
177
+ </View>
178
+
179
+ <View
180
+ style={{
181
+ flexDirection: 'row',
182
+ justifyContent: 'flex-end',
183
+ }}
184
+ >
185
+ {!item?.done && (
186
+ <TouchableOpacity
187
+ disabled={item?.done}
217
188
  style={{
218
- color: !item?.done ? color.primary : '#333333',
219
- fontSize: 12,
189
+ borderRadius: 24,
190
+ height: 30,
191
+ paddingHorizontal: 8,
192
+ alignItems: 'center',
193
+ justifyContent: 'center',
194
+ borderWidth: 1,
195
+ borderColor: !item?.done ? color.primary : '#333333',
220
196
  }}
197
+ onPress={() =>
198
+ navigation.navigate('ShowQrCode', {
199
+ item,
200
+ data,
201
+ id: id,
202
+ })
203
+ }
221
204
  >
222
- Thanh toán
223
- </MText>
224
- </TouchableOpacity>
225
- )}
205
+ <MText
206
+ style={{
207
+ color: !item?.done ? color.primary : '#333333',
208
+ fontSize: 12,
209
+ }}
210
+ >
211
+ Thanh toán
212
+ </MText>
213
+ </TouchableOpacity>
214
+ )}
215
+ </View>
226
216
  </View>
227
- </View>
228
- ))}
229
- <TouchableOpacity
230
- onPress={() =>
231
- navigation.navigate('ShowQrCode', {
232
- data,
233
- id: props.route?.params?.loan?.id,
234
- isFullPayment: true,
235
- totalMoney: moneyCloseLoan,
236
- })
237
- }
238
- style={{
239
- backgroundColor: '#FFEAD8',
240
- marginTop: 24,
241
- borderRadius: 24,
242
- height: 40,
243
- alignItems: 'center',
244
- justifyContent: 'center',
245
- borderWidth: 1,
246
- borderColor: '#F05123',
247
- marginBottom: insets.bottom + 24,
248
- }}
249
- >
250
- <MText
217
+ ))}
218
+ <TouchableOpacity
219
+ onPress={() =>
220
+ navigation.navigate('ShowQrCode', {
221
+ data,
222
+ id: id,
223
+ isFullPayment: true,
224
+ totalMoney: moneyCloseLoan,
225
+ })
226
+ }
251
227
  style={{
252
- color: '#F05123',
253
- fontWeight: '500',
254
- fontFamily: 'BeVietnamPro-Medium',
228
+ backgroundColor: '#FFEAD8',
229
+ marginTop: 24,
230
+ borderRadius: 24,
231
+ height: 40,
232
+ alignItems: 'center',
233
+ justifyContent: 'center',
234
+ borderWidth: 1,
235
+ borderColor: '#F05123',
236
+ marginBottom: insets.bottom + 24,
255
237
  }}
256
238
  >
257
- Xem thông tin tất toán
258
- </MText>
259
- </TouchableOpacity>
260
- </ScrollView>
261
- <Loading isLoading={isLoading} />
239
+ <MText
240
+ style={{
241
+ color: '#F05123',
242
+ fontWeight: '500',
243
+ fontFamily: 'BeVietnamPro-Medium',
244
+ }}
245
+ >
246
+ Xem thông tin tất toán
247
+ </MText>
248
+ </TouchableOpacity>
249
+ </ScrollView>
250
+ )}
262
251
  </View>
263
252
  </View>
264
253
  );
@@ -0,0 +1,109 @@
1
+ //@ts-nocheck
2
+ import React, { useState } from 'react';
3
+ import { observer } from 'mobx-react-lite';
4
+ import { TouchableOpacity, View, ViewStyle } from 'react-native';
5
+ import MHeader from '../../components/MHeader';
6
+ import { IconBack } from '../../assets/icons';
7
+ import { MText } from '../../components/MText';
8
+ import InforLoan from './InforLoan';
9
+ import { PaymentSchedule } from './PaymentSchedule';
10
+ import { useNavigation } from '@react-navigation/native';
11
+
12
+ export const DetailLoanTima = observer(function DetailLoanTima(props: any) {
13
+ const navigation = useNavigation();
14
+ const [tab, setTab] = useState(1);
15
+ return (
16
+ <View style={{ flex: 1, backgroundColor: '#FFFFFF' }}>
17
+ <MHeader title={`Vay Online 24/7`} />
18
+ <View style={$header}>
19
+ <TouchableOpacity
20
+ style={$backButton}
21
+ onPress={() => navigation.goBack()}
22
+ >
23
+ <IconBack />
24
+ </TouchableOpacity>
25
+ <MText
26
+ style={{
27
+ fontSize: 16,
28
+ fontWeight: '600',
29
+ fontFamily: 'BeVietnamPro-SemiBold',
30
+ }}
31
+ >
32
+ HD-{props.route?.params?.loan?.id}
33
+ </MText>
34
+ </View>
35
+ <View
36
+ style={{
37
+ flexDirection: 'row',
38
+ backgroundColor: '#F2F2F2',
39
+ borderRadius: 30,
40
+ marginHorizontal: 16,
41
+ }}
42
+ >
43
+ <TouchableOpacity onPress={() => setTab(1)} style={{ flex: 1 }}>
44
+ <View
45
+ style={{
46
+ alignItems: 'center',
47
+ borderRadius: 30,
48
+ paddingVertical: 10,
49
+ borderWidth: 1,
50
+ borderColor: tab === 1 ? '#EF4123' : '#F2F2F2',
51
+ backgroundColor: tab === 1 ? '#FFFFFF' : '#F2F2F2',
52
+ }}
53
+ >
54
+ <MText
55
+ style={{
56
+ color: tab === 1 ? '#EF4123' : '#333333',
57
+ fontWeight: tab === 1 ? 'bold' : '400',
58
+ }}
59
+ >
60
+ Thông tin đơn
61
+ </MText>
62
+ </View>
63
+ </TouchableOpacity>
64
+ <TouchableOpacity
65
+ onPress={() => setTab(2)}
66
+ style={{
67
+ flex: 1,
68
+ }}
69
+ >
70
+ <View
71
+ style={{
72
+ alignItems: 'center',
73
+ borderRadius: 30,
74
+ paddingVertical: 10,
75
+ borderWidth: 1,
76
+ borderColor: tab === 2 ? '#EF4123' : '#F2F2F2',
77
+ backgroundColor: tab === 2 ? '#FFFFFF' : '#F2F2F2',
78
+ }}
79
+ >
80
+ <MText
81
+ style={{
82
+ color: tab === 2 ? '#EF4123' : '#333333',
83
+ fontWeight: tab === 2 ? 'bold' : '400',
84
+ }}
85
+ >
86
+ Lịch thanh toán
87
+ </MText>
88
+ </View>
89
+ </TouchableOpacity>
90
+ </View>
91
+ {tab === 1 ? (
92
+ <InforLoan id={props.route?.params?.loan?.id} />
93
+ ) : (
94
+ <PaymentSchedule id={props.route?.params?.loan?.id} />
95
+ )}
96
+ </View>
97
+ );
98
+ });
99
+ const $backButton: ViewStyle = {
100
+ position: 'absolute',
101
+ left: 16,
102
+ };
103
+
104
+ const $header: ViewStyle = {
105
+ flexDirection: 'row',
106
+ alignItems: 'center',
107
+ paddingVertical: 16,
108
+ justifyContent: 'center',
109
+ };
@@ -305,7 +305,7 @@ export default function DigitalTopupItem({
305
305
  {item?.step !== 11 ? (
306
306
  <View
307
307
  style={{
308
- backgroundColor: '#FFF3E9',
308
+ backgroundColor: '#EEF7FF',
309
309
  flexDirection: 'row',
310
310
  alignItems: 'center',
311
311
  gap: 4,
@@ -328,7 +328,7 @@ export default function DigitalTopupItem({
328
328
  <MText
329
329
  style={{
330
330
  fontSize: 10,
331
- color: color.primary,
331
+ color: '#2F80ED',
332
332
  textDecorationLine: 'underline',
333
333
  }}
334
334
  >
@@ -292,7 +292,7 @@ export default function ItemMotoBikeLoan({
292
292
 
293
293
  <View
294
294
  style={{
295
- backgroundColor: '#FFF3E9',
295
+ backgroundColor: '#EEF7FF',
296
296
  flexDirection: 'row',
297
297
  alignItems: 'center',
298
298
  gap: 4,
@@ -314,7 +314,7 @@ export default function ItemMotoBikeLoan({
314
314
  <MText
315
315
  style={{
316
316
  fontSize: 10,
317
- color: '#EF592E',
317
+ color: '#2F80ED',
318
318
  textDecorationLine: 'underline',
319
319
  }}
320
320
  >