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
ff0a6cfa
Commit
ff0a6cfa
authored
May 18, 2021
by
Nguyễn Thị Thúy
Browse files
Options
Browse Files
Download
Plain Diff
merge dev phase2
parents
151a84a2
1a31e058
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
125 additions
and
86 deletions
+125
-86
PacketCQG.js
src/Screens/Account/PacrtCQG/PacketCQG.js
+2
-0
CQG.js
src/Screens/Menu/Profile/Tab/CQG.js
+39
-2
ItemCalculator.js
src/Screens/Tool/CalculatorProfitLoss/ItemCalculator.js
+6
-2
ConvertUnit.js
src/Screens/Tool/ConvertUnit.js
+27
-18
ExchangeRate.js
src/Screens/Tool/ExchangeRate.js
+37
-63
Transaction.js
src/apis/Functions/Transaction.js
+5
-0
url.js
src/apis/url.js
+2
-0
en.js
src/helper/i18/locales/en.js
+3
-0
vn.js
src/helper/i18/locales/vn.js
+4
-1
No files found.
src/Screens/Account/PacrtCQG/PacketCQG.js
View file @
ff0a6cfa
...
...
@@ -56,6 +56,7 @@ const PacketCQG = (props) => {
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
props
.
saveUserToRedux
(
res
.
data
.
data
);
navigate
.
goBack
();
showAlert
(
TYPE
.
SUCCESS
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
...
...
@@ -116,6 +117,7 @@ const PacketCQG = (props) => {
};
const
getData
=
async
()
=>
{
const
res
=
await
getListPacketCQG
({});
console
.
log
(
res
.
data
.
data
.
fee
.
data
);
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setListData
(
res
.
data
.
data
.
fee
.
data
);
...
...
src/Screens/Menu/Profile/Tab/CQG.js
View file @
ff0a6cfa
import
React
from
'react'
;
import
{
View
,
Text
,
TouchableOpacity
,
Image
,
StyleSheet
}
from
'react-native'
;
import
R
from
'../../../../assets/R'
;
import
{
getFontXD
}
from
'../../../../Config/Functions'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../../../Config/Functions'
;
import
{
connect
}
from
'react-redux'
;
import
AppText
from
'../../../../components/AppText'
;
import
I18n
from
'../../../../helper/i18/i18n'
;
...
...
@@ -9,6 +9,9 @@ import {useNavigation} from '@react-navigation/native';
import
{
PACKETCQG
}
from
'../../../../routers/ScreenNames'
;
const
Profile
=
(
props
)
=>
{
const
onClickCLose
=
()
=>
{
console
.
log
(
'Close click'
);
};
const
navigation
=
useNavigation
();
return
(
<
View
style
=
{
styles
.
container
}
>
...
...
@@ -30,6 +33,23 @@ const Profile = (props) => {
style
=
{
styles
.
txtTitle
}
><
/AppText
>
<
Text
style
=
{
styles
.
txtBig
}
>
{
props
.
user
.
cqg_account
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
,
marginTop
:
50
,
}}
>
<
TouchableOpacity
onPress
=
{()
=>
navigation
.
navigate
(
PACKETCQG
)}
style
=
{
styles
.
btnLeft
}
>
<
AppText
i18nKey
=
{
'UpdatePacket'
}
style
=
{
styles
.
txtBtn
}
><
/AppText
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{
onClickCLose
}
style
=
{
styles
.
btnRight
}
>
<
AppText
i18nKey
=
{
'CloseAccount'
}
style
=
{
styles
.
txtBtn
}
><
/AppText
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
...
...
@@ -91,8 +111,9 @@ const styles = StyleSheet.create({
fontSize
:
getFontXD
(
46
),
},
txtBtn
:
{
fontSize
:
getFontXD
(
5
2
),
fontSize
:
getFontXD
(
4
2
),
color
:
R
.
colors
.
white
,
fontWeight
:
'600'
,
},
containerBtn
:
{
paddingVertical
:
10
,
...
...
@@ -101,6 +122,22 @@ const styles = StyleSheet.create({
borderRadius
:
5
,
marginTop
:
30
,
},
btnLeft
:
{
backgroundColor
:
R
.
colors
.
main
,
width
:
WIDTHXD
(
460
),
alignItems
:
'center'
,
justifyContent
:
'center'
,
height
:
HEIGHTXD
(
109
),
borderRadius
:
5
,
},
btnRight
:
{
backgroundColor
:
'#E3434F'
,
width
:
WIDTHXD
(
460
),
alignItems
:
'center'
,
justifyContent
:
'center'
,
height
:
HEIGHTXD
(
109
),
borderRadius
:
5
,
},
});
const
mapStateToProps
=
(
state
)
=>
{
...
...
src/Screens/Tool/CalculatorProfitLoss/ItemCalculator.js
View file @
ff0a6cfa
...
...
@@ -88,11 +88,15 @@ const ItemCalculator = (props) => {
/
>
<
TextField
title
=
{
`
${
I18n
.
t
(
'ProfitLoss'
)}
(USD)`
}
content
=
{
toPriceVnd
(
props
.
item
.
profit
.
USD
)}
content
=
{
props
.
item
.
profit
.
USD
?
toPriceVnd
(
props
.
item
.
profit
.
USD
)
:
'0'
}
/
>
<
TextField
title
=
{
`
${
I18n
.
t
(
'ProfitLoss'
)}
(VNĐ)`
}
content
=
{
toPriceVnd
(
props
.
item
.
profit
.
VND
)}
content
=
{
props
.
item
.
profit
.
VND
?
toPriceVnd
(
props
.
item
.
profit
.
VND
)
:
'0'
}
/
>
<
/View
>
)
:
null
}
...
...
src/Screens/Tool/ConvertUnit.js
View file @
ff0a6cfa
...
...
@@ -14,6 +14,7 @@ import AppText from '../../components/AppText';
import
TextField
from
'../../components/Input/TextField'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
R
from
'../../assets/R'
;
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
const
dataType
=
[
{
...
...
@@ -31,6 +32,7 @@ const ConvertUnit = (props) => {
const
[
typeTwo
,
setTypeTwo
]
=
useState
();
const
[
valueOne
,
setValueOne
]
=
useState
();
const
[
valueTwo
,
setValueTwo
]
=
useState
();
const
[
result
,
setResult
]
=
useState
();
const
onClick
=
()
=>
{
console
.
log
(
'Heloo'
,
typeOne
,
typeTwo
,
valueOne
,
valueTwo
);
...
...
@@ -40,43 +42,43 @@ const ConvertUnit = (props) => {
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'ConvertUnit'
}
/
>
<
View
style
=
{{
flex
:
1
,
paddingTop
:
20
,
paddingHorizontal
:
20
}}
>
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Co
nversionUni
t'
}
/
>
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Co
un
t'
}
/
>
<
View
style
=
{
styles
.
Item
}
>
<
View
style
=
{
styles
.
wrap
}
>
<
PickerItem
width
=
{
WIDTHXD
(
431
)}
data
=
{
dataType
}
onValueChange
=
{(
value
,
items
)
=>
{
setTypeOne
(
items
);
}}
/
>
<
TextInput
onChangeText
=
{(
val
)
=>
setValueOne
(
val
)}
keyboardType
=
{
'number-pad'
}
style
=
{
styles
.
wrapInput
}
maxLength
=
{
12
}
/
>
<
/View
>
<
Text
style
=
{
styles
.
txtNote
}
>
1
KG
=
2
Pount
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
Item
}
>
<
View
style
=
{
styles
.
wrap
}
>
<
PickerItem
width
=
{
WIDTHXD
(
4
31
)}
width
=
{
WIDTHXD
(
4
00
)}
data
=
{
dataType
}
onValueChange
=
{(
value
,
items
)
=>
{
setTypeTwo
(
items
);
}}
/
>
<
TextInput
onChangeText
=
{(
val
)
=>
setValueTwo
(
val
)}
keyboardType
=
{
'number-pad'
}
style
=
{
styles
.
wrapInput
}
<
TouchableOpacity
>
<
Icon
name
=
{
'exchange'
}
size
=
{
30
}
color
=
{
R
.
colors
.
black
}
/
>
<
/TouchableOpacity
>
<
PickerItem
width
=
{
WIDTHXD
(
400
)}
data
=
{
dataType
}
onValueChange
=
{(
value
,
items
)
=>
{
setTypeOne
(
items
);
}}
/
>
<
/View
>
<
Text
style
=
{
styles
.
txtNote
}
>
1
Pount
=
0.5
KG
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
txtResult
}
>
K
ế
t
qu
ả
:
{
result
}
<
/Text
>
<
View
style
=
{
styles
.
footer
}
>
<
TouchableOpacity
onPress
=
{
onClick
}
style
=
{
styles
.
btnContainer
}
>
<
AppText
style
=
{
styles
.
txtBtn
}
i18nKey
=
{
'Caculate'
}
/
>
...
...
@@ -91,7 +93,7 @@ const styles = StyleSheet.create({
txtTitle
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
color777
,
marginBottom
:
1
5
,
marginBottom
:
5
,
},
note
:
{
fontSize
:
getFontXD
(
36
),
...
...
@@ -108,7 +110,7 @@ const styles = StyleSheet.create({
footer
:
{
alignItems
:
'center'
,
justifyContent
:
'center'
,
marginTop
:
2
0
,
marginTop
:
4
0
,
},
btnContainer
:
{
width
:
WIDTHXD
(
428
),
...
...
@@ -124,7 +126,7 @@ const styles = StyleSheet.create({
fontWeight
:
'600'
,
},
wrapInput
:
{
width
:
WIDTHXD
(
431
)
,
width
:
'100%'
,
backgroundColor
:
R
.
colors
.
white
,
height
:
HEIGHTXD
(
109
),
fontSize
:
getFontXD
(
42
),
...
...
@@ -152,5 +154,12 @@ const styles = StyleSheet.create({
textAlign
:
'right'
,
marginTop
:
10
,
},
txtResult
:
{
fontSize
:
getFontXD
(
52
),
color
:
R
.
colors
.
black
,
fontWeight
:
'600'
,
textAlign
:
'center'
,
marginTop
:
20
,
},
});
export
default
ConvertUnit
;
src/Screens/Tool/ExchangeRate.js
View file @
ff0a6cfa
...
...
@@ -16,78 +16,42 @@ import TextField from '../../components/Input/TextField';
import
{
getFontXD
,
HEIGHTXD
,
toPriceVnd
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
R
from
'../../assets/R'
;
import
{
showAlert
,
TYPE
}
from
'../../components/DropdownAlert'
;
import
{
getTransactionListByCategory
}
from
'../../apis/Functions/Transaction'
;
const
DATA
=
[
{
id
:
1
,
name
:
'Đậu tương'
,
value
:
0.36744
,
},
{
id
:
2
,
name
:
'Khô đậu tương'
,
value
:
1.1023
,
},
{
id
:
3
,
name
:
'Dầu đậu tương'
,
value
:
22.0462
,
},
{
id
:
4
,
name
:
'Ngô'
,
value
:
0.39368
,
},
{
id
:
5
,
name
:
'Lúa mỳ'
,
value
:
0.36744
,
},
{
id
:
6
,
name
:
'Cà phê arabica'
,
value
:
22.0462
,
},
{
id
:
7
,
name
:
'Cà phê Robusta'
,
value
:
1
,
},
{
id
:
8
,
name
:
'Ca cao'
,
value
:
1
,
},
{
id
:
9
,
name
:
'Bông'
,
value
:
22.0462
,
},
{
id
:
10
,
name
:
'Đường'
,
value
:
22.0462
,
},
{
id
:
11
,
name
:
'Cao su'
,
value
:
9.4
,
},
];
import
{
getListExchangeRate
}
from
'../../apis/Functions/Transaction'
;
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
import
{
connect
}
from
'react-redux'
;
const
ExchangeRate
=
(
props
)
=>
{
const
[
product
,
setProduct
]
=
useState
();
const
[
priceExchange
,
setPriceExchange
]
=
useState
();
const
[
usdTan
,
setUsdTan
]
=
useState
();
const
[
dataProduct
,
setDataProduct
]
=
useState
([]);
useEffect
(()
=>
{
getProductData
();
},
[]);
const
getProductData
=
async
()
=>
{
props
.
showLoading
();
const
res
=
await
getListExchangeRate
({
platform
:
Platform
.
OS
,
page_size
:
1000
,
page_index
:
1
,
});
props
.
hideLoading
();
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'
)));
}
};
useEffect
(()
=>
{
caculator
();
},
[
product
,
priceExchange
]);
const
caculator
=
()
=>
{
if
(
product
&&
priceExchange
)
{
const
total
=
priceExchange
*
product
.
valu
e
;
const
total
=
priceExchange
*
product
.
exchange_rat
e
;
setUsdTan
(
total
+
''
);
}
else
if
(
!
priceExchange
)
setUsdTan
(
''
);
};
...
...
@@ -99,7 +63,7 @@ const ExchangeRate = (props) => {
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Product'
}
/
>
<
PickerItem
width
=
{
width
-
20
}
data
=
{
DATA
}
data
=
{
dataProduct
}
onValueChange
=
{(
value
,
items
)
=>
{
setProduct
(
items
);
}}
...
...
@@ -110,6 +74,8 @@ const ExchangeRate = (props) => {
title
=
{
I18n
.
t
(
'UnitsQuotedFloor'
)}
/
>
<
TextField
isNumber
=
{
true
}
maxLength
=
{
12
}
onChangeText
=
{(
val
)
=>
setPriceExchange
(
val
)}
title
=
{
I18n
.
t
(
'ConversionPrice'
)}
/
>
...
...
@@ -194,4 +160,12 @@ const styles = StyleSheet.create({
marginTop
:
10
,
},
});
export
default
ExchangeRate
;
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
ExchangeRate
,
);
src/apis/Functions/Transaction.js
View file @
ff0a6cfa
...
...
@@ -21,3 +21,8 @@ export const getProfitLost = async (body) =>
PostData
(
url
.
urlProfitLost
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
getListExchangeRate
=
async
(
body
)
=>
GetData
(
url
.
urlGetListExchangeRate
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
ff0a6cfa
...
...
@@ -55,4 +55,6 @@ export default {
urlSendRequest
:
root
+
'api/v1/customers/send-request'
,
urlProfitLost
:
root
+
'api/v1/customers/calculate-profit'
,
urlGetListExchangeRate
:
root
+
'api/v1/customers/get-list-exchange-rate'
,
};
src/helper/i18/locales/en.js
View file @
ff0a6cfa
...
...
@@ -277,4 +277,7 @@ export default {
EnterContractInfo
:
'Enter contract information'
,
EnterFirstEscrow
:
'Enter first escrow'
,
CloseAccount
:
'Close account'
,
UpdatePacket
:
'Update packet'
,
Count
:
'Count'
,
};
src/helper/i18/locales/vn.js
View file @
ff0a6cfa
...
...
@@ -92,7 +92,7 @@ export default {
Photo_library
:
'Thư viện ảnh'
,
Take_photo
:
'Chụp ảnh'
,
EnableCQG
:
'
Có tài khoản CQG
'
,
EnableCQG
:
'
Kích hoạt
'
,
Request_Open_Account_CQG
:
'Yêu cầu mở TK CQG'
,
Waiting_for_Progress
:
'Chờ xử lý'
,
Free
:
'Miễn phí'
,
...
...
@@ -273,4 +273,7 @@ export default {
EnterContractInfo
:
'Nhập thông tin hợp đồng'
,
EnterFirstEscrow
:
'Nhập ký quỹ ban đầu'
,
CloseAccount
:
'Đóng tài khoản'
,
UpdatePacket
:
'Cập nhật gói cước'
,
Count
:
'Số lượng'
,
};
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