Authored by QC-L

添加有赚商品详情分享事件 reveiew by sunkai

1 import React, { Component } from 'react'; 1 import React, { Component } from 'react';
2 -import ReactNative,{ StyleSheet, View, NativeModules ,Dimensions,Platform} from "react-native"; 2 +import ReactNative,{ StyleSheet, View, NativeModules, Dimensions, Platform, NativeAppEventEmitter} from "react-native";
3 import { bindActionCreators } from 'redux'; 3 import { bindActionCreators } from 'redux';
4 import { connect } from 'react-redux'; 4 import { connect } from 'react-redux';
5 import { Map } from 'immutable'; 5 import { Map } from 'immutable';
@@ -40,6 +40,19 @@ class ShareDetailContainer extends Component { @@ -40,6 +40,19 @@ class ShareDetailContainer extends Component {
40 this._jumpWithUrl = this._jumpWithUrl.bind(this); 40 this._jumpWithUrl = this._jumpWithUrl.bind(this);
41 this._onEndReached = this._onEndReached.bind(this); 41 this._onEndReached = this._onEndReached.bind(this);
42 this._onPressProduct = this._onPressProduct.bind(this); 42 this._onPressProduct = this._onPressProduct.bind(this);
  43 +
  44 + this.subscription = NativeAppEventEmitter.addListener(
  45 + 'ProductShareDetailEvent',
  46 + () => {
  47 + let { shareDetail } = this.props;
  48 + let shareDetailInfo = shareDetail ? shareDetail.toJS(): {};
  49 + let productInfo = shareDetailInfo.productInfo;
  50 + if (!productInfo || productInfo == {}) {
  51 + return
  52 + }
  53 + this.showShareView(productInfo);
  54 + }
  55 + );
43 } 56 }
44 57
45 render() { 58 render() {