Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
taochepaiRN
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shangbj
taochepaiRN
Commits
4167f5e0
Commit
4167f5e0
authored
Jun 21, 2018
by
陈天文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复使用immutable fromJson到toJson
parent
fabb94e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
22 deletions
+10
-22
Market.js
src/containers/tabs/Market.js
+5
-13
auctionInitialState.js
src/reducers/auction/auctionInitialState.js
+2
-6
auctionReducer.js
src/reducers/auction/auctionReducer.js
+3
-3
No files found.
src/containers/tabs/Market.js
View file @
4167f5e0
...
@@ -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
(),
};
};
}
}
...
@@ -93,8 +85,8 @@ const styles = StyleSheet.create({
...
@@ -93,8 +85,8 @@ const styles = StyleSheet.create({
container
:
{
container
:
{
flex
:
1
,
flex
:
1
,
backgroundColor
:
'#ffffff'
,
backgroundColor
:
'#ffffff'
,
//
alignItems: 'center',
alignItems
:
'center'
,
//
justifyContent: 'center'
justifyContent
:
'center'
},
},
webviewWrap
:
{
webviewWrap
:
{
width
:
Screen
.
width
,
width
:
Screen
.
width
,
...
...
src/reducers/auction/auctionInitialState.js
View file @
4167f5e0
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
;
src/reducers/auction/auctionReducer.js
View file @
4167f5e0
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment