Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
banma_credit
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hik_rn
project
banma_credit
Commits
80be55dd
Commit
80be55dd
authored
Sep 29, 2020
by
leiyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改导航测试
parent
41463039
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
android
+1
-1
index.js
+2
-2
src/test/NavigateEntryTest.js
+25
-3
No files found.
android
@
cfa005dd
Subproject commit
e108a7d998fec6596b0dfdc572b478779f3f3f73
Subproject commit
cfa005dd4b3902d32a52ef4eeaffb20ada906c4d
index.js
View file @
80be55dd
...
...
@@ -9,6 +9,6 @@ import { name as appName } from './app.json';
AppRegistry
.
registerComponent
(
appName
,
(
props
)
=>
{
console
.
log
(
'AppRegistry.registerComponent:'
+
props
);
return
App
;
//
return NavigateEntryTest;
//
return App;
return
NavigateEntryTest
;
});
src/test/NavigateEntryTest.js
View file @
80be55dd
...
...
@@ -6,6 +6,7 @@ import {
Button
,
Image
,
ScrollView
,
TextInput
}
from
'react-native'
;
import
{
IC_LAUNCHER
,
IC_WARN
}
from
'../assets/images'
import
{
NavigationContainer
}
from
'@react-navigation/native'
;
...
...
@@ -91,6 +92,23 @@ function TabHome() {
);
}
async
function
showBaseInfo
(
flag
)
{
try
{
var
result
if
(
flag
===
1
)
{
result
=
await
BMCInfo
.
getDeviceInfo
();
}
else
if
(
flag
===
2
)
{
result
=
await
BMCInfo
.
getLoginInfo
();
}
else
{
result
=
await
BMCInfo
.
getUserInfo
();
}
console
.
log
(
"result:"
+
result
+
"
\
n token: "
+
result
.
token
+
" nickname:"
+
result
.
nickname
+
" Version:"
+
result
.
Version
);
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
class
HomeScreen
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -135,6 +153,7 @@ class HomeScreen extends React.Component {
const
{
otherParam
}
=
this
.
props
.
route
.
params
;
return
(
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
,
justifyContent
:
'center'
}}
>
<
TextInput
value
=
"2121"
style
=
{{
height
:
30
,
backgroundColor
:
"red"
,
width
:
100
}}
><
/TextInput
>
<
Text
>
Home
Screen
<
/Text
>
<
Text
>
itemId
:
{
JSON
.
stringify
(
itemId
)}
<
/Text
>
<
Text
>
otherParam
:
{
JSON
.
stringify
(
otherParam
)}
<
/Text
>
...
...
@@ -165,15 +184,18 @@ class HomeScreen extends React.Component {
<
Text
style
=
{{
margin
:
10
}}
>
result
data
:
{
this
.
props
.
route
.
params
?.
post
}
<
/Text
>
<
Button
title
=
"show app info"
onPress
=
{
this
.
showUserInfo
}
// onPress={this.showUserInfo}
onPress
=
{()
=>
showBaseInfo
(
3
)}
/
>
<
Button
title
=
"show login info"
onPress
=
{
this
.
showLoginInfo
}
// onPress={this.showLoginInfo}
onPress
=
{()
=>
showBaseInfo
(
2
)}
/
>
<
Button
title
=
"show devices info"
onPress
=
{
this
.
showDevicesInfo
}
// onPress={this.showDevicesInfo}
onPress
=
{()
=>
showBaseInfo
(
1
)}
/
>
<
/View
>
);
...
...
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