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
94b48eb5
Commit
94b48eb5
authored
Apr 22, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api update user
parent
ec4e9c22
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
83 deletions
+110
-83
launch.json
.vscode/launch.json
+0
-7
GeneralInfor.js
src/Screens/Menu/Profile/Tab/GeneralInfor.js
+102
-75
users.js
src/apis/Functions/users.js
+5
-0
url.js
src/apis/url.js
+2
-0
FirebaseNotification.js
src/helper/FirebaseNotification.js
+1
-1
No files found.
.vscode/launch.json
View file @
94b48eb5
...
@@ -5,13 +5,6 @@
...
@@ -5,13 +5,6 @@
"version"
:
"0.2.0"
,
"version"
:
"0.2.0"
,
"configurations"
:
[
"configurations"
:
[
{
{
"name"
:
"Debug iOS"
,
"request"
:
"launch"
,
"type"
:
"reactnative"
,
"cwd"
:
"${workspaceFolder}"
,
"platform"
:
"ios"
},
{
"name"
:
"Attach to Chrome"
,
"name"
:
"Attach to Chrome"
,
"port"
:
9222
,
"port"
:
9222
,
"request"
:
"attach"
,
"request"
:
"attach"
,
...
...
src/Screens/Menu/Profile/Tab/GeneralInfor.js
View file @
94b48eb5
...
@@ -2,12 +2,9 @@ import React, {useState} from 'react';
...
@@ -2,12 +2,9 @@ import React, {useState} from 'react';
import
{
import
{
View
,
View
,
Text
,
Text
,
TextInput
,
TouchableOpacity
,
TouchableOpacity
,
StyleSheet
,
StyleSheet
,
Touchable
,
Alert
,
TouchableOpacityBase
,
Dimensions
,
KeyboardAvoidingView
,
KeyboardAvoidingView
,
ScrollView
,
ScrollView
,
Platform
,
Platform
,
...
@@ -15,37 +12,58 @@ import {
...
@@ -15,37 +12,58 @@ import {
Keyboard
,
Keyboard
,
}
from
'react-native'
;
}
from
'react-native'
;
import
R
from
'../../../../assets/R'
;
import
R
from
'../../../../assets/R'
;
import
RadioForm
,
{
RadioButton
,
RadioButtonInput
,
RadioButtonLabel
,
}
from
'react-native-simple-radio-button'
;
import
PickerDate
from
'../../../../components/Picker/PickerDate'
;
import
PickerDate
from
'../../../../components/Picker/PickerDate'
;
import
TextMulti
from
'../../../../components/Input/TextMulti'
;
import
TextMulti
from
'../../../../components/Input/TextMulti'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
showLoading
,
hideLoading
}
from
'../../../../actions/loadingAction'
;
import
{
showLoading
,
hideLoading
}
from
'../../../../actions/loadingAction'
;
import
{
converStringToDate
}
from
'../../../../Config/Functions'
;
import
{
saveUserToRedux
}
from
'../../../../actions/users'
;
var
radio_props
=
[
{
label
:
'Nam'
,
value
:
0
},
{
label
:
'Nữ'
,
value
:
1
},
];
const
{
width
}
=
Dimensions
.
get
(
'window'
);
import
TextField
from
'../../../../components/Input/TextField'
;
import
TextField
from
'../../../../components/Input/TextField'
;
import
PickerItem
from
'../../../../components/Picker/PickerItem'
;
import
{
import
{
getFontXD
,
getFontXD
,
HEIGHTXD
,
HEIGHTXD
,
WIDTHXD
,
WIDTHXD
,
renderStatus
,
renderStatus
,
checkFormatArray
,
}
from
'../../../../Config/Functions'
;
}
from
'../../../../Config/Functions'
;
import
Icon
from
'react-native-vector-icons/Ionicon
s'
;
import
{
updateInforUser
}
from
'../../../../apis/Functions/user
s'
;
const
GeneralInfor
=
(
props
)
=>
{
const
GeneralInfor
=
(
props
)
=>
{
const
[
Select
,
setSelect
]
=
useState
(
'ABC'
);
const
[
phone
,
setPhone
]
=
useState
(
props
.
user
.
phone
);
const
[
bank
,
setBank
]
=
useState
();
const
[
address
,
setAddress
]
=
useState
(
props
.
user
.
address
);
const
[
account
,
setAccount
]
=
useState
();
const
onClick
=
async
()
=>
{
const
titles
=
[
'điện thoại'
,
'địa chỉ'
];
const
index
=
checkFormatArray
([
phone
,
address
]);
if
(
index
===
true
)
{
props
.
showLoading
();
const
res
=
await
updateInforUser
({
uid
:
props
.
user
.
uid
,
platform
:
Platform
.
OS
,
phone
,
address
,
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
setTimeout
(()
=>
{
props
.
saveUserToRedux
(
res
.
data
.
data
);
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
props
.
navigation
.
popToTop
();
},
500
);
}
else
{
setTimeout
(()
=>
{
Alert
.
alert
(
'Thông báo!'
,
res
.
data
.
message
);
},
500
);
}
}
else
{
Alert
.
alert
(
'Thông báo!'
,
'Vui lòng điền '
+
titles
[
index
]);
}
};
const
renderMale
=
()
=>
{
if
(
props
.
user
.
gender
==
1
)
return
'Nữ'
;
return
'Nam'
;
};
return
(
return
(
<
KeyboardAvoidingView
<
KeyboardAvoidingView
behavior
=
{
Platform
.
Os
===
'ios'
?
'padding'
:
'height'
}
behavior
=
{
Platform
.
Os
===
'ios'
?
'padding'
:
'height'
}
...
@@ -54,68 +72,65 @@ const GeneralInfor = (props) => {
...
@@ -54,68 +72,65 @@ const GeneralInfor = (props) => {
<
TouchableWithoutFeedback
onPress
=
{
Keyboard
.
dismiss
}
>
<
TouchableWithoutFeedback
onPress
=
{
Keyboard
.
dismiss
}
>
<
ScrollView
style
=
{{
flex
:
1
}}
showsVerticalScrollIndicator
=
{
false
}
>
<
ScrollView
style
=
{{
flex
:
1
}}
showsVerticalScrollIndicator
=
{
false
}
>
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
TextField
<
View
style
=
{
styles
.
wrapItem
}
>
value
=
{
props
.
user
.
fullname
}
<
View
style
=
{
styles
.
wrapLeft
}
>
editable
=
{
false
}
<
Text
style
=
{
styles
.
txtTitle
}
>
H
ọ
v
à
t
ê
n
<
/Text
>
title
=
{
'Họ và tên'
}
<
/View
>
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
<
View
style
=
{
styles
.
wrapRight
}
>
/
>
<
Text
style
=
{
styles
.
txtTitle
}
>
{
props
.
user
.
fullname
}
<
/Text
>
<
TextField
<
/View
>
title
=
{
'Điện thoại'
}
<
/View
>
editable
=
{
false
}
<
View
style
=
{
styles
.
wrapItem
}
>
value
=
{
props
.
user
.
phone
}
<
View
style
=
{
styles
.
wrapLeft
}
>
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
<
Text
style
=
{
styles
.
txtTitle
}
>
Email
<
/Text
>
/
>
<
/View
>
<
View
style
=
{
styles
.
wrapRight
}
>
<
TextField
<
Text
style
=
{
styles
.
txtTitle
}
>
{
props
.
user
.
email
}
<
/Text
>
editable
=
{
false
}
<
/View
>
title
=
{
'Email'
}
<
/View
>
value
=
{
props
.
user
.
email
}
<
View
style
=
{
styles
.
wrapItem
}
>
onChangeText
=
{(
val
)
=>
console
.
log
(
val
)}
<
View
style
=
{
styles
.
wrapLeft
}
>
/
>
<
Text
style
=
{
styles
.
txtTitle
}
>
Ng
à
y
sinh
<
/Text
>
{
/*
<
/View
>
<TextInput
<
View
style
=
{
styles
.
wrapRight
}
>
style={styles.customTxt}
<
Text
style
=
{
styles
.
txtTitle
}
>
{
props
.
user
.
birthday
}
<
/Text
>
onChangeText={(val) => console.log(val)}
<
/View
>
placeholder="0000"
<
/View
>
/> */
}
<
View
style
=
{
styles
.
wrapItem
}
>
<
View
style
=
{
styles
.
wrapLeft
}
>
<
Text
style
=
{
styles
.
txtTitle
}
>
Gi
ớ
i
t
í
nh
<
/Text
>
<
Text
style
=
{
styles
.
txtTitle
}
>
Gi
ớ
i
t
í
nh
<
/Text
>
<
/View
>
<
RadioForm
<
View
style
=
{
styles
.
wrapRight
}
>
radio_props
=
{
radio_props
}
<
Text
style
=
{
styles
.
txtTitle
}
>
{
renderMale
()}
<
/Text
>
labelStyle
=
{{
fontSize
:
getFontXD
(
42
)}}
<
/View
>
formHorizontal
=
{
true
}
<
/View
>
style
=
{
styles
.
row
}
<
View
style
=
{
styles
.
wrapItem
}
>
initial
=
{
0
}
<
View
style
=
{
styles
.
wrapLeft
}
>
onPress
=
{(
value
)
=>
{
<
Text
style
=
{
styles
.
txtTitle
}
>
Tr
ạ
ng
th
á
i
<
/Text
>
setAccount
({
value
:
value
});
<
/View
>
}}
<
View
style
=
{
styles
.
wrapRight
}
>
/
>
<
Text
style
=
{
styles
.
txtTitle
}
>
{
' '
}
<
View
style
=
{
styles
.
status
}
>
{
renderStatus
(
props
.
user
.
status
)}
<
Text
style
=
{
styles
.
txtTitle
}
>
Tr
ạ
ng
th
á
i
<
/Text
>
<
/Text
>
{
renderStatus
(
props
.
user
.
status
)}
<
/View
>
<
/View
>
<
/View
>
<
PickerDate
<
TextField
valueString
=
{
converStringToDate
(
props
.
user
.
birthday
)
}
title
=
{
'Điện thoại'
}
title
=
{
'Ngày sinh'
}
value
=
{
phone
}
disabled
=
{
true
}
onChangeText
=
{(
val
)
=>
setPhone
(
val
)
}
/
>
/
>
<
TextMulti
<
TextMulti
onChangeText
=
{(
val
)
=>
consoele
.
log
(
val
)}
onChangeText
=
{(
val
)
=>
setAddress
(
val
)}
value
=
{
props
.
user
.
address
}
value
=
{
address
}
editable
=
{
false
}
title
=
{
'Địa chỉ'
}
title
=
{
'Địa chỉ'
}
/
>
/
>
<
View
style
=
{{
height
:
40
}}
/
>
<
View
style
=
{{
height
:
40
}}
/
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
TouchableOpacity
<
TouchableOpacity
onPress
=
{
onClick
}
style
=
{
styles
.
btn
}
>
onPress
=
{()
=>
console
.
log
(
'Hello'
)}
style
=
{
styles
.
btn
}
>
<
Text
style
=
{
styles
.
txtBtn
}
>
C
ậ
p
nh
ậ
t
<
/Text
>
<
Text
style
=
{
styles
.
txtBtn
}
>
C
ậ
p
nh
ậ
t
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
@@ -132,6 +147,10 @@ const styles = StyleSheet.create({
...
@@ -132,6 +147,10 @@ const styles = StyleSheet.create({
paddingHorizontal
:
10
,
paddingHorizontal
:
10
,
paddingVertical
:
10
,
paddingVertical
:
10
,
},
},
wrapItem
:
{
flexDirection
:
'row'
,
marginVertical
:
5
,
},
customTxt
:
{
customTxt
:
{
height
:
HEIGHTXD
(
110
),
height
:
HEIGHTXD
(
110
),
color
:
'black'
,
color
:
'black'
,
...
@@ -153,6 +172,12 @@ const styles = StyleSheet.create({
...
@@ -153,6 +172,12 @@ const styles = StyleSheet.create({
marginTop
:
50
,
marginTop
:
50
,
marginBottom
:
20
,
marginBottom
:
20
,
},
},
wrapLeft
:
{
flex
:
1
,
},
wrapRight
:
{
flex
:
2
,
},
status
:
{
status
:
{
flexDirection
:
'row'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
justifyContent
:
'space-between'
,
...
@@ -205,6 +230,8 @@ const mapStateToProps = (state) => {
...
@@ -205,6 +230,8 @@ const mapStateToProps = (state) => {
user
:
state
.
userReducer
,
user
:
state
.
userReducer
,
};
};
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
export
default
connect
(
mapStateToProps
,
{
GeneralInfor
,
showLoading
,
);
saveUserToRedux
,
hideLoading
,
})(
GeneralInfor
);
src/apis/Functions/users.js
View file @
94b48eb5
...
@@ -46,3 +46,8 @@ export const getListNotification = async (body) =>
...
@@ -46,3 +46,8 @@ export const getListNotification = async (body) =>
GetData
(
url
.
urlGetListNotification
,
body
)
GetData
(
url
.
urlGetListNotification
,
body
)
.
then
((
res
)
=>
res
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
.
catch
((
err
)
=>
err
);
export
const
updateInforUser
=
async
(
body
)
=>
PostData
(
url
.
urlUpdateInforUser
,
body
)
.
then
((
res
)
=>
res
)
.
catch
((
err
)
=>
err
);
src/apis/url.js
View file @
94b48eb5
...
@@ -33,4 +33,6 @@ export default {
...
@@ -33,4 +33,6 @@ export default {
urlGetListPacketCQG
:
root
+
'api/v1/customers/get-list-fee-package'
,
urlGetListPacketCQG
:
root
+
'api/v1/customers/get-list-fee-package'
,
urlOpenCQG
:
root
+
'api/v1/customers/register-open-cqg'
,
urlOpenCQG
:
root
+
'api/v1/customers/register-open-cqg'
,
urlUpdateInforUser
:
root
+
'api/v1/customers/update-general-info'
,
};
};
src/helper/FirebaseNotification.js
View file @
94b48eb5
...
@@ -31,7 +31,7 @@ const FirebaseNotification = (props) => {
...
@@ -31,7 +31,7 @@ const FirebaseNotification = (props) => {
});
});
});
});
(
async
()
=>
await
messaging
().
registerDeviceForRemoteMessages
())();
//
(async () => await messaging().registerDeviceForRemoteMessages())();
messaging
().
onNotificationOpenedApp
((
remoteMessage
)
=>
{
messaging
().
onNotificationOpenedApp
((
remoteMessage
)
=>
{
console
.
log
(
console
.
log
(
'Notification caused app to open from background state:'
,
'Notification caused app to open from background state:'
,
...
...
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