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
chenl
8 years ago
Commit
7eef12eb8dc716ddf5462341d3a77fa5c02d9e70
1 parent
2323d7d4
增加了首页数据判断和奥莱的下拉刷新。review by 孙凯。
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
23 deletions
js/home/components/home/Home.js
js/outlet/components/outlet/OutletPageListView.js
js/home/components/home/Home.js
View file @
7eef12e
...
...
@@ -170,6 +170,12 @@ export default class Home extends Component {
}
_floorCellRender
(
rowData
)
{
if
(
!
rowData
||
!
rowData
.
get
(
'data'
)){
return
null
;
}
let
template_name
=
rowData
.
get
(
'template_name'
);
switch
(
template_name
)
{
case
'focus'
:
{
...
...
@@ -509,7 +515,7 @@ export default class Home extends Component {
isOnPullToRefresh
=
{
isPullToRefresh
}
refreshControl
=
{
<
RefreshControl
refreshing
=
{
false
}
refreshing
=
{
isPullToRefresh
}
onRefresh
=
{()
=>
{
this
.
props
.
onRefresh
&&
this
.
props
.
onRefresh
();
}}
...
...
js/outlet/components/outlet/OutletPageListView.js
View file @
7eef12e
...
...
@@ -10,6 +10,7 @@ import {
Image
,
ListView
,
TouchableOpacity
,
RefreshControl
,
}
from
'react-native'
;
import
Immutable
,
{
Map
}
from
'immutable'
;
import
OutletSwiper
from
'./OutletSwiper'
;
...
...
@@ -148,7 +149,6 @@ export default class OutletPageListView extends Component {
}
render
()
{
let
{
resource
,
tabLabel
,
...
...
@@ -203,27 +203,59 @@ export default class OutletPageListView extends Component {
return
(
<
View
style
=
{
styles
.
container
}
>
<
ListView
ref
=
'OutletPageListView'
contentContainerStyle
=
{
styles
.
contentContainerStyle
}
enableEmptySections
=
{
true
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataSource
)}
renderRow
=
{
this
.
renderRow
}
renderSectionHeader
=
{
this
.
renderSectionHeader
}
enablePullToRefresh
=
{
true
}
isOnPullToRefresh
=
{
isFetching
}
onRefreshData
=
{()
=>
{
this
.
_onRefresh
&&
this
.
_onRefresh
(
true
);
}}
onEndReached
=
{()
=>
{
if
(
categoryNavigationList
&&
productList
&&
productList
.
size
>
0
)
{
let
{
resource
,
}
=
this
.
props
;
this
.
props
.
onEndReached
&&
this
.
props
.
onEndReached
(
resource
.
get
(
'content_code'
),
categoryNavigationList
?
categoryNavigationList
[
fliter
].
toJS
():
null
);
}
}}
/
>
{
Platform
.
OS
===
'ios'
?
<
ListView
ref
=
'OutletPageListView'
contentContainerStyle
=
{
styles
.
contentContainerStyle
}
enableEmptySections
=
{
true
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataSource
)}
renderRow
=
{
this
.
renderRow
}
renderSectionHeader
=
{
this
.
renderSectionHeader
}
enablePullToRefresh
=
{
true
}
isOnPullToRefresh
=
{
isFetching
}
onRefreshData
=
{()
=>
{
this
.
_onRefresh
&&
this
.
_onRefresh
(
true
);
}}
onEndReached
=
{()
=>
{
if
(
categoryNavigationList
&&
productList
&&
productList
.
size
>
0
)
{
let
{
resource
,
}
=
this
.
props
;
this
.
props
.
onEndReached
&&
this
.
props
.
onEndReached
(
resource
.
get
(
'content_code'
),
categoryNavigationList
?
categoryNavigationList
[
fliter
].
toJS
():
null
);
}
}}
/
>
:
<
ListView
ref
=
'OutletPageListView'
contentContainerStyle
=
{
styles
.
contentContainerStyle
}
enableEmptySections
=
{
true
}
dataSource
=
{
this
.
dataSource
.
cloneWithRowsAndSections
(
dataSource
)}
renderRow
=
{
this
.
renderRow
}
renderSectionHeader
=
{
this
.
renderSectionHeader
}
enablePullToRefresh
=
{
true
}
isOnPullToRefresh
=
{
isFetching
}
refreshControl
=
{
<
RefreshControl
refreshing
=
{
isFetching
}
onRefresh
=
{()
=>
{
this
.
_onRefresh
&&
this
.
_onRefresh
(
true
);
}}
colors
=
{[
'#000000'
,
'#ff0000'
]}
progressBackgroundColor
=
"#ffffff"
/>
}
onEndReached
=
{()
=>
{
if
(
categoryNavigationList
&&
productList
&&
productList
.
size
>
0
)
{
let
{
resource
,
}
=
this
.
props
;
this
.
props
.
onEndReached
&&
this
.
props
.
onEndReached
(
resource
.
get
(
'content_code'
),
categoryNavigationList
?
categoryNavigationList
[
fliter
].
toJS
():
null
);
}
}}
/
>
}
{
needShowToast
?
<
Prompt
text
=
{
showToastMessage
}
duration
=
{
3000
}
...
...
Please
register
or
login
to post a comment