Commit dd4bf4e7 by CaryaLiu

Merge branch 'develop' of http://git.hikcreate.com/hikrn/project/banma_credit into develop

# Conflicts:
#	ios
parents ab3dcf19 85cef32e
......@@ -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();
}
......
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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment