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
QC-L
7 years ago
Commit
6457b4a0eec3d4a97abb5b561663c00569d17011
1 parent
f542ada5
修复有赚首页列表悬浮记录高度的问题 review by sunkai
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
js/alliance/components/Home.js
js/alliance/components/recommend/CategorySelector.js
js/alliance/components/Home.js
View file @
6457b4a
...
...
@@ -27,6 +27,7 @@ export default class Home extends Component {
this
.
_renderRow
=
this
.
_renderRow
.
bind
(
this
);
this
.
_renderSectionHeader
=
this
.
_renderSectionHeader
.
bind
(
this
);
this
.
_floorCellRender
=
this
.
_floorCellRender
.
bind
(
this
);
this
.
_clickCategorySelector
=
this
.
_clickCategorySelector
.
bind
(
this
);
this
.
dataSource
=
new
ListView
.
DataSource
({
rowHasChanged
:
(
r1
,
r2
)
=>
!
Immutable
.
is
(
r1
,
r2
),
...
...
@@ -44,6 +45,7 @@ export default class Home extends Component {
<
CategorySelector
data
=
{
categoryList
}
selectedCategoryIndex
=
{
selectedCategoryIndex
}
changeCategorySelectorTitle
=
{
this
.
_clickCategorySelector
}
onPressCategory
=
{(
rowData
,
rowID
)
=>
{
this
.
props
.
onPressCategory
&&
this
.
props
.
onPressCategory
(
rowData
,
rowID
);
}}
...
...
@@ -55,6 +57,16 @@ export default class Home extends Component {
}
}
_clickCategorySelector
(
rowData
)
{
let
params
=
{
animated
:
true
,
sectionIndex
:
1
,
itemIndex
:
0
,
viewOffset
:
44
}
this
.
sectionList
.
scrollToLocation
(
params
);
}
_renderRow
(
item
)
{
let
rowID
=
item
.
index
;
let
rowData
=
item
.
item
;
...
...
@@ -174,9 +186,7 @@ export default class Home extends Component {
isShowGuide
=
{
this
.
props
.
isShowGuide
}
hiddenGuideDialog
=
{
this
.
props
.
hiddenGuideDialog
}
/>
<
SectionList
ref
=
{(
c
)
=>
{
this
.
listView
=
c
;
}}
ref
=
{(
ref
)
=>
this
.
sectionList
=
ref
}
sections
=
{
dataSource
}
renderSectionHeader
=
{
this
.
_renderSectionHeader
}
yh_viewVisible
=
{
true
}
...
...
js/alliance/components/recommend/CategorySelector.js
View file @
6457b4a
...
...
@@ -68,6 +68,7 @@ export default class CategorySelector extends Component {
onPress
=
{()
=>
{
this
.
scrollToCenter
(
rowID
);
this
.
props
.
onPressCategory
&&
this
.
props
.
onPressCategory
(
rowData
,
rowID
);
this
.
props
.
changeCategorySelectorTitle
&&
this
.
props
.
changeCategorySelectorTitle
(
rowData
);
}}
onLayout
=
{(
event
)
=>
{
this
.
rowPosition
[
rowID
]
=
event
.
nativeEvent
.
layout
;
...
...
@@ -105,14 +106,6 @@ export default class CategorySelector extends Component {
};
let
{
width
}
=
Dimensions
.
get
(
'window'
);
const
DEVICE_WIDTH_RATIO
=
width
/
320
;
let
imageWidth
=
Math
.
floor
(
width
/
2
);
let
imageHeight
=
Math
.
floor
(
imageWidth
*
180
/
375
);
let
selectorHeight
=
Math
.
ceil
(
45
*
DEVICE_WIDTH_RATIO
);
selectorHeight
=
45
;
let
styles
=
StyleSheet
.
create
({
container
:
{
...
...
Please
register
or
login
to post a comment