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
312d2e7efc12149203ab53de5408fd26a1f942b9
1 parent
c78ae45e
浏览记录优化 review by 盖剑秋
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
js/recorder/components/browse/Browse.js
js/recorder/components/product/Product.js
js/recorder/containers/BrandContainer.js
js/recorder/components/browse/Browse.js
View file @
312d2e7
...
...
@@ -24,7 +24,7 @@ export default class Browse extends Component {
super
(
props
);
this
.
renderRow
=
this
.
renderRow
.
bind
(
this
);
this
.
render
Header
=
this
.
render
Header
.
bind
(
this
);
this
.
render
SectionHeader
=
this
.
renderSection
Header
.
bind
(
this
);
this
.
handleScroll
=
this
.
handleScroll
.
bind
(
this
);
this
.
onOpen
=
this
.
onOpen
.
bind
(
this
);
this
.
onClose
=
this
.
onClose
.
bind
(
this
);
...
...
@@ -35,6 +35,7 @@ export default class Browse extends Component {
this
.
state
=
{
currentlyOpenSwipeable
:
null
,
isSwiping
:
false
,
};
this
.
listView
=
null
;
...
...
@@ -98,6 +99,8 @@ export default class Browse extends Component {
rightButtonWidth
=
{
70
}
onRightButtonsOpenRelease
=
{
this
.
onOpen
}
onRightButtonsCloseRelease
=
{
this
.
onClose
}
onSwipeStart
=
{()
=>
this
.
setState
({
isSwiping
:
true
})}
onSwipeRelease
=
{()
=>
this
.
setState
({
isSwiping
:
false
})}
>
<
ProductCell
key
=
{
'row'
+
rowID
}
...
...
@@ -109,7 +112,7 @@ export default class Browse extends Component {
);
}
renderHeader
()
{
render
Section
Header
()
{
let
{
isFetching
,
selectedProductList
,
categoryList
,
selectedCategoryIndex
}
=
this
.
props
.
data
;
return
(
<
CategorySelector
...
...
@@ -135,12 +138,14 @@ export default class Browse extends Component {
ref
=
{(
c
)
=>
{
this
.
listView
=
c
;
}}
scrollEnabled
=
{
!
this
.
state
.
isSwiping
}
enableEmptySections
=
{
true
}
dataSource
=
{
this
.
dataSource
.
cloneWithRows
(
selectedProductList
.
toArray
())}
renderRow
=
{
this
.
renderRow
}
render
Header
=
{
this
.
render
Header
}
render
SectionHeader
=
{
this
.
renderSection
Header
}
onScroll
=
{
this
.
handleScroll
}
/> : null
}
{
showEmpty
?
<
NoDataView
type
=
{
'browse'
}
onPressGuangGuang
=
{
this
.
props
.
onPressGuangGuang
}
/> : null
}
<
LoadingIndicator
isVisible
=
{
isLoading
}
...
...
js/recorder/components/product/Product.js
View file @
312d2e7
...
...
@@ -37,6 +37,7 @@ export default class Product extends Component {
this
.
state
=
{
currentlyOpenSwipeable
:
null
,
isSwiping
:
false
,
};
this
.
listView
=
null
;
...
...
@@ -117,6 +118,8 @@ export default class Product extends Component {
rightButtonWidth
=
{
70
}
onRightButtonsOpenRelease
=
{
this
.
onOpen
}
onRightButtonsCloseRelease
=
{
this
.
onClose
}
onSwipeStart
=
{()
=>
this
.
setState
({
isSwiping
:
true
})}
onSwipeRelease
=
{()
=>
this
.
setState
({
isSwiping
:
false
})}
>
<
ProductCell
key
=
{
'row'
+
rowID
}
...
...
@@ -245,6 +248,7 @@ export default class Product extends Component {
onScroll
=
{
this
.
handleScroll
}
renderFooter
=
{
this
.
renderFooter
}
bounces
=
{
dataArray
.
length
>
0
}
scrollEnabled
=
{
!
this
.
state
.
isSwiping
}
/> : null
}
<
LoadingIndicator
...
...
js/recorder/containers/BrandContainer.js
View file @
312d2e7
...
...
@@ -99,7 +99,9 @@ class BrandContainer extends Component {
if
(
!
brand
)
{
return
;
}
brand
=
brand
.
toJS
();
brand
.
id
=
brand
.
brand_id
;
ReactNative
.
NativeModules
.
YH_CommonHelper
.
pushBrandVC
(
brand
);
}
...
...
Please
register
or
login
to post a comment