Authored by 孙凯

修改显示逻辑 review by 红魔

@@ -53,7 +53,7 @@ export default class BrandStore extends Component { @@ -53,7 +53,7 @@ export default class BrandStore extends Component {
53 renderSectionHeader(sectionData, sectionID) { 53 renderSectionHeader(sectionData, sectionID) {
54 switch(sectionID) { 54 switch(sectionID) {
55 // 顶部menu 55 // 顶部menu
56 - case 'largeSlideImg_APP': { 56 + case 'brandReource': {
57 return ( 57 return (
58 <Text>首页、上新、人气、全部商品</Text> 58 <Text>首页、上新、人气、全部商品</Text>
59 ); 59 );
@@ -72,46 +72,86 @@ export default class BrandStore extends Component { @@ -72,46 +72,86 @@ export default class BrandStore extends Component {
72 72
73 renderRow(rowData, sectionID, rowID, highlightRow) { 73 renderRow(rowData, sectionID, rowID, highlightRow) {
74 74
75 - switch(sectionID) {  
76 - case 'shopTopBanner_APP': {  
77 - return (  
78 - <BrandStoreHeaderView  
79 - backgroundImage={rowData}  
80 - info={this.props.info}  
81 - onPressCollection={this.props.onPressCollection}  
82 - />  
83 - );  
84 - }  
85 - break;  
86 - case 'largeSlideImg_APP': {  
87 - return(  
88 - <BrandSwiper  
89 - resource={rowData}  
90 - onPressBrandItem={this.props.onPressBrandItem}  
91 - />  
92 - )  
93 - }  
94 - break;  
95 - case 'oneRowTwoColImages_APP': {  
96 - return (  
97 - <OneRowTwoColImages  
98 - resource={rowData}  
99 - onPressOneRowTwoColImages={this.props.onPressOneRowTwoColImages}  
100 - />  
101 - );  
102 - }  
103 - break;  
104 - case 'recommend_APP': {  
105 - return (  
106 - <Recommend  
107 - resource={rowData}  
108 - onPressRecommendItem={this.props.onPressRecommendItem}  
109 - />  
110 - ); 75 + if (sectionID == 'shopTopBanner_APP') {
  76 + return (
  77 + <BrandStoreHeaderView
  78 + backgroundImage={rowData}
  79 + info={this.props.info}
  80 + onPressCollection={this.props.onPressCollection}
  81 + />
  82 + );
  83 + }else if (sectionID == 'brandReource') {
  84 +
  85 + switch (rowID) {
  86 + case '0':
  87 + {
  88 + if (rowData != null) {
  89 + return null;
  90 +
  91 + }else {
  92 + return null;
  93 + }
  94 + }
  95 + break;
  96 + case '1':
  97 + {
  98 + if (rowData != null) {
  99 + return null;
  100 +
  101 + }else {
  102 + return null;
  103 + }
  104 + }
  105 + break;
  106 + case '2':
  107 + {
  108 + if (rowData != null) {
  109 + return (
  110 + <BrandSwiper
  111 + resource={rowData}
  112 + onPressBrandItem={this.props.onPressBrandItem}
  113 + />
  114 + );
  115 + }else {
  116 + return null;
  117 + }
  118 + }
  119 + break;
  120 + case '3':
  121 + {
  122 + if (rowData != null) {
  123 + return (
  124 + <OneRowTwoColImages
  125 + resource={rowData}
  126 + onPressOneRowTwoColImages={this.props.onPressOneRowTwoColImages}
  127 + />
  128 + );
  129 + }else {
  130 + return null;
  131 + }
  132 + }
  133 + break;
  134 + case '4':
  135 + {
  136 + if (rowData != null) {
  137 + return (
  138 + <Recommend
  139 + resource={rowData}
  140 + onPressRecommendItem={this.props.onPressRecommendItem}
  141 + />
  142 + );
  143 + }else {
  144 + return null;
  145 + }
  146 + }
  147 + break;
  148 + default:
  149 + return null;
  150 + break;
  151 +
111 } 152 }
112 - break;  
113 - default:  
114 - return null; 153 + }else if (sectionID == 'hotProducts_APP') {
  154 + return null;
115 } 155 }
116 } 156 }
117 render() { 157 render() {
@@ -127,13 +167,7 @@ export default class BrandStore extends Component { @@ -127,13 +167,7 @@ export default class BrandStore extends Component {
127 167
128 let dataSource = { 168 let dataSource = {
129 shopTopBanner_APP: [shopTopBanner_APP], 169 shopTopBanner_APP: [shopTopBanner_APP],
130 - menu: ['menu'],  
131 - coupon: [coupon],  
132 - brandBrowse: [brandBrowse],  
133 - largeSlideImg_APP: [largeSlideImg_APP],  
134 - oneRowTwoColImages_APP: [oneRowTwoColImages_APP],  
135 - recommend_APP: [recommend_APP],  
136 - hotProducts_APP: hotProducts_APP.list ? hotProducts_APP.list.toArray() : [], 170 + brandReource:[coupon,brandBrowse,largeSlideImg_APP,oneRowTwoColImages_APP,recommend_APP,hotProducts_APP.list ? hotProducts_APP.list.toArray() : []],
137 }; 171 };
138 172
139 return ( 173 return (