@tima2025/react-native-timalender 1.1.7 → 1.1.8
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/components/Features/Debt/debtSlice.js.flow +2 -2
- package/lib/commonjs/components/Features/Debt/debtSlice.js.map +1 -1
- package/lib/commonjs/controllers/Debt.js +1 -1
- package/lib/commonjs/controllers/Debt.js.flow +12 -4
- package/lib/commonjs/controllers/Debt.js.map +1 -1
- package/lib/commonjs/screens/BuyDebt/Components/ListSuccess/ListSuccess.js +1 -1
- package/lib/commonjs/screens/BuyDebt/Components/ListSuccess/ListSuccess.js.flow +1 -0
- package/lib/commonjs/screens/BuyDebt/Components/ListSuccess/ListSuccess.js.map +1 -1
- package/lib/commonjs/screens/ContractDetail/index.js +1 -1
- package/lib/commonjs/screens/ContractDetail/index.js.flow +1 -0
- package/lib/commonjs/screens/ContractDetail/index.js.map +1 -1
- package/lib/commonjs/screens/DetailBuyDue/index.js +1 -1
- package/lib/commonjs/screens/DetailBuyDue/index.js.flow +4 -15
- package/lib/commonjs/screens/DetailBuyDue/index.js.map +1 -1
- package/lib/commonjs/screens/SellDebt/Tabs/Sold.js +1 -1
- package/lib/commonjs/screens/SellDebt/Tabs/Sold.js.flow +3 -2
- package/lib/commonjs/screens/SellDebt/Tabs/Sold.js.map +1 -1
- package/lib/commonjs/screens/Transfer/Tabs/Buy.js +1 -1
- package/lib/commonjs/screens/Transfer/Tabs/Buy.js.flow +8 -4
- package/lib/commonjs/screens/Transfer/Tabs/Buy.js.map +1 -1
- package/lib/commonjs/screens/Transfer/Tabs/Sell.js +1 -1
- package/lib/commonjs/screens/Transfer/Tabs/Sell.js.flow +12 -3
- package/lib/commonjs/screens/Transfer/Tabs/Sell.js.map +1 -1
- package/lib/commonjs/screens/Transfer/index.js +1 -1
- package/lib/commonjs/screens/Transfer/index.js.flow +19 -18
- package/lib/commonjs/screens/Transfer/index.js.map +1 -1
- package/lib/module/components/Features/Debt/debtSlice.js.map +1 -1
- package/lib/module/controllers/Debt.js +1 -1
- package/lib/module/controllers/Debt.js.map +1 -1
- package/lib/module/screens/BuyDebt/Components/ListSuccess/ListSuccess.js +1 -1
- package/lib/module/screens/BuyDebt/Components/ListSuccess/ListSuccess.js.map +1 -1
- package/lib/module/screens/ContractDetail/index.js +1 -1
- package/lib/module/screens/ContractDetail/index.js.map +1 -1
- package/lib/module/screens/DetailBuyDue/index.js +1 -1
- package/lib/module/screens/DetailBuyDue/index.js.map +1 -1
- package/lib/module/screens/SellDebt/Tabs/Sold.js +1 -1
- package/lib/module/screens/SellDebt/Tabs/Sold.js.map +1 -1
- package/lib/module/screens/Transfer/Tabs/Buy.js +1 -1
- package/lib/module/screens/Transfer/Tabs/Buy.js.map +1 -1
- package/lib/module/screens/Transfer/Tabs/Sell.js +1 -1
- package/lib/module/screens/Transfer/Tabs/Sell.js.map +1 -1
- package/lib/module/screens/Transfer/index.js +1 -1
- package/lib/module/screens/Transfer/index.js.map +1 -1
- package/lib/typescript/src/controllers/Debt.d.ts +2 -2
- package/lib/typescript/src/controllers/Debt.d.ts.map +1 -1
- package/lib/typescript/src/screens/BuyDebt/Components/ListSuccess/ListSuccess.d.ts.map +1 -1
- package/lib/typescript/src/screens/ContractDetail/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/DetailBuyDue/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/SellDebt/Tabs/Sold.d.ts.map +1 -1
- package/lib/typescript/src/screens/Transfer/Tabs/Buy.d.ts.map +1 -1
- package/lib/typescript/src/screens/Transfer/Tabs/Sell.d.ts.map +1 -1
- package/lib/typescript/src/screens/Transfer/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Features/Debt/debtSlice.ts +2 -2
- package/src/controllers/Debt.ts +12 -4
- package/src/screens/BuyDebt/Components/ListSuccess/ListSuccess.tsx +1 -0
- package/src/screens/ContractDetail/index.tsx +1 -0
- package/src/screens/DetailBuyDue/index.tsx +4 -15
- package/src/screens/SellDebt/Tabs/Sold.tsx +3 -2
- package/src/screens/Transfer/Tabs/Buy.tsx +8 -4
- package/src/screens/Transfer/Tabs/Sell.tsx +12 -3
- package/src/screens/Transfer/index.tsx +19 -18
|
@@ -12,7 +12,7 @@ const debt = createSlice({
|
|
|
12
12
|
|
|
13
13
|
export const getBuyingDebtsTrading = createAsyncThunk(
|
|
14
14
|
'debt/getBuyingDebtsTrading',
|
|
15
|
-
async (params: number) => {
|
|
15
|
+
async (params: number | number[]) => {
|
|
16
16
|
const resp = await Debt.getBuyingDebtsTrading(params);
|
|
17
17
|
return resp;
|
|
18
18
|
}
|
|
@@ -20,7 +20,7 @@ export const getBuyingDebtsTrading = createAsyncThunk(
|
|
|
20
20
|
|
|
21
21
|
export const getSellingDebtsTrading = createAsyncThunk(
|
|
22
22
|
'debt/getSellingDebtsTrading',
|
|
23
|
-
async (params: number) => {
|
|
23
|
+
async (params: number | number[]) => {
|
|
24
24
|
const resp = await Debt.getSellingDebtsTrading(params);
|
|
25
25
|
return resp;
|
|
26
26
|
}
|
package/src/controllers/Debt.ts
CHANGED
|
@@ -5,10 +5,14 @@ import client from './Client';
|
|
|
5
5
|
|
|
6
6
|
const Debt = {
|
|
7
7
|
// status = -111 tất cả,2 chờ ký,3 chờ nđt bán ký, 7 hoàn tất
|
|
8
|
-
async getBuyingDebtsTrading(params: number) {
|
|
8
|
+
async getBuyingDebtsTrading(params: number | number[]) {
|
|
9
9
|
try {
|
|
10
|
+
const query = Array.isArray(params)
|
|
11
|
+
? params.join(',')
|
|
12
|
+
: params.toString();
|
|
13
|
+
|
|
10
14
|
const res = await client.get(
|
|
11
|
-
`/api/stats/get_buying_debts_trading?status=${
|
|
15
|
+
`/api/stats/get_buying_debts_trading?status=${query}`
|
|
12
16
|
);
|
|
13
17
|
return res;
|
|
14
18
|
} catch (err) {
|
|
@@ -16,10 +20,14 @@ const Debt = {
|
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
|
|
19
|
-
async getSellingDebtsTrading(params: number) {
|
|
23
|
+
async getSellingDebtsTrading(params: number | number[]) {
|
|
20
24
|
try {
|
|
25
|
+
const query = Array.isArray(params)
|
|
26
|
+
? params.join(',')
|
|
27
|
+
: params.toString();
|
|
28
|
+
|
|
21
29
|
const res = await client.get(
|
|
22
|
-
`/api/stats/get_selling_debts_trading?status=${
|
|
30
|
+
`/api/stats/get_selling_debts_trading?status=${query}`
|
|
23
31
|
);
|
|
24
32
|
return res;
|
|
25
33
|
} catch (err) {
|
|
@@ -244,6 +244,7 @@ export const ContractDetail = ({ route, navigation }: any) => {
|
|
|
244
244
|
<FlatList
|
|
245
245
|
data={listContracts?.detailData}
|
|
246
246
|
keyExtractor={(item, index) => `${index}`}
|
|
247
|
+
contentContainerStyle={{ paddingBottom: 40 }}
|
|
247
248
|
renderItem={_renderItem}
|
|
248
249
|
ListEmptyComponent={() => <EmptyView text="Không có hợp đồng nào" />}
|
|
249
250
|
/>
|
|
@@ -54,27 +54,16 @@ export const DetailBuyDue = ({ navigation, route }: any) => {
|
|
|
54
54
|
title="Hợp đồng"
|
|
55
55
|
onPress={() => navigation.navigate('MyBank.Main')}
|
|
56
56
|
/>
|
|
57
|
-
<View
|
|
58
|
-
style={{
|
|
59
|
-
width: '100%',
|
|
60
|
-
height: '100%',
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
57
|
+
<View style={{ flex: 1 }}>
|
|
63
58
|
<Pdf
|
|
64
59
|
showsVerticalScrollIndicator={false}
|
|
65
60
|
source={{ uri: data?.url, cache: true }}
|
|
66
|
-
style={{
|
|
61
|
+
style={{ flex: 1 }}
|
|
67
62
|
trustAllCerts={false}
|
|
68
63
|
/>
|
|
69
|
-
<View
|
|
70
|
-
style={{
|
|
71
|
-
position: 'absolute',
|
|
72
|
-
width: '100%',
|
|
73
|
-
bottom: actuatedNormalize(100),
|
|
74
|
-
}}
|
|
75
|
-
>
|
|
64
|
+
<View style={{ padding: actuatedNormalize(16) }}>
|
|
76
65
|
<Button
|
|
77
|
-
text=
|
|
66
|
+
text="Ký hợp đồng"
|
|
78
67
|
onPress={onSubmit}
|
|
79
68
|
buttonStyle={{
|
|
80
69
|
marginBottom: actuatedNormalize(32),
|
|
@@ -277,7 +277,7 @@ const Sold = () => {
|
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
return (
|
|
280
|
-
<View>
|
|
280
|
+
<View style={{ flex: 1 }}>
|
|
281
281
|
<FlexRow
|
|
282
282
|
style={{
|
|
283
283
|
padding: 12,
|
|
@@ -340,7 +340,7 @@ const Sold = () => {
|
|
|
340
340
|
</View>
|
|
341
341
|
</FlexRow>
|
|
342
342
|
|
|
343
|
-
<View style={{
|
|
343
|
+
<View style={{ flex: 1 }}>
|
|
344
344
|
<FlatList
|
|
345
345
|
refreshControl={
|
|
346
346
|
<RefreshControl
|
|
@@ -350,6 +350,7 @@ const Sold = () => {
|
|
|
350
350
|
/>
|
|
351
351
|
}
|
|
352
352
|
data={data}
|
|
353
|
+
contentContainerStyle={{ paddingBottom: 40 }}
|
|
353
354
|
keyExtractor={(item, index) => index.toString()}
|
|
354
355
|
renderItem={_renderItemLenderSell}
|
|
355
356
|
stickyHeaderIndices={[0]}
|
|
@@ -25,15 +25,19 @@ import {
|
|
|
25
25
|
import Countdown from '../../../hooks/Countdown/useCountdown';
|
|
26
26
|
|
|
27
27
|
const Buy = (props) => {
|
|
28
|
-
const { dataDebts } = props;
|
|
28
|
+
const { dataDebts, value } = props;
|
|
29
29
|
const navigation = useNavigation();
|
|
30
30
|
const dispatch = useAppDispatch();
|
|
31
31
|
const [refreshing, setRefreshing] = useState(false);
|
|
32
32
|
const [debts, setDebts] = useState(dataDebts);
|
|
33
33
|
|
|
34
34
|
useEffect(() => {
|
|
35
|
-
getListBuying(
|
|
36
|
-
}, []);
|
|
35
|
+
getListBuying(value);
|
|
36
|
+
}, [value]);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
setDebts(dataDebts);
|
|
40
|
+
}, [dataDebts]);
|
|
37
41
|
|
|
38
42
|
const wait = (timeout: number | undefined) => {
|
|
39
43
|
return new Promise((resolve) => setTimeout(resolve, timeout));
|
|
@@ -59,7 +63,7 @@ const Buy = (props) => {
|
|
|
59
63
|
} else {
|
|
60
64
|
setDebts([]);
|
|
61
65
|
}
|
|
62
|
-
console.log('respresp', JSON.stringify(resp));
|
|
66
|
+
console.log('respresp BUY', JSON.stringify(resp));
|
|
63
67
|
} catch (error) {
|
|
64
68
|
console.log('catching error getListBuy: ', error);
|
|
65
69
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//@ts-nocheck
|
|
4
4
|
import { useNavigation } from '@react-navigation/native';
|
|
5
5
|
import moment from 'moment';
|
|
6
|
-
import React, { useState } from 'react';
|
|
6
|
+
import React, { useEffect, useState } from 'react';
|
|
7
7
|
import { FlatList, RefreshControl, TouchableOpacity, View } from 'react-native';
|
|
8
8
|
import Feather from 'react-native-vector-icons/Feather';
|
|
9
9
|
import Colors from '../../../common/Colors';
|
|
@@ -25,11 +25,20 @@ import {
|
|
|
25
25
|
import Countdown from '../../../hooks/Countdown/useCountdown';
|
|
26
26
|
|
|
27
27
|
const Sell = (props) => {
|
|
28
|
-
const { dataDebts } = props;
|
|
28
|
+
const { dataDebts, value } = props;
|
|
29
29
|
const navigation = useNavigation();
|
|
30
30
|
const dispatch = useAppDispatch();
|
|
31
|
+
const [debts, setDebts] = useState(dataDebts);
|
|
31
32
|
const [refreshing, setRefreshing] = useState(false);
|
|
32
33
|
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
getListSelling(value);
|
|
36
|
+
}, [value]);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
setDebts(dataDebts);
|
|
40
|
+
}, [dataDebts]);
|
|
41
|
+
|
|
33
42
|
const wait = (timeout: number | undefined) => {
|
|
34
43
|
return new Promise((resolve) => setTimeout(resolve, timeout));
|
|
35
44
|
};
|
|
@@ -251,7 +260,7 @@ const Sell = (props) => {
|
|
|
251
260
|
}}
|
|
252
261
|
>
|
|
253
262
|
<FlatList
|
|
254
|
-
data={
|
|
263
|
+
data={debts}
|
|
255
264
|
keyExtractor={(i, index) => index.toString()}
|
|
256
265
|
renderItem={_renderItems}
|
|
257
266
|
showsVerticalScrollIndicator={false}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
//@ts-nocheck
|
|
2
1
|
/* eslint-disable react-native/no-inline-styles */
|
|
2
|
+
//@ts-nocheck
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { TouchableOpacity, View } from 'react-native';
|
|
5
5
|
import { showMessage } from 'react-native-flash-message';
|
|
@@ -38,8 +38,9 @@ const Transfer = ({ navigation, route }: any) => {
|
|
|
38
38
|
const [showPopover, setShowPopover] = useState(false);
|
|
39
39
|
const [openDropdown, setOpenDropdown] = useState(false);
|
|
40
40
|
const [shopName, setShopName] = useState('');
|
|
41
|
-
const [value, setValue] = useState(-111);
|
|
42
|
-
const [
|
|
41
|
+
const [value, setValue] = useState<number[]>([-111]);
|
|
42
|
+
const [dataBuy, setDataBuy] = useState([]);
|
|
43
|
+
const [dataSell, setDataSell] = useState([]);
|
|
43
44
|
const [refreshing, setRefreshing] = useState(false);
|
|
44
45
|
const userData = useSelector(userInfor);
|
|
45
46
|
|
|
@@ -59,26 +60,26 @@ const Transfer = ({ navigation, route }: any) => {
|
|
|
59
60
|
} else {
|
|
60
61
|
getListBuying(value);
|
|
61
62
|
}
|
|
62
|
-
}, [currentTab, userData?.accessToken]);
|
|
63
|
+
}, [currentTab, userData?.accessToken, value]);
|
|
63
64
|
|
|
64
|
-
const getListSelling = async (status: number) => {
|
|
65
|
+
const getListSelling = async (status: number | number[]) => {
|
|
65
66
|
const resp: any = await dispatch(getSellingDebtsTrading(status));
|
|
66
67
|
if (resp?.payload?.data?.length) {
|
|
67
68
|
const _data = resp?.payload?.data || [];
|
|
68
|
-
|
|
69
|
+
setDataSell(_data);
|
|
69
70
|
} else {
|
|
70
|
-
|
|
71
|
+
setDataSell([]);
|
|
71
72
|
}
|
|
72
73
|
console.log('resp selling----', resp);
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
const getListBuying = async (status: number) => {
|
|
76
|
+
const getListBuying = async (status: number | number[]) => {
|
|
76
77
|
const resp: any = await dispatch(getBuyingDebtsTrading(status));
|
|
77
78
|
if (resp?.payload?.data?.length) {
|
|
78
79
|
const _data = resp?.payload?.data || [];
|
|
79
|
-
|
|
80
|
+
setDataBuy(_data);
|
|
80
81
|
} else {
|
|
81
|
-
|
|
82
|
+
setDataBuy([]);
|
|
82
83
|
}
|
|
83
84
|
console.log('respresp', JSON.stringify(resp));
|
|
84
85
|
};
|
|
@@ -292,20 +293,20 @@ const Transfer = ({ navigation, route }: any) => {
|
|
|
292
293
|
</FlexRow>
|
|
293
294
|
|
|
294
295
|
{currentTab === 0 ? (
|
|
295
|
-
<Buy dataDebts={
|
|
296
|
+
<Buy dataDebts={dataBuy} />
|
|
296
297
|
) : (
|
|
297
|
-
<Sell dataDebts={
|
|
298
|
+
<Sell dataDebts={dataSell} />
|
|
298
299
|
)}
|
|
299
300
|
</View>
|
|
300
301
|
|
|
301
302
|
<PopoverSortDebt
|
|
302
303
|
tab={currentTab}
|
|
303
|
-
onPress={(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
304
|
+
onPress={(val: string) => {
|
|
305
|
+
console.log('value press: ', val);
|
|
306
|
+
|
|
307
|
+
const arr = val.split(',').map((v) => Number(v.trim()));
|
|
308
|
+
|
|
309
|
+
setValue(arr);
|
|
309
310
|
setShowPopover(false);
|
|
310
311
|
}}
|
|
311
312
|
isVisible={showPopover}
|