RedPersonBrand.js 1.66 KB
'use strict';

import React from 'react';
import createReactClass from 'create-react-class';
import ReactNative, {
	AppRegistry,
	Platform,
	StyleSheet,
	Dimensions,
	TouchableOpacity,
} from 'react-native';

import {
	Provider,
	connect
} from 'react-redux';

import configureStore from './store/configureStore';
import {Record, List, Map} from 'immutable';

import appInitialState from './reducers/app/appInitialState';
import redBrandInitialState from './reducers/redBrand/redBrandInitialState';

import RedPersonBrandContainer from './containers/RedPersonBrandContainer';

import {
	setPlatform,
	setHost,
	setSingleApiHost,
	setliveHost,
} from './reducers/app/appActions';

import {
	setShopId,
	setKeyWord,
} from './reducers/redBrand/redBrandActions';

function getInitialState() {
	const _initState = {
		app: (new appInitialState()),
    	redBrand: (new redBrandInitialState()),
	};
	return _initState;
}

export default function native(platform) {

	let YH_RedPersonBrandView = createReactClass({

		render() {
		  	const store = configureStore(getInitialState());
			store.dispatch(setPlatform(platform));
			let {storeId, host,singleApiHost,liveHost, keyWord} = this.props;
			store.dispatch(setHost(host));
			store.dispatch(setShopId(storeId));
			store.dispatch(setSingleApiHost(singleApiHost));
			store.dispatch(setliveHost(liveHost));
			//5.7.0 新增搜索关键词跳转到店铺落地页,上报关键词
			store.dispatch(setKeyWord(keyWord));

			return (
				<Provider store={store}>
					<RedPersonBrandContainer />
				</Provider>
			);
		}
	});

	AppRegistry.registerComponent('YH_RedPersonBrandView', () => YH_RedPersonBrandView);
}

let styles = StyleSheet.create({

});