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';
...
@@ -10,6 +10,7 @@ import moment from 'moment';
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
{
DETAILNEW
,
NOTIFICATION
}
from
'../routers/ScreenNames'
;
import
{
DETAILNEW
,
NOTIFICATION
}
from
'../routers/ScreenNames'
;
import
R
from
'../assets/R'
;
export
const
convertScreen
=
(
name
)
=>
{
export
const
convertScreen
=
(
name
)
=>
{
switch
(
name
)
{
switch
(
name
)
{
...
@@ -68,6 +69,28 @@ export const renderStatus = (status) => {
...
@@ -68,6 +69,28 @@ export const renderStatus = (status) => {
Đã
x
á
c
minh
Đã
x
á
c
minh
<
/Text
>
<
/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
:
default
:
return
(
return
(
<
Text
<
Text
...
...
src/Screens/Authen/Login.js
View file @
f66f2670
...
@@ -25,6 +25,7 @@ import AsyncStorage from '@react-native-community/async-storage';
...
@@ -25,6 +25,7 @@ import AsyncStorage from '@react-native-community/async-storage';
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
import
{
showLoading
,
hideLoading
}
from
'../../actions/loadingAction'
;
import
{
saveUserToRedux
}
from
'../../actions/users'
;
import
{
saveUserToRedux
}
from
'../../actions/users'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
messaging
from
'@react-native-firebase/messaging'
;
const
Login
=
(
props
)
=>
{
const
Login
=
(
props
)
=>
{
const
{
navigation
}
=
props
;
const
{
navigation
}
=
props
;
...
@@ -34,8 +35,20 @@ const Login = (props) => {
...
@@ -34,8 +35,20 @@ const Login = (props) => {
const
navigate
=
useNavigation
();
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
(()
=>
{
useEffect
(()
=>
{
getAccount
();
getAccount
();
getTokenDevice
();
},
[]);
},
[]);
const
getAccount
=
async
()
=>
{
const
getAccount
=
async
()
=>
{
...
@@ -51,8 +64,8 @@ const Login = (props) => {
...
@@ -51,8 +64,8 @@ const Login = (props) => {
const
index
=
checkFormatArray
([
email
,
pass
]);
const
index
=
checkFormatArray
([
email
,
pass
]);
if
(
index
===
true
)
{
if
(
index
===
true
)
{
props
.
showLoading
();
firebase
=
await
AsyncStorage
.
getItem
(
KEY
.
FIREBASE
);
firebase
=
await
AsyncStorage
.
getItem
(
KEY
.
FIREBASE
);
props
.
showLoading
();
const
res
=
await
loginApi
({
const
res
=
await
loginApi
({
email
,
email
,
password
:
pass
,
password
:
pass
,
...
...
src/Screens/Menu/Rose/Rose.js
View file @
f66f2670
...
@@ -62,11 +62,7 @@ const Rose = (props) => {
...
@@ -62,11 +62,7 @@ const Rose = (props) => {
return
(
return
(
<
View
style
=
{{
flex
:
1
}}
>
<
View
style
=
{{
flex
:
1
}}
>
<
HeaderSB
title
=
{
'Hoa hồng'
}
/
>
<
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
}}
>
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
flex
:
1
}}
>
<
Text
<
Text
style
=
{{
style
=
{{
...
...
src/components/Header/HeaderHome.js
View file @
f66f2670
...
@@ -77,7 +77,7 @@ const renderWallet = (status, current_money, current_cqg_money, contract) => {
...
@@ -77,7 +77,7 @@ const renderWallet = (status, current_money, current_cqg_money, contract) => {
<
/View
>
<
/View
>
<
/View
>
<
/View
>
);
);
if
(
status
==
3
&&
!
contract
)
if
(
status
==
3
)
return
(
return
(
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
}}
>
<
View
style
=
{
styles
.
containerWallet
}
>
<
View
style
=
{
styles
.
containerWallet
}
>
...
...
src/helper/FirebaseNotification.js
View file @
f66f2670
...
@@ -17,6 +17,9 @@ const FirebaseNotification = (props) => {
...
@@ -17,6 +17,9 @@ const FirebaseNotification = (props) => {
messaging
().
onNotificationOpenedApp
(
async
(
remoteMessage
)
=>
{
messaging
().
onNotificationOpenedApp
(
async
(
remoteMessage
)
=>
{
console
.
log
(
'On notifi open app-----'
,
remoteMessage
);
console
.
log
(
'On notifi open app-----'
,
remoteMessage
);
});
});
useEffect
(()
=>
{
getFcmToken
();
},
[]);
useEffect
(()
=>
{
useEffect
(()
=>
{
requestUserPermission
();
requestUserPermission
();
...
@@ -74,10 +77,10 @@ const FirebaseNotification = (props) => {
...
@@ -74,10 +77,10 @@ const FirebaseNotification = (props) => {
}
}
};
};
const
getFcmToken
=
async
()
=>
{
const
getFcmToken
=
async
()
=>
{
console
.
log
(
'Chay vao day'
);
let
fcmToken
=
await
AsyncStorage
.
getItem
(
KEY
.
FIREBASE
);
let
fcmToken
=
await
AsyncStorage
.
getItem
(
KEY
.
FIREBASE
);
console
.
log
(
fcmToken
);
console
.
log
(
'fcmToken save'
,
fcmToken
);
if
(
!
fcmToken
)
{
if
(
!
fcmToken
)
{
console
.
log
(
fcmToken
);
fcmToken
=
await
messaging
().
getToken
();
fcmToken
=
await
messaging
().
getToken
();
if
(
fcmToken
)
{
if
(
fcmToken
)
{
AsyncStorage
.
setItem
(
KEY
.
FIREBASE
,
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