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
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
228 additions
and
113 deletions
+228
-113
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
+54
-39
Payments.js
src/Screens/Menu/Payments/Payments.js
+72
-14
MethodPay.js
src/Screens/MethodPay/MethodPay.js
+6
-1
MethodPayView.js
src/Screens/MethodPay/MethodPayView.js
+0
-1
SelectBankModal.js
src/Screens/MethodPay/SelectBankModal.js
+10
-20
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 {
...
@@ -132,8 +132,8 @@ android {
applicationId
"com.dcv.invest"
applicationId
"com.dcv.invest"
minSdkVersion
rootProject
.
ext
.
minSdkVersion
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
versionCode
1
versionCode
3
versionName
"1.
0
"
versionName
"1.
3
"
vectorDrawables
.
useSupportLibrary
=
true
vectorDrawables
.
useSupportLibrary
=
true
}
}
splits
{
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 @@
...
@@ -40,7 +40,17 @@
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<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>
</intent-filter>
</activity>
</activity>
...
...
ios/Invest.xcodeproj/project.pbxproj
View file @
65a00329
...
@@ -903,7 +903,7 @@
...
@@ -903,7 +903,7 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2
;
CURRENT_PROJECT_VERSION
=
3
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
ENABLE_BITCODE
=
NO
;
ENABLE_BITCODE
=
NO
;
GCC_PREPROCESSOR_DEFINITIONS
=
(
GCC_PREPROCESSOR_DEFINITIONS
=
(
...
@@ -936,7 +936,7 @@
...
@@ -936,7 +936,7 @@
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Invest/Invest.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2
;
CURRENT_PROJECT_VERSION
=
3
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
DEVELOPMENT_TEAM
=
MXZ24GRH48
;
INFOPLIST_FILE
=
Invest/Info.plist
;
INFOPLIST_FILE
=
Invest/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
...
...
ios/Invest/Info.plist
View file @
65a00329
...
@@ -24,6 +24,19 @@
...
@@ -24,6 +24,19 @@
<
string
>
$
(
MARKETING_VERSION
)<
/string
>
<
string
>
$
(
MARKETING_VERSION
)<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
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
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
$
(
CURRENT_PROJECT_VERSION
)<
/string
>
<
string
>
$
(
CURRENT_PROJECT_VERSION
)<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
...
...
src/Screens/Action/History/HistoryView.js
View file @
65a00329
...
@@ -30,7 +30,7 @@ const Fillters = [
...
@@ -30,7 +30,7 @@ const Fillters = [
},
},
{
{
id
:
'4'
,
id
:
'4'
,
name
:
'
Withdraw
'
,
name
:
'
Transfer
'
,
value
:
'TRANSFER'
,
value
:
'TRANSFER'
,
},
},
];
];
...
...
src/Screens/Action/History/Item.js
View file @
65a00329
...
@@ -42,9 +42,7 @@ const Item = (props) => {
...
@@ -42,9 +42,7 @@ const Item = (props) => {
style
=
{{
style
=
{{
alignItems
:
'flex-start'
,
alignItems
:
'flex-start'
,
}}
>
}}
>
<
Text
style
=
{
styles
.
txtBlack
}
>
<
Text
style
=
{
styles
.
txtBlack
}
>
{
item
.
name
}
<
/Text
>
{
converType
(
item
.
transection_category
)}
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
transection_date_timestamp
}
<
/Text
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
transection_date_timestamp
}
<
/Text
>
<
/View
>
<
/View
>
...
@@ -100,7 +98,6 @@ const styles = StyleSheet.create({
...
@@ -100,7 +98,6 @@ const styles = StyleSheet.create({
fontSize
:
getFontXD
(
36
),
fontSize
:
getFontXD
(
36
),
color
:
'#C4C4C4'
,
color
:
'#C4C4C4'
,
marginTop
:
10
,
marginTop
:
10
,
fontStyle
:
'italic'
,
},
},
imgIcon
:
{
imgIcon
:
{
width
:
WIDTHXD
(
178
),
width
:
WIDTHXD
(
178
),
...
...
src/Screens/Menu/Payments/Item.js
View file @
65a00329
...
@@ -5,31 +5,58 @@ import {
...
@@ -5,31 +5,58 @@ import {
HEIGHTXD
,
HEIGHTXD
,
WIDTHXD
,
WIDTHXD
,
toPriceVnd
,
toPriceVnd
,
converType
,
converStatus
,
}
from
'../../../Config/Functions'
;
}
from
'../../../Config/Functions'
;
import
R
from
'../../../assets/R'
;
import
R
from
'../../../assets/R'
;
import
Block
from
'../../../components/Block'
;
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
{
item
}
=
props
;
const
{
item
}
=
props
;
const
navigate
=
useNavigation
();
return
(
return
(
<
TouchableOpacity
onPress
=
{()
=>
console
.
log
(
'HEllo'
)}
>
<
TouchableOpacity
<
View
style
=
{
styles
.
container
}
>
onPress
=
{()
=>
navigate
.
navigate
(
HISTORYDETAIL
,
{
id
:
item
.
transection_id
})
}
style
=
{
styles
.
container
}
>
<
Block
flex
=
{
1
}
row
>
<
Block
flex
=
{
1
}
row
>
<
Block
padding
=
{[
5
,
10
]}
space
=
{
'between'
}
flex
=
{
1
}
>
<
View
style
=
{
styles
.
wrapLeft
}
/
>
<
View
style
=
{{
justifyContent
:
'center'
,
flex
:
1
}}
>
<
View
style
=
{
styles
.
wrapDate
}
>
<
Text
style
=
{
styles
.
txt1
}
>
<
Image
source
=
{{
uri
:
item
.
icon
}}
style
=
{
styles
.
imgIcon
}
/
>
`
${
I18n
.
t
(
'BonusMoney'
)}
:{' '}`
<
/View
>
<
Text
style
=
{
styles
.
money
}
>
{
toPriceVnd
(
item
.
money
)}
<
/Text> vn
đ
<
Block
<
/Text
>
style
=
{{
justifyContent
:
'center'
}}
<
Text
numberOfLines
=
{
1
}
style
=
{
styles
.
txt2
}
>
padding
=
{[
5
,
10
]}
`{I18n.t('Content')}: {item.content}`
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
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
status_name
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
Text
style
=
{
styles
.
txt
}
>
{
item
.
time
}
<
/Text
>
<
/Block
>
<
/Block
>
<
/Block
>
<
/Block
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
);
);
};
};
...
@@ -38,7 +65,6 @@ export default Item;
...
@@ -38,7 +65,6 @@ export default Item;
const
styles
=
StyleSheet
.
create
({
const
styles
=
StyleSheet
.
create
({
container
:
{
container
:
{
marginTop
:
10
,
height
:
HEIGHTXD
(
250
),
height
:
HEIGHTXD
(
250
),
shadowColor
:
'#000'
,
shadowColor
:
'#000'
,
shadowOffset
:
{
shadowOffset
:
{
...
@@ -50,10 +76,13 @@ const styles = StyleSheet.create({
...
@@ -50,10 +76,13 @@ const styles = StyleSheet.create({
elevation
:
5
,
elevation
:
5
,
marginHorizontal
:
10
,
marginHorizontal
:
10
,
backgroundColor
:
R
.
colors
.
white
,
backgroundColor
:
R
.
colors
.
white
,
margin
Bottom
:
10
,
margin
Vertical
:
5
,
borderRadius
:
HEIGHTXD
(
30
),
borderRadius
:
HEIGHTXD
(
30
),
},
},
wrapRight
:
{
borderLeftColor
:
R
.
colors
.
borderGray
,
borderLeftWidth
:
0.7
,
},
wrapLeft
:
{
wrapLeft
:
{
width
:
WIDTHXD
(
16
),
width
:
WIDTHXD
(
16
),
borderTopLeftRadius
:
HEIGHTXD
(
30
),
borderTopLeftRadius
:
HEIGHTXD
(
30
),
...
@@ -63,36 +92,22 @@ const styles = StyleSheet.create({
...
@@ -63,36 +92,22 @@ const styles = StyleSheet.create({
justifyContent
:
'center'
,
justifyContent
:
'center'
,
paddingHorizontal
:
10
,
paddingHorizontal
:
10
,
},
},
txtTitle
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
black
,
fontWeight
:
'bold'
,
},
txt
:
{
txt
:
{
fontSize
:
getFontXD
(
3
9
),
fontSize
:
getFontXD
(
3
6
),
color
:
'#C4C4C4'
,
color
:
'#C4C4C4'
,
fontStyle
:
'italic'
,
marginTop
:
10
,
},
rowBet
:
{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
},
txt1
:
{
fontSize
:
getFontXD
(
42
),
color
:
'#0B2031'
,
},
txt2
:
{
fontSize
:
getFontXD
(
42
),
color
:
'#0B2031'
,
marginVertical
:
2
,
},
},
imgIcon
:
{
imgIcon
:
{
width
:
WIDTHXD
(
178
),
width
:
WIDTHXD
(
178
),
height
:
HEIGHTXD
(
178
),
height
:
HEIGHTXD
(
178
),
resizeMode
:
'contain'
,
resizeMode
:
'contain'
,
},
},
money
:
{
txtMoney
:
{
color
:
'#E3434F'
,
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
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
View
,
FlatList
,
Text
}
from
'react-native'
;
import
{
View
,
FlatList
,
Text
,
Alert
}
from
'react-native'
;
import
HeaderBack
from
'../../../components/Header/HeaderBack'
;
import
HeaderBack
from
'../../../components/Header/HeaderBack'
;
import
Item
from
'./Item'
;
import
Item
from
'./Item'
;
import
AppText
from
'../../../components/AppText'
;
import
AppText
from
'../../../components/AppText'
;
import
{
getListTransaction
}
from
'../../../apis/Functions/Widthdraw'
;
import
I18n
from
'../../../helper/i18/i18n'
;
const
Payments
=
(
props
)
=>
{
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
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
isWhite
=
{
false
}
title
=
{
'Payments'
}
/
>
<
HeaderBack
isWhite
=
{
false
}
title
=
{
'Payments'
}
/
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
FlatList
<
AppText
i18nKey
=
{
'Features_develop'
}
style
=
{{
fontSize
:
18
,
fontWeight
:
'bold'
,
textAlign
:
'center'
,
}}
/
>
<
/View
>
{
/* <FlatList
keyExtractor
=
{(
item
)
=>
item
.
id
}
keyExtractor
=
{(
item
)
=>
item
.
id
}
data
=
{
data
}
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
}
/>
}
renderItem
=
{({
item
})
=>
<
Item
item
=
{
item
}
/>
}
/>
*/
}
/>
<
/View
>
<
/View
>
);
);
};
};
...
...
src/Screens/MethodPay/MethodPay.js
View file @
65a00329
...
@@ -8,10 +8,15 @@ import I18n from '../../helper/i18/i18n';
...
@@ -8,10 +8,15 @@ import I18n from '../../helper/i18/i18n';
const
MethodPay
=
(
props
)
=>
{
const
MethodPay
=
(
props
)
=>
{
const
[
data
,
setData
]
=
useState
([]);
const
[
data
,
setData
]
=
useState
([]);
const
[
isRefresh
,
setRefresh
]
=
useState
(
false
);
const
[
isRefresh
,
setRefresh
]
=
useState
(
false
);
const
navigation
=
useNavigation
();
useEffect
(()
=>
{
useEffect
(()
=>
{
const
unsubscribe
=
navigation
.
addListener
(
'focus'
,
()
=>
{
getData
();
getData
();
},
[]);
});
return
unsubscribe
;
},
[
navigation
]);
const
onRefresh
=
()
=>
{
const
onRefresh
=
()
=>
{
getData
();
getData
();
...
...
src/Screens/MethodPay/MethodPayView.js
View file @
65a00329
...
@@ -13,7 +13,6 @@ const MethodPayView = (props) => {
...
@@ -13,7 +13,6 @@ const MethodPayView = (props) => {
const
{
isRefresh
,
listMethod
,
onRefresh
}
=
props
;
const
{
isRefresh
,
listMethod
,
onRefresh
}
=
props
;
console
.
log
(
'List'
,
listMethod
);
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderBack
title
=
{
'PaymentSetting'
}
/
>
<
HeaderBack
title
=
{
'PaymentSetting'
}
/
>
...
...
src/Screens/MethodPay/SelectBankModal.js
View file @
65a00329
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
import
{
Text
,
Text
,
View
,
View
,
...
@@ -24,14 +24,13 @@ import ItemBank from './ItemBank';
...
@@ -24,14 +24,13 @@ import ItemBank from './ItemBank';
import
{
SafeAreaView
}
from
'react-native-safe-area-context'
;
import
{
SafeAreaView
}
from
'react-native-safe-area-context'
;
const
SelectBankModal
=
(
props
)
=>
{
const
SelectBankModal
=
(
props
)
=>
{
console
.
log
(
props
)
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
valueSearch
,
setValueSearch
]
=
useState
(
''
);
const
[
valueSearch
,
setValueSearch
]
=
useState
(
''
);
const
[
result
,
setResult
]
=
useState
(
props
.
data
);
const
[
result
,
setResult
]
=
useState
(
props
.
data
);
const
[
keySearch
,
setKeySearch
]
=
useState
(
''
);
const
[
keySearch
,
setKeySearch
]
=
useState
(
''
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setResult
(
props
.
data
)
setResult
(
props
.
data
)
;
},
[
props
.
data
])
},
[
props
.
data
]);
const
localFilter
=
(
data
,
allowFields
=
[],
search_text
)
=>
{
const
localFilter
=
(
data
,
allowFields
=
[],
search_text
)
=>
{
if
(
!
data
)
return
[];
if
(
!
data
)
return
[];
if
(
!
search_text
||
search_text
===
''
)
return
data
;
if
(
!
search_text
||
search_text
===
''
)
return
data
;
...
@@ -59,15 +58,12 @@ const SelectBankModal = (props) => {
...
@@ -59,15 +58,12 @@ const SelectBankModal = (props) => {
};
};
const
_onSearch
=
async
(
keySearch
)
=>
{
const
_onSearch
=
async
(
keySearch
)
=>
{
const
data
=
props
.
data
const
data
=
props
.
data
?
localFilter
(
props
.
data
,
[
'code'
,
'name'
],
keySearch
)
?
localFilter
(
props
.
data
,
[
'code'
,
'name'
],
keySearch
).
map
((
x
)
=>
({
.
map
(
(
x
)
=>
({
id
:
x
.
id
,
id
:
x
.
id
,
code
:
x
.
code
,
code
:
x
.
code
,
name
:
x
.
name
,
name
:
x
.
name
,
logo
:
x
.
logo
,
logo
:
x
.
logo
,
})
}))
)
:
[];
:
[];
// remove duplicate
// remove duplicate
...
@@ -79,8 +75,6 @@ const SelectBankModal = (props) => {
...
@@ -79,8 +75,6 @@ const SelectBankModal = (props) => {
setResult
(
result
);
setResult
(
result
);
};
};
const
_onPressItem
=
(
item
)
=>
{
const
_onPressItem
=
(
item
)
=>
{
console
.
log
(
'_onPressItem'
,
item
)
props
.
onPressItem
(
item
)
setValueSearch
(
item
?
item
.
name
:
''
);
setValueSearch
(
item
?
item
.
name
:
''
);
setModalVisible
(
false
);
setModalVisible
(
false
);
};
};
...
@@ -132,11 +126,7 @@ const SelectBankModal = (props) => {
...
@@ -132,11 +126,7 @@ const SelectBankModal = (props) => {
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
Modal
<
Modal
animated
=
{
true
}
animationType
=
"fade"
visible
=
{
modalVisible
}
>
animated
=
{
true
}
animationType
=
"fade"
visible
=
{
modalVisible
}
>
<
SafeAreaView
>
<
SafeAreaView
>
<
View
style
=
{
styles
.
overViewModal
}
>
<
View
style
=
{
styles
.
overViewModal
}
>
<
View
style
=
{[
styles
.
container
]}
>
<
View
style
=
{[
styles
.
container
]}
>
...
@@ -180,7 +170,7 @@ const SelectBankModal = (props) => {
...
@@ -180,7 +170,7 @@ const SelectBankModal = (props) => {
renderItem
=
{({
item
,
index
})
=>
(
renderItem
=
{({
item
,
index
})
=>
(
<
ItemBank
<
ItemBank
item
=
{
item
}
item
=
{
item
}
isEndItem
=
{
index
==
result
.
length
-
1
}
isEndItem
=
{
index
==
result
.
length
-
1
}
onPress
=
{(
item
)
=>
_onPressItem
(
item
)}
onPress
=
{(
item
)
=>
_onPressItem
(
item
)}
/
>
/
>
)}
)}
...
@@ -242,7 +232,7 @@ const styles = StyleSheet.create({
...
@@ -242,7 +232,7 @@ const styles = StyleSheet.create({
},
},
flatlist
:
{
flatlist
:
{
width
:
getWidth
(),
width
:
getWidth
(),
marginBottom
:
HEIGHTXD
(
300
)
marginBottom
:
HEIGHTXD
(
300
)
,
},
},
input
:
{
input
:
{
height
:
WIDTHXD
(
110
),
height
:
WIDTHXD
(
110
),
...
@@ -321,4 +311,4 @@ const styles = StyleSheet.create({
...
@@ -321,4 +311,4 @@ const styles = StyleSheet.create({
marginTop
:
24
,
marginTop
:
24
,
},
},
});
});
export
default
SelectBankModal
;
export
default
React
.
memo
(
SelectBankModal
)
;
src/Screens/Setting/Setting.js
View file @
65a00329
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Alert
}
from
'react-native'
;
import
SettingView
from
'./SettingView'
;
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
)
=>
{
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 = [
...
@@ -23,7 +23,9 @@ const dataLanguage = [
const
SettingView
=
(
props
)
=>
{
const
SettingView
=
(
props
)
=>
{
const
[
isEnabled
,
setIsEnabled
]
=
useState
(
true
);
const
[
isEnabled
,
setIsEnabled
]
=
useState
(
true
);
const
toggleSwitch
=
()
=>
setIsEnabled
((
previousState
)
=>
!
previousState
);
const
toggleSwitch
=
()
=>
setIsEnabled
((
previousState
)
=>
!
previousState
);
const
[
language
,
setLanguage
]
=
useState
();
const
[
language
,
setLanguage
]
=
useState
();
useEffect
(()
=>
{
useEffect
(()
=>
{
convertLanguage
();
convertLanguage
();
},
[]);
},
[]);
...
@@ -59,7 +61,8 @@ const SettingView = (props) => {
...
@@ -59,7 +61,8 @@ const SettingView = (props) => {
setLanguage
(
items
.
name
);
setLanguage
(
items
.
name
);
props
.
changeLanguage
(
items
.
value
);
props
.
changeLanguage
(
items
.
value
);
AsyncStorage
.
setItem
(
KEY
.
LANGUAGE
,
items
.
value
);
AsyncStorage
.
setItem
(
KEY
.
LANGUAGE
,
items
.
value
);
setLocation
(
I18n
,
items
.
value
)
setLocation
(
I18n
,
items
.
value
);
props
.
updateLangue
(
items
.
value
);
}}
}}
/
>
/
>
<
/View
>
<
/View
>
...
...
src/apis/Functions/users.js
View file @
65a00329
...
@@ -51,3 +51,8 @@ export const updateInforUser = async (body) =>
...
@@ -51,3 +51,8 @@ export const updateInforUser = async (body) =>
PostData
(
url
.
urlUpdateInforUser
,
body
)
PostData
(
url
.
urlUpdateInforUser
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
.
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 {
...
@@ -35,4 +35,6 @@ export default {
urlOpenCQG
:
root
+
'api/v1/customers/register-open-cqg'
,
urlOpenCQG
:
root
+
'api/v1/customers/register-open-cqg'
,
urlUpdateInforUser
:
root
+
'api/v1/customers/update-general-info'
,
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 {
...
@@ -96,7 +96,7 @@ export default {
Provisional
:
'Provisional'
,
Provisional
:
'Provisional'
,
Here
:
'Here'
,
Here
:
'Here'
,
Open_account_demo
:
'You can open a demo account'
,
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'
,
Language
:
'Language'
,
Email
:
'Email'
,
Email
:
'Email'
,
Password
:
'Password'
,
Password
:
'Password'
,
...
@@ -139,7 +139,8 @@ export default {
...
@@ -139,7 +139,8 @@ export default {
BeneficiaryAccount
:
'the beneficiary account'
,
BeneficiaryAccount
:
'the beneficiary account'
,
FromWallet
:
'From wallet'
,
FromWallet
:
'From wallet'
,
FromCQGAccount
:
'From CQG account'
,
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'
,
EnterEmailRequest
:
'Please enter email'
,
EnterEmail
:
'Enter email'
,
EnterEmail
:
'Enter email'
,
GetVerificationCode
:
'Get the verification code'
,
GetVerificationCode
:
'Get the verification code'
,
...
...
src/helper/i18/locales/vn.js
View file @
65a00329
...
@@ -103,7 +103,7 @@ export default {
...
@@ -103,7 +103,7 @@ export default {
Provisional
:
'Tạm tính'
,
Provisional
:
'Tạm tính'
,
Here
:
'Tại đây'
,
Here
:
'Tại đây'
,
Open_account_demo
:
'Bạn có thể mở tài khoản thử'
,
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'
,
Email
:
'Email'
,
Password
:
'Mật khẩu'
,
Password
:
'Mật khẩu'
,
Login
:
'Đăng nhập'
,
Login
:
'Đăng nhập'
,
...
@@ -128,7 +128,8 @@ export default {
...
@@ -128,7 +128,8 @@ export default {
Branch
:
'Chi nhánh'
,
Branch
:
'Chi nhánh'
,
OwnerAccountName
:
'Tên chủ tài khoản'
,
OwnerAccountName
:
'Tên chủ tài khoản'
,
AccountNumber
:
'Số tài khoản ngân hàng'
,
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'
,
Forbidden
:
'Từ chối'
,
OwnerAccount
:
'Chủ TK'
,
OwnerAccount
:
'Chủ TK'
,
Add
:
'Thêm'
,
Add
:
'Thêm'
,
...
@@ -143,7 +144,8 @@ export default {
...
@@ -143,7 +144,8 @@ export default {
BeneficiaryAccount
:
'tài khoản hưởng thụ'
,
BeneficiaryAccount
:
'tài khoản hưởng thụ'
,
FromWallet
:
'Từ ví'
,
FromWallet
:
'Từ ví'
,
FromCQGAccount
:
'Từ tài khoản CQG'
,
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'
,
EnterEmailRequest
:
'Vui lòng nhập email'
,
EnterEmail
:
'Nhập email'
,
EnterEmail
:
'Nhập email'
,
GetVerificationCode
:
'Lấy mã xác thực'
,
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