revert home.js review by 盖剑秋
Showing
1 changed file
with
105 additions
and
10 deletions
@@ -21,13 +21,25 @@ import Announcement from '../floor/Announcement'; | @@ -21,13 +21,25 @@ import Announcement from '../floor/Announcement'; | ||
21 | import SingleImage from '../floor/SingleImage'; | 21 | import SingleImage from '../floor/SingleImage'; |
22 | import SingleNameImage from '../floor/SingleNameImage'; | 22 | import SingleNameImage from '../floor/SingleNameImage'; |
23 | import TrendsetterCollocation from '../floor/TrendsetterCollocation'; | 23 | import TrendsetterCollocation from '../floor/TrendsetterCollocation'; |
24 | +import TrendgoodsTopic from '../floor/TrendgoodsTopic'; | ||
24 | import KidsBrandFloor from '../floor/KidsBrandFloor'; | 25 | import KidsBrandFloor from '../floor/KidsBrandFloor'; |
25 | import DivideImage from '../floor/DivideImage'; | 26 | import DivideImage from '../floor/DivideImage'; |
26 | import NewProductFloor from '../floor/NewProductFloor'; | 27 | import NewProductFloor from '../floor/NewProductFloor'; |
28 | +import PopularSingleProduct from '../floor/PopularSingleProduct'; | ||
29 | +import ShopRecommend from '../floor/ShopRecommend'; | ||
30 | +import SixLinesFloor from '../floor/SixLinesFloor'; | ||
31 | +import LivePicture from '../floor/LivePicture'; | ||
27 | import SmallPic from '../floor/SmallPic'; | 32 | import SmallPic from '../floor/SmallPic'; |
33 | +import RecommendContentOne from '../floor/RecommendContentOne'; | ||
34 | +import RecommendContentTwo from '../floor/RecommendContentTwo'; | ||
35 | +import RecommendContentThree from '../floor/RecommendContentThree'; | ||
36 | +import RecommendContentFive from '../floor/RecommendContentFive'; | ||
37 | +import CustomBrands from '../floor/CustomBrands'; | ||
28 | import NewUserFloor from '../floor/NewUserFloor'; | 38 | import NewUserFloor from '../floor/NewUserFloor'; |
29 | import VipUserFloor from '../floor/VipUserFloor'; | 39 | import VipUserFloor from '../floor/VipUserFloor'; |
30 | import ActivityProductFloor from '../floor/ActivityProductFloor'; | 40 | import ActivityProductFloor from '../floor/ActivityProductFloor'; |
41 | +import HotCategoryIndividualization from '../floor/HotCategoryIndividualization'; | ||
42 | + | ||
31 | 43 | ||
32 | export default class Home extends Component { | 44 | export default class Home extends Component { |
33 | 45 | ||
@@ -99,7 +111,6 @@ export default class Home extends Component { | @@ -99,7 +111,6 @@ export default class Home extends Component { | ||
99 | backImage={rowData.get('back_image')} | 111 | backImage={rowData.get('back_image')} |
100 | data={rowData.get('data')} | 112 | data={rowData.get('data')} |
101 | number={rowData.get('number')} | 113 | number={rowData.get('number')} |
102 | - onPressAppIconItem={this.props.onPressAppIconItem} | ||
103 | /> | 114 | /> |
104 | ); | 115 | ); |
105 | } | 116 | } |
@@ -134,9 +145,65 @@ export default class Home extends Component { | @@ -134,9 +145,65 @@ export default class Home extends Component { | ||
134 | /> | 145 | /> |
135 | ); | 146 | ); |
136 | } | 147 | } |
137 | - case 'trendsetterCollocation': { | 148 | + case 'recommend_content_one': { |
149 | + return ( | ||
150 | + <RecommendContentOne | ||
151 | + data={rowData.get('data')} | ||
152 | + onPressRecommendSlideItem={this.props.onPressRecommendSlideItem} | ||
153 | + onPressRecommendListItem={this.props.onPressRecommendListItem} | ||
154 | + /> | ||
155 | + ); | ||
156 | + } | ||
157 | + case 'recommend_content_two': { | ||
158 | + return ( | ||
159 | + <RecommendContentTwo | ||
160 | + data={rowData.get('data')} | ||
161 | + onPressRecommendSlideItem={this.props.onPressRecommendSlideItem} | ||
162 | + onPressRecommendListItem={this.props.onPressRecommendListItem} | ||
163 | + /> | ||
164 | + ); | ||
165 | + } | ||
166 | + case 'recommend_content_three': { | ||
167 | + return ( | ||
168 | + <RecommendContentThree | ||
169 | + data={rowData.get('data')} | ||
170 | + onPressRecommendSlideItem={this.props.onPressRecommendSlideItem} | ||
171 | + onPressRecommendListItem={this.props.onPressRecommendListItem} | ||
172 | + /> | ||
173 | + ); | ||
174 | + } | ||
175 | + case 'recommend_content_five': { | ||
176 | + return ( | ||
177 | + <RecommendContentFive | ||
178 | + data={rowData.get('data')} | ||
179 | + onPressRecommendSlideItem={this.props.onPressRecommendSlideItem} | ||
180 | + onPressRecommendListItem={this.props.onPressRecommendListItem} | ||
181 | + /> | ||
182 | + ); | ||
183 | + } | ||
184 | + case 'trendsetter_collocation': { | ||
185 | + return ( | ||
186 | + <TrendsetterCollocation | ||
187 | + data={rowData.get('data')} | ||
188 | + onPressTrendArticleItem={this.props.onPressTrendArticleItem} | ||
189 | + onPressTrendRecommendItem={this.props.onPressTrendRecommendItem} | ||
190 | + /> | ||
191 | + ); | ||
192 | + } | ||
193 | + case 'trendgoods_topic': { | ||
194 | + return ( | ||
195 | + <TrendgoodsTopic | ||
196 | + data={rowData.get('data')} | ||
197 | + onPressTrendTopicItem={this.props.onPressTrendTopicItem} | ||
198 | + /> | ||
199 | + ); | ||
200 | + } | ||
201 | + case 'custom_brands': { | ||
138 | return ( | 202 | return ( |
139 | - <TrendsetterCollocation /> | 203 | + <CustomBrands |
204 | + data={rowData.get('data')} | ||
205 | + onPressCustomBrandItem={this.props.onPressCustomBrandItem} | ||
206 | + /> | ||
140 | ); | 207 | ); |
141 | } | 208 | } |
142 | break; | 209 | break; |
@@ -154,29 +221,57 @@ export default class Home extends Component { | @@ -154,29 +221,57 @@ export default class Home extends Component { | ||
154 | ); | 221 | ); |
155 | } | 222 | } |
156 | case 'divideImage': { | 223 | case 'divideImage': { |
157 | - let data = rowData.get('data'); | ||
158 | return ( | 224 | return ( |
159 | - <DivideImage data={data}/> | 225 | + <DivideImage data={rowData.get('data')}/> |
160 | ); | 226 | ); |
161 | } | 227 | } |
162 | case 'NewProductFloor': { | 228 | case 'NewProductFloor': { |
163 | - let data = rowData.get('data'); | ||
164 | return ( | 229 | return ( |
165 | <NewProductFloor | 230 | <NewProductFloor |
166 | - data={data} | 231 | + data={rowData.get('data')} |
167 | onPressImageItem={this.props.onPressImageItem} | 232 | onPressImageItem={this.props.onPressImageItem} |
168 | /> | 233 | /> |
169 | ); | 234 | ); |
170 | } | 235 | } |
236 | + case 'popular_single_product':{ | ||
237 | + return ( | ||
238 | + <PopularSingleProduct | ||
239 | + data={rowData.get('data')} | ||
240 | + onPressImageItem={this.props.onPressImageItem}/> | ||
241 | + ) | ||
242 | + } | ||
243 | + case 'shopRecommend':{ | ||
244 | + return ( | ||
245 | + <ShopRecommend data={JSON.stringify(rowData)} /> | ||
246 | + ) | ||
247 | + } | ||
248 | + case 'sixLinesFloor':{ | ||
249 | + return ( | ||
250 | + <SixLinesFloor | ||
251 | + data={rowData.get('data')} | ||
252 | + onPressImageItem={this.props.onPressImageItem} /> | ||
253 | + ) | ||
254 | + } | ||
255 | + case 'livePicture':{ | ||
256 | + return ( | ||
257 | + <LivePicture | ||
258 | + data={rowData.get('data')} | ||
259 | + onPressImageItem={this.props.onPressImageItem} /> | ||
260 | + ) | ||
261 | + } | ||
171 | case 'vipUse':{ | 262 | case 'vipUse':{ |
172 | return ( | 263 | return ( |
173 | <VipUserFloor | 264 | <VipUserFloor |
174 | - data={data}/> | 265 | + data={rowData.get('data')}/> |
175 | ); | 266 | ); |
176 | } | 267 | } |
177 | case 'activityProductFloor':{ | 268 | case 'activityProductFloor':{ |
178 | return <ActivityProductFloor | 269 | return <ActivityProductFloor |
179 | - data = {data}/> | 270 | + data = {rowData.get('data')}/> |
271 | + } | ||
272 | + case 'hot_category_individualization':{ | ||
273 | + return <HotCategoryIndividualization | ||
274 | + data = {rowData.get('data')}/> | ||
180 | } | 275 | } |
181 | default: | 276 | default: |
182 | return null; | 277 | return null; |
@@ -208,7 +303,7 @@ export default class Home extends Component { | @@ -208,7 +303,7 @@ export default class Home extends Component { | ||
208 | let {list, isFetching, isFirstLoad, favorite} = data; | 303 | let {list, isFetching, isFirstLoad, favorite} = data; |
209 | 304 | ||
210 | let floorList = list.toArray(); | 305 | let floorList = list.toArray(); |
211 | - let favoriteList = favorite.toJS().list; | 306 | + let favoriteList = favorite ? favorite.toJS().list : []; |
212 | 307 | ||
213 | let dataSource = { | 308 | let dataSource = { |
214 | floor: floorList, | 309 | floor: floorList, |
-
Please register or login to post a comment