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
ff6fbf64
Commit
ff6fbf64
authored
May 19, 2021
by
Nguyễn Thị Thúy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrate convert unit api
parent
ff0a6cfa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
7 deletions
+25
-7
RootView.js
src/RootView.js
+12
-2
CaculatedStopLoss.js
src/Screens/Tool/CaculatedStopLoss.js
+1
-1
CalculatorProfitLoss.js
...Screens/Tool/CalculatorProfitLoss/CalculatorProfitLoss.js
+1
-1
CalculatorProfitLossView.js
...ens/Tool/CalculatorProfitLoss/CalculatorProfitLossView.js
+1
-1
ConvertUnit.js
src/Screens/Tool/ConvertUnit.js
+0
-0
ExchangeRate.js
src/Screens/Tool/ExchangeRate.js
+1
-1
Transaction.js
src/apis/Functions/Transaction.js
+5
-0
url.js
src/apis/url.js
+2
-0
TabNavigation.js
src/routers/TabNavigation.js
+2
-1
No files found.
src/RootView.js
View file @
ff6fbf64
...
@@ -14,6 +14,11 @@ import DeviceInfo from 'react-native-device-info';
...
@@ -14,6 +14,11 @@ import DeviceInfo from 'react-native-device-info';
import
R
from
'./assets/R'
;
import
R
from
'./assets/R'
;
import
{
WIDTHXD
,
HEIGHTXD
}
from
'./Config/Functions'
;
import
{
WIDTHXD
,
HEIGHTXD
}
from
'./Config/Functions'
;
import
DropdownManager
from
'./components/DropdownAlert/DropdownManager'
;
import
DropdownManager
from
'./components/DropdownAlert/DropdownManager'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
KEY
from
'./assets/AsynStorage'
;
import
I18n
,
{
setLocation
}
from
'./helper/i18/i18n'
;
import
{
changeLanguage
}
from
'./actions/language'
;
enableScreens
();
enableScreens
();
...
@@ -23,11 +28,16 @@ const RootView = (props) => {
...
@@ -23,11 +28,16 @@ const RootView = (props) => {
dropDownAlertRef
.
current
,
dropDownAlertRef
.
current
,
dropDownAlertLongTimeRef
.
current
,
dropDownAlertLongTimeRef
.
current
,
);
);
setInitLanguage
()
},
[]);
},
[]);
const
dropDownAlertRef
=
useRef
(
null
);
const
dropDownAlertRef
=
useRef
(
null
);
const
dropDownAlertLongTimeRef
=
useRef
(
null
);
const
dropDownAlertLongTimeRef
=
useRef
(
null
);
const
setInitLanguage
=
async
()
=>
{
const
laguage
=
await
AsyncStorage
.
getItem
(
KEY
.
LANGUAGE
);
if
(
laguage
)
props
.
changeLanguage
(
laguage
);
setLocation
(
I18n
,
laguage
);
};
return
(
return
(
<>
<>
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
...
@@ -85,4 +95,4 @@ const mapStateToProps = (state) => {
...
@@ -85,4 +95,4 @@ const mapStateToProps = (state) => {
};
};
};
};
export
default
connect
(
mapStateToProps
,
{})(
RootView
);
export
default
connect
(
mapStateToProps
,
{
changeLanguage
})(
RootView
);
src/Screens/Tool/CaculatedStopLoss.js
View file @
ff6fbf64
...
@@ -79,7 +79,7 @@ const CaculatedStopLoss = (props) => {
...
@@ -79,7 +79,7 @@ const CaculatedStopLoss = (props) => {
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
setDataProduct
(
res
.
data
.
data
);
setDataProduct
(
res
.
data
.
data
);
}
else
{
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
,
I18n
.
t
(
'Can_not_get_data'
)
));
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
I18n
.
t
(
'Can_not_get_data'
));
}
}
};
};
...
...
src/Screens/Tool/CalculatorProfitLoss/CalculatorProfitLoss.js
View file @
ff6fbf64
...
@@ -67,7 +67,7 @@ const CalculatorProfitLoss = (props) => {
...
@@ -67,7 +67,7 @@ const CalculatorProfitLoss = (props) => {
});
});
props
.
hideLoading
();
props
.
hideLoading
();
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
const
newList
=
[
res
.
data
.
data
].
concat
(
dataCalculator
);
const
newList
=
[
res
.
data
.
data
].
concat
(
[...
dataCalculator
]
);
setDataCalculator
(
newList
);
setDataCalculator
(
newList
);
setLotTransactionNumber
(
null
);
setLotTransactionNumber
(
null
);
setOpenPrice
(
null
);
setOpenPrice
(
null
);
...
...
src/Screens/Tool/CalculatorProfitLoss/CalculatorProfitLossView.js
View file @
ff6fbf64
...
@@ -112,7 +112,7 @@ const CalculatorProfitLossView = (props) => {
...
@@ -112,7 +112,7 @@ const CalculatorProfitLossView = (props) => {
<
/View
>
<
/View
>
<
FlatList
<
FlatList
style
=
{{
paddingBottom
:
HEIGHTXD
(
15
),
backgroundColor
:
R
.
colors
.
white
}}
style
=
{{
paddingBottom
:
HEIGHTXD
(
15
),
backgroundColor
:
R
.
colors
.
white
}}
keyExtractor
=
{(
item
)
=>
item
.
id
}
keyExtractor
=
{(
item
)
=>
item
}
data
=
{
props
.
dataCalculator
}
data
=
{
props
.
dataCalculator
}
renderItem
=
{({
item
,
index
})
=>
(
renderItem
=
{({
item
,
index
})
=>
(
<
ItemCalculator
<
ItemCalculator
...
...
src/Screens/Tool/ConvertUnit.js
View file @
ff6fbf64
This diff is collapsed.
Click to expand it.
src/Screens/Tool/ExchangeRate.js
View file @
ff6fbf64
...
@@ -41,7 +41,7 @@ const ExchangeRate = (props) => {
...
@@ -41,7 +41,7 @@ const ExchangeRate = (props) => {
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
setDataProduct
(
res
.
data
.
data
);
setDataProduct
(
res
.
data
.
data
);
}
else
{
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
,
I18n
.
t
(
'Can_not_get_data'
)
));
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
I18n
.
t
(
'Can_not_get_data'
));
}
}
};
};
...
...
src/apis/Functions/Transaction.js
View file @
ff6fbf64
...
@@ -26,3 +26,8 @@ export const getListExchangeRate = async (body) =>
...
@@ -26,3 +26,8 @@ export const getListExchangeRate = async (body) =>
GetData
(
url
.
urlGetListExchangeRate
,
body
)
GetData
(
url
.
urlGetListExchangeRate
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
.
catch
((
err
)
=>
err
);
export
const
getUnitList
=
async
(
body
)
=>
GetData
(
url
.
urlGetUnitList
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
ff6fbf64
...
@@ -57,4 +57,6 @@ export default {
...
@@ -57,4 +57,6 @@ export default {
urlProfitLost
:
root
+
'api/v1/customers/calculate-profit'
,
urlProfitLost
:
root
+
'api/v1/customers/calculate-profit'
,
urlGetListExchangeRate
:
root
+
'api/v1/customers/get-list-exchange-rate'
,
urlGetListExchangeRate
:
root
+
'api/v1/customers/get-list-exchange-rate'
,
urlGetUnitList
:
`
${
root
}
api/v1/customers/get-list-unit`
,
};
};
src/routers/TabNavigation.js
View file @
ff6fbf64
...
@@ -18,7 +18,7 @@ import Test from '../Screens/NewFeed/Test';
...
@@ -18,7 +18,7 @@ import Test from '../Screens/NewFeed/Test';
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
Transaction
from
'../Screens/Transaction/Transaction'
;
import
Transaction
from
'../Screens/Transaction/Transaction'
;
import
{
AccountVerification
,
PACKETCQG
}
from
'../routers/ScreenNames'
;
import
{
AccountVerification
,
PACKETCQG
}
from
'../routers/ScreenNames'
;
import
I18n
from
'../helper/i18/i18n'
;
import
I18n
,
{
setLocation
}
from
'../helper/i18/i18n'
;
import
{
changeLanguage
}
from
'../actions/language'
;
import
{
changeLanguage
}
from
'../actions/language'
;
import
KEY
from
'../assets/AsynStorage'
;
import
KEY
from
'../assets/AsynStorage'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
...
@@ -77,6 +77,7 @@ const TabNavigator = (props) => {
...
@@ -77,6 +77,7 @@ const TabNavigator = (props) => {
const
setInitLanguage
=
async
()
=>
{
const
setInitLanguage
=
async
()
=>
{
const
laguage
=
await
AsyncStorage
.
getItem
(
KEY
.
LANGUAGE
);
const
laguage
=
await
AsyncStorage
.
getItem
(
KEY
.
LANGUAGE
);
if
(
laguage
)
props
.
changeLanguage
(
laguage
);
if
(
laguage
)
props
.
changeLanguage
(
laguage
);
setLocation
(
I18n
,
laguage
);
};
};
const
showPopUp
=
()
=>
{
const
showPopUp
=
()
=>
{
...
...
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