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
dd4bf4e7
Commit
dd4bf4e7
authored
Oct 20, 2020
by
CaryaLiu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://git.hikcreate.com/hikrn/project/banma_credit
into develop
# Conflicts: # ios
parents
ab3dcf19
85cef32e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
src/test/CustomerView.js
+17
-5
src/test/RoundedImage.js
+18
-1
No files found.
src/test/CustomerView.js
View file @
dd4bf4e7
...
...
@@ -85,15 +85,27 @@ export default class CustomerView extends React.Component {
componentDidMount
()
{
console
.
log
(
"CustomerView componentDidMount"
);
if
(
Platform
.
OS
==
'android'
)
{
this
.
eventListener
=
DeviceEventEmitter
.
addListener
(
'msg'
,
(
a
)
=>
{
// alert('收到通知:' + a);
console
.
log
(
"收到通知:"
+
a
);
// this.subscription = DeviceEventEmitter.addListener('msg', (a) => {
// // alert('收到通知:' + a);
// console.log("收到通知:" + a);
// if (a && a.test) {
// tip = a.test
// } else {
// tip = a
// }
// BMCUI.showConfirmDialogWithCancelable(false, "收到新消息:" + tip, "确定", (result) => {
// console.log("你点击了取确定按钮,结果为:" + result);
// });
// });
//
const
alertEmitter
=
new
NativeEventEmitter
()
this
.
subscription
=
alertEmitter
.
addListener
(
'msg'
,
(
a
)
=>
{
if
(
a
&&
a
.
test
)
{
tip
=
a
.
test
}
else
{
tip
=
a
}
BMCUI
.
showConfirmDialogWithCancelable
(
false
,
"收到新消息:"
+
tip
,
"确定"
,
(
result
)
=>
{
BMCUI
.
showConfirmDialogWithCancelable
(
false
,
"收到新消息
(CustomerView)
:"
+
tip
,
"确定"
,
(
result
)
=>
{
console
.
log
(
"你点击了取确定按钮,结果为:"
+
result
);
});
});
...
...
@@ -118,7 +130,7 @@ export default class CustomerView extends React.Component {
componentWillUnmount
()
{
console
.
log
(
"CustomerView componentWillUnmount"
);
if
(
Platform
.
OS
==
'android'
)
{
this
.
eventListener
.
remove
();
// Removes the listener
this
.
subscription
.
remove
();
// Removes the listener
}
else
{
this
.
subscription
.
remove
();
}
...
...
src/test/RoundedImage.js
View file @
dd4bf4e7
import
React
from
'react'
;
import
PropTypes
from
"prop-types"
;
import
{
requireNativeComponent
,
View
}
from
'react-native'
;
import
{
requireNativeComponent
,
View
,
NativeEventEmitter
}
from
'react-native'
;
import
{
BMCUI
,
ImagePicker
}
from
'./ui.js'
/**
* Composes `View`.
...
...
@@ -56,8 +56,25 @@ export default class CustomRoundImageView extends React.Component {
};
}
componentDidMount
()
{
const
alertEmitter
=
new
NativeEventEmitter
()
this
.
subscription
=
alertEmitter
.
addListener
(
'msg'
,
(
a
)
=>
{
if
(
a
&&
a
.
test
)
{
tip
=
a
.
test
}
else
{
tip
=
a
}
BMCUI
.
showConfirmDialogWithCancelable
(
false
,
"收到新消息(RoundedImage):"
+
tip
,
"确定"
,
(
result
)
=>
{
console
.
log
(
"你点击了取确定按钮,结果为:"
+
result
);
});
});
console
.
log
(
"CustomRoundImageView componentDidMount : "
+
RoundImage
+
" / default img:"
+
this
.
state
.
imgUrl
);
}
componentWillUnmount
()
{
console
.
log
(
"CustomRoundImageView componentWillUnmount"
);
this
.
subscription
.
remove
();
// Removes the listener
}
_onChange
(
event
)
{
console
.
log
(
"onChange props:"
+
this
.
props
+
" / event:"
+
event
);
if
(
event
.
nativeEvent
.
message
)
{
...
...
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