Authored by 孙凯

退出页面是 取消timer review by zhanglixia

... ... @@ -69,6 +69,10 @@ export default class ActivityCell extends React.Component {
}
}
componentWillUnmount() {
this.interval && clearInterval(this.interval);
}
getStartTimeString(startTime){
let startDate = new Date(startTime);
return startDate.getMonth()+'月'+startDate.getDate()+'日'+startDate.getHours()+'时'+'开始';
... ...
... ... @@ -115,7 +115,7 @@ export default class OutletPageListView extends Component {
// return(<TripleImage resource={rowData} onPressProduct={this.props.onPressProduct}/>);
}
}else if (sectionID == 'activityList') {
return(<ActivityCell resource={rowData} onPressProduct={this.props.onPressProduct}/>);
return(<ActivityCell resource={rowData} key = {rowID + 'activityList'} onPressProduct={this.props.onPressProduct}/>);
}else if (sectionID == 'activityMore') {
if (rowData == 'more') {
return(
... ... @@ -153,10 +153,11 @@ export default class OutletPageListView extends Component {
return null;
}
let title = tabLabel;
let isFetching = resource.get('isFetching')?resource.get('isFetching'):false;
let isFetching_homeResource = resource.get('isFetching')?resource.get('isFetching'):false;
let honeResource = resource.get('honeResource');
let activityList = resource.get('activityList')?resource.get('activityList').toArray():null;
let activityMore = resource.get('activityMore');
let activityFetching = resource.get('activityFetching')?resource.get('activityFetching'):false;
let categoryNavigationList = resource.get('categoryNavigationList')?resource.get('categoryNavigationList').toArray():null;
let fliter = resource.get('Navfliter')?resource.get('Navfliter'):0;
let productList = categoryNavigationList?categoryNavigationList[fliter].get('list'):null;
... ... @@ -167,6 +168,7 @@ export default class OutletPageListView extends Component {
if (!activityMore) {
activityList = activityList?activityList.slice(0,10):null;
}
let isFetching = isFetching_homeResource || activityFetching;
let dataSource = {
outletHomeReource: list?list.toArray():[],
... ...
... ... @@ -162,7 +162,15 @@ export default function outletReducer(state=initialState, action) {
return state.setIn(['categoryList', 'list'], Immutable.fromJS(categoryList.list))
}
case GET_OUTLET_ACTIVITY_LIST_REQUEST: {
let categoryList = state.categoryList.toJS();
let content_code1 = action.payload;
categoryList.list.map((item, i) => {
let content_code0 = item.content_code;
if (content_code1 == content_code0) {
item.activityFetching = true;
}
})
return state.setIn(['categoryList', 'list'], Immutable.fromJS(categoryList.list))
}
case GET_OUTLET_ACTIVITY_LIST_SUCCESS: {
let categoryList = state.categoryList.toJS();
... ... @@ -172,12 +180,22 @@ export default function outletReducer(state=initialState, action) {
if (content_code1 == content_code0) {
item.activityList = action.payload.json;
item.activityMore = false;
item.activityFetching = false;
}
})
return state.setIn(['categoryList', 'list'], Immutable.fromJS(categoryList.list))
}
case GET_OUTLET_ACTIVITY_LIST_FAILURE: {
let categoryList = state.categoryList.toJS();
let content_code1 = action.payload.content_code;
categoryList.list.map((item, i) => {
let content_code0 = item.content_code;
if (content_code1 == content_code0) {
item.activityFetching = false;
item.error = action.payload.error;
}
})
return state.setIn(['categoryList', 'list'], Immutable.fromJS(categoryList.list))
}
case SET_ACTIVITY_FLITER: {
let categoryList = state.categoryList.toJS();
... ...