Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Commit

Permalink
recommend update
Browse files Browse the repository at this point in the history
  • Loading branch information
3lang3 committed Jun 6, 2017
1 parent b4b9a8e commit 0ad3734
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Recommend/Recommend.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
import CategoryItem from 'components/CategoryItem';
import ScreenItem from 'components/ScreenItem';
import { Scrollbars } from 'react-custom-scrollbars';
Expand Down Expand Up @@ -44,7 +45,7 @@ class Recommend extends React.Component {
constructor(props) {
super(props)


this.moreCategory = this.moreCategory.bind(this)
}

componentDidMount() {
Expand All @@ -56,6 +57,12 @@ class Recommend extends React.Component {
forceCheck()
}

moreCategory(clas) {

browserHistory.push(`/category/${clas}`)
this.props.getCategorys(clas)
}

render() {
const {loading: loading, error: error, done: done, data: data } = this.props.recommend;
let itemsHtml = [];
Expand All @@ -65,7 +72,7 @@ class Recommend extends React.Component {
for(let key in data) {

let items = data[key];
itemsHtml.push(<h2 key={key}>{key}<span className={styles.text}>热门主播</span> <span onClick={() => this.props.getCategorys(key)} className={styles.more}>more</span></h2>)
itemsHtml.push(<h2 key={key}>{key}<span className={styles.text}>热门主播</span> <span onClick={ () => {this.moreCategory(key)}} className={styles.more}>more</span></h2>)

items && items.forEach((item, key) => {
itemsHtml.push(<CategoryItem favoriteStatus={(isFavorite(item, favoriteList))} filterSwitch={false} key={`${item.roomId}${key}`} item={item} type="category" />)
Expand Down

0 comments on commit 0ad3734

Please sign in to comment.