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
65a00329
Commit
65a00329
authored
Apr 28, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update api language
parent
92293725
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
338 additions
and
223 deletions
+338
-223
build.gradle
android/app/build.gradle
+2
-2
InvestCustomer2604.apk
android/app/release/InvestCustomer2604.apk
+0
-0
app-release.aab
android/app/release/app-release.aab
+0
-0
output-metadata.json
android/app/release/output-metadata.json
+0
-21
AndroidManifest.xml
android/app/src/main/AndroidManifest.xml
+10
-0
project.pbxproj
ios/Invest.xcodeproj/project.pbxproj
+2
-2
Info.plist
ios/Invest/Info.plist
+13
-0
HistoryView.js
src/Screens/Action/History/HistoryView.js
+1
-1
Item.js
src/Screens/Action/History/Item.js
+1
-4
Item.js
src/Screens/Menu/Payments/Item.js
+56
-41
Payments.js
src/Screens/Menu/Payments/Payments.js
+72
-14
MethodPay.js
src/Screens/MethodPay/MethodPay.js
+7
-2
MethodPayView.js
src/Screens/MethodPay/MethodPayView.js
+0
-1
SelectBankModal.js
src/Screens/MethodPay/SelectBankModal.js
+117
-127
Setting.js
src/Screens/Setting/Setting.js
+38
-2
SettingView.js
src/Screens/Setting/SettingView.js
+4
-1
users.js
src/apis/Functions/users.js
+5
-0
url.js
src/apis/url.js
+2
-0
en.js
src/helper/i18/locales/en.js
+3
-2
vn.js
src/helper/i18/locales/vn.js
+5
-3
No files found.
android/app/build.gradle
View file @
65a00329
...
...
@@ -132,8 +132,8 @@ android {
applicationId
"com.dcv.invest"
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
versionCode
1
versionName
"1.
0
"
versionCode
3
versionName
"1.
3
"
vectorDrawables
.
useSupportLibrary
=
true
}
splits
{
...
...
android/app/release/InvestCustomer2604.apk
deleted
100644 → 0
View file @
92293725
File deleted
android/app/release/app-release.aab
deleted
100644 → 0
View file @
92293725
File deleted
android/app/release/output-metadata.json
deleted
100644 → 0
View file @
92293725
{
"version"
:
1
,
"artifactType"
:
{
"type"
:
"APK"
,
"kind"
:
"Directory"
},
"applicationId"
:
"com.dcv.invest"
,
"variantName"
:
"release"
,
"elements"
:
[
{
"type"
:
"SINGLE"
,
"filters"
:
[],
"properties"
:
[],
"versionCode"
:
1
,
"versionName"
:
"1.0"
,
"enabled"
:
true
,
"outputFile"
:
"app-release.apk"
}
]
}
\ No newline at end of file
android/app/src/main/AndroidManifest.xml
View file @
65a00329
...
...
@@ -40,7 +40,17 @@
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"dcvinvest"
/>
</intent-filter>
</activity>
...
...
ios/Invest.xcodeproj/project.pbxproj
View file @
65a00329
...
...
@@ -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
=
3
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
ENABLE_BITCODE
=
NO
;
GCC_PREPROCESSOR_DEFINITIONS
=
(
...
...
@@ -936,7 +936,7 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2
;
CURRENT_PROJECT_VERSION
=
3
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
...
...
ios/Invest/Info.plist
View file @
65a00329
...
...
@@ -24,6 +24,19 @@
<
string
>
$
(
MARKETING_VERSION
)<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
<
a
rr
a
y
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLName
<
/k
e
y
>
<
string
>
dcv.investcustomer.vn.
linking
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
dcvinvest
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
$
(
CURRENT_PROJECT_VERSION
)<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
...
...
src/Screens/Action/History/HistoryView.js
View file @
65a00329
...
...
@@ -30,7 +30,7 @@ const Fillters = [
},
{
id
:
'4'
,
name
:
'
Withdraw
'
,
name
:
'
Transfer
'
,
value
:
'TRANSFER'
,
},
];
...
...
src/Screens/Action/History/Item.js
View file @
65a00329
...
...
@@ -42,9 +42,7 @@ const Item = (props) => {
style
=
{{
alignItems
:
'flex-start'
,
}}
>
<
Text
style
=
{
styles
.
txtBlack
}
>
{
converType
(
item
.
transection_category
)}
<
/Text
>
<
Text
style
=
{
styles
.
txtBlack
}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
transection_date_timestamp
}
<
/Text
>
<
/View
>
...
...
@@ -100,7 +98,6 @@ const styles = StyleSheet.create({
fontSize
:
getFontXD
(
36
),
color
:
'#C4C4C4'
,
marginTop
:
10
,
fontStyle
:
'italic'
,
},
imgIcon
:
{
width
:
WIDTHXD
(
178
),
...
...
src/Screens/Menu/Payments/Item.js
View file @
65a00329
...
...
@@ -5,31 +5,58 @@ import {
HEIGHTXD
,
WIDTHXD
,
toPriceVnd
,
converType
,
converStatus
,
}
from
'../../../Config/Functions'
;
import
R
from
'../../../assets/R'
;
import
Block
from
'../../../components/Block'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
HISTORYDETAIL
}
from
'../../../routers/ScreenNames'
;
const
Item
=
(
props
)
=>
{
const
{
item
}
=
props
;
const
navigate
=
useNavigation
();
return
(
<
TouchableOpacity
onPress
=
{()
=>
console
.
log
(
'HEllo'
)}
>
<
View
style
=
{
styles
.
container
}
>
<
Block
flex
=
{
1
}
row
>
<
Block
padding
=
{[
5
,
10
]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
style
=
{{
justifyContent
:
'center'
,
flex
:
1
}}
>
<
Text
style
=
{
styles
.
txt1
}
>
`
${
I18n
.
t
(
'BonusMoney'
)}
:{' '}`
<
Text
style
=
{
styles
.
money
}
>
{
toPriceVnd
(
item
.
money
)}
<
/Text> vn
đ
<
/Text
>
<
Text
numberOfLines
=
{
1
}
style
=
{
styles
.
txt2
}
>
`{I18n.t('Content')}: {item.content}`
<
TouchableOpacity
onPress
=
{()
=>
navigate
.
navigate
(
HISTORYDETAIL
,
{
id
:
item
.
transection_id
})
}
style
=
{
styles
.
container
}
>
<
Block
flex
=
{
1
}
row
>
<
View
style
=
{
styles
.
wrapLeft
}
/
>
<
View
style
=
{
styles
.
wrapDate
}
>
<
Image
source
=
{{
uri
:
item
.
icon
}}
style
=
{
styles
.
imgIcon
}
/
>
<
/View
>
<
Block
style
=
{{
justifyContent
:
'center'
}}
padding
=
{[
5
,
10
]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
}}
>
<
View
style
=
{{
alignItems
:
'flex-start'
,
}}
>
<
Text
style
=
{
styles
.
txtBlack
}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
transection_date_timestamp
}
<
/Text
>
<
/View
>
<
View
style
=
{{
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{[
styles
.
txtMoney
,
item
.
status
==
1
?
{
color
:
'#1473E6'
}
:
null
,
]}
>
{
toPriceVnd
(
item
.
amount
)}
Đ
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
status_name
}
<
/Text
>
<
/View
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
time
}
<
/Text
>
<
/Block
>
<
/View
>
<
/Block
>
<
/
View
>
<
/
Block
>
<
/TouchableOpacity
>
);
};
...
...
@@ -38,7 +65,6 @@ export default Item;
const
styles
=
StyleSheet
.
create
({
container
:
{
marginTop
:
10
,
height
:
HEIGHTXD
(
250
),
shadowColor
:
'#000'
,
shadowOffset
:
{
...
...
@@ -50,10 +76,13 @@ const styles = StyleSheet.create({
elevation
:
5
,
marginHorizontal
:
10
,
backgroundColor
:
R
.
colors
.
white
,
margin
Bottom
:
10
,
margin
Vertical
:
5
,
borderRadius
:
HEIGHTXD
(
30
),
},
wrapRight
:
{
borderLeftColor
:
R
.
colors
.
borderGray
,
borderLeftWidth
:
0.7
,
},
wrapLeft
:
{
width
:
WIDTHXD
(
16
),
borderTopLeftRadius
:
HEIGHTXD
(
30
),
...
...
@@ -63,36 +92,22 @@ const styles = StyleSheet.create({
justifyContent
:
'center'
,
paddingHorizontal
:
10
,
},
txtTitle
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
black
,
fontWeight
:
'bold'
,
},
txt
:
{
fontSize
:
getFontXD
(
3
9
),
fontSize
:
getFontXD
(
3
6
),
color
:
'#C4C4C4'
,
fontStyle
:
'italic'
,
},
rowBet
:
{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
},
txt1
:
{
fontSize
:
getFontXD
(
42
),
color
:
'#0B2031'
,
},
txt2
:
{
fontSize
:
getFontXD
(
42
),
color
:
'#0B2031'
,
marginVertical
:
2
,
marginTop
:
10
,
},
imgIcon
:
{
width
:
WIDTHXD
(
178
),
height
:
HEIGHTXD
(
178
),
resizeMode
:
'contain'
,
},
money
:
{
color
:
'#E3434F'
,
txtMoney
:
{
fontSize
:
getFontXD
(
42
),
fontWeight
:
'bold'
,
color
:
'#F99D1D'
,
},
txtBlack
:
{
fontSize
:
getFontXD
(
42
),
},
});
src/Screens/Menu/Payments/Payments.js
View file @
65a00329
import
React
from
'react'
;
import
{
View
,
FlatList
,
Text
}
from
'react-native'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
View
,
FlatList
,
Text
,
Alert
}
from
'react-native'
;
import
HeaderBack
from
'../../../components/Header/HeaderBack'
;
import
Item
from
'./Item'
;
import
AppText
from
'../../../components/AppText'
;
import
{
getListTransaction
}
from
'../../../apis/Functions/Widthdraw'
;
import
I18n
from
'../../../helper/i18/i18n'
;
const
Payments
=
(
props
)
=>
{
const
[
page
,
setPage
]
=
useState
(
1
);
const
[
data
,
setData
]
=
useState
([]);
const
[
tottalPage
,
setTotalPage
]
=
useState
(
1
);
const
[
isRefresh
,
setisRefresh
]
=
useState
(
false
);
useEffect
(()
=>
{
getData
();
},
[]);
const
getData
=
async
()
=>
{
setisRefresh
(
true
);
setPage
(
1
);
const
res
=
await
getListTransaction
({
keyword
:
''
,
type
:
'PAYMENT'
,
platform
:
Platform
.
OS
,
page_size
:
10
,
status
:
-
1
,
page_index
:
1
,
start_date
:
''
,
end_date
:
''
,
});
setisRefresh
(
false
);
if
((
res
.
data
.
code
=
200
&&
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
setTotalPage
(
res
.
data
.
meta
.
pages
);
console
.
log
(
res
.
data
.
data
);
}
else
{
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
};
const
onRefresh
=
()
=>
{
getData
();
};
const
onLoadMore
=
()
=>
{
if
(
page
<
tottalPage
)
getDataLoadMore
();
};
const
getDataLoadMore
=
async
()
=>
{
setisRefresh
(
true
);
const
res
=
await
getListTransaction
({
keyword
:
''
,
type
:
'PAYMENT'
,
platform
:
Platform
.
OS
,
page_size
:
10
,
status
:
-
1
,
page_index
:
page
+
1
,
start_date
:
''
,
end_date
:
''
,
});
setPage
(
page
+
1
);
if
(
res
.
data
.
code
==
200
)
{
setData
(
data
.
concat
(
res
.
data
.
data
));
}
setisRefresh
(
false
);
};
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
isWhite
=
{
false
}
title
=
{
'Payments'
}
/
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
AppText
i18nKey
=
{
'Features_develop'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
textAlign
:
'center'
,
}}
/
>
<
/View
>
{
/* <FlatList
<
FlatList
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
refreshing
=
{
isRefresh
}
showsVerticalScrollIndicator
=
{
false
}
onRefresh
=
{
onRefresh
}
onEndReachedThreshold
=
{
0.01
}
onEndReached
=
{(
info
)
=>
{
onLoadMore
();
}}
keyExtractor
=
{(
item
)
=>
item
.
transection_id
+
'a'
}
renderItem
=
{({
item
})
=>
<
Item
item
=
{
item
}
/>
}
/>
*/
}
/>
<
/View
>
);
};
...
...
src/Screens/MethodPay/MethodPay.js
View file @
65a00329
...
...
@@ -8,10 +8,15 @@ import I18n from '../../helper/i18/i18n';
const
MethodPay
=
(
props
)
=>
{
const
[
data
,
setData
]
=
useState
([]);
const
[
isRefresh
,
setRefresh
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
useEffect
(()
=>
{
getData
();
},
[]);
const
unsubscribe
=
navigation
.
addListener
(
'focus'
,
()
=>
{
getData
();
});
return
unsubscribe
;
},
[
navigation
]);
const
onRefresh
=
()
=>
{
getData
();
...
...
src/Screens/MethodPay/MethodPayView.js
View file @
65a00329
...
...
@@ -13,7 +13,6 @@ const MethodPayView = (props) => {
const
{
isRefresh
,
listMethod
,
onRefresh
}
=
props
;
console
.
log
(
'List'
,
listMethod
);
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'PaymentSetting'
}
/
>
...
...
src/Screens/MethodPay/SelectBankModal.js
View file @
65a00329
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Text
,
View
,
...
...
@@ -24,14 +24,13 @@ import ItemBank from './ItemBank';
import
{
SafeAreaView
}
from
'react-native-safe-area-context'
;
const
SelectBankModal
=
(
props
)
=>
{
console
.
log
(
props
)
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
valueSearch
,
setValueSearch
]
=
useState
(
''
);
const
[
result
,
setResult
]
=
useState
(
props
.
data
);
const
[
keySearch
,
setKeySearch
]
=
useState
(
''
);
useEffect
(()
=>
{
setResult
(
props
.
data
)
},
[
props
.
data
])
useEffect
(()
=>
{
setResult
(
props
.
data
)
;
},
[
props
.
data
]);
const
localFilter
=
(
data
,
allowFields
=
[],
search_text
)
=>
{
if
(
!
data
)
return
[];
if
(
!
search_text
||
search_text
===
''
)
return
data
;
...
...
@@ -44,10 +43,10 @@ const SelectBankModal = (props) => {
let
added
=
false
;
allowFields
.
map
((
param
)
=>
{
if
(
!
added
&&
(
item
[
param
+
''
]
+
''
)
.
toLowerCase
()
.
includes
(
search_text
.
toLowerCase
())
!
added
&&
(
item
[
param
+
''
]
+
''
)
.
toLowerCase
()
.
includes
(
search_text
.
toLowerCase
())
)
{
result
.
push
(
item
);
added
=
true
;
...
...
@@ -59,16 +58,13 @@ const SelectBankModal = (props) => {
};
const
_onSearch
=
async
(
keySearch
)
=>
{
const
data
=
props
.
data
?
localFilter
(
props
.
data
,
[
'code'
,
'name'
],
keySearch
)
.
map
(
(
x
)
=>
({
id
:
x
.
id
,
code
:
x
.
code
,
name
:
x
.
name
,
logo
:
x
.
logo
,
})
)
:
[];
?
localFilter
(
props
.
data
,
[
'code'
,
'name'
],
keySearch
).
map
((
x
)
=>
({
id
:
x
.
id
,
code
:
x
.
code
,
name
:
x
.
name
,
logo
:
x
.
logo
,
}))
:
[];
// remove duplicate
let
result
=
[];
...
...
@@ -79,124 +75,118 @@ const SelectBankModal = (props) => {
setResult
(
result
);
};
const
_onPressItem
=
(
item
)
=>
{
console
.
log
(
'_onPressItem'
,
item
)
props
.
onPressItem
(
item
)
setValueSearch
(
item
?
item
.
name
:
''
);
setModalVisible
(
false
);
};
return
(
<
View
>
<
TouchableOpacity
style
=
{[
styles
.
buttonShowModal
]}
onPress
=
{()
=>
{
setModalVisible
(
true
);
setKeySearch
(
''
);
_onSearch
(
keySearch
);
}}
>
<
View
style
=
{
styles
.
flexRowJustifyBetween
}
>
<
Text
style
=
{[
styles
.
txtTitle
,
{
flex
:
1
,
flexWrap
:
'wrap'
}]}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
{
valueSearch
.
trim
()}
<
/Text
>
<
View
>
{
valueSearch
===
''
?
(
<
TouchableOpacity
onPress
=
{()
=>
{
setModalVisible
(
true
);
_onSearch
(
keySearch
);
}}
hitSlop
=
{{
left
:
WIDTHXD
(
50
),
right
:
WIDTHXD
(
50
)}}
>
<
AntDesign
name
=
"search1"
size
=
{
WIDTHXD
(
43
)}
color
=
{
R
.
colors
.
iconGray
}
/
>
<
/TouchableOpacity
>
)
:
(
<
TouchableOpacity
onPress
=
{()
=>
{
_onPressItem
(
null
);
}}
hitSlop
=
{{
left
:
WIDTHXD
(
50
),
right
:
WIDTHXD
(
50
)}}
>
<
AntDesign
name
=
"close"
size
=
{
WIDTHXD
(
43
)}
color
=
{
R
.
colors
.
iconGray
}
/
>
<
/TouchableOpacity
>
)}
<
/View
>
<
View
>
<
TouchableOpacity
style
=
{[
styles
.
buttonShowModal
]}
onPress
=
{()
=>
{
setModalVisible
(
true
);
setKeySearch
(
''
);
_onSearch
(
keySearch
);
}}
>
<
View
style
=
{
styles
.
flexRowJustifyBetween
}
>
<
Text
style
=
{[
styles
.
txtTitle
,
{
flex
:
1
,
flexWrap
:
'wrap'
}]}
numberOfLines
=
{
1
}
ellipsizeMode
=
"tail"
>
{
valueSearch
.
trim
()}
<
/Text
>
<
View
>
{
valueSearch
===
''
?
(
<
TouchableOpacity
onPress
=
{()
=>
{
setModalVisible
(
true
);
_onSearch
(
keySearch
);
}}
hitSlop
=
{{
left
:
WIDTHXD
(
50
),
right
:
WIDTHXD
(
50
)}}
>
<
AntDesign
name
=
"search1"
size
=
{
WIDTHXD
(
43
)}
color
=
{
R
.
colors
.
iconGray
}
/
>
<
/TouchableOpacity
>
)
:
(
<
TouchableOpacity
onPress
=
{()
=>
{
_onPressItem
(
null
);
}}
hitSlop
=
{{
left
:
WIDTHXD
(
50
),
right
:
WIDTHXD
(
50
)}}
>
<
AntDesign
name
=
"close"
size
=
{
WIDTHXD
(
43
)}
color
=
{
R
.
colors
.
iconGray
}
/
>
<
/TouchableOpacity
>
)}
<
/View
>
<
/TouchableOpacity
>
<
/View
>
<
/TouchableOpacity
>
<
Modal
animated
=
{
true
}
animationType
=
"fade"
visible
=
{
modalVisible
}
>
<
SafeAreaView
>
<
View
style
=
{
styles
.
overViewModal
}
>
<
View
style
=
{[
styles
.
container
]}
>
<
View
style
=
{
styles
.
viewTitle
}
>
<
Text
style
=
{[
styles
.
title
]}
>
{
props
.
title
}
<
/Text
>
<
TouchableOpacity
style
=
{
styles
.
btClose
}
onPress
=
{()
=>
setModalVisible
(
false
)}
>
<
AntDesign
name
=
"close"
size
=
{
WIDTHXD
(
48
)}
color
=
{
R
.
colors
.
black
}
/
>
<
/TouchableOpacity
>
<
Modal
animated
=
{
true
}
animationType
=
"fade"
visible
=
{
modalVisible
}
>
<
SafeAreaView
>
<
View
style
=
{
styles
.
overViewModal
}
>
<
View
style
=
{[
styles
.
container
]}
>
<
View
style
=
{
styles
.
viewTitle
}
>
<
Text
style
=
{[
styles
.
title
]}
>
{
props
.
title
}
<
/Text
>
<
TouchableOpacity
style
=
{
styles
.
btClose
}
onPress
=
{()
=>
setModalVisible
(
false
)}
>
<
AntDesign
name
=
"close"
size
=
{
WIDTHXD
(
48
)}
color
=
{
R
.
colors
.
black
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
viewContent
}
>
<
View
style
=
{
styles
.
inputSearch
}
>
<
TextInput
style
=
{
styles
.
input
}
value
=
{
keySearch
}
placeholder
=
{
I18n
.
t
(
'Search'
)}
placeholderTextColor
=
{
R
.
colors
.
color777
}
onChangeText
=
{(
keySearch
)
=>
{
setKeySearch
(
keySearch
);
_onSearch
(
keySearch
);
}}
/
>
<
AntDesign
name
=
"search1"
size
=
{
WIDTHXD
(
40
)}
color
=
{
R
.
colors
.
gray
}
style
=
{{
position
:
'absolute'
,
left
:
WIDTHXD
(
28
)}}
/
>
<
/View
>
<
View
style
=
{
styles
.
viewContent
}
>
<
View
style
=
{
styles
.
inputSearch
}
>
<
TextInput
style
=
{
styles
.
input
}
value
=
{
keySearch
}
placeholder
=
{
I18n
.
t
(
'Search'
)}
placeholderTextColor
=
{
R
.
colors
.
color777
}
onChangeText
=
{(
keySearch
)
=>
{
setKeySearch
(
keySearch
);
_onSearch
(
keySearch
);
}}
/
>
<
AntDesign
name
=
"search1"
size
=
{
WIDTHXD
(
40
)}
color
=
{
R
.
colors
.
gray
}
style
=
{{
position
:
'absolute'
,
left
:
WIDTHXD
(
28
)}}
{
!
_
.
isEmpty
(
result
)
?
(
<
View
style
=
{
styles
.
viewResult
}
>
<
FlatList
data
=
{
result
}
extraData
=
{
result
}
style
=
{
styles
.
flatlist
}
renderItem
=
{({
item
,
index
})
=>
(
<
ItemBank
item
=
{
item
}
isEndItem
=
{
index
==
result
.
length
-
1
}
onPress
=
{(
item
)
=>
_onPressItem
(
item
)}
/
>
)}
/
>
<
/View
>
{
!
_
.
isEmpty
(
result
)
?
(
<
View
style
=
{
styles
.
viewResult
}
>
<
FlatList
data
=
{
result
}
extraData
=
{
result
}
style
=
{
styles
.
flatlist
}
renderItem
=
{({
item
,
index
})
=>
(
<
ItemBank
item
=
{
item
}
isEndItem
=
{
index
==
result
.
length
-
1
}
onPress
=
{(
item
)
=>
_onPressItem
(
item
)}
/
>
)}
/
>
<
/View
>
)
:
(
<
Text
style
=
{
styles
.
txtEmpty
}
>
{
I18n
.
t
(
'NullDataSearch'
)}
<
/Text
>
)}
<
/View
>
)
:
(
<
Text
style
=
{
styles
.
txtEmpty
}
>
{
I18n
.
t
(
'NullDataSearch'
)}
<
/Text
>
)}
<
/View
>
<
/View
>
<
/SafeAreaView
>
<
/Modal
>
<
/View
>
<
/View
>
<
/SafeAreaView
>
<
/Modal
>
<
/View
>
);
};
...
...
@@ -242,7 +232,7 @@ const styles = StyleSheet.create({
},
flatlist
:
{
width
:
getWidth
(),
marginBottom
:
HEIGHTXD
(
300
)
marginBottom
:
HEIGHTXD
(
300
)
,
},
input
:
{
height
:
WIDTHXD
(
110
),
...
...
@@ -321,4 +311,4 @@ const styles = StyleSheet.create({
marginTop
:
24
,
},
});
export
default
SelectBankModal
;
export
default
React
.
memo
(
SelectBankModal
)
;
src/Screens/Setting/Setting.js
View file @
65a00329
import
React
from
'react'
;
import
{
Alert
}
from
'react-native'
;
import
SettingView
from
'./SettingView'
;
import
{
updateLangugeApi
}
from
'../../apis/Functions/users'
;
import
I18n
from
'../../helper/i18/i18n'
;
import
{
connect
}
from
'react-redux'
;
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
const
Setting
=
(
props
)
=>
{
return
<
SettingView
/>
;
const
convertKeyLanguage
=
(
key
)
=>
{
if
(
key
==
'en'
)
return
'ENGLISH'
;
return
'VIETNAMESE'
;
};
const
updateLangue
=
async
(
key
)
=>
{
props
.
showLoading
();
const
res
=
await
updateLangugeApi
({
platform
:
Platform
.
OS
,
language
:
convertKeyLanguage
(
key
),
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
setTimeout
(()
=>
{
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
},
500
);
}
else
{
setTimeout
(()
=>
{
Alert
.
alert
(
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
},
500
);
}
};
return
<
SettingView
updateLangue
=
{
updateLangue
}
/>
;
};
export
default
Setting
;
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
,
})(
Setting
);
src/Screens/Setting/SettingView.js
View file @
65a00329
...
...
@@ -23,7 +23,9 @@ const dataLanguage = [
const
SettingView
=
(
props
)
=>
{
const
[
isEnabled
,
setIsEnabled
]
=
useState
(
true
);
const
toggleSwitch
=
()
=>
setIsEnabled
((
previousState
)
=>
!
previousState
);
const
[
language
,
setLanguage
]
=
useState
();
useEffect
(()
=>
{
convertLanguage
();
},
[]);
...
...
@@ -59,7 +61,8 @@ const SettingView = (props) => {
setLanguage
(
items
.
name
);
props
.
changeLanguage
(
items
.
value
);
AsyncStorage
.
setItem
(
KEY
.
LANGUAGE
,
items
.
value
);
setLocation
(
I18n
,
items
.
value
)
setLocation
(
I18n
,
items
.
value
);
props
.
updateLangue
(
items
.
value
);
}}
/
>
<
/View
>
...
...
src/apis/Functions/users.js
View file @
65a00329
...
...
@@ -51,3 +51,8 @@ export const updateInforUser = async (body) =>
PostData
(
url
.
urlUpdateInforUser
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
export
const
updateLangugeApi
=
async
(
body
)
=>
PostData
(
url
.
urlUpdateLanguage
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
65a00329
...
...
@@ -35,4 +35,6 @@ export default {
urlOpenCQG
:
root
+
'api/v1/customers/register-open-cqg'
,
urlUpdateInforUser
:
root
+
'api/v1/customers/update-general-info'
,
urlUpdateLanguage
:
root
+
'api/v1/customers/update-language'
,
};
src/helper/i18/locales/en.js
View file @
65a00329
...
...
@@ -96,7 +96,7 @@ export default {
Provisional
:
'Provisional'
,
Here
:
'Here'
,
Open_account_demo
:
'You can open a demo account'
,
Features_develop
:
'
Features are under development, please come back later
!'
,
Features_develop
:
'
No data
!'
,
Language
:
'Language'
,
Email
:
'Email'
,
Password
:
'Password'
,
...
...
@@ -139,7 +139,8 @@ export default {
BeneficiaryAccount
:
'the beneficiary account'
,
FromWallet
:
'From wallet'
,
FromCQGAccount
:
'From CQG account'
,
SettingPaymentMethodConfirm
:
'You have not the payment method. Go to payment method setting?'
,
SettingPaymentMethodConfirm
:
'You have not the payment method. Go to payment method setting?'
,
EnterEmailRequest
:
'Please enter email'
,
EnterEmail
:
'Enter email'
,
GetVerificationCode
:
'Get the verification code'
,
...
...
src/helper/i18/locales/vn.js
View file @
65a00329
...
...
@@ -103,7 +103,7 @@ export default {
Provisional
:
'Tạm tính'
,
Here
:
'Tại đây'
,
Open_account_demo
:
'Bạn có thể mở tài khoản thử'
,
Features_develop
:
'
Tính năng đang được phát triển, vui lòng quay lại sa
u!'
,
Features_develop
:
'
Không có dữ liệ
u!'
,
Email
:
'Email'
,
Password
:
'Mật khẩu'
,
Login
:
'Đăng nhập'
,
...
...
@@ -128,7 +128,8 @@ export default {
Branch
:
'Chi nhánh'
,
OwnerAccountName
:
'Tên chủ tài khoản'
,
AccountNumber
:
'Số tài khoản ngân hàng'
,
DeletePaymentMethodConfirm
:
'Bạn có chắc chắn muốn xoá phương thức thanh toán'
,
DeletePaymentMethodConfirm
:
'Bạn có chắc chắn muốn xoá phương thức thanh toán'
,
Forbidden
:
'Từ chối'
,
OwnerAccount
:
'Chủ TK'
,
Add
:
'Thêm'
,
...
...
@@ -143,7 +144,8 @@ export default {
BeneficiaryAccount
:
'tài khoản hưởng thụ'
,
FromWallet
:
'Từ ví'
,
FromCQGAccount
:
'Từ tài khoản CQG'
,
SettingPaymentMethodConfirm
:
'Bạn chưa có phương thức thanh toán.Đi đến cài đặt phương thức thanh toán?'
,
SettingPaymentMethodConfirm
:
'Bạn chưa có phương thức thanh toán.Đi đến cài đặt phương thức thanh toán?'
,
EnterEmailRequest
:
'Vui lòng nhập email'
,
EnterEmail
:
'Nhập email'
,
GetVerificationCode
:
'Lấy mã xác thực'
,
...
...
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