Authored by 孙凯

添加监听频道事件 review by 张丽霞

... ... @@ -49,23 +49,18 @@ export default class ChannelFliter extends React.Component {
}
_renderRow(rowData, sectionID, rowID) {
let colorStyle = rowID == this.state.selectedIndex ? {color: '#444444',fontFamily: 'HelveticaNeue',fontSize: 17} : {color: '#b0b0b0',fontFamily: 'HelveticaNeue-Bold',fontSize: 14,};
let colorStyle = rowID == this.props.selectID ? {color: '#444444',fontFamily: 'HelveticaNeue',fontSize: 17} : {color: '#b0b0b0',fontFamily: 'HelveticaNeue-Bold',fontSize: 14,};
return (
<TouchableOpacity onPress={() => {
let filters = this.state.filters;
let filter = this.state.filters[rowID];
if (this.state.selectedIndex == rowID) {
if (this.props.selectID == rowID) {
return;
}
filter.isSelect = !filter.isSelect;
filters[rowID] = filter;
this.setState({
selectedIndex: rowID,
filters,
});
this.props.onChannelPressFliter && this.props.onChannelPressFliter(rowID);
}}>
<View key={'row' + rowID} style={styles.rowContainer}>
... ...
... ... @@ -58,6 +58,15 @@ class BrandContainer extends Component {
this._onPressBrandSearchItem = this._onPressBrandSearchItem.bind(this);
this._setBrandData = this._setBrandData.bind(this);
this._setInitialListSize = this._setInitialListSize.bind(this);
this.subscription = NativeAppEventEmitter.addListener(
'ChannelDidChangeEvent',
(reminder) => {
this._onChannelPressFliter(reminder.channel-1);
}
);
}
componentDidMount() {
... ... @@ -71,6 +80,10 @@ class BrandContainer extends Component {
}
componentWillUnmount() {
this.subscription && this.subscription.remove();
}
_onPressSlideItem(url){
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
... ...