Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
于良
8 years ago
Commit
e5656c94426f5af82d1f7d36651022c8b16812d2
1 parent
db44eaf6
首页优化 review by days
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
js/home/containers/HomeContainer.js
js/home/reducers/home/homeActions.js
js/home/containers/HomeContainer.js
View file @
e5656c9
...
...
@@ -163,6 +163,7 @@ class HomeContainer extends Component {
}
onRefresh
()
{
InteractionManager
.
runAfterInteractions
(()
=>
{
this
.
props
.
actions
.
resetStateWhenRefresh
();
this
.
props
.
actions
.
fetchFloor
();
});
}
...
...
js/home/reducers/home/homeActions.js
View file @
e5656c9
...
...
@@ -133,8 +133,6 @@ export function fetchFloor() {
return
;
}
dispatch
(
resetStateWhenRefresh
(
channelStr
));
dispatch
(
fetchFloorRequest
(
channelStr
));
let
cached
=
currentChannelData
.
cached
;
...
...
@@ -214,10 +212,9 @@ export function fetchBoyGirlFavoriteList() {
let
channelStr
=
channelTransfer
.
number2String
(
channel
);
let
currentChannelData
=
home
[
channelStr
];
if
(
currentChannelData
.
favorite
.
isFetching
if
(
currentChannelData
.
favorite
.
get
(
'isFetching'
)
||
currentChannelData
.
endReached
||
(
currentChannelData
.
list
.
size
==
0
&&
currentChannelData
.
cached
.
get
(
'list'
).
size
==
0
))
{
return
;
}
...
...
@@ -281,7 +278,7 @@ export function fetchKidsFavoriteList() {
let
channelStr
=
channelTransfer
.
number2String
(
channel
);
let
{
kid
}
=
home
;
if
(
kid
.
favorite
.
isFetching
if
(
kid
.
favorite
.
get
(
'isFetching'
)
||
kid
.
endReached
||
(
kid
.
list
.
size
==
0
&&
kid
.
cached
.
get
(
'list'
).
size
==
0
))
{
...
...
@@ -392,6 +389,10 @@ export function fetchBottomBanner() {
let
channelStr
=
channelTransfer
.
number2String
(
channel
);
let
currentChannelData
=
home
[
channelStr
];
if
(
currentChannelData
.
bottomBanner
.
get
(
'list'
).
size
>
0
)
{
return
;
}
dispatch
(
fetchBottomBannerRequest
(
channelStr
));
let
fetchBanner
=
(
fromPage
,
contentCode
)
=>
{
...
...
@@ -718,11 +719,15 @@ export function fetchFloorFailure(error, channelStr) {
}
//下拉刷新时重置商品列表数据状态
export
function
resetStateWhenRefresh
(
channelStr
)
{
return
{
type
:
HOME_RESET_STATE_WHEN_REFRESH
,
payload
:
channelStr
,
};
export
function
resetStateWhenRefresh
()
{
return
(
dispatch
,
getState
)
=>
{
let
{
app
,
home
}
=
getState
();
let
channelStr
=
channelTransfer
.
number2String
(
app
.
channel
);
dispatch
({
type
:
HOME_RESET_STATE_WHEN_REFRESH
,
payload
:
channelStr
,
});
};
}
//下拉刷新时接口返回数据没有变动,无需刷新
...
...
Please
register
or
login
to post a comment