react-native-timacare 3.1.72 → 3.3.0

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 (67) hide show
  1. package/lib/commonjs/assets/v3/index.js +1 -1
  2. package/lib/commonjs/assets/v3/index.js.flow +4 -0
  3. package/lib/commonjs/assets/v3/index.js.map +1 -1
  4. package/lib/commonjs/assets/v3/option1-active.svg +45 -0
  5. package/lib/commonjs/assets/v3/option2-disable.svg +18 -0
  6. package/lib/commonjs/assets/v3/option2.svg +32 -12
  7. package/lib/commonjs/components/ItemTimaOneV3.js +1 -1
  8. package/lib/commonjs/components/ItemTimaOneV3.js.flow +18 -15
  9. package/lib/commonjs/components/ItemTimaOneV3.js.map +1 -1
  10. package/lib/commonjs/components/ModalOptionLoan.js +1 -1
  11. package/lib/commonjs/components/ModalOptionLoan.js.flow +133 -106
  12. package/lib/commonjs/components/ModalOptionLoan.js.map +1 -1
  13. package/lib/commonjs/screens/home/index.js +1 -1
  14. package/lib/commonjs/screens/home/index.js.flow +4 -1
  15. package/lib/commonjs/screens/home/index.js.map +1 -1
  16. package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js +1 -1
  17. package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.flow +9 -16
  18. package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
  19. package/lib/commonjs/screens/toan-trinh-so/TopupLoanInfo.js +1 -1
  20. package/lib/commonjs/screens/toan-trinh-so/TopupLoanInfo.js.flow +202 -536
  21. package/lib/commonjs/screens/toan-trinh-so/TopupLoanInfo.js.map +1 -1
  22. package/lib/commonjs/services/api/api-config.js +1 -1
  23. package/lib/commonjs/services/api/api-config.js.flow +2 -2
  24. package/lib/commonjs/services/api/api-config.js.map +1 -1
  25. package/lib/commonjs/services/api/api.js +1 -1
  26. package/lib/commonjs/services/api/api.js.flow +16 -0
  27. package/lib/commonjs/services/api/api.js.map +1 -1
  28. package/lib/module/assets/v3/index.js +1 -1
  29. package/lib/module/assets/v3/index.js.map +1 -1
  30. package/lib/module/assets/v3/option1-active.svg +45 -0
  31. package/lib/module/assets/v3/option2-disable.svg +18 -0
  32. package/lib/module/assets/v3/option2.svg +32 -12
  33. package/lib/module/components/ItemTimaOneV3.js +1 -1
  34. package/lib/module/components/ItemTimaOneV3.js.map +1 -1
  35. package/lib/module/components/ModalOptionLoan.js +1 -1
  36. package/lib/module/components/ModalOptionLoan.js.map +1 -1
  37. package/lib/module/screens/home/index.js +1 -1
  38. package/lib/module/screens/home/index.js.map +1 -1
  39. package/lib/module/screens/toan-trinh-so/TTSSelfie.js +1 -1
  40. package/lib/module/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
  41. package/lib/module/screens/toan-trinh-so/TopupLoanInfo.js +1 -1
  42. package/lib/module/screens/toan-trinh-so/TopupLoanInfo.js.map +1 -1
  43. package/lib/module/services/api/api-config.js +1 -1
  44. package/lib/module/services/api/api-config.js.map +1 -1
  45. package/lib/module/services/api/api.js +1 -1
  46. package/lib/module/services/api/api.js.map +1 -1
  47. package/lib/typescript/assets/v3/index.d.ts +3 -1
  48. package/lib/typescript/assets/v3/index.d.ts.map +1 -1
  49. package/lib/typescript/components/ItemTimaOneV3.d.ts.map +1 -1
  50. package/lib/typescript/components/ModalOptionLoan.d.ts.map +1 -1
  51. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  52. package/lib/typescript/screens/toan-trinh-so/TTSSelfie.d.ts.map +1 -1
  53. package/lib/typescript/screens/toan-trinh-so/TopupLoanInfo.d.ts.map +1 -1
  54. package/lib/typescript/services/api/api.d.ts +16 -0
  55. package/lib/typescript/services/api/api.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/src/assets/v3/index.tsx +4 -0
  58. package/src/assets/v3/option1-active.svg +45 -0
  59. package/src/assets/v3/option2-disable.svg +18 -0
  60. package/src/assets/v3/option2.svg +32 -12
  61. package/src/components/ItemTimaOneV3.tsx +18 -15
  62. package/src/components/ModalOptionLoan.tsx +133 -106
  63. package/src/screens/home/index.tsx +4 -1
  64. package/src/screens/toan-trinh-so/TTSSelfie.tsx +9 -16
  65. package/src/screens/toan-trinh-so/TopupLoanInfo.tsx +202 -536
  66. package/src/services/api/api-config.ts +2 -2
  67. package/src/services/api/api.ts +16 -0
