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
b9230dce
Commit
b9230dce
authored
Sep 27, 2020
by
leiyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加用户信息模块
parent
d36685e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
android
+1
-1
src/test/NavigateEntryTest.js
+40
-0
src/test/ui.js
+3
-2
No files found.
android
@
e108a7d9
Subproject commit
1b110e079ac8e510cbb513b122c95ed9c1328958
Subproject commit
e108a7d998fec6596b0dfdc572b478779f3f3f73
src/test/NavigateEntryTest.js
View file @
b9230dce
...
...
@@ -11,6 +11,7 @@ import { IC_LAUNCHER, IC_WARN } from '../assets/images'
import
{
NavigationContainer
}
from
'@react-navigation/native'
;
import
{
createStackNavigator
}
from
'@react-navigation/stack'
;
import
{
createBottomTabNavigator
}
from
'@react-navigation/bottom-tabs'
;
import
{
BMCInfo
,
BMCUI
}
from
'./ui.js'
function
LogoTitle
(
props
)
{
return
(
...
...
@@ -91,6 +92,9 @@ function TabHome() {
}
class
HomeScreen
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
}
componentDidMount
()
{
this
.
props
.
navigation
.
setParams
({
itemId
:
87
,
...
...
@@ -101,6 +105,30 @@ class HomeScreen extends React.Component {
componentWillUnmount
()
{
console
.
log
(
'HomeScreen componentWillUnmount:'
+
JSON
.
stringify
(
this
.
props
.
route
.
params
));
}
showAppInfo
()
{
BMCInfo
.
getUserInfo
((
result
)
=>
{
console
.
log
(
"获取用户信息,结果为:"
+
result
);
BMCUI
.
showConfirmDialog
(
result
,
'确定'
,
(
result
)
=>
{
console
.
log
(
"你点击了取确定按钮,结果为:"
+
result
);
})
})
}
showLoginInfo
()
{
BMCInfo
.
getLoginInfo
((
result
)
=>
{
console
.
log
(
"获取登录信息,结果为:"
+
result
);
BMCUI
.
showConfirmDialog
(
result
,
'确定'
,
(
result
)
=>
{
console
.
log
(
"你点击了取确定按钮,结果为:"
+
result
);
})
})
}
showDevicesInfo
()
{
BMCInfo
.
getDeviceInfo
((
result
)
=>
{
console
.
log
(
"获取设备信息,结果为:"
+
result
);
BMCUI
.
showConfirmDialog
(
result
,
'确定'
,
(
result
)
=>
{
console
.
log
(
"你点击了取确定按钮,结果为:"
+
result
);
})
})
}
render
()
{
console
.
log
(
'HomeScreen path:'
+
this
.
props
.
path
);
const
{
itemId
}
=
this
.
props
.
route
.
params
;
...
...
@@ -135,6 +163,18 @@ class HomeScreen extends React.Component {
onPress
=
{()
=>
this
.
props
.
navigation
.
setOptions
({
title
:
'Updated!'
})}
/
>
<
Text
style
=
{{
margin
:
10
}}
>
result
data
:
{
this
.
props
.
route
.
params
?.
post
}
<
/Text
>
<
Button
title
=
"show app info"
onPress
=
{
this
.
showAppInfo
}
/
>
<
Button
title
=
"show login info"
onPress
=
{
this
.
showLoginInfo
}
/
>
<
Button
title
=
"show devices info"
onPress
=
{
this
.
showDevicesInfo
}
/
>
<
/View
>
);
}
...
...
src/test/ui.js
View file @
b9230dce
...
...
@@ -11,4 +11,5 @@ import { NativeModules, requireNativeComponent } from 'react-native';
//export default NativeModules.BMCUI;
//不使用export default时,对应的import语句需要使用大括号
export
var
BMCUI
=
NativeModules
.
BMCUI
;
export
var
ImagePicker
=
NativeModules
.
ImagePicker
;
\ No newline at end of file
export
var
ImagePicker
=
NativeModules
.
ImagePicker
;
export
var
BMCInfo
=
NativeModules
.
BMCInfo
;
\ No newline at end of file
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