|
@@ -40,6 +40,16 @@ export default class BrandProductFilter extends React.Component { |
|
@@ -40,6 +40,16 @@ export default class BrandProductFilter extends React.Component { |
40
|
radio: true,
|
40
|
radio: true,
|
41
|
},
|
41
|
},
|
42
|
{
|
42
|
{
|
|
|
43
|
+ key: 'new',
|
|
|
44
|
+ name: '最新',
|
|
|
45
|
+ value: {
|
|
|
46
|
+ asc: 's_t_desc',
|
|
|
47
|
+ desc: 's_t_desc',
|
|
|
48
|
+ },
|
|
|
49
|
+ isAsc: false,
|
|
|
50
|
+ radio: true,
|
|
|
51
|
+ },
|
|
|
52
|
+ {
|
43
|
key: 'price',
|
53
|
key: 'price',
|
44
|
name: '价格',
|
54
|
name: '价格',
|
45
|
value: {
|
55
|
value: {
|
|
@@ -86,7 +96,7 @@ export default class BrandProductFilter extends React.Component { |
|
@@ -86,7 +96,7 @@ export default class BrandProductFilter extends React.Component { |
86
|
}
|
96
|
}
|
87
|
|
97
|
|
88
|
componentWillReceiveProps(nextProps){
|
98
|
componentWillReceiveProps(nextProps){
|
89
|
- if(nextProps.selectOrder=='s_t_desc'||nextProps.selectOrder==''){
|
99
|
+ if(nextProps.selectOrder==''){
|
90
|
this.setState({
|
100
|
this.setState({
|
91
|
selectedIndex: 0,
|
101
|
selectedIndex: 0,
|
92
|
});
|
102
|
});
|
|
@@ -95,13 +105,14 @@ export default class BrandProductFilter extends React.Component { |
|
@@ -95,13 +105,14 @@ export default class BrandProductFilter extends React.Component { |
95
|
|
105
|
|
96
|
_renderImage(rowData, rowID) {
|
106
|
_renderImage(rowData, rowID) {
|
97
|
let img;
|
107
|
let img;
|
98
|
- if(rowID==0){
|
|
|
99
|
- if (rowID == this.state.selectedIndex) {
|
|
|
100
|
- img = this.props.moreFilter ? this.images.up : this.images.down;
|
|
|
101
|
- }else{
|
|
|
102
|
- img = this.props.moreFilter ? this.images.up_normal : this.images.down_normal;
|
|
|
103
|
- }
|
|
|
104
|
- }else if(rowID==3){
|
108
|
+ if(rowID==0||rowID==1){
|
|
|
109
|
+ // if (rowID == this.state.selectedIndex) {
|
|
|
110
|
+ // img = this.props.moreFilter ? this.images.up : this.images.down;
|
|
|
111
|
+ // }else{
|
|
|
112
|
+ // img = this.props.moreFilter ? this.images.up_normal : this.images.down_normal;
|
|
|
113
|
+ // }
|
|
|
114
|
+ img = null;
|
|
|
115
|
+ }else if(rowID==4){
|
105
|
img = this.props.lastSelected ? this.images.up : this.images.down_normal;
|
116
|
img = this.props.lastSelected ? this.images.up : this.images.down_normal;
|
106
|
}else{
|
117
|
}else{
|
107
|
if (rowID == this.state.selectedIndex){
|
118
|
if (rowID == this.state.selectedIndex){
|
|
@@ -120,11 +131,11 @@ export default class BrandProductFilter extends React.Component { |
|
@@ -120,11 +131,11 @@ export default class BrandProductFilter extends React.Component { |
120
|
}
|
131
|
}
|
121
|
|
132
|
|
122
|
if(rowID==0){
|
133
|
if(rowID==0){
|
123
|
- if(this.props.selectOrder=='s_t_desc'){
|
|
|
124
|
- rowData.name='最新';
|
|
|
125
|
- }else{
|
|
|
126
|
- rowData.name='默认';
|
|
|
127
|
- }
|
134
|
+ // if(this.props.selectOrder=='s_t_desc'){
|
|
|
135
|
+ // rowData.name='最新';
|
|
|
136
|
+ // }else{
|
|
|
137
|
+ // rowData.name='默认';
|
|
|
138
|
+ // }
|
128
|
}
|
139
|
}
|
129
|
return (
|
140
|
return (
|
130
|
<View style={{backgroundColor: 'white'}}>
|
141
|
<View style={{backgroundColor: 'white'}}>
|
|
@@ -132,10 +143,10 @@ export default class BrandProductFilter extends React.Component { |
|
@@ -132,10 +143,10 @@ export default class BrandProductFilter extends React.Component { |
132
|
|
143
|
|
133
|
let filters = this.state.filters;
|
144
|
let filters = this.state.filters;
|
134
|
let filter = this.state.filters[rowID];
|
145
|
let filter = this.state.filters[rowID];
|
135
|
- if (filter.radio) {
|
|
|
136
|
- this.props.onPressFilter && this.props.onPressFilter(filters[0].key);
|
|
|
137
|
- return;
|
|
|
138
|
- }
|
146
|
+ // if (filter.radio) {
|
|
|
147
|
+ // this.props.onPressFilter && this.props.onPressFilter(filters[0].key);
|
|
|
148
|
+ // return;
|
|
|
149
|
+ // }
|
139
|
if (rowID == 3) {
|
150
|
if (rowID == 3) {
|
140
|
let value = 'filter';
|
151
|
let value = 'filter';
|
141
|
this.props.onPressFilter && this.props.onPressFilter(value);
|
152
|
this.props.onPressFilter && this.props.onPressFilter(value);
|
|
@@ -208,7 +219,7 @@ let styles = StyleSheet.create({ |
|
@@ -208,7 +219,7 @@ let styles = StyleSheet.create({ |
208
|
flexDirection: 'row',
|
219
|
flexDirection: 'row',
|
209
|
justifyContent: 'center',
|
220
|
justifyContent: 'center',
|
210
|
alignItems: 'center',
|
221
|
alignItems: 'center',
|
211
|
- width: Math.ceil(width / 4),
|
222
|
+ width: Math.ceil(width / 5),
|
212
|
height: 40,
|
223
|
height: 40,
|
213
|
backgroundColor: 'white',
|
224
|
backgroundColor: 'white',
|
214
|
},
|
225
|
},
|