Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InvestCustomer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Giang Tran
InvestCustomer
Commits
bca4af05
Commit
bca4af05
authored
May 06, 2021
by
Nguyễn Thị Thúy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrate transaction api
parent
a76c9a92
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
568 additions
and
492 deletions
+568
-492
project.pbxproj
ios/Invest.xcodeproj/project.pbxproj
+2
-0
DueDate.js
src/Screens/Transaction/DueDate/DueDate.js
+53
-20
DueDateView.js
src/Screens/Transaction/DueDate/DueDateView.js
+82
-104
Item.js
src/Screens/Transaction/DueDate/Item.js
+15
-15
Escrow.js
src/Screens/Transaction/Escrow/Escrow.js
+52
-19
EscrowView.js
src/Screens/Transaction/Escrow/EscrowView.js
+106
-105
Item.js
src/Screens/Transaction/Escrow/Item.js
+13
-17
Item.js
src/Screens/Transaction/PriceList/Item.js
+3
-3
PriceList.js
src/Screens/Transaction/PriceList/PriceList.js
+2
-0
Item.js
src/Screens/Transaction/TimeTransaction/Item.js
+86
-88
TimeTransaction.js
src/Screens/Transaction/TimeTransaction/TimeTransaction.js
+51
-19
TimeTransactionView.js
...creens/Transaction/TimeTransaction/TimeTransactionView.js
+102
-101
url.js
src/apis/url.js
+1
-1
No files found.
ios/Invest.xcodeproj/project.pbxproj
View file @
bca4af05
...
...
@@ -923,6 +923,7 @@
PROVISIONING_PROFILE_SPECIFIER
=
""
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_VERSION
=
5.0
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
name
=
Debug
;
...
...
@@ -950,6 +951,7 @@
PRODUCT_NAME
=
Invest
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
SWIFT_VERSION
=
5.0
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
name
=
Release
;
...
...
src/Screens/Transaction/DueDate/DueDate.js
View file @
bca4af05
...
...
@@ -2,30 +2,62 @@ import React, {useState, useEffect} from 'react';
import
{
getListNotification
}
from
'../../../apis/Functions/users'
;
import
DueDateView
from
'./DueDateView'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
{
getListCategoryProduct
,
getTransactionListByCategory
}
from
'../../../apis/Functions/Transaction'
;
import
{
Alert
,
Platform
}
from
'react-native'
;
import
PriceListView
from
'../PriceList/PriceListView'
;
const
DueDate
=
(
props
)
=>
{
const
[
selected
,
setSelected
]
=
useState
(
''
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
data
,
setData
]
=
useState
([]);
const
[
tottalPage
,
setTotalPage
]
=
useState
(
1
);
const
[
isRefresh
,
setisRefresh
]
=
useState
(
false
);
const
[
fillter
,
setFillters
]
=
useState
(
'ALL'
);
const
[
isRefresh
,
setIsRefresh
]
=
useState
(
false
);
const
[
filters
,
setFilters
]
=
useState
([]);
const
[
filterId
,
setFilterId
]
=
useState
(
-
1
);
useEffect
(()
=>
{
getCategoryData
();
},
[]);
useEffect
(()
=>
{
setData
([])
getData
();
},
[
fillter
]);
},
[
filterId
]);
const
getCategoryData
=
async
()
=>
{
// setIsRefresh(true);
const
res
=
await
getListCategoryProduct
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
20
,
page_index
:
1
,
type
:
'PRODUCT'
,
});
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
let
data
=
[];
data
.
push
({
id
:
-
1
,
name
:
'All'
});
setFilters
(
data
.
concat
([...
res
.
data
.
data
]));
}
else
{
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
};
const
onRefresh
=
()
=>
{
setPage
(
1
);
getData
();
};
const
getData
=
async
()
=>
{
set
i
sRefresh
(
true
);
set
I
sRefresh
(
true
);
setPage
(
1
);
const
res
=
await
get
ListNotification
({
const
res
=
await
get
TransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
type
:
fillter
,
type
:
'EXPIRY_DATE'
,
category_id
:
filterId
,
});
setisRefresh
(
false
);
setIsRefresh
(
false
);
console
.
log
(
'getData'
,
res
);
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
setTotalPage
(
res
.
data
.
meta
.
pages
);
...
...
@@ -34,38 +66,39 @@ const DueDate = (props) => {
}
};
const
onRefresh
=
()
=>
{
getData
();
};
const
onLoadMore
=
()
=>
{
console
.
log
(
tottalPage
);
if
(
page
<
tottalPage
)
getDataLoadMore
();
if
(
page
<
tottalPage
)
{
getDataLoadMore
();
}
};
const
getDataLoadMore
=
async
()
=>
{
set
i
sRefresh
(
true
);
const
res
=
await
get
ListNotification
({
set
I
sRefresh
(
true
);
const
res
=
await
get
TransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
type
:
fillter
,
page_index
:
page
+
1
,
type
:
'EXPIRY_DATE'
,
category_id
:
filterId
,
});
setPage
(
page
+
1
);
if
(
res
.
data
.
code
==
200
)
{
setData
(
data
.
concat
(
res
.
data
.
data
));
}
set
i
sRefresh
(
false
);
set
I
sRefresh
(
false
);
};
return
(
<
DueDateView
onRefresh
=
{
onRefresh
}
isRefresh
=
{
isRefresh
}
onLoadMore
=
{
onLoadMore
}
setFillters
=
{
setFillters
}
fillter
=
{
fillter
}
setFilterId
=
{
setFilterId
}
filterId
=
{
filterId
}
filters
=
{
filters
}
data
=
{
data
}
/
>
);
...
...
src/Screens/Transaction/DueDate/DueDateView.js
View file @
bca4af05
import
React
,
{
useState
}
from
'react'
;
import
{
View
,
Text
,
FlatList
,
StyleSheet
,
TouchableOpacity
,
ScrollView
,
View
,
Text
,
FlatList
,
StyleSheet
,
TouchableOpacity
,
ScrollView
,
}
from
'react-native'
;
import
HeaderDrawer
from
'../../../components/Header/HeaderDrawer'
;
import
Item
from
'./Item'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
getFontXD
,
HEIGHTXD
}
from
'../../../Config/Functions'
;
import
AppText
from
'../../../components/AppText'
;
import
{
PRODUCTDETAIL
}
from
'../../../routers/ScreenNames'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
const
Fillters
=
[
{
id
:
'1'
,
name
:
'All'
,
value
:
'ALL'
,
},
{
id
:
'2'
,
name
:
'Deposit'
,
value
:
'DEPOSIT'
,
},
{
id
:
'3'
,
name
:
'Withdraw'
,
value
:
'WITHDRAW'
,
},
{
id
:
'4'
,
name
:
'Transfer'
,
value
:
'TRANSFER'
,
},
];
const
EscrowView
=
(
props
)
=>
{
const
{
onRefresh
,
isRefresh
,
onLoadMore
,
setFillters
,
fillter
,
data
}
=
props
;
const
navigate
=
useNavigation
();
const
{
onRefresh
,
isRefresh
,
onLoadMore
,
setFilterId
,
filters
,
filterId
,
data
}
=
props
;
const
navigate
=
useNavigation
();
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
{
Fillters
.
map
((
e
)
=>
(
<
TouchableOpacity
key
=
{
e
.
value
}
onPress
=
{()
=>
setFillters
(
e
.
value
)}
style
=
{[
styles
.
itemFillter
,
fillter
==
e
.
value
?
{
borderColor
:
'#1473E6'
}
:
null
,
]}
>
<
AppText
i18nKey
=
{
e
.
name
}
style
=
{[
styles
.
txtFillter
,
fillter
==
e
.
value
?
{
color
:
'#1473E6'
}
:
{},
]}
><
/AppText
>
<
/TouchableOpacity
>
))}
<
/ScrollView
>
<
/View
>
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
{
filters
.
map
((
e
)
=>
(
<
TouchableOpacity
key
=
{
e
.
id
}
onPress
=
{()
=>
setFilterId
(
e
.
id
)}
style
=
{[
styles
.
itemFillter
,
filterId
==
e
.
id
?
{
borderColor
:
'#1473E6'
}
:
null
,
]}
>
<
Text
style
=
{[
styles
.
txtFillter
,
filterId
==
e
.
id
?
{
color
:
'#1473E6'
}
:
{},
]}
>
{
e
.
name
}
<
/Text
>
<
/TouchableOpacity
>
))}
<
/ScrollView
>
<
/View
>
{
data
.
length
==
0
?
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
AppText
i18nKey
=
{
'NoData'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
}}
><
/AppText
>
{
data
.
length
==
0
&&
!
isRefresh
?
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
AppText
i18nKey
=
{
'NoData'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
}}
><
/AppText
>
<
/View
>
)
:
(
<
FlatList
style
=
{{
marginTop
:
HEIGHTXD
(
15
)}}
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
refreshing
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
renderItem
=
{({
item
,
index
})
=>
<
Item
item
=
{
item
}
isEndItem
=
{
index
==
(
data
.
length
-
1
)}
onPress
=
{(
item
)
=>
navigate
.
navigate
(
PRODUCTDETAIL
)}
/>
}
/>
)}
<
/View
>
)
:
(
<
FlatList
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
refreshing
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
renderItem
=
{({
item
})
=>
<
Item
item
=
{
item
}
onPress
=
{(
item
)
=>
navigate
.
navigate
(
PRODUCTDETAIL
)}
/>
}
/>
)}
<
/View
>
);
);
};
const
styles
=
StyleSheet
.
create
({
headerContainer
:
{
paddingVertical
:
10
,
backgroundColor
:
'white'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
paddingHorizontal
:
10
,
},
itemFillter
:
{
borderRadius
:
10
,
paddingVertical
:
5
,
paddingHorizontal
:
10
,
borderWidth
:
1
,
borderColor
:
'#929292'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
marginRight
:
10
,
},
txtFillter
:
{
fontSize
:
getFontXD
(
36
),
color
:
'#929292'
,
fontWeight
:
'bold'
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
46
),
fontWeight
:
'bold'
,
},
headerContainer
:
{
paddingVertical
:
10
,
backgroundColor
:
'white'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
paddingHorizontal
:
10
,
},
itemFillter
:
{
borderRadius
:
10
,
paddingVertical
:
5
,
paddingHorizontal
:
10
,
borderWidth
:
1
,
borderColor
:
'#929292'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
marginRight
:
10
,
},
txtFillter
:
{
fontSize
:
getFontXD
(
36
),
color
:
'#929292'
,
fontWeight
:
'bold'
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
46
),
fontWeight
:
'bold'
,
},
});
export
default
EscrowView
;
src/Screens/Transaction/DueDate/Item.js
View file @
bca4af05
...
...
@@ -15,15 +15,17 @@ import {
}
from
'../../../Config/Functions'
;
import
R
from
'../../../assets/R'
;
import
Block
from
'../../../components/Block'
;
import
I18n
from
'../../../helper/i18/i18n'
;
const
Item
=
(
props
)
=>
{
const
{
item
}
=
props
;
const
{
item
,
isEndItem
}
=
props
;
console
.
log
(
item
)
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
[
styles
.
container
,
isEndItem
&&
{
marginBottom
:
HEIGHTXD
(
100
)}]
}
>
<
TouchableOpacity
onPress
=
{()
=>
props
.
onPress
(
item
)}
>
<
Block
flex
=
{
1
}
row
>
<
View
style
=
{
styles
.
wrapDate
}
>
<
Image
source
=
{
R
.
images
.
iconRecharge
}
style
=
{
styles
.
imgIcon
}
/
>
<
Image
source
=
{
{
uri
:
item
.
commoditiy
.
image_path
}
}
style
=
{
styles
.
imgIcon
}
/
>
<
/View
>
<
Block
padding
=
{[
5
,
10
]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
...
...
@@ -32,13 +34,13 @@ const Item = (props) => {
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
}}
>
<
Text
numberOfLines
=
{
2
}
style
=
{
styles
.
txtBlack
}
>
Ng
ô
CBOT
<
Text
numberOfLines
=
{
2
}
style
=
{
[
styles
.
txtBlack
,
{
flexWrap
:
'wrap'
,
flex
:
1
}]}
numberOfLines
=
{
1
}
ellipsizeMode
=
'tail'
>
{
item
.
contract_name
}
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
05
/
2022
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
item
.
term
}
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
txtCode
}
>
M
ã
h
ợ
p
đồ
ng
:
ZCEK22
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
29
/
04
/
2022
-
13
/
05
/
2022
<
/Text
>
<
Text
style
=
{
styles
.
txtCode
}
>
{
`
${
I18n
.
t
(
'ContactCode'
)}
:
${
item
.
contract_code
}
`
}
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
open_interest_range
}
<
/Text
>
<
/Block
>
<
/Block
>
<
/TouchableOpacity
>
...
...
@@ -50,7 +52,6 @@ export default Item;
const
styles
=
StyleSheet
.
create
({
container
:
{
marginTop
:
10
,
paddingVertical
:
10
,
shadowColor
:
'#000'
,
shadowOffset
:
{
...
...
@@ -62,8 +63,8 @@ const styles = StyleSheet.create({
elevation
:
5
,
marginHorizontal
:
10
,
backgroundColor
:
R
.
colors
.
white
,
marginBottom
:
10
,
borderRadius
:
HEIGHTXD
(
30
),
marginVertical
:
HEIGHTXD
(
15
)
},
wrapLeft
:
{
...
...
@@ -94,14 +95,13 @@ const styles = StyleSheet.create({
alignItems
:
'center'
,
},
txtBlack
:
{
fontSize
:
getFontXD
(
42
),
fontSize
:
getFontXD
(
50
),
color
:
'black'
,
fontWeight
:
'bold'
,
},
imgIcon
:
{
width
:
WIDTHXD
(
1
78
),
height
:
HEIGHTXD
(
178
),
resizeMode
:
'co
ntain
'
,
width
:
WIDTHXD
(
1
50
),
height
:
WIDTHXD
(
150
),
resizeMode
:
'co
ver
'
,
},
txtMoney
:
{
fontSize
:
getFontXD
(
42
),
...
...
src/Screens/Transaction/Escrow/Escrow.js
View file @
bca4af05
...
...
@@ -2,29 +2,62 @@ import React, {useState, useEffect} from 'react';
import
{
getListNotification
}
from
'../../../apis/Functions/users'
;
import
EscrowView
from
'./EscrowView'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
{
getListCategoryProduct
,
getTransactionListByCategory
}
from
'../../../apis/Functions/Transaction'
;
import
{
Alert
,
Platform
}
from
'react-native'
;
import
PriceListView
from
'../PriceList/PriceListView'
;
const
Escrow
=
(
props
)
=>
{
const
[
selected
,
setSelected
]
=
useState
(
''
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
data
,
setData
]
=
useState
([]);
const
[
tottalPage
,
setTotalPage
]
=
useState
(
1
);
const
[
isRefresh
,
setisRefresh
]
=
useState
(
false
);
const
[
fillter
,
setFillters
]
=
useState
(
'ALL'
);
const
[
isRefresh
,
setIsRefresh
]
=
useState
(
false
);
const
[
filters
,
setFilters
]
=
useState
([]);
const
[
filterId
,
setFilterId
]
=
useState
(
-
1
);
useEffect
(()
=>
{
getCategoryData
();
},
[]);
useEffect
(()
=>
{
setData
([])
getData
();
},
[
filterId
]);
const
getCategoryData
=
async
()
=>
{
// setIsRefresh(true);
const
res
=
await
getListCategoryProduct
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
20
,
page_index
:
1
,
type
:
'PRODUCT'
,
});
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
let
data
=
[];
data
.
push
({
id
:
-
1
,
name
:
'All'
});
setFilters
(
data
.
concat
([...
res
.
data
.
data
]));
}
else
{
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
};
const
onRefresh
=
()
=>
{
setPage
(
1
);
getData
();
}
,
[
fillter
])
;
};
const
getData
=
async
()
=>
{
set
i
sRefresh
(
true
);
set
I
sRefresh
(
true
);
setPage
(
1
);
const
res
=
await
get
ListNotification
({
const
res
=
await
get
TransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
type
:
fillter
,
type
:
'ESCROW'
,
category_id
:
filterId
,
});
setisRefresh
(
false
);
setIsRefresh
(
false
);
console
.
log
(
'getData'
,
res
);
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
setTotalPage
(
res
.
data
.
meta
.
pages
);
...
...
@@ -33,29 +66,28 @@ const Escrow = (props) => {
}
};
const
onRefresh
=
()
=>
{
getData
();
};
const
onLoadMore
=
()
=>
{
console
.
log
(
tottalPage
);
if
(
page
<
tottalPage
)
getDataLoadMore
();
if
(
page
<
tottalPage
)
{
getDataLoadMore
();
}
};
const
getDataLoadMore
=
async
()
=>
{
set
i
sRefresh
(
true
);
const
res
=
await
get
ListNotification
({
set
I
sRefresh
(
true
);
const
res
=
await
get
TransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
type
:
fillter
,
page_index
:
page
+
1
,
type
:
'ESCROW'
,
category_id
:
filterId
,
});
setPage
(
page
+
1
);
if
(
res
.
data
.
code
==
200
)
{
setData
(
data
.
concat
(
res
.
data
.
data
));
}
set
i
sRefresh
(
false
);
set
I
sRefresh
(
false
);
};
return
(
...
...
@@ -63,8 +95,9 @@ const Escrow = (props) => {
onRefresh
=
{
onRefresh
}
isRefresh
=
{
isRefresh
}
onLoadMore
=
{
onLoadMore
}
setFillters
=
{
setFillters
}
fillter
=
{
fillter
}
setFilterId
=
{
setFilterId
}
filterId
=
{
filterId
}
filters
=
{
filters
}
data
=
{
data
}
/
>
);
...
...
src/Screens/Transaction/Escrow/EscrowView.js
View file @
bca4af05
import
React
,
{
useState
}
from
'react'
;
import
{
View
,
Text
,
FlatList
,
StyleSheet
,
TouchableOpacity
,
ScrollView
,
View
,
Text
,
FlatList
,
StyleSheet
,
TouchableOpacity
,
ScrollView
,
}
from
'react-native'
;
import
HeaderDrawer
from
'../../../components/Header/HeaderDrawer'
;
import
Item
from
'./Item'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
getFontXD
,
HEIGHTXD
}
from
'../../../Config/Functions'
;
import
AppText
from
'../../../components/AppText'
;
import
{
PRODUCTDETAIL
}
from
'../../../routers/ScreenNames'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
const
Fillters
=
[
{
id
:
'1'
,
name
:
'All'
,
value
:
'ALL'
,
},
{
id
:
'2'
,
name
:
'Deposit'
,
value
:
'DEPOSIT'
,
},
{
id
:
'3'
,
name
:
'Withdraw'
,
value
:
'WITHDRAW'
,
},
{
id
:
'4'
,
name
:
'Transfer'
,
value
:
'TRANSFER'
,
},
{
id
:
'1'
,
name
:
'All'
,
value
:
'ALL'
,
},
{
id
:
'2'
,
name
:
'Deposit'
,
value
:
'DEPOSIT'
,
},
{
id
:
'3'
,
name
:
'Withdraw'
,
value
:
'WITHDRAW'
,
},
{
id
:
'4'
,
name
:
'Transfer'
,
value
:
'TRANSFER'
,
},
];
const
EscrowView
=
(
props
)
=>
{
const
{
onRefresh
,
isRefresh
,
onLoadMore
,
setFillters
,
fillter
,
data
}
=
props
;
const
navigate
=
useNavigation
();
const
{
onRefresh
,
isRefresh
,
onLoadMore
,
setFilterId
,
filters
,
filterId
,
data
}
=
props
;
const
navigate
=
useNavigation
();
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
{
Fillters
.
map
((
e
)
=>
(
<
TouchableOpacity
key
=
{
e
.
value
}
onPress
=
{()
=>
setFillters
(
e
.
value
)}
style
=
{[
styles
.
itemFillter
,
fillter
==
e
.
value
?
{
borderColor
:
'#1473E6'
}
:
null
,
]}
>
<
AppText
i18nKey
=
{
e
.
name
}
style
=
{[
styles
.
txtFillter
,
fillter
==
e
.
value
?
{
color
:
'#1473E6'
}
:
{},
]}
><
/AppText
>
<
/TouchableOpacity
>
))}
<
/ScrollView
>
<
/View
>
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
{
filters
.
map
((
e
)
=>
(
<
TouchableOpacity
key
=
{
e
.
id
}
onPress
=
{()
=>
setFilterId
(
e
.
id
)}
style
=
{[
styles
.
itemFillter
,
filterId
==
e
.
id
?
{
borderColor
:
'#1473E6'
}
:
null
,
]}
>
<
Text
style
=
{[
styles
.
txtFillter
,
filterId
==
e
.
id
?
{
color
:
'#1473E6'
}
:
{},
]}
>
{
e
.
name
}
<
/Text
>
<
/TouchableOpacity
>
))}
<
/ScrollView
>
<
/View
>
{
data
.
length
==
0
?
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
AppText
i18nKey
=
{
'NoData'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
}}
><
/AppText
>
{
data
.
length
==
0
?
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
AppText
i18nKey
=
{
'NoData'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
}}
><
/AppText
>
<
/View
>
)
:
(
<
FlatList
style
=
{{
marginTop
:
HEIGHTXD
(
15
)}}
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
refreshing
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
renderItem
=
{({
item
,
index
})
=>
(
<
Item
item
=
{
item
}
isEndItem
=
{
index
==
data
.
length
-
1
}
onPress
=
{(
item
)
=>
navigate
.
navigate
(
PRODUCTDETAIL
)}
/
>
)}
/
>
)}
<
/View
>
)
:
(
<
FlatList
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
refreshing
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
renderItem
=
{({
item
})
=>
(
<
Item
item
=
{
item
}
onPress
=
{(
item
)
=>
navigate
.
navigate
(
PRODUCTDETAIL
)}
/
>
)}
/
>
)}
<
/View
>
);
);
};
const
styles
=
StyleSheet
.
create
({
headerContainer
:
{
paddingVertical
:
10
,
backgroundColor
:
'white'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
paddingHorizontal
:
10
,
},
itemFillter
:
{
borderRadius
:
10
,
paddingVertical
:
5
,
paddingHorizontal
:
10
,
borderWidth
:
1
,
borderColor
:
'#929292'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
marginRight
:
10
,
},
txtFillter
:
{
fontSize
:
getFontXD
(
36
),
color
:
'#929292'
,
fontWeight
:
'bold'
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
46
),
fontWeight
:
'bold'
,
},
headerContainer
:
{
paddingVertical
:
10
,
backgroundColor
:
'white'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
paddingHorizontal
:
10
,
},
itemFillter
:
{
borderRadius
:
10
,
paddingVertical
:
5
,
paddingHorizontal
:
10
,
borderWidth
:
1
,
borderColor
:
'#929292'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
marginRight
:
10
,
},
txtFillter
:
{
fontSize
:
getFontXD
(
36
),
color
:
'#929292'
,
fontWeight
:
'bold'
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
46
),
fontWeight
:
'bold'
,
},
});
export
default
EscrowView
;
src/Screens/Transaction/Escrow/Item.js
View file @
bca4af05
...
...
@@ -17,13 +17,13 @@ import R from '../../../assets/R';
import
Block
from
'../../../components/Block'
;
const
Item
=
(
props
)
=>
{
const
{
item
}
=
props
;
const
{
item
,
isEndItem
}
=
props
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
[
styles
.
container
,
isEndItem
&&
{
marginBottom
:
HEIGHTXD
(
100
)}]
}
>
<
TouchableOpacity
onPress
=
{()
=>
props
.
onPress
(
item
)}
>
<
Block
flex
=
{
1
}
row
>
<
View
style
=
{
styles
.
wrapDate
}
>
<
Image
source
=
{
R
.
images
.
iconRecharge
}
style
=
{
styles
.
imgIcon
}
/
>
<
Image
source
=
{
{
uri
:
item
.
image_path
}
}
style
=
{
styles
.
imgIcon
}
/
>
<
/View
>
<
Block
padding
=
{[
5
,
10
]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
...
...
@@ -32,12 +32,12 @@ const Item = (props) => {
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
}}
>
<
Text
numberOfLines
=
{
2
}
style
=
{
styles
.
txtBlack
}
>
Ng
ô
CBOT
<
Text
numberOfLines
=
{
2
}
style
=
{
[
styles
.
txtBlack
,
{
flexWrap
:
'wrap'
,
flex
:
1
}]}
numberOfLines
=
{
1
}
ellipsizeMode
=
'tail'
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
toPriceVnd
(
300000
)
}
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
item
.
escrow
>
0
?
toPriceVnd
(
item
.
escrow
)
:
0
}
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
txt
}
>
ZCE
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
code
}
<
/Text
>
<
/Block
>
<
/Block
>
<
/TouchableOpacity
>
...
...
@@ -49,7 +49,6 @@ export default Item;
const
styles
=
StyleSheet
.
create
({
container
:
{
marginTop
:
10
,
paddingVertical
:
10
,
shadowColor
:
'#000'
,
shadowOffset
:
{
...
...
@@ -61,8 +60,8 @@ const styles = StyleSheet.create({
elevation
:
5
,
marginHorizontal
:
10
,
backgroundColor
:
R
.
colors
.
white
,
marginBottom
:
10
,
borderRadius
:
HEIGHTXD
(
30
),
marginVertical
:
HEIGHTXD
(
15
)
},
wrapLeft
:
{
...
...
@@ -77,12 +76,10 @@ const styles = StyleSheet.create({
txtTitle
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
black
,
fontWeight
:
'bold'
,
},
txt
:
{
fontSize
:
getFontXD
(
39
),
color
:
'#929292'
,
fontStyle
:
'italic'
,
fontSize
:
getFontXD
(
36
),
color
:
R
.
colors
.
black
,
},
rowBet
:
{
flexDirection
:
'row'
,
...
...
@@ -90,14 +87,13 @@ const styles = StyleSheet.create({
alignItems
:
'center'
,
},
txtBlack
:
{
fontSize
:
getFontXD
(
42
),
fontSize
:
getFontXD
(
50
),
color
:
'black'
,
fontWeight
:
'bold'
,
},
imgIcon
:
{
width
:
WIDTHXD
(
178
),
height
:
HEIGHT
XD
(
178
),
resizeMode
:
'co
ntain
'
,
height
:
WIDTH
XD
(
178
),
resizeMode
:
'co
ver
'
,
},
txtMoney
:
{
fontSize
:
getFontXD
(
42
),
...
...
src/Screens/Transaction/PriceList/Item.js
View file @
bca4af05
...
...
@@ -22,7 +22,7 @@ const Item = (props) => {
<
View
style
=
{[
styles
.
container
,
isEndItem
&&
{
marginBottom
:
HEIGHTXD
(
100
)}]}
>
<
TouchableOpacity
onPress
=
{()
=>
props
.
onPress
(
item
)}
>
<
Block
flex
=
{
1
}
row
>
<
Image
source
=
{
R
.
images
.
iconRecharge
}
style
=
{
styles
.
imgIcon
}
/
>
<
Image
source
=
{
{
uri
:
item
.
image_path
}
}
style
=
{
styles
.
imgIcon
}
/
>
<
Block
padding
=
{[
0
,
WIDTHXD
(
40
)]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
style
=
{{
...
...
@@ -87,8 +87,8 @@ const styles = StyleSheet.create({
},
imgIcon
:
{
width
:
WIDTHXD
(
150
),
height
:
HEIGHT
XD
(
150
),
resizeMode
:
'co
ntain
'
,
height
:
WIDTH
XD
(
150
),
resizeMode
:
'co
ver
'
,
marginLeft
:
WIDTHXD
(
35
)
},
txtMoney
:
{
...
...
src/Screens/Transaction/PriceList/PriceList.js
View file @
bca4af05
...
...
@@ -52,6 +52,7 @@ const PriceList = (props) => {
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
type
:
'PRICE_TABLE'
,
category_id
:
filterId
,
});
setIsRefresh
(
false
);
...
...
@@ -78,6 +79,7 @@ const PriceList = (props) => {
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
page
+
1
,
type
:
'PRICE_TABLE'
,
category_id
:
filterId
,
});
setPage
(
page
+
1
);
...
...
src/Screens/Transaction/TimeTransaction/Item.js
View file @
bca4af05
import
React
from
'react'
;
import
{
View
,
Text
,
StyleSheet
,
TouchableOpacity
,
Image
,
Alert
,
View
,
Text
,
StyleSheet
,
TouchableOpacity
,
Image
,
}
from
'react-native'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
,
toPriceVnd
,
getFontXD
,
HEIGHTXD
,
WIDTHXD
,
}
from
'../../../Config/Functions'
;
import
R
from
'../../../assets/R'
;
import
Block
from
'../../../components/Block'
;
const
Item
=
(
props
)
=>
{
const
{
item
}
=
props
;
return
(
<
View
style
=
{
styles
.
container
}
>
<
TouchableOpacity
onPress
=
{()
=>
props
.
onPress
(
item
)}
>
<
Block
flex
=
{
1
}
row
>
<
View
style
=
{
styles
.
wrapDate
}
>
<
Image
source
=
{
R
.
images
.
iconRecharge
}
style
=
{
styles
.
imgIcon
}
/
>
<
/View
>
<
Block
padding
=
{[
5
,
10
]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
}}
>
<
Text
numberOfLines
=
{
2
}
style
=
{
styles
.
txtBlack
}
>
Ng
ô
CBOT
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
Th
ứ
2
-
Th
ứ
6
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
txt
}
>
Phi
ê
n
1
:
07
:
00
-
19
:
45
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
Phi
ê
n
2
:
20
:
30
-
01
:
20
<
/Text
>
<
/Block
>
<
/Block
>
<
/TouchableOpacity
>
<
/View
>
);
const
{
item
,
isEndItem
}
=
props
;
return
(
<
View
style
=
{[
styles
.
container
,
isEndItem
&&
{
marginBottom
:
HEIGHTXD
(
100
)}]}
>
<
TouchableOpacity
onPress
=
{()
=>
props
.
onPress
(
item
)}
>
<
Block
flex
=
{
1
}
row
>
<
View
style
=
{
styles
.
wrapDate
}
>
<
Image
source
=
{{
uri
:
item
.
image_path
}}
style
=
{
styles
.
imgIcon
}
/
>
<
/View
>
<
Block
padding
=
{[
0
,
10
]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
}}
>
<
Text
numberOfLines
=
{
2
}
style
=
{[
styles
.
txtBlack
,
{
flexWrap
:
'wrap'
,
flex
:
1
}]}
numberOfLines
=
{
1
}
ellipsizeMode
=
'tail'
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{
styles
.
txtMoney
}
>
{
item
.
trans_time
}
<
/Text
>
<
/View
>
{
item
.
trans_session_list
.
map
((
sessionItem
)
=>
(
<
Text
style
=
{[
styles
.
txt
,
{
marginTop
:
HEIGHTXD
(
20
)}]}
>
{
sessionItem
}
<
/Text
>
)
)}
<
/Block
>
<
/Block
>
<
/TouchableOpacity
>
<
/View
>
);
};
export
default
Item
;
const
styles
=
StyleSheet
.
create
({
container
:
{
marginTop
:
10
,
paddingVertical
:
10
,
shadowColor
:
'#000'
,
shadowOffset
:
{
width
:
0
,
height
:
2
,
container
:
{
paddingVertical
:
HEIGHTXD
(
30
),
shadowColor
:
'#000'
,
shadowOffset
:
{
width
:
0
,
height
:
2
,
},
shadowOpacity
:
0.25
,
shadowRadius
:
3.84
,
elevation
:
5
,
marginHorizontal
:
10
,
backgroundColor
:
R
.
colors
.
white
,
borderRadius
:
HEIGHTXD
(
30
),
marginVertical
:
HEIGHTXD
(
15
),
},
shadowOpacity
:
0.25
,
shadowRadius
:
3.84
,
elevation
:
5
,
marginHorizontal
:
10
,
backgroundColor
:
R
.
colors
.
white
,
marginBottom
:
10
,
borderRadius
:
HEIGHTXD
(
30
),
},
wrapLeft
:
{
width
:
WIDTHXD
(
16
),
borderTopLeftRadius
:
HEIGHTXD
(
30
),
borderBottomStartRadius
:
HEIGHTXD
(
30
),
},
wrapDate
:
{
justifyContent
:
'center'
,
paddingLeft
:
10
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
black
,
fontWeight
:
'bold'
,
},
txt
:
{
fontSize
:
getFontXD
(
36
),
},
rowBet
:
{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
},
txtBlack
:
{
fontSize
:
getFontXD
(
42
),
color
:
'black'
,
fontWeight
:
'bold'
,
},
imgIcon
:
{
width
:
WIDTHXD
(
178
),
height
:
HEIGHTXD
(
178
),
resizeMode
:
'contain'
,
},
txtMoney
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
main
,
},
wrapLeft
:
{
width
:
WIDTHXD
(
16
),
borderTopLeftRadius
:
HEIGHTXD
(
30
),
borderBottomStartRadius
:
HEIGHTXD
(
30
),
},
wrapDate
:
{
justifyContent
:
'center'
,
paddingLeft
:
10
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
black
,
},
txt
:
{
fontSize
:
getFontXD
(
36
),
},
rowBet
:
{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
},
txtBlack
:
{
fontSize
:
getFontXD
(
50
),
color
:
'black'
,
},
imgIcon
:
{
width
:
WIDTHXD
(
150
),
height
:
WIDTHXD
(
150
),
resizeMode
:
'cover'
,
},
txtMoney
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
main
,
},
});
src/Screens/Transaction/TimeTransaction/TimeTransaction.js
View file @
bca4af05
...
...
@@ -2,29 +2,61 @@ import React, {useState, useEffect} from 'react';
import
{
getListNotification
}
from
'../../../apis/Functions/users'
;
import
TimeTransactionView
from
'./TimeTransactionView'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
{
getListCategoryProduct
,
getTransactionListByCategory
}
from
'../../../apis/Functions/Transaction'
;
import
{
Alert
,
Platform
}
from
'react-native'
;
import
PriceListView
from
'../PriceList/PriceListView'
;
const
PriceList
=
(
props
)
=>
{
const
[
selected
,
setSelected
]
=
useState
(
''
);
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
data
,
setData
]
=
useState
([]);
const
[
tottalPage
,
setTotalPage
]
=
useState
(
1
);
const
[
isRefresh
,
setisRefresh
]
=
useState
(
false
);
const
[
fillter
,
setFillters
]
=
useState
(
'ALL'
);
const
[
isRefresh
,
setIsRefresh
]
=
useState
(
false
);
const
[
filters
,
setFilters
]
=
useState
([]);
const
[
filterId
,
setFilterId
]
=
useState
(
-
1
);
useEffect
(()
=>
{
getCategoryData
();
},
[]);
useEffect
(()
=>
{
setData
([])
getData
();
},
[
filterId
]);
const
getCategoryData
=
async
()
=>
{
// setIsRefresh(true);
const
res
=
await
getListCategoryProduct
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
20
,
page_index
:
1
,
type
:
'PRODUCT'
,
});
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
let
data
=
[];
data
.
push
({
id
:
-
1
,
name
:
'All'
});
setFilters
(
data
.
concat
([...
res
.
data
.
data
]));
}
else
{
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
};
const
onRefresh
=
()
=>
{
setPage
(
1
);
getData
();
}
,
[
fillter
])
;
};
const
getData
=
async
()
=>
{
set
i
sRefresh
(
true
);
set
I
sRefresh
(
true
);
setPage
(
1
);
const
res
=
await
get
ListNotification
({
const
res
=
await
get
TransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
type
:
fillter
,
type
:
'TRANSACTION_TIME'
,
category_id
:
filterId
,
});
set
i
sRefresh
(
false
);
set
I
sRefresh
(
false
);
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
setTotalPage
(
res
.
data
.
meta
.
pages
);
...
...
@@ -33,29 +65,28 @@ const PriceList = (props) => {
}
};
const
onRefresh
=
()
=>
{
getData
();
};
const
onLoadMore
=
()
=>
{
console
.
log
(
tottalPage
);
if
(
page
<
tottalPage
)
getDataLoadMore
();
if
(
page
<
tottalPage
)
{
getDataLoadMore
();
}
};
const
getDataLoadMore
=
async
()
=>
{
set
i
sRefresh
(
true
);
const
res
=
await
get
ListNotification
({
set
I
sRefresh
(
true
);
const
res
=
await
get
TransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
10
,
page_index
:
1
,
type
:
fillter
,
page_index
:
page
+
1
,
type
:
'TRANSACTION_TIME'
,
category_id
:
filterId
,
});
setPage
(
page
+
1
);
if
(
res
.
data
.
code
==
200
)
{
setData
(
data
.
concat
(
res
.
data
.
data
));
}
set
i
sRefresh
(
false
);
set
I
sRefresh
(
false
);
};
return
(
...
...
@@ -63,8 +94,9 @@ const PriceList = (props) => {
onRefresh
=
{
onRefresh
}
isRefresh
=
{
isRefresh
}
onLoadMore
=
{
onLoadMore
}
setFillters
=
{
setFillters
}
fillter
=
{
fillter
}
setFilterId
=
{
setFilterId
}
filterId
=
{
filterId
}
filters
=
{
filters
}
data
=
{
data
}
/
>
);
...
...
src/Screens/Transaction/TimeTransaction/TimeTransactionView.js
View file @
bca4af05
import
React
,
{
useState
}
from
'react'
;
import
{
View
,
Text
,
FlatList
,
StyleSheet
,
TouchableOpacity
,
ScrollView
,
View
,
Text
,
FlatList
,
StyleSheet
,
TouchableOpacity
,
ScrollView
,
}
from
'react-native'
;
import
HeaderDrawer
from
'../../../components/Header/HeaderDrawer'
;
import
Item
from
'./Item'
;
import
{
getFontXD
}
from
'../../../Config/Functions'
;
import
{
getFontXD
,
HEIGHTXD
}
from
'../../../Config/Functions'
;
import
AppText
from
'../../../components/AppText'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
PRODUCTDETAIL
}
from
'../../../routers/ScreenNames'
;
const
Fillters
=
[
{
id
:
'1'
,
name
:
'All'
,
value
:
'ALL'
,
},
{
id
:
'2'
,
name
:
'Deposit'
,
value
:
'DEPOSIT'
,
},
{
id
:
'3'
,
name
:
'Withdraw'
,
value
:
'WITHDRAW'
,
},
{
id
:
'4'
,
name
:
'Transfer'
,
value
:
'TRANSFER'
,
},
{
id
:
'1'
,
name
:
'All'
,
value
:
'ALL'
,
},
{
id
:
'2'
,
name
:
'Deposit'
,
value
:
'DEPOSIT'
,
},
{
id
:
'3'
,
name
:
'Withdraw'
,
value
:
'WITHDRAW'
,
},
{
id
:
'4'
,
name
:
'Transfer'
,
value
:
'TRANSFER'
,
},
];
const
NotificaitonView
=
(
props
)
=>
{
const
{
onRefresh
,
isRefresh
,
onLoadMore
,
setFillters
,
fillter
,
data
}
=
props
;
const
navigate
=
useNavigation
();
const
{
onRefresh
,
isRefresh
,
onLoadMore
,
setFilterId
,
filters
,
filterId
,
data
}
=
props
;
const
navigate
=
useNavigation
();
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
{
Fillters
.
map
((
e
)
=>
(
<
TouchableOpacity
key
=
{
e
.
value
}
onPress
=
{()
=>
setFillters
(
e
.
value
)}
style
=
{[
styles
.
itemFillter
,
fillter
==
e
.
value
?
{
borderColor
:
'#1473E6'
}
:
null
,
]}
>
<
AppText
i18nKey
=
{
e
.
name
}
style
=
{[
styles
.
txtFillter
,
fillter
==
e
.
value
?
{
color
:
'#1473E6'
}
:
{},
]}
><
/AppText
>
<
/TouchableOpacity
>
))}
<
/ScrollView
>
<
/View
>
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{
styles
.
headerContainer
}
>
<
ScrollView
horizontal
showsHorizontalScrollIndicator
=
{
false
}
>
{
filters
.
map
((
e
)
=>
(
<
TouchableOpacity
key
=
{
e
.
id
}
onPress
=
{()
=>
setFilterId
(
e
.
id
)}
style
=
{[
styles
.
itemFillter
,
filterId
==
e
.
id
?
{
borderColor
:
'#1473E6'
}
:
null
,
]}
>
<
Text
style
=
{[
styles
.
txtFillter
,
filterId
==
e
.
id
?
{
color
:
'#1473E6'
}
:
{},
]}
>
{
e
.
name
}
<
/Text
>
<
/TouchableOpacity
>
))}
<
/ScrollView
>
<
/View
>
{
data
.
length
==
0
?
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
AppText
i18nKey
=
{
'NoData'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
}}
><
/AppText
>
{
data
.
length
==
0
&&
!
isRefresh
?
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
AppText
i18nKey
=
{
'NoData'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
}}
><
/AppText
>
<
/View
>
)
:
(
<
FlatList
style
=
{{
marginTop
:
HEIGHTXD
(
15
)}}
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
refreshing
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
renderItem
=
{({
item
,
index
})
=>
<
Item
item
=
{
item
}
isEndItem
=
{
index
==
(
data
.
length
-
1
)}
onPress
=
{(
item
)
=>
navigate
.
navigate
(
PRODUCTDETAIL
)}
/>
}
/>
)}
<
/View
>
)
:
(
<
FlatList
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
refreshing
=
{
isRefresh
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
renderItem
=
{({
item
})
=>
<
Item
item
=
{
item
}
onPress
=
{(
item
)
=>
navigate
.
navigate
(
PRODUCTDETAIL
)}
/>
}
/>
)}
<
/View
>
);
);
};
const
styles
=
StyleSheet
.
create
({
headerContainer
:
{
paddingVertical
:
10
,
backgroundColor
:
'white'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
paddingHorizontal
:
10
,
},
itemFillter
:
{
borderRadius
:
10
,
paddingVertical
:
5
,
paddingHorizontal
:
10
,
borderWidth
:
1
,
borderColor
:
'#929292'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
marginRight
:
10
,
},
txtFillter
:
{
fontSize
:
getFontXD
(
36
),
color
:
'#929292'
,
fontWeight
:
'bold'
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
46
),
fontWeight
:
'bold'
,
},
headerContainer
:
{
paddingVertical
:
10
,
backgroundColor
:
'white'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
paddingHorizontal
:
10
,
},
itemFillter
:
{
borderRadius
:
10
,
paddingVertical
:
5
,
paddingHorizontal
:
10
,
borderWidth
:
1
,
borderColor
:
'#929292'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
marginRight
:
10
,
},
txtFillter
:
{
fontSize
:
getFontXD
(
36
),
color
:
'#929292'
,
fontWeight
:
'bold'
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
46
),
fontWeight
:
'bold'
,
},
});
export
default
NotificaitonView
;
src/apis/url.js
View file @
bca4af05
...
...
@@ -40,5 +40,5 @@ export default {
urlGetNewestVersionInfo
:
root
+
'api/v1/settings/version'
,
//Transaction
urlGetTransactionListByCategory
:
`
${
root
}
api/v1/transactions/pr
ice-table
`
,
urlGetTransactionListByCategory
:
`
${
root
}
api/v1/transactions/pr
oducts
`
,
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment