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
fccd145b
Commit
fccd145b
authored
May 17, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connect api product
parent
76a6e782
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
4 deletions
+54
-4
CaculatedStopLoss.js
src/Screens/Tool/CaculatedStopLoss.js
+27
-2
ExchangeRate.js
src/Screens/Tool/ExchangeRate.js
+27
-2
No files found.
src/Screens/Tool/CaculatedStopLoss.js
View file @
fccd145b
import
React
,
{
Component
,
useState
}
from
'react'
;
import
React
,
{
Component
,
use
Effect
,
use
State
}
from
'react'
;
import
{
import
{
View
,
View
,
Text
,
Text
,
...
@@ -24,6 +24,9 @@ import RadioForm, {
...
@@ -24,6 +24,9 @@ import RadioForm, {
RadioButtonLabel
,
RadioButtonLabel
,
}
from
'react-native-simple-radio-button'
;
}
from
'react-native-simple-radio-button'
;
import
{
showAlert
,
TYPE
}
from
'../../components/DropdownAlert'
;
import
{
getTransactionListByCategory
}
from
'../../apis/Functions/Transaction'
;
var
radio_props
=
[
var
radio_props
=
[
{
label
:
'Mua'
,
value
:
'BUY'
},
{
label
:
'Mua'
,
value
:
'BUY'
},
{
label
:
'Bán'
,
value
:
'SALE'
},
{
label
:
'Bán'
,
value
:
'SALE'
},
...
@@ -43,6 +46,8 @@ const dataType = [
...
@@ -43,6 +46,8 @@ const dataType = [
const
{
width
}
=
Dimensions
.
get
(
'window'
);
const
{
width
}
=
Dimensions
.
get
(
'window'
);
const
CaculatedStopLoss
=
(
props
)
=>
{
const
CaculatedStopLoss
=
(
props
)
=>
{
const
[
dataProduct
,
setDataProduct
]
=
useState
([]);
const
[
product
,
setProduct
]
=
useState
();
const
[
product
,
setProduct
]
=
useState
();
const
[
type
,
setType
]
=
useState
(
'BUY'
);
const
[
type
,
setType
]
=
useState
(
'BUY'
);
const
[
lot
,
setLot
]
=
useState
(
0
);
const
[
lot
,
setLot
]
=
useState
(
0
);
...
@@ -58,6 +63,26 @@ const CaculatedStopLoss = (props) => {
...
@@ -58,6 +63,26 @@ const CaculatedStopLoss = (props) => {
console
.
log
(
'hello'
);
console
.
log
(
'hello'
);
};
};
useEffect
(()
=>
{
getProductData
();
},
[]);
const
getProductData
=
async
()
=>
{
const
res
=
await
getTransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
1000
,
page_index
:
1
,
type
:
'PRICE_TABLE'
,
category_id
:
-
1
,
});
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
setDataProduct
(
res
.
data
.
data
);
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
,
I18n
.
t
(
'Can_not_get_data'
)));
}
};
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'CaculatedStopLoss'
}
/
>
<
HeaderBack
title
=
{
'CaculatedStopLoss'
}
/
>
...
@@ -71,7 +96,7 @@ const CaculatedStopLoss = (props) => {
...
@@ -71,7 +96,7 @@ const CaculatedStopLoss = (props) => {
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Product'
}
/
>
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Product'
}
/
>
<
PickerItem
<
PickerItem
width
=
{
width
-
20
}
width
=
{
width
-
20
}
data
=
{
data
Type
}
data
=
{
data
Product
}
onValueChange
=
{(
value
,
items
)
=>
{
onValueChange
=
{(
value
,
items
)
=>
{
setProduct
(
items
);
setProduct
(
items
);
}}
}}
...
...
src/Screens/Tool/ExchangeRate.js
View file @
fccd145b
import
React
,
{
Component
,
useState
}
from
'react'
;
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
{
import
{
View
,
View
,
Text
,
Text
,
...
@@ -15,6 +15,8 @@ import AppText from '../../components/AppText';
...
@@ -15,6 +15,8 @@ import AppText from '../../components/AppText';
import
TextField
from
'../../components/Input/TextField'
;
import
TextField
from
'../../components/Input/TextField'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
R
from
'../../assets/R'
;
import
R
from
'../../assets/R'
;
import
{
showAlert
,
TYPE
}
from
'../../components/DropdownAlert'
;
import
{
getTransactionListByCategory
}
from
'../../apis/Functions/Transaction'
;
const
dataType
=
[
const
dataType
=
[
{
{
...
@@ -28,7 +30,30 @@ const dataType = [
...
@@ -28,7 +30,30 @@ const dataType = [
];
];
const
ExchangeRate
=
(
props
)
=>
{
const
ExchangeRate
=
(
props
)
=>
{
const
[
dataProduct
,
setDataProduct
]
=
useState
([]);
const
[
product
,
setProduct
]
=
useState
();
const
[
product
,
setProduct
]
=
useState
();
useEffect
(()
=>
{
getProductData
();
},
[]);
const
getProductData
=
async
()
=>
{
const
res
=
await
getTransactionListByCategory
({
keyword
:
''
,
platform
:
Platform
.
OS
,
page_size
:
1000
,
page_index
:
1
,
type
:
'PRICE_TABLE'
,
category_id
:
-
1
,
});
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
setDataProduct
(
res
.
data
.
data
);
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
,
I18n
.
t
(
'Can_not_get_data'
)));
}
};
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'ConvertUnit'
}
/
>
<
HeaderBack
title
=
{
'ConvertUnit'
}
/
>
...
@@ -36,7 +61,7 @@ const ExchangeRate = (props) => {
...
@@ -36,7 +61,7 @@ const ExchangeRate = (props) => {
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Product'
}
/
>
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Product'
}
/
>
<
PickerItem
<
PickerItem
width
=
{
width
-
20
}
width
=
{
width
-
20
}
data
=
{
data
Type
}
data
=
{
data
Product
}
onValueChange
=
{(
value
,
items
)
=>
{
onValueChange
=
{(
value
,
items
)
=>
{
setProduct
(
items
);
setProduct
(
items
);
}}
}}
...
...
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