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
6c10a84eb73eb438ba54f2a94029a1c54e639f48
1 parent
fc797b1e
会员等级内部跳转,review by 盖剑秋
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
5 deletions
js/personalInfo/components/VIPLevel.js
js/personalInfo/components/VIPLevelHeader.js
js/personalInfo/components/VIPPrivilegeCell.js
js/personalInfo/containers/VIPLevelContainer.js
js/personalInfo/reducers/vipLevel/vipLevelActions.js
js/personalInfo/components/VIPLevel.js
View file @
6c10a84
...
...
@@ -26,6 +26,7 @@ export default class VIPLevel extends Component {
this
.
renderSeparator
=
this
.
renderSeparator
.
bind
(
this
);
this
.
dataSource
=
new
ListView
.
DataSource
({
rowHasChanged
:
(
r1
,
r2
)
=>
!
Immutable
.
is
(
r1
,
r2
),
sectionHeaderHasChanged
:
(
s1
,
s2
)
=>
!
Immutable
.
is
(
s1
,
s2
),
});
}
...
...
@@ -69,7 +70,7 @@ export default class VIPLevel extends Component {
return
null
;
}
return
(
<
View
style
=
{
styles
.
sectionHeader
}
>
<
View
key
=
{
'sectionHeader'
+
sectionID
}
style
=
{
styles
.
sectionHeader
}
>
<
Text
style
=
{{
lineHeight
:
38
,
fontSize
:
17
,
color
:
'#444444'
,
height
:
58
}}
>
当前可享受的特权
<
/Text
>
...
...
@@ -81,15 +82,17 @@ export default class VIPLevel extends Component {
renderRow
(
rowData
,
sectionID
,
rowID
)
{
return
(
<
VIPPrivilegeCell
key
=
{
'row'
+
rowID
}
dataSource
=
{
rowData
}
onPressPrivilegeCell
=
{
this
.
props
.
onPressPrivilegeCell
}
rowID
=
{
rowID
}
/
>
);
}
renderSeparator
(
sectionID
,
rowID
,
adjacentRowHighlighted
)
{
return
(
<
View
style
=
{{
width
:
width
,
height
:
0.5
,
backgroundColor
:
'#e5e5e5'
,}}
/
>
<
View
key
=
{
'separator'
+
rowID
}
style
=
{{
width
:
width
,
height
:
0.5
,
backgroundColor
:
'#e5e5e5'
,}}
/
>
);
}
...
...
@@ -110,6 +113,7 @@ export default class VIPLevel extends Component {
renderHeader
=
{
this
.
renderHeader
}
renderSectionHeader
=
{
this
.
renderSectionHeader
}
renderSeparator
=
{
this
.
renderSeparator
}
showsVerticalScrollIndicator
=
{
false
}
/
>
<
/View
>
);
...
...
js/personalInfo/components/VIPLevelHeader.js
View file @
6c10a84
...
...
@@ -82,7 +82,7 @@ export default class VIPLevelHeader extends Component {
{
VIPLevel
==
'3'
?
null
:
<
View
style
=
{
styles
.
nextLevelCost
}
>
<
Text
style
=
{{
color
:
'#b0b0b0'
,
fontSize
:
13
}}
>
¥
0.00
{
vipInfo
.
next_need_cost
}
¥
{
vipInfo
.
next_need_cost
}
<
/Text
>
<
/View
>
...
...
js/personalInfo/components/VIPPrivilegeCell.js
View file @
6c10a84
...
...
@@ -20,10 +20,10 @@ export default class VIPPrivilegeCell extends Component {
}
render
()
{
let
{
dataSource
}
=
this
.
props
;
let
{
dataSource
,
rowID
}
=
this
.
props
;
return
(
<
TouchableOpacity
activeOpacity
=
{
1.0
}
onPress
=
{()
=>
{
this
.
props
.
onPressPrivilegeCell
&&
this
.
props
.
onPressPrivilegeCell
(
dataSource
);
this
.
props
.
onPressPrivilegeCell
&&
this
.
props
.
onPressPrivilegeCell
(
dataSource
,
rowID
);
}}
>
<
View
style
=
{
styles
.
container
}
>
<
YH_Image
url
=
{
dataSource
.
get
(
'pic'
)}
style
=
{
styles
.
image
}
/
>
...
...
js/personalInfo/containers/VIPLevelContainer.js
View file @
6c10a84
...
...
@@ -45,6 +45,16 @@ function mapDispatchToProps(dispatch) {
class
VIPLevelContainer
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
_onPressPrivilegeCell
=
this
.
_onPressPrivilegeCell
.
bind
(
this
);
this
.
_onPressAllVIPPrivilegeCell
=
this
.
_onPressAllVIPPrivilegeCell
.
bind
(
this
);
}
_onPressPrivilegeCell
(
cellInfo
,
rowID
)
{
this
.
props
.
actions
.
onPressPrivilegeCell
(
cellInfo
,
rowID
);
}
_onPressAllVIPPrivilegeCell
()
{
this
.
props
.
actions
.
onPressAllVIPPrivilegeCell
();
}
componentDidMount
()
{
...
...
@@ -61,6 +71,8 @@ class VIPLevelContainer extends Component {
isFetching
=
{
isFetching
}
vipInfo
=
{
vipInfo
}
vipShowPageInfo
=
{
vipShowPageInfo
}
onPressPrivilegeCell
=
{
this
.
_onPressPrivilegeCell
}
onPressAllVIPPrivilegeCell
=
{
this
.
_onPressAllVIPPrivilegeCell
}
/
>
<
/View
>
);
...
...
js/personalInfo/reducers/vipLevel/vipLevelActions.js
View file @
6c10a84
...
...
@@ -94,3 +94,19 @@ function processVIPInfo(json) {
}
return
({
upgradeNeedCost
,
vipNextLevelProgress
})
}
export
function
onPressPrivilegeCell
(
cellInfo
,
rowID
)
{
return
(
dispatch
,
getState
)
=>
{
let
{
app
,
vipLevel
}
=
getState
();
let
{
vipInfo
}
=
vipLevel
;
ReactNative
.
NativeModules
.
YH_PersonalInfoHelper
.
gotoVIPPrivilegeDetailPage
({
'id'
:
cellInfo
.
get
(
'id'
),
'current_vip_level'
:
vipInfo
.
get
(
'current_vip_level'
),
'title'
:
cellInfo
.
get
(
'title'
),
'rowID'
:
rowID
});
}
}
export
function
onPressAllVIPPrivilegeCell
()
{
return
(
dispatch
,
getState
)
=>
{
ReactNative
.
NativeModules
.
YH_PersonalInfoHelper
.
gotoAllVIPPrivilegePage
();
}
}
...
...
Please
register
or
login
to post a comment