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
bd1a3c70
Commit
bd1a3c70
authored
May 28, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug language
parent
0f249e58
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
47 deletions
+119
-47
build.gradle
android/app/build.gradle
+2
-2
project.pbxproj
ios/Invest.xcodeproj/project.pbxproj
+4
-4
WalletWithdraw.js
src/Screens/Action/Wallet/WalletWithdraw.js
+13
-3
ConvertUnit.js
src/Screens/Tool/ConvertUnit.js
+17
-9
ExchangeRate.js
src/Screens/Tool/ExchangeRate.js
+7
-1
index.js
src/Screens/VersionChecker/index.js
+76
-28
No files found.
android/app/build.gradle
View file @
bd1a3c70
...
...
@@ -132,8 +132,8 @@ android {
applicationId
"com.dcv.invest"
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
versionCode
2
versionName
"1.
4
"
versionCode
11
versionName
"1.
5
"
vectorDrawables
.
useSupportLibrary
=
true
}
splits
{
...
...
ios/Invest.xcodeproj/project.pbxproj
View file @
bd1a3c70
...
...
@@ -903,7 +903,7 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2
;
CURRENT_PROJECT_VERSION
=
4
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
ENABLE_BITCODE
=
NO
;
GCC_PREPROCESSOR_DEFINITIONS
=
(
...
...
@@ -912,7 +912,7 @@
);
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
2.
0
;
MARKETING_VERSION
=
2.
1
;
OTHER_LDFLAGS
=
(
"$(inherited)"
,
"-ObjC"
,
...
...
@@ -937,11 +937,11 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2
;
CURRENT_PROJECT_VERSION
=
4
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
2.
0
;
MARKETING_VERSION
=
2.
1
;
OTHER_LDFLAGS
=
(
"$(inherited)"
,
"-ObjC"
,
...
...
src/Screens/Action/Wallet/WalletWithdraw.js
View file @
bd1a3c70
...
...
@@ -38,8 +38,13 @@ import {getOTPApi} from '../../../apis/Functions/users';
import
{
OTPWALLET
}
from
'../../../routers/ScreenNames'
;
import
{
showAlert
,
TYPE
}
from
'../../../components/DropdownAlert'
;
var
radio_props
=
[
{
label
:
I18n
.
t
(
'FromWallet'
),
value
:
'WALLET'
},
{
label
:
I18n
.
t
(
'FromCQGAccount'
),
value
:
'INVESTMENT'
},
{
label
:
'Từ ví'
,
value
:
'WALLET'
},
{
label
:
'Từ tài khoản CQG'
,
value
:
'INVESTMENT'
},
];
var
radio_propsEN
=
[
{
label
:
'From wallet'
,
value
:
'WALLET'
},
{
label
:
'From CQG Account'
,
value
:
'INVESTMENT'
},
];
const
{
width
}
=
Dimensions
.
get
(
'window'
);
...
...
@@ -161,7 +166,11 @@ const WalletWithdraw = (props) => {
<
/Text
>
{
/* <View style={styles.row}> */
}
<
RadioForm
radio_props
=
{
radio_props
}
radio_props
=
{
props
.
language
.
language
==
'vi'
?
radio_props
:
radio_propsEN
}
labelStyle
=
{{
fontSize
:
getFontXD
(
42
)}}
formHorizontal
=
{
true
}
style
=
{
styles
.
row
}
...
...
@@ -273,6 +282,7 @@ const styles = StyleSheet.create({
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
language
:
state
.
languageReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
...
...
src/Screens/Tool/ConvertUnit.js
View file @
bd1a3c70
...
...
@@ -5,14 +5,19 @@ import HeaderBack from '../../components/Header/HeaderBack';
import
PickerItem
from
'../../components/Picker/PickerItem'
;
import
I18n
from
'../../helper/i18/i18n'
;
import
AppText
from
'../../components/AppText'
;
import
{
floatToPriceVnd
,
getFontXD
,
HEIGHTXD
,
toPriceVnd
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
floatToPriceVnd
,
getFontXD
,
HEIGHTXD
,
toPriceVnd
,
WIDTHXD
,
}
from
'../../Config/Functions'
;
import
R
from
'../../assets/R'
;
import
{
getUnitList
}
from
'../../apis/Functions/Transaction'
;
import
{
showAlert
,
TYPE
}
from
'../../components/DropdownAlert'
;
import
{
hideLoading
,
showLoading
}
from
'../../actions/loadingAction'
;
import
{
connect
}
from
'react-redux'
;
const
ConvertUnit
=
(
props
)
=>
{
const
[
fromUnitList
,
setFromUnitList
]
=
useState
([]);
const
[
toUnitList
,
setToUnitList
]
=
useState
([]);
...
...
@@ -41,7 +46,7 @@ const ConvertUnit = (props) => {
if
(
res
.
status
==
200
&&
res
.
data
.
code
==
200
)
{
setFromUnitList
(
res
.
data
.
data
);
setFromUnit
(
res
.
data
.
data
[
0
]);
onChangeFromUnit
(
''
,
res
.
data
.
data
[
0
])
onChangeFromUnit
(
''
,
res
.
data
.
data
[
0
]);
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
I18n
.
t
(
'Can_not_get_data'
));
}
...
...
@@ -51,7 +56,6 @@ const ConvertUnit = (props) => {
const
onChangeNumber
=
(
string
)
=>
{
let
number
=
string
.
toString
().
split
(
','
).
join
(
''
);
setNumber
(
number
);
};
const
onChangeFromUnit
=
(
value
,
item
)
=>
{
...
...
@@ -76,17 +80,21 @@ const ConvertUnit = (props) => {
const
calcultorResult
=
()
=>
{
if
(
number
&&
number
!=
''
&&
parseFloat
(
number
)
>
0
)
{
let
result
=
parseFloat
(
number
)
*
toUnit
.
rate
;
setResult
(
`
${
floatToPriceVnd
(
number
.
toString
())}
${
fromUnit
.
name
}
=
${
floatToPriceVnd
(
result
.
toString
())}
${
toUnit
.
name
}
`
);
setResult
(
`
${
floatToPriceVnd
(
number
.
toString
())}
${
fromUnit
.
name
}
=
${
floatToPriceVnd
(
result
.
toString
())}
${
toUnit
.
name
}
`
,
);
}
else
{
setResult
(
''
)
setResult
(
''
);
}
};
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'ConvertUnit'
}
/
>
<
HeaderBack
title
=
{
'ConvertUnit'
}
/
>
<
View
style
=
{{
flex
:
1
,
paddingTop
:
20
,
paddingHorizontal
:
20
}}
>
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Count'
}
/
>
<
AppText
style
=
{
styles
.
txtTitle
}
i18nKey
=
{
'Count'
}
/
>
<
View
style
=
{
styles
.
Item
}
>
<
View
style
=
{
styles
.
wrap
}
>
<
TextInput
...
...
@@ -184,6 +192,7 @@ const styles = StyleSheet.create({
shadowOpacity
:
0.2
,
shadowRadius
:
1.41
,
elevation
:
2
,
color
:
R
.
colors
.
black
,
},
wrap
:
{
flexDirection
:
'row'
,
...
...
@@ -213,4 +222,3 @@ export default connect(mapStateToProps, {
showLoading
,
hideLoading
,
})(
ConvertUnit
);
src/Screens/Tool/ExchangeRate.js
View file @
bd1a3c70
...
...
@@ -56,6 +56,11 @@ const ExchangeRate = (props) => {
}
else
if
(
!
priceExchange
)
setUsdTan
(
''
);
};
const
onClick
=
()
=>
{
setPriceExchange
(
''
);
setUsdTan
(
''
);
};
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'ExchangeRate'
}
/
>
...
...
@@ -76,6 +81,7 @@ const ExchangeRate = (props) => {
<
TextField
isNumber
=
{
true
}
maxLength
=
{
12
}
value
=
{
priceExchange
}
onChangeText
=
{(
val
)
=>
setPriceExchange
(
val
)}
title
=
{
I18n
.
t
(
'ConversionPrice'
)}
/
>
...
...
@@ -85,7 +91,7 @@ const ExchangeRate = (props) => {
title
=
{
I18n
.
t
(
'ConvertUSD'
)}
/
>
<
View
style
=
{
styles
.
footer
}
>
<
TouchableOpacity
style
=
{
styles
.
btnContainer
}
>
<
TouchableOpacity
onPress
=
{
onClick
}
style
=
{
styles
.
btnContainer
}
>
<
AppText
style
=
{
styles
.
txtBtn
}
i18nKey
=
{
'Delete'
}
/
>
<
/TouchableOpacity
>
<
/View
>
...
...
src/Screens/VersionChecker/index.js
View file @
bd1a3c70
...
...
@@ -7,14 +7,22 @@ import {
StyleSheet
,
Image
,
TouchableWithoutFeedback
,
Linking
,
Platform
,
Linking
,
Platform
,
}
from
'react-native'
;
import
R
from
'../../assets/R'
;
import
{
getFontXD
,
getHeight
,
getWidth
,
HEIGHTXD
,
WIDTHXD
}
from
'../../Config/Functions'
;
import
{
getFontXD
,
getHeight
,
getWidth
,
HEIGHTXD
,
WIDTHXD
,
}
from
'../../Config/Functions'
;
import
I18n
from
'../../helper/i18/i18n'
;
import
DeviceInfo
from
'react-native-device-info'
;
import
{
getNewestVersionInfo
}
from
'../../apis/Functions/users'
;
import
InAppUpdate
from
'../../helper/InAppUpdate'
;
import
{
connect
}
from
'react-redux'
;
const
VersionChecker
=
(
props
)
=>
{
const
[
visible
,
setVisible
]
=
useState
(
false
);
...
...
@@ -31,10 +39,15 @@ const VersionChecker = (props) => {
});
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
console
.
log
(
res
);
if
(
res
.
data
.
data
[
0
].
version_name
!==
verCurrent
||
res
.
data
.
data
[
0
].
build
.
toString
()
!==
DeviceInfo
.
getBuildNumber
)
{
if
(
res
.
data
.
data
[
0
].
version_name
!==
verCurrent
||
res
.
data
.
data
[
0
].
build
.
toString
()
!==
DeviceInfo
.
getBuildNumber
)
{
setVersion
(
res
.
data
.
data
[
0
].
version_name
);
setVisible
(
true
);
setIsForceUpdate
(
res
.
data
.
data
[
0
].
is_require_update
==
0
?
false
:
true
);
setIsForceUpdate
(
res
.
data
.
data
[
0
].
is_require_update
==
0
?
false
:
true
,
);
}
}
};
...
...
@@ -44,7 +57,7 @@ const VersionChecker = (props) => {
setIsForceUpdate
(
isForceUpdate
);
};
const
_renderDivider
=
()
=>
<
View
style
=
{
styles
.
dividerStyle
}
/>
;
const
_renderDivider
=
()
=>
<
View
style
=
{
styles
.
dividerStyle
}
/>
;
const
onOutsidePressed
=
()
=>
{
setVisible
(
false
);
...
...
@@ -53,17 +66,20 @@ const VersionChecker = (props) => {
const
onUpdatePressed
=
async
()
=>
{
try
{
if
(
Platform
.
OS
===
'ios'
)
{
Linking
.
openURL
(
'itms-apps://itunes.apple.com/us/app/dcv-invest/id1556621903?l=id'
);
Linking
.
openURL
(
'itms-apps://itunes.apple.com/us/app/dcv-invest/id1556621903?l=id'
,
);
}
else
{
// try {
// InAppUpdate.checkUpdate()
// } catch(e) {
// console.log(e)
// }
Linking
.
openURL
(
'https://play.google.com/store/apps/details?id=com.dcv.invest'
);
}
}
catch
(
error
)
{
Linking
.
openURL
(
'https://play.google.com/store/apps/details?id=com.dcv.invest'
,
);
}
}
catch
(
error
)
{}
};
const
onRequestClose
=
()
=>
null
;
...
...
@@ -97,50 +113,76 @@ const VersionChecker = (props) => {
transparent
animationType
=
"fade"
style
=
{{
position
:
'absolute'
}}
visible
=
{
visible
}
>
visible
=
{
visible
}
>
{
renderBackdrop
()}
<
View
pointerEvents
=
"box-none"
style
=
{
styles
.
containerStyle
}
>
<
View
style
=
{
styles
.
imageUpgradeContainer
}
zIndex
=
{
100
}
>
<
Image
source
=
{
R
.
images
.
iconUpgrade
}
style
=
{[
styles
.
imageUpgradeStyle
,
{
tintColor
:
R
.
colors
.
main
}]}
/
>
style
=
{[
styles
.
imageUpgradeStyle
,
{
tintColor
:
R
.
colors
.
main
}]}
/
>
<
/View
>
<
View
style
=
{
styles
.
contentContainerStyle
}
>
<
Text
style
=
{
styles
.
titleStyle
}
>
{
I18n
.
t
(
'Update'
)}
<
/Text
>
<
Text
style
=
{
styles
.
titleStyle
}
>
{
props
.
language
.
language
==
'vi'
?
'Cập nhật'
:
'Update'
}
<
/Text
>
<
Text
style
=
{
styles
.
versionLabelStyle
}
>
{
I18n
.
t
(
'Version'
)}
{
': '
}
{
version
}
<
/Text
>
<
Text
style
=
{
styles
.
descStyle
}
>
{
I18n
.
t
(
'UpdateDescription'
)}
<
/Text
>
<
Text
style
=
{
styles
.
descStyle
}
>
{
' '
}
{
props
.
language
.
language
==
'vi'
?
'Đã có phiên bản DCVInvest mới. Cập nhật ngay để tiếp tục sử dụng và trải nghiệm những tính năng mới nhất của hệ thống!'
:
'A new version of DCVInvest is available. Update now to continue using and experiencing the latest system features!'
}
<
/Text
>
{
_renderDivider
()}
{
isForceUpdate
?
<
TouchableOpacity
onPress
=
{()
=>
onUpdatePressed
()}
style
=
{
styles
.
notNowContainerStyle
}
>
<
Text
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
main
}]}
>
{
I18n
.
t
(
'Update'
)}
<
/Text
>
{
isForceUpdate
?
(
<
TouchableOpacity
onPress
=
{()
=>
onUpdatePressed
()}
style
=
{
styles
.
notNowContainerStyle
}
>
<
Text
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
main
}]}
>
{
props
.
language
.
language
==
'vi'
?
'Cập nhật'
:
'Update'
}
<
/Text
>
<
/TouchableOpacity
>
:
<
View
style
=
{[
styles
.
notNowContainerStyle
,
{
)
:
(
<
View
style
=
{[
styles
.
notNowContainerStyle
,
{
flexDirection
:
'row'
,
marginHorizontal
:
WIDTHXD
(
100
),
}]}
>
<
TouchableOpacity
onPress
=
{()
=>
cancelUpdate
()}
style
=
{[
styles
.
btnButton
,
{
paddingRight
:
WIDTHXD
(
60
)
}]}
>
},
]}
>
<
TouchableOpacity
onPress
=
{()
=>
cancelUpdate
()}
style
=
{[
styles
.
btnButton
,
{
paddingRight
:
WIDTHXD
(
60
)}]}
>
<
Text
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
color777
,
textAlign
:
'right'
}]}
>
{
I18n
.
t
(
'Cancel'
)}
<
/Text
>
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
color777
,
textAlign
:
'right'
},
]}
>
{
props
.
language
.
language
==
'vi'
?
'Bỏ qua'
:
'Cancel'
}
<
/Text
>
<
/TouchableOpacity
>
<
View
style
=
{
styles
.
dividerStyleVertical
}
><
/View
>
<
TouchableOpacity
onPress
=
{()
=>
onUpdatePressed
()}
<
TouchableOpacity
onPress
=
{()
=>
onUpdatePressed
()}
style
=
{[
styles
.
btnButton
,
{
paddingLeft
:
WIDTHXD
(
60
)}]}
>
<
Text
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
main
,
textAlign
:
'left'
}]}
>
{
I18n
.
t
(
'Update'
)}
<
/Text
>
style
=
{[
styles
.
textNotNowStyle
,
{
color
:
R
.
colors
.
main
,
textAlign
:
'left'
},
]}
>
{
I18n
.
t
(
'Update'
)}
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
}
)
}
<
/View
>
<
/View
>
<
/Modal
>
...
...
@@ -245,4 +287,10 @@ const styles = StyleSheet.create({
},
});
export
default
VersionChecker
;
const
mapStateToProps
=
(
state
)
=>
{
return
{
language
:
state
.
languageReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{})(
VersionChecker
);
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