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
Yincheng
8 years ago
Commit
b1f4966bf451ea827c81caaee0df7de437594828
1 parent
c427c557
发现好货添加loadMore
reviewed by gaijianqiu
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
js/goodGoodsRecommend/components/list/List.js
js/goodGoodsRecommend/containers/ListContainer.js
js/goodGoodsRecommend/components/list/List.js
View file @
b1f4966
...
...
@@ -3,6 +3,7 @@
import
React
,
{
Component
}
from
'react'
;
import
Immutable
,
{
Map
}
from
'immutable'
;
import
LoadingIndicator
from
'../../../common/components/LoadingIndicator'
;
import
LoadMoreIndicator
from
'../../../common/components/LoadMoreIndicator'
;
import
ListCell
from
'./ListCell'
;
import
ListBannerSwiper
from
'./ListBannerSwiper'
;
...
...
@@ -46,7 +47,8 @@ export default class List extends Component {
render
()
{
let
{
products
,
banner
}
=
this
.
props
.
resource
;
let
isFetching
=
(
products
.
isFetching
&&
products
.
page
==
0
)
||
banner
.
isFetching
;
let
isProductListFetching
=
products
.
isFetching
;
let
isFetching
=
(
isProductListFetching
&&
products
.
page
==
0
)
||
banner
.
isFetching
;
let
list
=
products
.
list
&&
products
.
list
.
toJS
();
let
bannerList
=
banner
.
data
&&
banner
.
data
.
toJS
();
...
...
@@ -65,6 +67,22 @@ export default class List extends Component {
showsVerticalScrollIndicator
=
{
false
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataBlob
)}
renderRow
=
{
this
.
renderRow
}
onEndReached
=
{()
=>
{
if
(
list
&&
list
.
length
)
{
this
.
props
.
onEndReached
&&
this
.
props
.
onEndReached
();
}
}}
renderFooter
=
{()
=>
{
if
(
list
&&
list
.
length
&&
isProductListFetching
)
{
return
<
LoadMoreIndicator
isVisible
=
{
true
}
animating
=
{
true
}
/>
;
}
else
{
return
null
;
}
}}
/
>
:
<
LoadingIndicator
isVisible
=
{
isFetching
}
...
...
js/goodGoodsRecommend/containers/ListContainer.js
View file @
b1f4966
...
...
@@ -47,6 +47,7 @@ class ListContainer extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
_onPressDetail
=
this
.
_onPressDetail
.
bind
(
this
);
this
.
_onEndReached
=
this
.
_onEndReached
.
bind
(
this
);
}
componentDidMount
()
{
...
...
@@ -65,12 +66,20 @@ class ListContainer extends Component {
ReactNative
.
NativeModules
.
YH_CommonHelper
.
pushGoodGoodsRecommendDetailWithProductSKN
(
product_skn
+
''
);
}
_onEndReached
()
{
console
.
log
(
'onasdfadfadfa'
);
InteractionManager
.
runAfterInteractions
(()
=>
{
this
.
props
.
actions
.
getProductList
();
});
}
render
()
{
let
{
list
}
=
this
.
props
;
return
(
<
List
resource
=
{
list
}
onPressDetail
=
{
this
.
_onPressDetail
}
onEndReached
=
{
this
.
_onEndReached
}
/
>
);
}
...
...
Please
register
or
login
to post a comment