Authored by shixiang

修改默认最新展开方式

review 于良
... ... @@ -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',
},
... ...
... ... @@ -30,7 +30,7 @@ export function getTopInfo() {
return (dispatch, getState) => {
let {app} = getState();
dispatch(topInfoRequest());
return new NewArrivalService('http://api.gray.yohops.com').fetchRecommendShop(app.channel)
return new NewArrivalService(app.host).fetchRecommendShop(app.channel)
.then(json => {
let {
shop_list,
... ... @@ -190,7 +190,7 @@ export function getProductList(reload=false) {
}
}
dispatch(productListRequest());
return new NewArrivalService('http://api.gray.yohops.com').fetchProductList(channel, order, page, pageSize, allFilterFactors)
return new NewArrivalService(app.host).fetchProductList(channel, order, page, pageSize, allFilterFactors)
.then(json => {
let payload = parseProductList(json);
payload.endReached = payload.currentPage == payload.pageCount;
... ... @@ -398,7 +398,7 @@ export function getRecommendBrand() {
let channel = app.channel;
dispatch(recommendBrandRequest());
return new NewArrivalService('http://api.gray.yohops.com').fetchRecommendBrand(channel)
return new NewArrivalService(app.host).fetchRecommendBrand(channel)
.then(json => {
let hotBrandList = json.hot_brand_list;
let browseBrandList = json.browse_brand_list;
... ...