Commit fca68a54 authored by zhaixiaoou's avatar zhaixiaoou
parents 08c8ae03 1b13ce0c
...@@ -39,13 +39,10 @@ class Market extends Component { ...@@ -39,13 +39,10 @@ class Market extends Component {
}, 1000); }, 1000);
} }
// <TouchableOpacity onPress={ this.onButtonPress.bind(this) }>
// <Text>获取测试列表数据</Text>
// </TouchableOpacity>
render() { render() {
const { navigate } = this.props.navigation; const { navigate } = this.props.navigation;
const listData = this.props.auction; const { listData } = this.props.auction;
console.log('listData', this.props.auction);
return ( return (
<View style = {styles.container}> <View style = {styles.container}>
...@@ -58,11 +55,6 @@ class Market extends Component { ...@@ -58,11 +55,6 @@ class Market extends Component {
</View> </View>
); );
} }
onButtonPress() {
this.props.actions.getLongAuctionList();
console.log('auction', this.props.auction);
}
} }
const actions = [ const actions = [
...@@ -71,7 +63,7 @@ const actions = [ ...@@ -71,7 +63,7 @@ const actions = [
function mapStateToProps(state) { function mapStateToProps(state) {
return { return {
...state auction: state.auction.toJS(),
}; };
} }
...@@ -92,9 +84,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(Market); ...@@ -92,9 +84,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(Market);
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: '#ffffff', backgroundColor: '#ffffff'
// alignItems: 'center',
// justifyContent: 'center'
}, },
webviewWrap: { webviewWrap: {
width: Screen.width, width: Screen.width,
......
import { Record, fromJS } from 'immutable'; import { Record, fromJS } from 'immutable';
const InitialState = { const InitialState = fromJS({
listData: [] listData: []
}; });
// Record({
// listData: fromJS([])
// });
export default InitialState; export default InitialState;
...@@ -8,11 +8,11 @@ const { GET_LIST_SUCC } = require('../actionTypes').default; ...@@ -8,11 +8,11 @@ const { GET_LIST_SUCC } = require('../actionTypes').default;
// alert(error.errorMessage || '网络错误'); // alert(error.errorMessage || '网络错误');
// } // }
export default function auctionReducer(state = initialState, action) { export default function auctionReducer (state = initialState, action) {
switch (action.type) { switch (action.type) {
case GET_LIST_SUCC: { case GET_LIST_SUCC: {
const listData = action.payload; const listData = fromJS(action.payload);
return state.listData = listData; return state.setIn(['listData'], listData);
} }
} }
return state; return state;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment