...
|
...
|
@@ -40,6 +40,16 @@ export default class BrandProductFilter extends React.Component { |
|
|
radio: true,
|
|
|
},
|
|
|
{
|
|
|
key: 'new',
|
|
|
name: '最新',
|
|
|
value: {
|
|
|
asc: 's_t_desc',
|
|
|
desc: 's_t_desc',
|
|
|
},
|
|
|
isAsc: false,
|
|
|
radio: true,
|
|
|
},
|
|
|
{
|
|
|
key: 'price',
|
|
|
name: '价格',
|
|
|
value: {
|
...
|
...
|
@@ -86,7 +96,7 @@ export default class BrandProductFilter extends React.Component { |
|
|
}
|
|
|
|
|
|
componentWillReceiveProps(nextProps){
|
|
|
if(nextProps.selectOrder=='s_t_desc'||nextProps.selectOrder==''){
|
|
|
if(nextProps.selectOrder==''){
|
|
|
this.setState({
|
|
|
selectedIndex: 0,
|
|
|
});
|
...
|
...
|
@@ -95,13 +105,14 @@ export default class BrandProductFilter extends React.Component { |
|
|
|
|
|
_renderImage(rowData, rowID) {
|
|
|
let img;
|
|
|
if(rowID==0){
|
|
|
if (rowID == this.state.selectedIndex) {
|
|
|
img = this.props.moreFilter ? this.images.up : this.images.down;
|
|
|
}else{
|
|
|
img = this.props.moreFilter ? this.images.up_normal : this.images.down_normal;
|
|
|
}
|
|
|
}else if(rowID==3){
|
|
|
if(rowID==0||rowID==1){
|
|
|
// if (rowID == this.state.selectedIndex) {
|
|
|
// img = this.props.moreFilter ? this.images.up : this.images.down;
|
|
|
// }else{
|
|
|
// img = this.props.moreFilter ? this.images.up_normal : this.images.down_normal;
|
|
|
// }
|
|
|
img = null;
|
|
|
}else if(rowID==4){
|
|
|
img = this.props.lastSelected ? this.images.up : this.images.down_normal;
|
|
|
}else{
|
|
|
if (rowID == this.state.selectedIndex){
|
...
|
...
|
@@ -120,11 +131,11 @@ export default class BrandProductFilter extends React.Component { |
|
|
}
|
|
|
|
|
|
if(rowID==0){
|
|
|
if(this.props.selectOrder=='s_t_desc'){
|
|
|
rowData.name='最新';
|
|
|
}else{
|
|
|
rowData.name='默认';
|
|
|
}
|
|
|
// if(this.props.selectOrder=='s_t_desc'){
|
|
|
// rowData.name='最新';
|
|
|
// }else{
|
|
|
// rowData.name='默认';
|
|
|
// }
|
|
|
}
|
|
|
return (
|
|
|
<View style={{backgroundColor: 'white'}}>
|
...
|
...
|
@@ -132,10 +143,10 @@ export default class BrandProductFilter extends React.Component { |
|
|
|
|
|
let filters = this.state.filters;
|
|
|
let filter = this.state.filters[rowID];
|
|
|
if (filter.radio) {
|
|
|
this.props.onPressFilter && this.props.onPressFilter(filters[0].key);
|
|
|
return;
|
|
|
}
|
|
|
// if (filter.radio) {
|
|
|
// this.props.onPressFilter && this.props.onPressFilter(filters[0].key);
|
|
|
// return;
|
|
|
// }
|
|
|
if (rowID == 3) {
|
|
|
let value = 'filter';
|
|
|
this.props.onPressFilter && this.props.onPressFilter(value);
|
...
|
...
|
@@ -208,7 +219,7 @@ let styles = StyleSheet.create({ |
|
|
flexDirection: 'row',
|
|
|
justifyContent: 'center',
|
|
|
alignItems: 'center',
|
|
|
width: Math.ceil(width / 4),
|
|
|
width: Math.ceil(width / 5),
|
|
|
height: 40,
|
|
|
backgroundColor: 'white',
|
|
|
},
|
...
|
...
|
|