Authored by 于良

品牌初始化时传入channelId review by shixiang

... ... @@ -36,6 +36,10 @@ import {
setCurrentChannelId,
} from './reducers/category/categoryActions';
import {
setBrandSelectedChannel,
} from './reducers/brand/brandActions';
function getInitialState() {
const _initState = {
app: (new appInitialState()),
... ... @@ -52,8 +56,24 @@ export default function native(platform) {
_renderContainer() {
if (this.props.type == 0) {
if(this.props.channelId=='1'){
store.dispatch(setCurrentChannelId('boy'));
}else if(this.props.channelId=='2'){
store.dispatch(setCurrentChannelId('girl'));
}else if(this.props.channelId=='3'){
store.dispatch(setCurrentChannelId('kids'));
}else if(this.props.channelId=='4'){
store.dispatch(setCurrentChannelId('lifestyle'));
}
return <CategoryContainer />;
} else if (this.props.type == 1) {
if(this.props.channelId){
store.dispatch(setBrandSelectedChannel(this.props.channelId));
}
return <BrandContainer />;
} else if (this.props.type == 2) {
return <InterestContainer />;
... ... @@ -66,15 +86,7 @@ export default function native(platform) {
store.dispatch(setPlatform(platform));
store.dispatch(setHost(this.props.host));
store.dispatch(setServiceHost(this.props.serviceHost));
if(this.props.channelId=='1'){
store.dispatch(setCurrentChannelId('boy'));
}else if(this.props.channelId=='2'){
store.dispatch(setCurrentChannelId('girl'));
}else if(this.props.channelId=='3'){
store.dispatch(setCurrentChannelId('kids'));
}else if(this.props.channelId=='4'){
store.dispatch(setCurrentChannelId('lifestyle'));
}
return (
<Provider store={store}>
{this._renderContainer()}
... ...