...
|
...
|
@@ -20,6 +20,7 @@ import BrandIntro from '../components/detail/BrandIntro' |
|
|
import BrandArticleList from '../components/detail/BrandArticleList'
|
|
|
import BrandArticleCell from '../components/detail/BrandArticleCell'
|
|
|
import NewArrival from '../components/detail/NewArrival'
|
|
|
import Prompt from '../../coupon/components/coupon/Prompt';
|
|
|
|
|
|
const actions = [
|
|
|
detailActions,
|
...
|
...
|
@@ -55,6 +56,7 @@ class DetailContainer extends Component { |
|
|
this._onPressFav = this._onPressFav.bind(this);
|
|
|
this._onPressBrandIntroMore = this._onPressBrandIntroMore.bind(this);
|
|
|
this._onPressMoreProducts = this._onPressMoreProducts.bind(this);
|
|
|
this._addCanelFavTipRemove = this._addCanelFavTipRemove.bind(this);
|
|
|
|
|
|
this.renderRow = this.renderRow.bind(this);
|
|
|
this.dataSource = new ListView.DataSource({
|
...
|
...
|
@@ -64,15 +66,12 @@ class DetailContainer extends Component { |
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
this.props.actions.setBrandId('153');
|
|
|
this.props.actions.uidBrandFav();
|
|
|
this.props.actions.brandInfo();
|
|
|
this.props.actions.newArrive();
|
|
|
this.props.actions.articleByBrand();
|
|
|
}
|
|
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
if (!nextProps.detail.get('brandInfo').get('titleUnfold')) {
|
|
|
if (this.props.detail.get('brandInfo').get('titleUnfold') && !nextProps.detail.get('brandInfo').get('titleUnfold')) {
|
|
|
this.listView.scrollTo({x: 0, y: 0, animated: false, });
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -115,6 +114,10 @@ class DetailContainer extends Component { |
|
|
|
|
|
}
|
|
|
|
|
|
_addCanelFavTipRemove(){
|
|
|
this.props.actions.addCanelFavTipRemove();
|
|
|
}
|
|
|
|
|
|
renderRow(rowData, sectionID, rowID, highlightRow) {
|
|
|
if (!rowData && rowData.length == 0) {
|
|
|
return null;
|
...
|
...
|
@@ -127,6 +130,7 @@ class DetailContainer extends Component { |
|
|
brandFav={this.props.detail.get('brandFav')}
|
|
|
onPressFav={this._onPressFav}
|
|
|
onPressBrandIntroMore={this._onPressBrandIntroMore}
|
|
|
addCanelFavTipRemove={this._addCanelFavTipRemove}
|
|
|
/>
|
|
|
);
|
|
|
case 'productList':
|
...
|
...
|
@@ -175,6 +179,13 @@ class DetailContainer extends Component { |
|
|
dataSource={this.dataSource.cloneWithRows(dataSource)}
|
|
|
renderRow={this.renderRow}
|
|
|
/>
|
|
|
|
|
|
|
|
|
{detail.get('brandInfo').get('addCancelTip') !== '' ? <Prompt
|
|
|
text={detail.get('brandInfo').get('addCancelTip')}
|
|
|
duration={800}
|
|
|
onPromptHidden={this._addCanelFavTipRemove}
|
|
|
/> : null}
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -183,6 +194,7 @@ class DetailContainer extends Component { |
|
|
let styles = StyleSheet.create({
|
|
|
container: {
|
|
|
flex: 1,
|
|
|
backgroundColor: '#f0f0f0',
|
|
|
},
|
|
|
contentContainer:{
|
|
|
flexDirection: 'column',
|
...
|
...
|
|