@@ -29,113 +29,63 @@ import MButton from '../../components/MButton';
29
29
  import LinearGradient from 'react-native-linear-gradient';
30
30
  import moment from 'moment';
31
31
  import * as yup from 'yup';
32
+ import DatePicker from 'react-native-date-picker';
32
33
 
33
34
  export default function TopupLoanInfo(props) {
34
35
  const navigation = useNavigation();
35
36
  const formRef = useRef(null);
36
37
  const [isLoading, setIsLoading] = useState(false);
37
-
38
+ const [showDate, setShowDate] = useState(false);
38
39
  const getData = async () => {
39
40
  try {
40
41
  setIsLoading(true);
41
- const response = await Api.getInstance().getInfoLoanTopupTts(
42
+ const response = await Api.getInstance().getInfoCustomerV2(
42
43
  props.route?.params?.loan?.id
43
44
  );
44
45
  setIsLoading(false);
45
46
  if (response.kind === 'ok') {
46
47
  if (response.data?.meta.errorCode === 200) {
47
48
  formRef.current.setFieldValue(
48
- 'bankAccountName',
49
- response?.data?.data?.bankAccountName ?? ''
50
- );
51
- formRef.current.setFieldValue(
52
- 'bankAccountNumber',
53
- response?.data?.data?.bankAccountNumber ?? ''
54
- );
55
- formRef.current.setFieldValue(
56
- 'bankId',
57
- response?.data?.data?.bankId ?? null
58
- );
59
- formRef.current.setFieldValue(
60
- 'bankName',
61
- response?.data?.data?.bankName ?? ''
49
+ 'fullName',
50
+ response?.data?.data?.fullName
62
51
  );
63
52
  formRef.current.setFieldValue(
64
- 'loanAmount',
65
- response?.data?.data?.loanAmount ?? 0
53
+ 'dob',
54
+ response?.data?.data?.dob
55
+ ? formatDDMMYYY(response?.data?.data?.dob)
56
+ : ''
66
57
  );
67
58
  formRef.current.setFieldValue(
68
- 'firstPaymentDate',
69
- formatDDMMYYY(response?.data?.data?.firstPaymentDate) ?? ''
59
+ 'gender',
60
+ response?.data?.data?.gender ?? null
70
61
  );
71
62
  formRef.current.setFieldValue(
72
- 'rateTypeId',
73
- response?.data?.data?.rateTypeId ?? null
63
+ 'nationalCard',
64
+ response?.data?.data?.nationalCard
65
+ ? response?.data?.data?.nationalCard
66
+ : ''
74
67
  );
75
-
76
- if (response?.data?.data?.rateTypeId) {
77
- appStore.getLoanTimeByType(
78
- response?.data?.data?.rateTypeId,
79
- props.route?.params?.loan?.typeLoan ?? 0
80
- );
81
- }
82
68
  formRef.current.setFieldValue(
83
- 'loanTime',
84
- response?.data?.data?.loanTime ?? null
69
+ 'dateNationalId',
70
+ response?.data?.data?.dateNationalId
71
+ ? formatDDMMYYY(response?.data?.data?.dateNationalId)
72
+ : ''
85
73
  );
86
74
  formRef.current.setFieldValue(
87
- 'moneyInsuranceProperty',
88
- response?.data?.data?.moneyInsuranceProperty ?? null
75
+ 'bankAccountName',
76
+ response?.data?.data?.bankAccountName ?? ''
89
77
  );
90
78
  formRef.current.setFieldValue(
91
- 'moneyInsurenceCustomer',
92
- response?.data?.data?.moneyInsurenceCustomer ?? null
79
+ 'bankAccountNumber',
80
+ response?.data?.data?.bankAccountNumber ?? ''
93
81
  );
94
82
  formRef.current.setFieldValue(
95
- 'buyInsuranceProperty',
96
- response?.data?.data?.buyInsuranceProperty
97
- ? response?.data?.data?.buyInsuranceProperty
98
- : false
83
+ 'bankId',
84
+ response?.data?.data?.bankId ?? null
99
85
  );
100
86
  formRef.current.setFieldValue(
101
- 'buyInsurenceCustomer',
102
- response?.data?.data?.buyInsurenceCustomer
103
- ? response?.data?.data?.buyInsurenceCustomer
104
- : false
105
- );
106
-
107
- const timeInsurenceCustomer = appStore.listInsurenceTimeAll.find(
108
- (x) => x.id === response.data.data?.timeInsurenceCustomer
109
- );
110
- formRef.current?.setFieldValue(
111
- 'timeInsurenceCustomer',
112
- timeInsurenceCustomer
113
- );
114
- const timeInsuranceProperty = appStore.listInsurenceTimeAll.find(
115
- (x) => x.id === response.data.data?.timeInsuranceProperty
116
- );
117
- formRef.current?.setFieldValue(
118
- 'timeInsuranceProperty',
119
- timeInsuranceProperty
120
- );
121
-
122
- if (response.data?.data?.brand) {
123
- ttsStore.getListYearCar(response.data?.data?.brand);
124
- }
125
- if (response.data?.data?.brand && response.data?.data?.yearCar) {
126
- ttsStore.getListCar(
127
- response.data?.data?.brand,
128
- response.data?.data?.yearCar
129
- );
130
- }
131
-
132
- formRef.current?.setFieldValue(
133
- 'typeLoanBrief',
134
- response.data.data?.typeLoanBrief ?? null
135
- );
136
- formRef.current?.setFieldValue(
137
- 'carTypeId',
138
- response.data.data?.carTypeId ?? null
87
+ 'bankName',
88
+ response?.data?.data?.bankName ?? ''
139
89
  );
140
90
  } else {
141
91
  }
@@ -145,93 +95,26 @@ export default function TopupLoanInfo(props) {
145
95
  console.log(error);
146
96
  }
147
97
  };
148
- const getInfoInsurence = async (
149
- loanAmount,
150
- loanTime,
151
- rateTypeId,
152
- timeInsurenceCustomer,
153
- timeInsuranceProperty
154
- ) => {
155
- try {
156
- setIsLoading(true);
157
- const response = await Api.getInstance().getInfoInsurence2(
158
- props.route.params?.loan?.id,
159
- loanAmount,
160
- loanTime,
161
- rateTypeId,
162
- timeInsurenceCustomer,
163
- timeInsuranceProperty
164
- );
165
- setIsLoading(false);
166
- if (response.kind === 'ok') {
167
- if (response.data?.meta?.errorCode === 200) {
168
- formRef.current?.setFieldValue(
169
- 'moneyInsurenceCustomer',
170
- response.data.data?.moneyInsurenceCustomer
171
- );
172
- formRef.current?.setFieldValue(
173
- 'moneyInsuranceProperty',
174
- response.data.data?.moneyInsuranceProperty
175
- );
176
- formRef.current?.setFieldValue(
177
- 'moneyInsurranceHospitalization',
178
- response.data.data?.moneyInsurranceHospitalization
179
- );
180
- } else {
181
- Alert.alert('Thông báo', response.data?.meta?.errorMessage);
182
- }
183
- } else {
184
- }
185
- } catch (error) {
186
- setIsLoading(false);
187
- }
188
- };
189
-
190
- const debounceCall = useCallback(
191
- debounce((textParam) => {
192
- getInfoInsurence(
193
- Number(textParam.replace(/\D/g, '')),
194
- formRef.current.values.loanTime,
195
- formRef.current.values?.rateTypeId,
196
- formRef.current.values.timeInsurenceCustomer?.id ?? 0,
197
- formRef.current.values.timeInsuranceProperty?.id ?? 0
198
- );
199
- }, 2000),
200
- []
201
- );
202
98
 
203
- useEffect(async () => {
99
+ useEffect(() => {
204
100
  getData();
205
- ttsStore.getFirstPayment(props.route?.params?.loan?.id);
206
- await logEvent('thongtinvay_started', {
207
- event: 'thongtinvay_started',
208
- createdAt: new Date(),
209
- deviceId: appStore.deviceId,
210
- loanId: String(props.route?.params?.loan?.id),
211
- utmSource: props.route?.params?.loan?.utmSource,
212
- });
213
- logEventFb('thongtinvay_started');
101
+ ttsStore.getListBank();
214
102
  }, []);
215
103
 
216
104
  const onSubmit = async (values) => {
217
105
  try {
218
106
  setIsLoading(true);
219
107
  const body = {
220
- loanBriefId: props.route?.params?.loan?.id,
221
- loanAmount: Number(values.loanAmount),
222
- rateTypeId: values.rateTypeId,
223
- loanTime: values.loanTime,
224
- firstPaymentDate: moment(values.firstPaymentDate, 'DD/MM/YYYY').format(
108
+ LoanBriefId: props.route?.params?.loan?.id,
109
+ DateNationalId: moment(values.dateNationalId, 'DD/MM/YYYY').format(
225
110
  'YYYY-MM-DD'
226
111
  ),
227
- buyInsurenceCustomer: values?.buyInsurenceCustomer,
228
- buyInsuranceProperty: values?.buyInsuranceProperty,
229
- timeInsurenceCustomer: values?.timeInsurenceCustomer?.id ?? 0,
230
- timeInsuranceProperty: values?.timeInsuranceProperty?.id ?? 0,
231
- moneyInsurenceCustomer: values.moneyInsurenceCustomer,
232
- moneyInsuranceProperty: values.moneyInsuranceProperty,
112
+ bankId: values.bankId,
113
+ bankAccountName: values?.bankAccountName,
114
+ bankAccountNumber: values?.bankAccountNumber,
233
115
  };
234
- const response = await Api.getInstance().updateInfoLoanTopup(body);
116
+
117
+ const response = await Api.getInstance().updateInfoLoanTopupV2(body);
235
118
  setIsLoading(false);
236
119
  if (response.kind === 'ok') {
237
120
  if (response.data?.meta?.errorCode === 200) {
@@ -317,16 +200,11 @@ export default function TopupLoanInfo(props) {
317
200
  onSubmit={onSubmit}
318
201
  innerRef={formRef}
319
202
  initialValues={{
320
- loanAmount: '',
321
- rateTypeId: null,
322
- loanTime: null,
323
- firstPaymentDate: '',
324
- buyInsurenceCustomer: false,
325
- buyInsuranceProperty: false,
326
- timeInsurenceCustomer: null,
327
- timeInsuranceProperty: null,
328
- moneyInsurenceCustomer: null,
329
- moneyInsuranceProperty: null,
203
+ fullName: '',
204
+ dob: '',
205
+ gender: null,
206
+ nationalCard: '',
207
+ dateNationalId: '',
330
208
  bankId: null,
331
209
  bankName: '',
332
210
  bankAccountName: '',
@@ -335,108 +213,162 @@ export default function TopupLoanInfo(props) {
335
213
  validateOnBlur={false}
336
214
  validateOnChange={false}
337
215
  validationSchema={yup.object().shape({
338
- loanAmount: yup.string().required('Số tiền bắt buộc'),
339
- rateTypeId: yup
340
- .number()
341
- .required('Chọn hình thức thanh toán')
342
- .nullable(),
343
- loanTime: yup
344
- .number()
345
- .required('Thời gian vay là bắt buộc')
346
- .nullable(),
347
- firstPaymentDate: yup
216
+ bankName: yup.string().required('Vui lòng chọn ngân hàng'),
217
+ bankAccountName: yup.string().required('Vui lòng nhập chủ thẻ'),
218
+ bankAccountNumber: yup
348
219
  .string()
349
- .required('Ngày thanh toán đầu kỳ là bắt buộc'),
220
+ .required('Vui lòng nhập số tài khoản'),
350
221
  })}
351
222
  >
352
- {({ values, errors, setFieldValue, handleSubmit }) => (
223
+ {({
224
+ values,
225
+ errors,
226
+ setFieldValue,
227
+ handleSubmit,
228
+ handleChange,
229
+ }) => (
353
230
  <View style={{ flex: 1, paddingHorizontal: 16 }}>
354
231
  <ScrollView
355
232
  style={[commonStyles.fill]}
356
233
  showsVerticalScrollIndicator={false}
357
234
  >
358
- <MText style={$title2}>1.1 Thông tin đề nghị khoản vay</MText>
359
- <View style={$row}>
360
- <View style={{ flex: 1 }}>
361
- <MText style={$label}>Số tiền đề nghị vay</MText>
235
+ <MText style={$title2}>1.1 Thông tin nhân</MText>
236
+ <MText style={$label}>Họ và tên</MText>
237
+ <TextInput
238
+ editable={false}
239
+ style={[
240
+ $textInput,
241
+ {
242
+ color: '#333333',
243
+ fontSize: 16,
244
+ fontWeight: '500',
245
+ fontFamily: 'BeVietnamPro-Medium',
246
+ backgroundColor: '#EAEAEA',
247
+ },
248
+ ]}
249
+ value={values.fullName}
250
+ />
251
+ {errors && errors.fullName && (
252
+ <MText style={$error}>{errors.fullName}</MText>
253
+ )}
254
+ <View style={[$row, { marginTop: 16 }]}>
255
+ <View style={[commonStyles.fill]}>
256
+ <MText style={$label}>Sinh ngày</MText>
257
+ <TouchableOpacity
258
+ style={[$select, { backgroundColor: '#EAEAEA' }]}
259
+ disabled
260
+ >
261
+ <MText
262
+ style={{
263
+ color: '#333333',
264
+ fontSize: 16,
265
+ fontWeight: '500',
266
+ fontFamily: 'BeVietnamPro-Medium',
267
+ }}
268
+ >
269
+ {values.dob}
270
+ </MText>
271
+ </TouchableOpacity>
272
+ </View>
273
+ <View style={[commonStyles.fill]}>
274
+ <MText style={$label}>Giới tính</MText>
275
+ <TouchableOpacity
276
+ disabled
277
+ style={[$select, { backgroundColor: '#EAEAEA' }]}
278
+ >
279
+ <MText
280
+ style={{
281
+ color: '#333333',
282
+ fontSize: 16,
283
+ fontWeight: '500',
284
+ flex: 1,
285
+ }}
286
+ >
287
+ {values.gender === 0
288
+ ? 'Nam'
289
+ : values.gender === 1
290
+ ? 'Nữ'
291
+ : ''}
292
+ </MText>
293
+ <DropDown2 />
294
+ </TouchableOpacity>
295
+ </View>
296
+ </View>
297
+
298
+ <View style={[$row]}>
299
+ <View style={[commonStyles.fill]}>
300
+ <MText style={$label}>Số CCCD/CMND</MText>
362
301
  <TextInput
363
- numberOfLines={1}
302
+ editable={false}
303
+ keyboardType="number-pad"
364
304
  style={[
365
305
  $textInput,
366
306
  {
367
307
  color: '#333333',
368
308
  fontSize: 16,
369
309
  fontWeight: '500',
310
+ backgroundColor: '#EAEAEA',
370
311
  },
371
312
  ]}
372
- value={formatMoney(values.loanAmount)}
373
- onChangeText={(text) => {
374
- setFieldValue('loanAmount', text.replaceAll(',', ''));
375
- debounceCall(text);
376
- }}
313
+ value={values.nationalCard}
314
+ onChangeText={handleChange('nationalCard')}
377
315
  />
378
- {errors && errors.loanAmount && (
379
- <MText style={$error}>{errors.loanAmount}</MText>
380
- )}
381
316
  </View>
382
- <View style={{ flex: 1 }}>
383
- <MText style={$label}>Hình thức thanh toán</MText>
317
+ <View style={[commonStyles.fill]}>
318
+ <MText style={$label}>Ngày cấp</MText>
384
319
  <TouchableOpacity
385
320
  style={$select}
386
321
  onPress={() => {
387
- navigation.push(ScreenNames.MSelect, {
388
- title: 'Chọn hình thức thanh toán',
389
- data: appStore.listRateType,
390
- callback: (value) => {
391
- setFieldValue('rateTypeId', value?.id);
392
- appStore.getLoanTimeByType(
393
- value?.id,
394
- props.route?.params?.loan?.typeLoan ?? 0
395
- );
396
- setFieldValue('loanTime', null);
397
- },
398
- });
322
+ setShowDate(true);
399
323
  }}
400
324
  >
401
325
  <MText
402
326
  numberOfLines={1}
403
327
  style={{
404
- color: '#333333',
328
+ color:
329
+ values.dateNationalId !== ''
330
+ ? '#333333'
331
+ : '#BDBDBD',
405
332
  fontSize: 16,
406
333
  fontWeight: '500',
407
334
  flex: 1,
408
- fontFamily: 'BeVietnamPro-Medium',
409
335
  }}
410
336
  >
411
- {
412
- appStore.listRateType?.find(
413
- (x) => x?.id === values.rateTypeId
414
- )?.name
415
- }
337
+ {values.dateNationalId !== ''
338
+ ? values.dateNationalId
339
+ : 'DD/MM/YYYY'}
416
340
  </MText>
417
- <DropDown2 />
418
341
  </TouchableOpacity>
419
- {errors && errors.rateTypeId && (
420
- <MText style={$error}>{errors.rateTypeId}</MText>
421
- )}
422
342
  </View>
343
+
344
+ <DatePicker
345
+ mode="date"
346
+ open={showDate}
347
+ modal
348
+ title="Chọn thời gian"
349
+ locale="vi"
350
+ date={new Date()}
351
+ onCancel={() => {
352
+ setShowDate(false);
353
+ }}
354
+ onConfirm={(date) => {
355
+ setShowDate(false);
356
+
357
+ setFieldValue('dateNationalId', formatDDMMYYY(date));
358
+ }}
359
+ />
423
360
  </View>
424
- <MText style={$label}>Thời gian vay</MText>
361
+ <MText style={[$title2]}>1.2 Thông tin giải ngân</MText>
362
+ <MText style={$label}>Ngân hàng</MText>
425
363
  <TouchableOpacity
426
364
  style={$select}
427
365
  onPress={() => {
428
- navigation.push(ScreenNames.MSelect, {
429
- title: 'Chọn thời gian vay',
430
- data: appStore.listLoanTimeByType,
366
+ navigation.push(ScreenNames.CommonSelect, {
367
+ title: 'Chọn ngân hàng',
368
+ data: ttsStore.listBank,
431
369
  callback: (value) => {
432
- setFieldValue('loanTime', value?.id);
433
- getInfoInsurence(
434
- values.loanAmount,
435
- value?.id,
436
- values?.rateTypeId,
437
- values.timeInsurenceCustomer?.id ?? 0,
438
- values.timeInsuranceProperty?.id ?? 0
439
- );
370
+ setFieldValue('bankName', value.name);
371
+ setFieldValue('bankId', value.id);
440
372
  },
441
373
  });
442
374
  }}
@@ -451,328 +383,62 @@ export default function TopupLoanInfo(props) {
451
383
  fontFamily: 'BeVietnamPro-Medium',
452
384
  }}
453
385
  >
454
- {values?.loanTime ? `${values?.loanTime} tháng` : ''}
386
+ {values.bankName}
455
387
  </MText>
456
388
  <DropDown2 />
457
389
  </TouchableOpacity>
458
- {errors && errors.loanTime && (
459
- <MText style={$error}>{errors.loanTime}</MText>
390
+ {errors && errors.bankName && (
391
+ <MText style={$error}>{errors.bankName}</MText>
460
392
  )}
461
393
  <MText style={[$label, { marginTop: 16 }]}>
462
- Ngày thanh toán kỳ đầu
394
+ Tên số tài khoản
463
395
  </MText>
464
- <TouchableOpacity
465
- style={$select}
466
- onPress={() => {
467
- navigation.push(ScreenNames.MSelect, {
468
- title: 'Ngày thanh toán kỳ đầu',
469
- data: ttsStore.listFirstPayment,
470
- callback: (value) => {
471
- setFieldValue('firstPaymentDate', value?.name);
472
- },
473
- });
474
- }}
475
- >
476
- <MText
477
- numberOfLines={1}
478
- style={{
396
+ <TextInput
397
+ numberOfLines={1}
398
+ style={[
399
+ $textInput,
400
+ {
479
401
  color: '#333333',
480
402
  fontSize: 16,
481
403
  fontWeight: '500',
482
- flex: 1,
483
- fontFamily: 'BeVietnamPro-Medium',
484
- }}
485
- >
486
- {values?.firstPaymentDate}
487
- </MText>
488
- <DropDown2 />
489
- </TouchableOpacity>
490
- {errors && errors.firstPaymentDate && (
491
- <MText style={$error}>{errors.firstPaymentDate}</MText>
404
+ },
405
+ ]}
406
+ value={values.bankAccountName}
407
+ onChangeText={handleChange('bankAccountName')}
408
+ />
409
+ {errors && errors.bankAccountName && (
410
+ <MText style={$error}>{errors.bankAccountName}</MText>
492
411
  )}
493
-
494
- <View
495
- style={{
496
- backgroundColor: '#FFF8F2',
497
- borderLeftWidth: 1,
498
- borderRadius: 8,
499
- padding: 16,
500
- borderColor: color.primary,
501
- marginTop: 10,
502
- }}
503
- >
504
- <MText
505
- style={{
506
- color: color.primary,
507
- fontWeight: 'bold',
508
- }}
509
- >
510
- Bảo hiểm
511
- </MText>
512
- <View
513
- style={{
514
- flexDirection: 'row',
515
- alignItems: 'center',
516
- gap: 10,
517
- marginTop: 10,
518
- }}
519
- >
520
- <TouchableOpacity
521
- onPress={() => {
522
- setFieldValue(
523
- 'buyInsurenceCustomer',
524
- !values.buyInsurenceCustomer
525
- );
526
- }}
527
- >
528
- {values.buyInsurenceCustomer === true ? (
529
- <CheckBoxActive />
530
- ) : (
531
- <CheckBox />
532
- )}
533
- </TouchableOpacity>
534
- <View style={{ flex: 1 }}>
535
- <MText
536
- style={{
537
- color: '#333333',
538
- fontSize: 12,
539
- fontWeight: 'bold',
540
- }}
541
- >
542
- BH sức khoẻ người vay
543
- </MText>
544
- <MText
545
- style={{
546
- color: '#828282',
547
- fontSize: 12,
548
- marginTop: 5,
549
- }}
550
- >
551
- Số tiền{' '}
552
- <MText
553
- style={{
554
- fontSize: 12,
555
- color: '#333333',
556
- }}
557
- >
558
- {formatMoney(values.moneyInsurenceCustomer)} đ
559
- </MText>
560
- </MText>
561
- </View>
562
- <TouchableOpacity
563
- onPress={() => {
564
- navigation.push(ScreenNames.MSelect, {
565
- title: 'Chọn thời gian',
566
- data: appStore.listInsurenceTimeAll,
567
- callback: (value) => {
568
- setFieldValue('timeInsurenceCustomer', value);
569
- getInfoInsurence(
570
- values.loanAmount,
571
- values.loanTime,
572
- values?.rateTypeId,
573
- value?.id,
574
- values.timeInsuranceProperty?.id ?? 0
575
- );
576
- },
577
- });
578
- }}
579
- style={{
580
- backgroundColor: '#FFFFFF',
581
- height: 40,
582
- borderRadius: 6,
583
- alignItems: 'center',
584
- justifyContent: 'space-between',
585
- flexDirection: 'row',
586
- paddingHorizontal: 10,
587
- borderWidth: 1,
588
- borderColor: '#F5F5F5',
589
- width: Dimensions.get('window').width / 3,
590
- }}
591
- >
592
- <MText style={{ fontSize: 12, color: '#333333' }}>
593
- {values.timeInsurenceCustomer?.name ??
594
- 'Chọn thời gian'}
595
- </MText>
596
- <DropDown2 />
597
- </TouchableOpacity>
598
- </View>
599
- <View
600
- style={{
601
- height: 1,
602
- backgroundColor: '#EFEFEF',
603
- marginVertical: 8,
604
- }}
605
- />
606
- <View
607
- style={{
608
- flexDirection: 'row',
609
- alignItems: 'center',
610
- gap: 10,
611
- marginTop: 10,
612
- }}
613
- >
614
- <TouchableOpacity
615
- onPress={() => {
616
- setFieldValue(
617
- 'buyInsuranceProperty',
618
- !values.buyInsuranceProperty
619
- );
620
- }}
621
- >
622
- {values.buyInsuranceProperty === true ? (
623
- <CheckBoxActive />
624
- ) : (
625
- <CheckBox />
626
- )}
627
- </TouchableOpacity>
628
- <View style={{ flex: 1 }}>
629
- <MText
630
- style={{
631
- color: '#333333',
632
- fontSize: 12,
633
- fontWeight: 'bold',
634
- }}
635
- >
636
- BH vật chất
637
- </MText>
638
- <MText
639
- style={{
640
- color: '#828282',
641
- fontSize: 12,
642
- marginTop: 5,
643
- }}
644
- >
645
- Số tiền{' '}
646
- <MText
647
- style={{
648
- fontSize: 12,
649
- color: '#333333',
650
- }}
651
- >
652
- {formatMoney(values.moneyInsuranceProperty)} đ
653
- </MText>
654
- </MText>
655
- </View>
656
- <TouchableOpacity
657
- onPress={() => {
658
- navigation.push(ScreenNames.MSelect, {
659
- title: 'Chọn thời gian',
660
- data: appStore.listInsurenceTimeAll,
661
- callback: (value) => {
662
- setFieldValue('timeInsuranceProperty', value);
663
- getInfoInsurence(
664
- values.loanAmount,
665
- values.loanTime,
666
- values?.rateTypeId,
667
- values?.timeInsurenceCustomer?.id ?? 0,
668
- value?.id
669
- );
670
- },
671
- });
672
- }}
673
- style={{
674
- backgroundColor: '#FFFFFF',
675
- height: 40,
676
- borderRadius: 6,
677
- alignItems: 'center',
678
- justifyContent: 'space-between',
679
- flexDirection: 'row',
680
- paddingHorizontal: 10,
681
- borderWidth: 1,
682
- borderColor: '#F5F5F5',
683
- width: Dimensions.get('window').width / 3,
684
- }}
685
- >
686
- <MText style={{ fontSize: 12, color: '#333333' }}>
687
- {values.timeInsuranceProperty?.name ??
688
- 'Chọn thời gian'}
689
- </MText>
690
- <DropDown2 />
691
- </TouchableOpacity>
692
- </View>
693
- <View
694
- style={{
695
- height: 1,
696
- backgroundColor: '#BDBDBD',
697
- marginVertical: 8,
698
- }}
699
- />
700
- <View style={{ flexDirection: 'row', gap: 5 }}>
701
- <Tick2 />
702
- <MText
703
- style={{
704
- fontSize: 10,
705
- color: '#828282',
706
- }}
707
- >
708
- Quyền lợi bảo hiểm sức khoẻ lên tới 100% từ Bảo Minh
709
- {'\n'}
710
- (Tai nạn, thương tật,...)
711
- </MText>
712
- </View>
713
- <View
714
- style={{ marginTop: 8, flexDirection: 'row', gap: 5 }}
715
- >
716
- <Tick2 />
717
- <MText
718
- style={{
719
- fontSize: 10,
720
- color: '#828282',
721
- }}
722
- >
723
- Quyền lợi bảo hiểm vật chất 100% từ Bảo Minh
724
- </MText>
725
- </View>
726
- </View>
727
-
728
- <MText style={[$title2, { marginTop: 10 }]}>
729
- 1.2 Thông tin giải ngân
730
- </MText>
731
- <MText style={[$label, { color: 'rgba(125, 125, 125, 1)' }]}>
732
- Ngân hàng
733
- </MText>
734
- <MText
735
- style={{
736
- color: 'rgba(51, 51, 51, 1)',
737
- fontSize: 16,
738
- fontWeight: '500',
739
- flex: 1,
740
- fontFamily: 'BeVietnamPro-Medium',
741
- marginBottom: 16,
742
- }}
743
- >
744
- {values?.bankName}
745
- </MText>
746
- <MText style={[$label, { color: 'rgba(125, 125, 125, 1)' }]}>
747
- Tên chủ thẻ
748
- </MText>
749
- <MText
750
- style={{
751
- color: 'rgba(51, 51, 51, 1)',
752
- fontSize: 16,
753
- fontWeight: '500',
754
- flex: 1,
755
- fontFamily: 'BeVietnamPro-Medium',
756
- marginBottom: 16,
757
- }}
758
- >
759
- {values?.bankAccountName}
760
- </MText>
761
- <MText style={[$label, { color: 'rgba(125, 125, 125, 1)' }]}>
412
+ <MText style={[$label, { marginTop: 16 }]}>
762
413
  Số tài khoản
763
414
  </MText>
764
- <MText
765
- style={{
766
- color: 'rgba(51, 51, 51, 1)',
767
- fontSize: 16,
768
- fontWeight: '500',
769
- flex: 1,
770
- fontFamily: 'BeVietnamPro-Medium',
771
- marginBottom: 16,
772
- }}
773
- >
774
- {values?.bankAccountNumber}
775
- </MText>
415
+ <TextInput
416
+ keyboardType="number-pad"
417
+ numberOfLines={1}
418
+ style={[
419
+ $textInput,
420
+ {
421
+ color: '#333333',
422
+ fontSize: 16,
423
+ fontWeight: '500',
424
+ },
425
+ ]}
426
+ value={values.bankAccountNumber}
427
+ onChangeText={handleChange('bankAccountNumber')}
428
+ />
429
+ {errors && errors.bankAccountNumber && (
430
+ <MText style={$error}>{errors.bankAccountNumber}</MText>
431
+ )}
432
+ <View style={{ height: 50 }} />
433
+ </ScrollView>
434
+ <View
435
+ style={{
436
+ position: 'absolute',
437
+ bottom: 24,
438
+ left: 16,
439
+ right: 16,
440
+ }}
441
+ >
776
442
  <MButton
777
443
  onPress={() => {
778
444
  handleSubmit();
@@ -802,7 +468,7 @@ export default function TopupLoanInfo(props) {
802
468
  </MText>
803
469
  </LinearGradient>
804
470
  </MButton>
805
- </ScrollView>
471
+ </View>
806
472
  </View>
807
473
  )}
808
474
  </Formik>