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
90242d0a
Commit
90242d0a
authored
Jun 11, 2021
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push code
parent
b404a8ba
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
640 additions
and
121 deletions
+640
-121
project.pbxproj
ios/instrumentscli0.trace/Invest.xcodeproj/project.pbxproj
+0
-0
Invest-tvOS.xcscheme
...est.xcodeproj/xcshareddata/xcschemes/Invest-tvOS.xcscheme
+88
-0
Invest.xcscheme
...e/Invest.xcodeproj/xcshareddata/xcschemes/Invest.xcscheme
+88
-0
ChangeSmartOTP.js
src/Screens/SmartOTP/ChangeSmartOTP/ChangeSmartOTP.js
+2
-1
ConfirmChangeSmartOTP.js
src/Screens/SmartOTP/ChangeSmartOTP/ConfirmChangeSmartOTP.js
+52
-22
ConfirmCreate.js
src/Screens/SmartOTP/ConfirmCreate/ConfirmCreate.js
+91
-0
ConfirmCreateView.js
src/Screens/SmartOTP/ConfirmCreate/ConfirmCreateView.js
+200
-0
EnterPasswordSmartOTP.js
src/Screens/SmartOTP/EnterPasswordSmartOTP.js
+97
-94
ScreenNames.js
src/routers/ScreenNames.js
+2
-0
StackNavigation.js
src/routers/StackNavigation.js
+14
-2
TabNavigation.js
src/routers/TabNavigation.js
+6
-2
No files found.
ios/instrumentscli0.trace/Invest.xcodeproj/project.pbxproj
0 → 100644
View file @
90242d0a
This diff is collapsed.
Click to expand it.
ios/instrumentscli0.trace/Invest.xcodeproj/xcshareddata/xcschemes/Invest-tvOS.xcscheme
0 → 100644
View file @
90242d0a
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"1130"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"2D02E47A1E0B4A5D006451C7"
BuildableName =
"Invest-tvOS.app"
BlueprintName =
"Invest-tvOS"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
<TestableReference
skipped =
"NO"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"2D02E48F1E0B4A5D006451C7"
BuildableName =
"Invest-tvOSTests.xctest"
BlueprintName =
"Invest-tvOSTests"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"2D02E47A1E0B4A5D006451C7"
BuildableName =
"Invest-tvOS.app"
BlueprintName =
"Invest-tvOS"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"2D02E47A1E0B4A5D006451C7"
BuildableName =
"Invest-tvOS.app"
BlueprintName =
"Invest-tvOS"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Debug"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
ios/instrumentscli0.trace/Invest.xcodeproj/xcshareddata/xcschemes/Invest.xcscheme
0 → 100644
View file @
90242d0a
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"1130"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"13B07F861A680F5B00A75B9A"
BuildableName =
"Invest.app"
BlueprintName =
"Invest"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
<TestableReference
skipped =
"NO"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"00E356ED1AD99517003FC87E"
BuildableName =
"InvestTests.xctest"
BlueprintName =
"InvestTests"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"13B07F861A680F5B00A75B9A"
BuildableName =
"Invest.app"
BlueprintName =
"Invest"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"13B07F861A680F5B00A75B9A"
BuildableName =
"Invest.app"
BlueprintName =
"Invest"
ReferencedContainer =
"container:Invest.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Debug"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
src/Screens/SmartOTP/ChangeSmartOTP/ChangeSmartOTP.js
View file @
90242d0a
...
@@ -33,7 +33,7 @@ const EnterPasswordSmartOTP = (props) => {
...
@@ -33,7 +33,7 @@ const EnterPasswordSmartOTP = (props) => {
setFourNumber
(
number
.
toString
());
setFourNumber
(
number
.
toString
());
}
}
};
};
console
.
log
(
'Pros pass'
,
props
.
route
.
params
);
const
onCheckPINSmartOTPPin
=
async
()
=>
{
const
onCheckPINSmartOTPPin
=
async
()
=>
{
let
pinCode
=
`
${
firstNumber
}${
secondsNumber
}${
thirdNumber
}${
fourNumber
}
`
;
let
pinCode
=
`
${
firstNumber
}${
secondsNumber
}${
thirdNumber
}${
fourNumber
}
`
;
setFirstNumber
(
null
);
setFirstNumber
(
null
);
...
@@ -43,6 +43,7 @@ const EnterPasswordSmartOTP = (props) => {
...
@@ -43,6 +43,7 @@ const EnterPasswordSmartOTP = (props) => {
navigation
.
navigate
(
CONFIRMCHANGESMARTOTP
,
{
navigation
.
navigate
(
CONFIRMCHANGESMARTOTP
,
{
pre_otp
:
pinCode
,
pre_otp
:
pinCode
,
old_password
:
props
.
route
.
params
.
old_password
,
old_password
:
props
.
route
.
params
.
old_password
,
TYPE
:
props
.
route
.
params
.
TYPE
,
});
});
};
};
const
onDeletePress
=
()
=>
{
const
onDeletePress
=
()
=>
{
...
...
src/Screens/SmartOTP/ChangeSmartOTP/ConfirmChangeSmartOTP.js
View file @
90242d0a
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
ConfirmSmartOTPView
from
'./ConfirmSmartOTPView'
;
import
ConfirmSmartOTPView
from
'./ConfirmSmartOTPView'
;
import
{
updateOTPApiSmart
}
from
'../../../apis/Functions/users'
;
import
{
updateOTPApiSmart
,
getOTPApiSmartOTP
,
}
from
'../../../apis/Functions/users'
;
import
{
showAlert
,
TYPE
}
from
'../../../components/DropdownAlert'
;
import
{
showAlert
,
TYPE
}
from
'../../../components/DropdownAlert'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
hideLoading
,
showLoading
}
from
'../../../actions/loadingAction'
;
import
{
hideLoading
,
showLoading
}
from
'../../../actions/loadingAction'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
{
SMARTOTPCONFIG
,
TABNAVIGATOR
}
from
'../../../routers/ScreenNames'
;
import
{
SMARTOTPCONFIG
,
TABNAVIGATOR
,
CONFIRMCREATEOTP
,
}
from
'../../../routers/ScreenNames'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
const
ConfirmChangeSmartOTP
=
(
props
)
=>
{
const
ConfirmChangeSmartOTP
=
(
props
)
=>
{
...
@@ -31,29 +38,52 @@ const ConfirmChangeSmartOTP = (props) => {
...
@@ -31,29 +38,52 @@ const ConfirmChangeSmartOTP = (props) => {
}
}
};
};
console
.
log
(
'Pros pass'
,
props
.
route
.
params
);
const
onCheckPINSmartOTPPin
=
async
()
=>
{
const
onCheckPINSmartOTPPin
=
async
()
=>
{
let
pinCode
=
`
${
firstNumber
}${
secondsNumber
}${
thirdNumber
}${
fourNumber
}
`
;
let
pinCode
=
`
${
firstNumber
}${
secondsNumber
}${
thirdNumber
}${
fourNumber
}
`
;
props
.
showLoading
();
const
res
=
await
updateOTPApiSmart
({
if
(
props
.
route
.
params
.
TYPE
==
'CHANGE_SMART_OTP'
)
{
platform
:
Platform
.
OS
,
props
.
showLoading
();
password
:
props
.
route
.
params
.
pre_otp
,
const
res
=
await
updateOTPApiSmart
({
password_confirmation
:
pinCode
,
platform
:
Platform
.
OS
,
old_password
:
props
.
route
.
params
.
old_password
,
password
:
props
.
route
.
params
.
pre_otp
,
});
password_confirmation
:
pinCode
,
props
.
hideLoading
();
old_password
:
props
.
route
.
params
.
old_password
,
if
(
res
.
data
.
code
==
200
)
{
});
showAlert
(
TYPE
.
SUCCESS
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
props
.
hideLoading
();
setFirstNumber
(
null
);
if
(
res
.
data
.
code
==
200
)
{
setSecondsNumber
(
null
);
showAlert
(
TYPE
.
SUCCESS
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
setThirdNumber
(
null
);
setFirstNumber
(
null
);
setFourNumber
(
null
);
setSecondsNumber
(
null
);
navigation
.
navigate
(
SMARTOTPCONFIG
);
setThirdNumber
(
null
);
setFourNumber
(
null
);
navigation
.
navigate
(
SMARTOTPCONFIG
);
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
setFirstNumber
(
null
);
setSecondsNumber
(
null
);
setThirdNumber
(
null
);
setFourNumber
(
null
);
}
}
else
{
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
props
.
showLoading
();
setFirstNumber
(
null
);
const
res
=
await
getOTPApiSmartOTP
({
setSecondsNumber
(
null
);
platform
:
Platform
.
OS
,
setThirdNumber
(
null
);
otp_by
:
props
.
user
.
email
,
setFourNumber
(
null
);
otp_password
:
'1234'
,
type
:
'CREATE_OTP_PASSWORD'
,
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
showAlert
(
TYPE
.
SUCCESS
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
navigation
.
navigate
(
CONFIRMCREATEOTP
,
{
password
:
props
.
route
.
params
.
pre_otp
,
password_confirmation
:
pinCode
,
});
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
}
}
};
};
const
onDeletePress
=
()
=>
{
const
onDeletePress
=
()
=>
{
...
...
src/Screens/SmartOTP/ConfirmCreate/ConfirmCreate.js
0 → 100644
View file @
90242d0a
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
ConfirmCreateView
from
'./ConfirmCreateView'
;
import
{
verifyStoreOTPApiSmart
}
from
'../../../apis/Functions/users'
;
import
{
showAlert
,
TYPE
}
from
'../../../components/DropdownAlert'
;
import
{
connect
}
from
'react-redux'
;
import
{
hideLoading
,
showLoading
}
from
'../../../actions/loadingAction'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
{
useNavigation
}
from
'@react-navigation/native'
;
import
{
CONFIRMCHANGESMARTOTP
,
TABNAVIGATOR
,
}
from
'../../../routers/ScreenNames'
;
const
EnterPasswordSmartOTP
=
(
props
)
=>
{
const
navigation
=
useNavigation
();
const
[
firstNumber
,
setFirstNumber
]
=
useState
(
null
);
const
[
secondsNumber
,
setSecondsNumber
]
=
useState
(
null
);
const
[
thirdNumber
,
setThirdNumber
]
=
useState
(
null
);
const
[
fourNumber
,
setFourNumber
]
=
useState
(
null
);
useEffect
(()
=>
{
if
(
fourNumber
)
{
onCheckPINSmartOTPPin
();
}
},
[
fourNumber
]);
const
onNumberPress
=
(
number
)
=>
{
if
(
!
firstNumber
)
{
setFirstNumber
(
number
.
toString
());
}
else
if
(
!
secondsNumber
)
{
setSecondsNumber
(
number
.
toString
());
}
else
if
(
!
thirdNumber
)
{
setThirdNumber
(
number
.
toString
());
}
else
if
(
!
fourNumber
)
{
setFourNumber
(
number
.
toString
());
}
};
const
onCheckPINSmartOTPPin
=
async
()
=>
{
let
pinCode
=
`
${
firstNumber
}${
secondsNumber
}${
thirdNumber
}${
fourNumber
}
`
;
setFirstNumber
(
null
);
setSecondsNumber
(
null
);
setThirdNumber
(
null
);
setFourNumber
(
null
);
props
.
showLoading
();
const
res
=
await
verifyStoreOTPApiSmart
({
platform
:
Platform
.
OS
,
password
:
props
.
route
.
params
.
password
,
password_confirmation
:
props
.
route
.
params
.
password_confirmation
,
otp
:
pinCode
,
type
:
'CREATE_OTP_PASSWORD'
,
});
props
.
hideLoading
();
if
(
res
.
data
.
code
==
200
)
{
showAlert
(
TYPE
.
SUCCESS
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
navigation
.
navigate
(
TABNAVIGATOR
);
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
}
};
const
onDeletePress
=
()
=>
{
if
(
fourNumber
)
{
setFourNumber
(
null
);
}
else
if
(
thirdNumber
)
{
setThirdNumber
(
null
);
}
else
if
(
secondsNumber
)
{
setSecondsNumber
(
null
);
}
else
if
(
firstNumber
)
{
setFirstNumber
(
null
);
}
};
return
(
<
ConfirmCreateView
firstNumber
=
{
firstNumber
}
secondsNumber
=
{
secondsNumber
}
thirdNumber
=
{
thirdNumber
}
fourNumber
=
{
fourNumber
}
onNumberPress
=
{
onNumberPress
}
onDeletePress
=
{
onDeletePress
}
/
>
);
};
const
mapStateToProps
=
(
state
)
=>
{
return
{
user
:
state
.
userReducer
,
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
EnterPasswordSmartOTP
,
);
src/Screens/SmartOTP/ConfirmCreate/ConfirmCreateView.js
0 → 100644
View file @
90242d0a
import
React
from
'react'
;
import
{
StyleSheet
,
Text
,
TouchableOpacity
,
View
}
from
'react-native'
;
import
HeaderBack
from
'../../../components/Header/HeaderBack'
;
import
{
getFontXD
,
HEIGHTXD
,
WIDTHXD
}
from
'../../../Config/Functions'
;
import
I18n
from
'../../../helper/i18/i18n'
;
import
R
from
'../../../assets/R'
;
import
Icon
from
'react-native-vector-icons/FontAwesome5'
;
const
ChangeSmartOTPView
=
(
props
)
=>
{
return
(
<
View
style
=
{{
flex
:
1
,
colorBackground
:
R
.
colors
.
white
}}
>
<
HeaderBack
title
=
{
'ChangeSmartOTP'
}
/
>
<
Text
style
=
{[
styles
.
textNormal
,
{
marginTop
:
HEIGHTXD
(
40
)}]}
>
{
I18n
.
t
(
'EnterOTPRequest'
)}
<
/Text
>
<
View
style
=
{[
styles
.
rowNumber
]}
>
<
View
style
=
{[
styles
.
indicator
,
{
backgroundColor
:
props
.
firstNumber
?
R
.
colors
.
main
:
R
.
colors
.
white
,
},
]}
/
>
<
View
style
=
{[
styles
.
indicator
,
{
backgroundColor
:
props
.
secondsNumber
?
R
.
colors
.
main
:
R
.
colors
.
white
,
},
]}
/
>
<
View
style
=
{[
styles
.
indicator
,
{
backgroundColor
:
props
.
thirdNumber
?
R
.
colors
.
main
:
R
.
colors
.
white
,
},
]}
/
>
<
View
style
=
{[
styles
.
indicator
,
{
backgroundColor
:
props
.
fourNumber
?
R
.
colors
.
main
:
R
.
colors
.
white
,
},
]}
/
>
<
/View
>
<
View
style
=
{[
styles
.
rowNumber
,
{
marginTop
:
HEIGHTXD
(
80
)}]}
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
1
);
}}
style
=
{
styles
.
btnNumber
}
>
<
Text
style
=
{
styles
.
textNumber
}
>
1
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
2
);
}}
style
=
{[
styles
.
btnNumber
,
{
marginLeft
:
WIDTHXD
(
40
)}]}
>
<
Text
style
=
{
styles
.
textNumber
}
>
2
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
3
);
}}
style
=
{[
styles
.
btnNumber
,
{
marginLeft
:
WIDTHXD
(
40
)}]}
>
<
Text
style
=
{
styles
.
textNumber
}
>
3
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
rowNumber
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
4
);
}}
style
=
{
styles
.
btnNumber
}
>
<
Text
style
=
{
styles
.
textNumber
}
>
4
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
5
);
}}
style
=
{[
styles
.
btnNumber
,
{
marginLeft
:
WIDTHXD
(
40
)}]}
>
<
Text
style
=
{
styles
.
textNumber
}
>
5
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
6
);
}}
style
=
{[
styles
.
btnNumber
,
{
marginLeft
:
WIDTHXD
(
40
)}]}
>
<
Text
style
=
{
styles
.
textNumber
}
>
6
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
rowNumber
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
7
);
}}
style
=
{
styles
.
btnNumber
}
>
<
Text
style
=
{
styles
.
textNumber
}
>
7
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
8
);
}}
style
=
{[
styles
.
btnNumber
,
{
marginLeft
:
WIDTHXD
(
40
)}]}
>
<
Text
style
=
{
styles
.
textNumber
}
>
8
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
9
);
}}
style
=
{[
styles
.
btnNumber
,
{
marginLeft
:
WIDTHXD
(
40
)}]}
>
<
Text
style
=
{
styles
.
textNumber
}
>
9
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
View
style
=
{
styles
.
rowNumber
}
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onNumberPress
(
0
);
}}
style
=
{[
styles
.
btnNumber
,
{
marginLeft
:
WIDTHXD
(
300
)}]}
>
<
Text
style
=
{
styles
.
textNumber
}
>
0
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
{
props
.
onDeletePress
();
}}
style
=
{{
width
:
HEIGHTXD
(
260
),
height
:
HEIGHTXD
(
260
),
marginLeft
:
WIDTHXD
(
40
),
justifyContent
:
'center'
,
alignItems
:
'center'
,
}}
>
<
Icon
name
=
{
'backspace'
}
size
=
{
HEIGHTXD
(
80
)}
color
=
{
'#8E8C8C'
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
);
};
export
default
ChangeSmartOTPView
;
const
styles
=
StyleSheet
.
create
({
btnSend
:
{
height
:
HEIGHTXD
(
80
),
justifyContent
:
'center'
,
alignItems
:
'center'
,
},
rowNumber
:
{
flexDirection
:
'row'
,
justifyContent
:
'center'
,
marginTop
:
HEIGHTXD
(
40
),
},
btnNumber
:
{
height
:
HEIGHTXD
(
260
),
width
:
HEIGHTXD
(
260
),
justifyContent
:
'center'
,
alignItems
:
'center'
,
borderWidth
:
0.3
,
borderColor
:
R
.
colors
.
gray6
,
borderRadius
:
HEIGHTXD
(
130
),
},
indicator
:
{
height
:
HEIGHTXD
(
50
),
width
:
HEIGHTXD
(
50
),
borderWidth
:
0.3
,
borderColor
:
R
.
colors
.
gray6
,
borderRadius
:
HEIGHTXD
(
35
),
marginHorizontal
:
WIDTHXD
(
20
),
},
textNormal
:
{
fontSize
:
getFontXD
(
39
),
color
:
R
.
colors
.
black
,
textAlign
:
'center'
,
},
textNumber
:
{
fontSize
:
getFontXD
(
90
),
color
:
R
.
colors
.
black
,
textAlign
:
'center'
,
},
txtSend
:
{
fontSize
:
getFontXD
(
42
),
color
:
R
.
colors
.
main
,
},
});
src/Screens/SmartOTP/EnterPasswordSmartOTP.js
View file @
90242d0a
...
@@ -10,107 +10,110 @@ import {useNavigation} from '@react-navigation/native';
...
@@ -10,107 +10,110 @@ import {useNavigation} from '@react-navigation/native';
import
{
RESET_SMART_OTP
,
CHANGESMARTOTP
}
from
'../../routers/ScreenNames'
;
import
{
RESET_SMART_OTP
,
CHANGESMARTOTP
}
from
'../../routers/ScreenNames'
;
const
EnterPasswordSmartOTP
=
(
props
)
=>
{
const
EnterPasswordSmartOTP
=
(
props
)
=>
{
const
navigation
=
useNavigation
();
const
navigation
=
useNavigation
();
const
[
firstNumber
,
setFirstNumber
]
=
useState
(
null
);
const
[
firstNumber
,
setFirstNumber
]
=
useState
(
null
);
const
[
secondsNumber
,
setSecondsNumber
]
=
useState
(
null
);
const
[
secondsNumber
,
setSecondsNumber
]
=
useState
(
null
);
const
[
thirdNumber
,
setThirdNumber
]
=
useState
(
null
);
const
[
thirdNumber
,
setThirdNumber
]
=
useState
(
null
);
const
[
fourNumber
,
setFourNumber
]
=
useState
(
null
);
const
[
fourNumber
,
setFourNumber
]
=
useState
(
null
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
fourNumber
)
{
if
(
fourNumber
)
{
onCheckPINSmartOTPPin
();
onCheckPINSmartOTPPin
();
}
}
},
[
fourNumber
]);
},
[
fourNumber
]);
const
onNumberPress
=
(
number
)
=>
{
const
onNumberPress
=
(
number
)
=>
{
if
(
!
firstNumber
)
{
if
(
!
firstNumber
)
{
setFirstNumber
(
number
.
toString
());
setFirstNumber
(
number
.
toString
());
}
else
if
(
!
secondsNumber
)
{
}
else
if
(
!
secondsNumber
)
{
setSecondsNumber
(
number
.
toString
());
setSecondsNumber
(
number
.
toString
());
}
else
if
(
!
thirdNumber
)
{
}
else
if
(
!
thirdNumber
)
{
setThirdNumber
(
number
.
toString
());
setThirdNumber
(
number
.
toString
());
}
else
if
(
!
fourNumber
)
{
}
else
if
(
!
fourNumber
)
{
setFourNumber
(
number
.
toString
());
setFourNumber
(
number
.
toString
());
}
}
};
};
const
onCheckPINSmartOTPPin
=
async
()
=>
{
const
onCheckPINSmartOTPPin
=
async
()
=>
{
let
pinCode
=
`
${
firstNumber
}${
secondsNumber
}${
thirdNumber
}${
fourNumber
}
`
;
let
pinCode
=
`
${
firstNumber
}${
secondsNumber
}${
thirdNumber
}${
fourNumber
}
`
;
props
.
showLoading
();
props
.
showLoading
();
if
(
props
.
route
.
params
.
type
==
'CHANGE_SMART_OTP'
)
{
if
(
props
.
route
.
params
.
type
==
'CHANGE_SMART_OTP'
)
{
const
res
=
await
verifyOTPApiSmart
({
const
res
=
await
verifyOTPApiSmart
({
platform
:
Platform
.
OS
,
platform
:
Platform
.
OS
,
otp_password
:
pinCode
,
otp_password
:
pinCode
,
type
:
'VERIFY_OTP_PASSWORD'
,
type
:
'VERIFY_OTP_PASSWORD'
,
});
});
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
navigation
.
navigate
(
CHANGESMARTOTP
,
{
old_password
:
pinCode
});
navigation
.
navigate
(
CHANGESMARTOTP
,
{
clearPIN
()
old_password
:
pinCode
,
}
else
{
TYPE
:
'CHANGE_SMART_OTP'
,
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
});
clearPIN
()
clearPIN
();
}
}
else
{
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
const
res
=
await
getOTPApiSmartOTP
({
clearPIN
();
platform
:
Platform
.
OS
,
}
otp_by
:
props
.
user
.
email
,
}
else
{
otp_password
:
pinCode
,
const
res
=
await
getOTPApiSmartOTP
({
type
:
platform
:
Platform
.
OS
,
props
.
route
.
params
.
type
==
'DEPOSIT'
otp_by
:
props
.
user
.
email
,
?
OTP_TYPE
.
CUSTOMER_REQUEST_DEPOSIT
otp_password
:
pinCode
,
:
OTP_TYPE
.
REQUEST_WITHDRAW
,
type
:
});
props
.
route
.
params
.
type
==
'DEPOSIT'
?
OTP_TYPE
.
CUSTOMER_REQUEST_DEPOSIT
:
OTP_TYPE
.
REQUEST_WITHDRAW
,
});
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
props
.
route
.
params
.
onGoToSmartOTP
(
pinCode
,
res
.
data
.
data
.
otp
);
props
.
route
.
params
.
onGoToSmartOTP
(
pinCode
,
res
.
data
.
data
.
otp
);
}
else
{
}
else
{
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
showAlert
(
TYPE
.
ERROR
,
I18n
.
t
(
'Notification'
),
res
.
data
.
message
);
clearPIN
()
clearPIN
();
}
}
}
}
props
.
hideLoading
();
props
.
hideLoading
();
};
};
const
clearPIN
=
()
=>
{
const
clearPIN
=
()
=>
{
setFirstNumber
(
null
);
setFirstNumber
(
null
);
setSecondsNumber
(
null
);
setSecondsNumber
(
null
);
setThirdNumber
(
null
);
setThirdNumber
(
null
);
setFourNumber
(
null
);
setFourNumber
(
null
);
};
const
onDeletePress
=
()
=>
{
if
(
fourNumber
)
{
setFourNumber
(
null
);
}
else
if
(
thirdNumber
)
{
setThirdNumber
(
null
);
}
else
if
(
secondsNumber
)
{
setSecondsNumber
(
null
);
}
else
if
(
firstNumber
)
{
setFirstNumber
(
null
);
}
}
const
onDeletePress
=
()
=>
{
};
if
(
fourNumber
)
{
const
onReactivationSmartOTP
=
()
=>
{
setFourNumber
(
null
);
navigation
.
navigate
(
RESET_SMART_OTP
,
{
title
:
'ReactivationSmartOTP'
});
}
else
if
(
thirdNumber
)
{
};
setThirdNumber
(
null
);
}
else
if
(
secondsNumber
)
{
setSecondsNumber
(
null
);
}
else
if
(
firstNumber
)
{
setFirstNumber
(
null
);
}
};
const
onReactivationSmartOTP
=
()
=>
{
navigation
.
navigate
(
RESET_SMART_OTP
,
{
title
:
'ReactivationSmartOTP'
});
};
const
onForgotPINCode
=
()
=>
{
const
onForgotPINCode
=
()
=>
{
navigation
.
navigate
(
RESET_SMART_OTP
,
{
title
:
'ForgotSmartOTP'
});
navigation
.
navigate
(
RESET_SMART_OTP
,
{
title
:
'ForgotSmartOTP'
});
};
};
return
(
return
(
<
EnterPasswordSmartOTPView
<
EnterPasswordSmartOTPView
firstNumber
=
{
firstNumber
}
firstNumber
=
{
firstNumber
}
secondsNumber
=
{
secondsNumber
}
secondsNumber
=
{
secondsNumber
}
thirdNumber
=
{
thirdNumber
}
thirdNumber
=
{
thirdNumber
}
fourNumber
=
{
fourNumber
}
fourNumber
=
{
fourNumber
}
onNumberPress
=
{
onNumberPress
}
onNumberPress
=
{
onNumberPress
}
onDeletePress
=
{
onDeletePress
}
onDeletePress
=
{
onDeletePress
}
onForgotPINCode
=
{
onForgotPINCode
}
onForgotPINCode
=
{
onForgotPINCode
}
onReactivationSmartOTP
=
{
onReactivationSmartOTP
}
onReactivationSmartOTP
=
{
onReactivationSmartOTP
}
/
>
/
>
);
);
};
};
const
mapStateToProps
=
(
state
)
=>
{
const
mapStateToProps
=
(
state
)
=>
{
return
{
return
{
user
:
state
.
userReducer
,
user
:
state
.
userReducer
,
};
};
};
};
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
export
default
connect
(
mapStateToProps
,
{
showLoading
,
hideLoading
})(
EnterPasswordSmartOTP
,
EnterPasswordSmartOTP
,
);
);
src/routers/ScreenNames.js
View file @
90242d0a
...
@@ -93,3 +93,5 @@ export const CONFIRMCHANGESMARTOTP = 'CONFIRMCHANGESMARTOTP';
...
@@ -93,3 +93,5 @@ export const CONFIRMCHANGESMARTOTP = 'CONFIRMCHANGESMARTOTP';
export
const
RULESSMARTOTP
=
'RULESSMARTOTP'
;
export
const
RULESSMARTOTP
=
'RULESSMARTOTP'
;
export
const
FAQSSMARTOTP
=
'FAQSSMARTOTP'
;
export
const
FAQSSMARTOTP
=
'FAQSSMARTOTP'
;
export
const
CONFIRMCREATEOTP
=
'CONFIRMCREATEOTP'
;
src/routers/StackNavigation.js
View file @
90242d0a
...
@@ -67,6 +67,7 @@ import ConfirmChangeSmartOTP from '../Screens/SmartOTP/ChangeSmartOTP/ConfirmCha
...
@@ -67,6 +67,7 @@ import ConfirmChangeSmartOTP from '../Screens/SmartOTP/ChangeSmartOTP/ConfirmCha
import
FAQs
from
'../Screens/SmartOTP/WebView/FAQs'
;
import
FAQs
from
'../Screens/SmartOTP/WebView/FAQs'
;
import
RulesSmartOTP
from
'../Screens/SmartOTP/WebView/RulesSmartOTP'
;
import
RulesSmartOTP
from
'../Screens/SmartOTP/WebView/RulesSmartOTP'
;
import
ConfirmCreate
from
'../Screens/SmartOTP/ConfirmCreate/ConfirmCreate'
;
import
*
as
ScreenName
from
'./ScreenNames'
;
import
*
as
ScreenName
from
'./ScreenNames'
;
...
@@ -86,9 +87,14 @@ function MyStack(props) {
...
@@ -86,9 +87,14 @@ function MyStack(props) {
headerMode
=
{
'none'
}
headerMode
=
{
'none'
}
initialRouteName
=
{
ScreenName
.
AUTHEN
}
>
initialRouteName
=
{
ScreenName
.
AUTHEN
}
>
<
Stack
.
Screen
<
Stack
.
Screen
name
=
{
ScreenName
.
CONFIRMCREATEOTP
}
component
=
{
ConfirmCreate
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
CACULATEDDEPOSIT
}
name
=
{
ScreenName
.
CACULATEDDEPOSIT
}
component
=
{
CaculatedDeposit
}
component
=
{
CaculatedDeposit
}
/
>
/
>
<
Stack
.
Screen
<
Stack
.
Screen
name
=
{
ScreenName
.
CONFIRMOTPSMART
}
name
=
{
ScreenName
.
CONFIRMOTPSMART
}
component
=
{
ConfirmOTPSmart
}
component
=
{
ConfirmOTPSmart
}
...
@@ -172,8 +178,14 @@ function MyStack(props) {
...
@@ -172,8 +178,14 @@ function MyStack(props) {
<
Stack
.
Screen
name
=
{
ScreenName
.
NEWPASSWORD
}
component
=
{
NewPassWord
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
NEWPASSWORD
}
component
=
{
NewPassWord
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
PRODUCTDETAIL
}
component
=
{
ProductDetail
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
PRODUCTDETAIL
}
component
=
{
ProductDetail
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
SMARTOTP
}
component
=
{
SmartOTP
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
SMARTOTP
}
component
=
{
SmartOTP
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
ENTER_PASSWORD_SMART_OTP
}
component
=
{
EnterPasswordSmartOTP
}
/
>
<
Stack
.
Screen
<
Stack
.
Screen
name
=
{
ScreenName
.
RESET_SMART_OTP
}
component
=
{
ResetSmartOTP
}
/
>
name
=
{
ScreenName
.
ENTER_PASSWORD_SMART_OTP
}
component
=
{
EnterPasswordSmartOTP
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
RESET_SMART_OTP
}
component
=
{
ResetSmartOTP
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
FAQSSMARTOTP
}
component
=
{
FAQs
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
FAQSSMARTOTP
}
component
=
{
FAQs
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
RULESSMARTOTP
}
component
=
{
RulesSmartOTP
}
/
>
<
Stack
.
Screen
name
=
{
ScreenName
.
RULESSMARTOTP
}
component
=
{
RulesSmartOTP
}
/
>
...
...
src/routers/TabNavigation.js
View file @
90242d0a
...
@@ -21,6 +21,7 @@ import {
...
@@ -21,6 +21,7 @@ import {
AccountVerification
,
AccountVerification
,
PACKETCQG
,
PACKETCQG
,
SETTINGOTP
,
SETTINGOTP
,
CHANGESMARTOTP
,
}
from
'../routers/ScreenNames'
;
}
from
'../routers/ScreenNames'
;
import
I18n
,
{
setLocation
}
from
'../helper/i18/i18n'
;
import
I18n
,
{
setLocation
}
from
'../helper/i18/i18n'
;
import
{
changeLanguage
}
from
'../actions/language'
;
import
{
changeLanguage
}
from
'../actions/language'
;
...
@@ -104,13 +105,16 @@ const TabNavigator = (props) => {
...
@@ -104,13 +105,16 @@ const TabNavigator = (props) => {
return
confirmAlert
(
I18n
.
t
(
'PopupVerifyAccount'
),
()
=>
{
return
confirmAlert
(
I18n
.
t
(
'PopupVerifyAccount'
),
()
=>
{
navigate
.
navigate
(
AccountVerification
);
navigate
.
navigate
(
AccountVerification
);
});
});
}
else
if
(
!
props
.
user
.
smart_otp_status
)
{
}
else
if
(
props
.
user
.
smart_otp_status
)
{
return
confirmAlert
(
return
confirmAlert
(
props
.
language
.
language
==
'vi'
props
.
language
.
language
==
'vi'
?
'Bạn có muốn cài đặt Smart OTP?'
?
'Bạn có muốn cài đặt Smart OTP?'
:
'Do you want setting Smart OTP?'
,
:
'Do you want setting Smart OTP?'
,
()
=>
{
()
=>
{
navigate
.
navigate
(
SETTINGOTP
);
navigate
.
navigate
(
CHANGESMARTOTP
,
{
TYPE
:
'CREATE_SMART_OTP'
,
old_password
:
null
,
});
},
},
);
);
}
else
if
(
props
.
user
.
status
==
3
&&
!
props
.
user
.
contract_code
)
{
}
else
if
(
props
.
user
.
status
==
3
&&
!
props
.
user
.
contract_code
)
{
...
...
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