react-native-timacare 1.0.1 → 1.0.3
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/back2.svg +13 -0
- package/lib/commonjs/assets/icons/check1.svg +4 -0
- package/lib/commonjs/assets/icons/check2.svg +9 -0
- package/lib/commonjs/assets/icons/error.svg +6 -0
- package/lib/commonjs/assets/icons/index.js +1 -1
- package/lib/commonjs/assets/icons/index.js.flow +16 -0
- package/lib/commonjs/assets/icons/index.js.map +1 -1
- package/lib/commonjs/assets/icons/line2.svg +12 -0
- package/lib/commonjs/assets/icons/next.svg +6 -0
- package/lib/commonjs/assets/icons/step.svg +9 -0
- package/lib/commonjs/assets/icons/update.svg +5 -0
- package/lib/commonjs/components/CommonSelect.js +2 -0
- package/lib/commonjs/components/CommonSelect.js.flow +12 -0
- package/lib/commonjs/components/CommonSelect.js.map +1 -0
- package/lib/commonjs/components/MText.js +1 -1
- package/lib/commonjs/components/MText.js.flow +2 -2
- package/lib/commonjs/components/MText.js.map +1 -1
- package/lib/commonjs/navigation/primary-navigator.js +1 -1
- package/lib/commonjs/navigation/primary-navigator.js.flow +6 -0
- package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
- package/lib/commonjs/screens/digital-lending/Step1.js +2 -0
- package/lib/commonjs/screens/digital-lending/Step1.js.flow +670 -0
- package/lib/commonjs/screens/digital-lending/Step1.js.map +1 -0
- package/lib/commonjs/screens/digital-lending/Step2.js +2 -0
- package/lib/commonjs/screens/digital-lending/Step2.js.flow +613 -0
- package/lib/commonjs/screens/digital-lending/Step2.js.map +1 -0
- package/lib/commonjs/screens/digital-lending/Step3.js +2 -0
- package/lib/commonjs/screens/digital-lending/Step3.js.flow +606 -0
- package/lib/commonjs/screens/digital-lending/Step3.js.map +1 -0
- package/lib/commonjs/screens/digital-lending/Step4.js +2 -0
- package/lib/commonjs/screens/digital-lending/Step4.js.flow +496 -0
- package/lib/commonjs/screens/digital-lending/Step4.js.map +1 -0
- package/lib/commonjs/screens/digital-lending/Step5.js +2 -0
- package/lib/commonjs/screens/digital-lending/Step5.js.flow +350 -0
- package/lib/commonjs/screens/digital-lending/Step5.js.map +1 -0
- package/lib/commonjs/screens/digital-lending/Step6.js +2 -0
- package/lib/commonjs/screens/digital-lending/Step6.js.flow +369 -0
- package/lib/commonjs/screens/digital-lending/Step6.js.map +1 -0
- package/lib/commonjs/screens/digital-lending/index.js +2 -0
- package/lib/commonjs/screens/digital-lending/index.js.flow +110 -0
- package/lib/commonjs/screens/digital-lending/index.js.map +1 -0
- package/lib/commonjs/screens/digital-lending/store.js +2 -0
- package/lib/commonjs/screens/digital-lending/store.js.flow +294 -0
- package/lib/commonjs/screens/digital-lending/store.js.map +1 -0
- package/lib/commonjs/screens/home/index.js +1 -1
- package/lib/commonjs/screens/home/index.js.flow +475 -0
- package/lib/commonjs/screens/home/index.js.map +1 -1
- package/lib/commonjs/screens/register/index.js +1 -1
- package/lib/commonjs/screens/register/index.js.flow +1 -1
- package/lib/commonjs/services/api/api-config.js +1 -1
- package/lib/commonjs/services/api/api-config.js.flow +2 -2
- package/lib/commonjs/services/api/api-config.js.map +1 -1
- package/lib/commonjs/services/api/api.js +1 -1
- package/lib/commonjs/services/api/api.js.flow +95 -0
- package/lib/commonjs/services/api/api.js.map +1 -1
- package/lib/module/assets/icons/back2.svg +13 -0
- package/lib/module/assets/icons/check1.svg +4 -0
- package/lib/module/assets/icons/check2.svg +9 -0
- package/lib/module/assets/icons/error.svg +6 -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/line2.svg +12 -0
- package/lib/module/assets/icons/next.svg +6 -0
- package/lib/module/assets/icons/step.svg +9 -0
- package/lib/module/assets/icons/update.svg +5 -0
- package/lib/module/components/CommonSelect.js +2 -0
- package/lib/module/components/CommonSelect.js.map +1 -0
- package/lib/module/components/MText.js +1 -1
- package/lib/module/components/MText.js.map +1 -1
- package/lib/module/navigation/primary-navigator.js +1 -1
- package/lib/module/navigation/primary-navigator.js.map +1 -1
- package/lib/module/screens/digital-lending/Step1.js +2 -0
- package/lib/module/screens/digital-lending/Step1.js.map +1 -0
- package/lib/module/screens/digital-lending/Step2.js +2 -0
- package/lib/module/screens/digital-lending/Step2.js.map +1 -0
- package/lib/module/screens/digital-lending/Step3.js +2 -0
- package/lib/module/screens/digital-lending/Step3.js.map +1 -0
- package/lib/module/screens/digital-lending/Step4.js +2 -0
- package/lib/module/screens/digital-lending/Step4.js.map +1 -0
- package/lib/module/screens/digital-lending/Step5.js +2 -0
- package/lib/module/screens/digital-lending/Step5.js.map +1 -0
- package/lib/module/screens/digital-lending/Step6.js +2 -0
- package/lib/module/screens/digital-lending/Step6.js.map +1 -0
- package/lib/module/screens/digital-lending/index.js +2 -0
- package/lib/module/screens/digital-lending/index.js.map +1 -0
- package/lib/module/screens/digital-lending/store.js +2 -0
- package/lib/module/screens/digital-lending/store.js.map +1 -0
- package/lib/module/screens/home/index.js +1 -1
- package/lib/module/screens/home/index.js.map +1 -1
- package/lib/module/screens/register/index.js +1 -1
- package/lib/module/services/api/api-config.js +1 -1
- package/lib/module/services/api/api-config.js.map +1 -1
- package/lib/module/services/api/api.js +1 -1
- package/lib/module/services/api/api.js.map +1 -1
- package/lib/typescript/assets/icons/index.d.ts +9 -1
- package/lib/typescript/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/components/CommonSelect.d.ts +8 -0
- package/lib/typescript/components/CommonSelect.d.ts.map +1 -0
- package/lib/typescript/navigation/primary-navigator.d.ts +1 -0
- package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
- package/lib/typescript/screens/digital-lending/Step1.d.ts +2 -0
- package/lib/typescript/screens/digital-lending/Step1.d.ts.map +1 -0
- package/lib/typescript/screens/digital-lending/Step2.d.ts +2 -0
- package/lib/typescript/screens/digital-lending/Step2.d.ts.map +1 -0
- package/lib/typescript/screens/digital-lending/Step3.d.ts +2 -0
- package/lib/typescript/screens/digital-lending/Step3.d.ts.map +1 -0
- package/lib/typescript/screens/digital-lending/Step4.d.ts +2 -0
- package/lib/typescript/screens/digital-lending/Step4.d.ts.map +1 -0
- package/lib/typescript/screens/digital-lending/Step5.d.ts +2 -0
- package/lib/typescript/screens/digital-lending/Step5.d.ts.map +1 -0
- package/lib/typescript/screens/digital-lending/Step6.d.ts +2 -0
- package/lib/typescript/screens/digital-lending/Step6.d.ts.map +1 -0
- package/lib/typescript/screens/digital-lending/index.d.ts +2 -0
- package/lib/typescript/screens/digital-lending/index.d.ts.map +1 -0
- package/lib/typescript/screens/digital-lending/store.d.ts +35 -0
- package/lib/typescript/screens/digital-lending/store.d.ts.map +1 -0
- package/lib/typescript/screens/home/index.d.ts.map +1 -1
- package/lib/typescript/services/api/api.d.ts +80 -19
- package/lib/typescript/services/api/api.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/back2.svg +13 -0
- package/src/assets/icons/check1.svg +4 -0
- package/src/assets/icons/check2.svg +9 -0
- package/src/assets/icons/error.svg +6 -0
- package/src/assets/icons/index.tsx +16 -0
- package/src/assets/icons/line2.svg +12 -0
- package/src/assets/icons/next.svg +6 -0
- package/src/assets/icons/step.svg +9 -0
- package/src/assets/icons/update.svg +5 -0
- package/src/components/CommonSelect.tsx +12 -0
- package/src/components/MText.tsx +2 -2
- package/src/navigation/primary-navigator.tsx +6 -0
- package/src/screens/digital-lending/Step1.tsx +670 -0
- package/src/screens/digital-lending/Step2.tsx +613 -0
- package/src/screens/digital-lending/Step3.tsx +606 -0
- package/src/screens/digital-lending/Step4.tsx +496 -0
- package/src/screens/digital-lending/Step5.tsx +350 -0
- package/src/screens/digital-lending/Step6.tsx +369 -0
- package/src/screens/digital-lending/index.tsx +110 -0
- package/src/screens/digital-lending/store.tsx +294 -0
- package/src/screens/home/index.tsx +475 -0
- package/src/screens/register/index.tsx +1 -1
- package/src/services/api/api-config.ts +2 -2
- package/src/services/api/api.ts +95 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import { observable, action, toJS, makeAutoObservable } from 'mobx';
|
|
3
|
+
import { Alert } from 'react-native';
|
|
4
|
+
import { Api } from '../../services/api';
|
|
5
|
+
|
|
6
|
+
class Store {
|
|
7
|
+
@observable isLoading = false;
|
|
8
|
+
@observable step = 1;
|
|
9
|
+
@observable data = undefined;
|
|
10
|
+
@observable listProvinces = [];
|
|
11
|
+
@observable listDistricts = [];
|
|
12
|
+
@observable listWards = [];
|
|
13
|
+
@observable householdListDistricts = [];
|
|
14
|
+
@observable householdListWards = [];
|
|
15
|
+
@observable companyListDistricts = [];
|
|
16
|
+
@observable companyListWards = [];
|
|
17
|
+
@observable listJob = [];
|
|
18
|
+
@observable listJobDescription = [];
|
|
19
|
+
@observable listBrand = [];
|
|
20
|
+
@observable listBrandName = [];
|
|
21
|
+
@observable listBank = [];
|
|
22
|
+
@observable loadingDocument = false;
|
|
23
|
+
|
|
24
|
+
@observable body = {};
|
|
25
|
+
|
|
26
|
+
//314
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
makeAutoObservable(this);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@action
|
|
33
|
+
clear() {
|
|
34
|
+
this.body = {};
|
|
35
|
+
this.data = null;
|
|
36
|
+
this.step = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@action
|
|
40
|
+
async uploadLoanReborrow(body, onSuccess?) {
|
|
41
|
+
this.isLoading = true;
|
|
42
|
+
try {
|
|
43
|
+
const response = await Api.getInstance().updateLoanReborrow(body);
|
|
44
|
+
console.log(response);
|
|
45
|
+
this.isLoading = false;
|
|
46
|
+
if (response.kind === 'ok') {
|
|
47
|
+
if (response.data.meta.errorCode === 200) {
|
|
48
|
+
if (onSuccess) onSuccess();
|
|
49
|
+
} else {
|
|
50
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau.');
|
|
54
|
+
}
|
|
55
|
+
} catch (error) {
|
|
56
|
+
this.isLoading = false;
|
|
57
|
+
Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau.');
|
|
58
|
+
console.log(error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@action
|
|
63
|
+
async uploadCavet(body, onSuccess?) {
|
|
64
|
+
this.loadingDocument = true;
|
|
65
|
+
try {
|
|
66
|
+
const response = await Api.getInstance().uploadDocument(body);
|
|
67
|
+
this.loadingDocument = false;
|
|
68
|
+
if (response.kind === 'ok') {
|
|
69
|
+
if (response.data.meta.errorCode === 200) {
|
|
70
|
+
if (onSuccess) onSuccess();
|
|
71
|
+
} else {
|
|
72
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau.');
|
|
76
|
+
}
|
|
77
|
+
} catch (error) {
|
|
78
|
+
this.loadingDocument = false;
|
|
79
|
+
Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau.');
|
|
80
|
+
console.log(error);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@action
|
|
85
|
+
async getBank() {
|
|
86
|
+
try {
|
|
87
|
+
const response = await Api.getInstance().getBanks();
|
|
88
|
+
console.log(response);
|
|
89
|
+
if (response.kind === 'ok') {
|
|
90
|
+
if (response.data.meta.errorCode === 200) {
|
|
91
|
+
this.listBank = response.data.data.map((item: any) => {
|
|
92
|
+
return { id: item.bankId, name: item.name };
|
|
93
|
+
});
|
|
94
|
+
} else {
|
|
95
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
// Alert.alert('Thông báo', 'Không lấy được danh sách hãng xe.');
|
|
99
|
+
}
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.log(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@action
|
|
106
|
+
async getBrandName(id) {
|
|
107
|
+
try {
|
|
108
|
+
const response = await Api.getInstance().getNameBrand(id);
|
|
109
|
+
console.log(response);
|
|
110
|
+
if (response.kind === 'ok') {
|
|
111
|
+
if (response.data.meta.errorCode === 200) {
|
|
112
|
+
this.listBrandName = response.data.data.map((item: any) => {
|
|
113
|
+
return { id: item.id, name: item.fullName };
|
|
114
|
+
});
|
|
115
|
+
} else {
|
|
116
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
// Alert.alert('Thông báo', 'Không lấy được danh sách hãng xe.');
|
|
120
|
+
}
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.log(error);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@action
|
|
127
|
+
async getBrandProduct() {
|
|
128
|
+
try {
|
|
129
|
+
const response = await Api.getInstance().getBrandProduct();
|
|
130
|
+
console.log(response);
|
|
131
|
+
if (response.kind === 'ok') {
|
|
132
|
+
if (response.data.meta.errorCode === 200) {
|
|
133
|
+
this.listBrand = response.data.data;
|
|
134
|
+
} else {
|
|
135
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
// Alert.alert('Thông báo', 'Không lấy được danh sách hãng xe.');
|
|
139
|
+
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
console.log(error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@action
|
|
146
|
+
async getJob() {
|
|
147
|
+
try {
|
|
148
|
+
const response = await Api.getInstance().getJobTima();
|
|
149
|
+
console.log(response);
|
|
150
|
+
if (response.kind === 'ok') {
|
|
151
|
+
if (response.data.meta.errorCode === 200) {
|
|
152
|
+
this.listJob = response.data.data;
|
|
153
|
+
} else {
|
|
154
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
// Alert.alert('Thông báo', 'Không lấy được danh sách nghề nghi.');
|
|
158
|
+
}
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.log(error);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@action
|
|
165
|
+
async getJobDescription(id) {
|
|
166
|
+
try {
|
|
167
|
+
const response = await Api.getInstance().getJobDescriptionTima(id);
|
|
168
|
+
console.log(response);
|
|
169
|
+
if (response.kind === 'ok') {
|
|
170
|
+
if (response.data.meta.errorCode === 200) {
|
|
171
|
+
this.listJobDescription = response.data.data.map((item: any) => {
|
|
172
|
+
return { id: item.jobId, name: item.name };
|
|
173
|
+
});
|
|
174
|
+
} else {
|
|
175
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
// Alert.alert('Thông báo', 'Không lấy được danh sách quận huyện.');
|
|
179
|
+
}
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.log(error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@action
|
|
186
|
+
async getDistricts(id, onSuccess?) {
|
|
187
|
+
try {
|
|
188
|
+
const response = await Api.getInstance().getDistricts(id);
|
|
189
|
+
console.log(response);
|
|
190
|
+
if (response.kind === 'ok') {
|
|
191
|
+
if (response.data.meta.errorCode === 200) {
|
|
192
|
+
if (onSuccess) {
|
|
193
|
+
onSuccess(
|
|
194
|
+
response.data.data.map((item: any) => {
|
|
195
|
+
return { id: item.districtId, name: item.name };
|
|
196
|
+
})
|
|
197
|
+
);
|
|
198
|
+
} else {
|
|
199
|
+
this.listDistricts = response.data.data.map((item: any) => {
|
|
200
|
+
return { id: item.districtId, name: item.name };
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
} else {
|
|
204
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
Alert.alert('Thông báo', 'Không lấy được danh sách quận huyện.');
|
|
208
|
+
}
|
|
209
|
+
} catch (error) {
|
|
210
|
+
console.log(error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@action
|
|
215
|
+
async getWards(id, onSuccess?) {
|
|
216
|
+
try {
|
|
217
|
+
const response = await Api.getInstance().getWards(id);
|
|
218
|
+
console.log(response);
|
|
219
|
+
if (response.kind === 'ok') {
|
|
220
|
+
if (response.data.meta.errorCode === 200) {
|
|
221
|
+
if (onSuccess) {
|
|
222
|
+
onSuccess(
|
|
223
|
+
response.data.data.map((item: any) => {
|
|
224
|
+
return { id: item.wardId, name: item.name };
|
|
225
|
+
})
|
|
226
|
+
);
|
|
227
|
+
} else {
|
|
228
|
+
this.listWards = response.data.data.map((item: any) => {
|
|
229
|
+
return { id: item.wardId, name: item.name };
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
Alert.alert('Thông báo', 'Không lấy được danh sách quận huyện.');
|
|
237
|
+
}
|
|
238
|
+
} catch (error) {
|
|
239
|
+
console.log(error);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
async getDetailLoan(id, onSuccess?) {
|
|
244
|
+
this.isLoading = true;
|
|
245
|
+
try {
|
|
246
|
+
const response = await Api.getInstance().detailLoanReborrow(id);
|
|
247
|
+
console.log(response, 'Detail');
|
|
248
|
+
this.isLoading = false;
|
|
249
|
+
if (response.kind === 'ok') {
|
|
250
|
+
if (response.data?.meta?.errorCode === 200) {
|
|
251
|
+
if (onSuccess) onSuccess();
|
|
252
|
+
this.data = response.data?.data;
|
|
253
|
+
if (response.data?.data?.provinceId) {
|
|
254
|
+
digitalLendingStore.getDistricts(response.data?.data?.provinceId);
|
|
255
|
+
}
|
|
256
|
+
if (response.data?.data?.wardId) {
|
|
257
|
+
digitalLendingStore.getWards(response.data?.data?.districtId);
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
Alert.alert(response.data?.meta?.errorMessage);
|
|
261
|
+
}
|
|
262
|
+
} else {
|
|
263
|
+
Alert.alert('Có lỗi xảy ra. Vui lòng thử lại sau!');
|
|
264
|
+
}
|
|
265
|
+
} catch (error) {
|
|
266
|
+
console.log(error);
|
|
267
|
+
this.isLoading = false;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@action
|
|
272
|
+
async getProvinces() {
|
|
273
|
+
try {
|
|
274
|
+
const response = await Api.getInstance().getProvinces({});
|
|
275
|
+
console.log(response);
|
|
276
|
+
if (response.kind === 'ok') {
|
|
277
|
+
if (response.data.meta.errorCode === 200) {
|
|
278
|
+
this.listProvinces = response.data.data.map((item: any) => {
|
|
279
|
+
return { id: item.provinceId, name: item.name };
|
|
280
|
+
});
|
|
281
|
+
} else {
|
|
282
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
283
|
+
}
|
|
284
|
+
} else {
|
|
285
|
+
Alert.alert('Thông báo', 'Không lấy được danh sách thành phố.');
|
|
286
|
+
}
|
|
287
|
+
} catch (error) {
|
|
288
|
+
console.log(error);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const digitalLendingStore = new Store();
|
|
294
|
+
export default digitalLendingStore;
|