Authored by 于良

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

@@ -36,6 +36,10 @@ import { @@ -36,6 +36,10 @@ import {
36 setCurrentChannelId, 36 setCurrentChannelId,
37 } from './reducers/category/categoryActions'; 37 } from './reducers/category/categoryActions';
38 38
  39 +import {
  40 + setBrandSelectedChannel,
  41 +} from './reducers/brand/brandActions';
  42 +
39 function getInitialState() { 43 function getInitialState() {
40 const _initState = { 44 const _initState = {
41 app: (new appInitialState()), 45 app: (new appInitialState()),
@@ -52,8 +56,24 @@ export default function native(platform) { @@ -52,8 +56,24 @@ export default function native(platform) {
52 56
53 _renderContainer() { 57 _renderContainer() {
54 if (this.props.type == 0) { 58 if (this.props.type == 0) {
  59 +
  60 + if(this.props.channelId=='1'){
  61 + store.dispatch(setCurrentChannelId('boy'));
  62 + }else if(this.props.channelId=='2'){
  63 + store.dispatch(setCurrentChannelId('girl'));
  64 + }else if(this.props.channelId=='3'){
  65 + store.dispatch(setCurrentChannelId('kids'));
  66 + }else if(this.props.channelId=='4'){
  67 + store.dispatch(setCurrentChannelId('lifestyle'));
  68 + }
  69 +
55 return <CategoryContainer />; 70 return <CategoryContainer />;
56 } else if (this.props.type == 1) { 71 } else if (this.props.type == 1) {
  72 +
  73 + if(this.props.channelId){
  74 + store.dispatch(setBrandSelectedChannel(this.props.channelId));
  75 + }
  76 +
57 return <BrandContainer />; 77 return <BrandContainer />;
58 } else if (this.props.type == 2) { 78 } else if (this.props.type == 2) {
59 return <InterestContainer />; 79 return <InterestContainer />;
@@ -66,15 +86,7 @@ export default function native(platform) { @@ -66,15 +86,7 @@ export default function native(platform) {
66 store.dispatch(setPlatform(platform)); 86 store.dispatch(setPlatform(platform));
67 store.dispatch(setHost(this.props.host)); 87 store.dispatch(setHost(this.props.host));
68 store.dispatch(setServiceHost(this.props.serviceHost)); 88 store.dispatch(setServiceHost(this.props.serviceHost));
69 - if(this.props.channelId=='1'){  
70 - store.dispatch(setCurrentChannelId('boy'));  
71 - }else if(this.props.channelId=='2'){  
72 - store.dispatch(setCurrentChannelId('girl'));  
73 - }else if(this.props.channelId=='3'){  
74 - store.dispatch(setCurrentChannelId('kids'));  
75 - }else if(this.props.channelId=='4'){  
76 - store.dispatch(setCurrentChannelId('lifestyle'));  
77 - } 89 +
78 return ( 90 return (
79 <Provider store={store}> 91 <Provider store={store}>
80 {this._renderContainer()} 92 {this._renderContainer()}