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
f66f2670
Commit
f66f2670
authored
Apr 22, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit logout
parent
350fc230
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
9 deletions
+44
-9
Functions.js
src/Config/Functions.js
+23
-0
Login.js
src/Screens/Authen/Login.js
+14
-1
Rose.js
src/Screens/Menu/Rose/Rose.js
+1
-5
HeaderHome.js
src/components/Header/HeaderHome.js
+1
-1
FirebaseNotification.js
src/helper/FirebaseNotification.js
+5
-2
No files found.
src/Config/Functions.js
View file @
f66f2670
...
...
@@ -10,6 +10,7 @@ import moment from 'moment';
import
_
from
'lodash'
;
import
{
DETAILNEW
,
NOTIFICATION
}
from
'../routers/ScreenNames'
;
import
R
from
'../assets/R'
;
export
const
convertScreen
=
(
name
)
=>
{
switch
(
name
)
{
...
...
@@ -68,6 +69,28 @@ export const renderStatus = (status) => {
Đã
x
á
c
minh
<
/Text
>
);
case
5
:
return
(
<
Text
style
=
{{
color
:
'#F99D1D'
,
fontWeight
:
'bold'
,
fontSize
:
getFontXD
(
42
),
}}
>
Y
ê
u
c
ầ
u
m
ở
TK
CQG
<
/Text
>
);
case
6
:
return
(
<
Text
style
=
{{
color
:
R
.
colors
.
main
,
fontWeight
:
'bold'
,
fontSize
:
getFontXD
(
42
),
}}
>
C
ó
t
à
i
kho
ả
n
CQG
<
/Text
>
);
default
:
return
(
<
Text
...
...
src/Screens/Authen/Login.js
View file @
f66f2670
...
...
@@ -25,6 +25,7 @@ import AsyncStorage from '@react-native-community/async-storage';
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
import
{
saveUserToRedux
}
from
'../../actions/users'
;
import
{
connect
}
from
'react-redux'
;
import
messaging
from
'@react-native-firebase/messaging'
;
const
Login
=
(
props
)
=>
{
const
{
navigation
}
=
props
;
...
...
@@ -34,8 +35,20 @@ const Login = (props) => {
const
navigate
=
useNavigation
();
const
getTokenDevice
=
async
()
=>
{
let
fcmToken
=
await
AsyncStorage
.
getItem
(
KEY
.
FIREBASE
);
if
(
!
fcmToken
)
{
fcmToken
=
await
messaging
().
getToken
();
if
(
fcmToken
)
{
AsyncStorage
.
setItem
(
KEY
.
FIREBASE
,
fcmToken
);
}
}
};
useEffect
(()
=>
{
getAccount
();
getTokenDevice
();
},
[]);
const
getAccount
=
async
()
=>
{
...
...
@@ -51,8 +64,8 @@ const Login = (props) => {
const
index
=
checkFormatArray
([
email
,
pass
]);
if
(
index
===
true
)
{
props
.
showLoading
();
firebase
=
await
AsyncStorage
.
getItem
(
KEY
.
FIREBASE
);
props
.
showLoading
();
const
res
=
await
loginApi
({
email
,
password
:
pass
,
...
...
src/Screens/Menu/Rose/Rose.js
View file @
f66f2670
...
...
@@ -62,11 +62,7 @@ const Rose = (props) => {
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderSB
title
=
{
'Hoa hồng'
}
/
>
<
TextMoney
value
=
{
toPriceVnd
(
text
)}
style
=
{{
width
:
100
}}
onChangeText
=
{(
val
)
=>
setText
(
val
.
split
(
','
).
join
(
''
))}
/
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
Text
style
=
{{
...
...
src/components/Header/HeaderHome.js
View file @
f66f2670
...
...
@@ -77,7 +77,7 @@ const renderWallet = (status, current_money, current_cqg_money, contract) => {
<
/View
>
<
/View
>
);
if
(
status
==
3
&&
!
contract
)
if
(
status
==
3
)
return
(
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{
styles
.
containerWallet
}
>
...
...
src/helper/FirebaseNotification.js
View file @
f66f2670
...
...
@@ -17,6 +17,9 @@ const FirebaseNotification = (props) => {
messaging
().
onNotificationOpenedApp
(
async
(
remoteMessage
)
=>
{
console
.
log
(
'On notifi open app-----'
,
remoteMessage
);
});
useEffect
(()
=>
{
getFcmToken
();
},
[]);
useEffect
(()
=>
{
requestUserPermission
();
...
...
@@ -74,10 +77,10 @@ const FirebaseNotification = (props) => {
}
};
const
getFcmToken
=
async
()
=>
{
console
.
log
(
'Chay vao day'
);
let
fcmToken
=
await
AsyncStorage
.
getItem
(
KEY
.
FIREBASE
);
console
.
log
(
fcmToken
);
console
.
log
(
'fcmToken save'
,
fcmToken
);
if
(
!
fcmToken
)
{
console
.
log
(
fcmToken
);
fcmToken
=
await
messaging
().
getToken
();
if
(
fcmToken
)
{
AsyncStorage
.
setItem
(
KEY
.
FIREBASE
,
fcmToken
);
...
...
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