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
54349e918cb275fbca6b4345f8d61c8b322093b9
1 parent
8ab8e684
add product list review by hongmo
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
5 deletions
js/outlet/components/outlet/OutletPageListView.js
js/outlet/constants/actionTypes.js
js/outlet/containers/OutletContainer.js
js/outlet/reducers/outlet/outletActions.js
js/outlet/reducers/outlet/outletReducer.js
js/outlet/components/outlet/OutletPageListView.js
View file @
54349e9
...
...
@@ -34,6 +34,7 @@ export default class OutletPageListView extends Component {
this
.
renderRow
=
this
.
renderRow
.
bind
(
this
);
this
.
_onRefresh
=
this
.
_onRefresh
.
bind
(
this
);
this
.
setActivityFliter
=
this
.
setActivityFliter
.
bind
(
this
);
this
.
_onPressFilter
=
this
.
_onPressFilter
.
bind
(
this
);
}
componentDidMount
()
{
...
...
@@ -50,6 +51,17 @@ export default class OutletPageListView extends Component {
this
.
props
.
getOutletActivityList
&&
this
.
props
.
getOutletActivityList
(
resource
.
get
(
'content_code'
));
}
_onPressFilter
(
value
){
let
{
resource
,
}
=
this
.
props
;
let
categoryNavigationList
=
resource
.
get
(
'categoryNavigationList'
)?
resource
.
get
(
'categoryNavigationList'
).
toArray
():
null
;
let
categoryNavigationItem
=
categoryNavigationList
?
categoryNavigationList
[
value
].
toJS
():
null
;
this
.
props
.
onPressFilter
&&
this
.
props
.
onPressFilter
(
resource
.
get
(
'content_code'
),
value
,
categoryNavigationItem
);
}
setActivityFliter
()
{
let
{
resource
,
...
...
@@ -71,7 +83,7 @@ export default class OutletPageListView extends Component {
return
(
<
ProductFliter
resource
=
{
categoryNavigationList
}
onPressFilter
=
{
this
.
props
.
onPressFilter
}
onPressFilter
=
{
this
.
_
onPressFilter
}
/
>
);
}
...
...
@@ -139,7 +151,8 @@ export default class OutletPageListView extends Component {
let
activityList
=
resource
.
get
(
'activityList'
)?
resource
.
get
(
'activityList'
).
toArray
():
null
;
let
activityMore
=
resource
.
get
(
'activityMore'
);
let
categoryNavigationList
=
resource
.
get
(
'categoryNavigationList'
)?
resource
.
get
(
'categoryNavigationList'
).
toArray
():
null
;
let
productObj
=
categoryNavigationList
?
categoryNavigationList
[
0
].
get
(
'list'
):
null
;
let
fliter
=
resource
.
get
(
'value'
)?
resource
.
get
(
'value'
):
0
;
let
productObj
=
categoryNavigationList
?
categoryNavigationList
[
fliter
].
get
(
'list'
):
null
;
let
productList
=
productObj
?
productObj
.
get
(
'product_list'
):
null
;
let
error
=
resource
.
get
(
'error'
);
let
ptr
=
resource
.
get
(
'ptr'
)
==
true
?
true
:
false
;
...
...
js/outlet/constants/actionTypes.js
View file @
54349e9
...
...
@@ -9,6 +9,7 @@ export default keyMirror({
SET_CATEGORYID
:
null
,
SET_ACTIVITY_FLITER
:
null
,
SET_FLITER
:
null
,
GET_CATEGORY_REQUEST
:
null
,
GET_CATEGORY_SUCCESS
:
null
,
...
...
js/outlet/containers/OutletContainer.js
View file @
54349e9
...
...
@@ -71,9 +71,12 @@ class OutletContainer extends Component {
console
.
log
(
'_onPressProduct = '
+
url
);
}
_onPressFilter
(
value
){
console
.
log
(
value
);
// this.props.actions.onPressFilter(value);
_onPressFilter
(
content_code
,
value
,
categoryNavigationItem
){
this
.
props
.
actions
.
onPressFilter
(
content_code
,
value
);
let
list
=
categoryNavigationItem
.
list
;
if
(
!
list
)
{
this
.
props
.
actions
.
getProductList
(
content_code
,
categoryNavigationItem
);
}
}
render
()
{
...
...
js/outlet/reducers/outlet/outletActions.js
View file @
54349e9
...
...
@@ -10,6 +10,8 @@ const {
SET_ACTIVITY_FLITER
,
SET_FLITER
,
GET_CATEGORY_REQUEST
,
GET_CATEGORY_SUCCESS
,
GET_CATEGORY_FAILURE
,
...
...
@@ -222,3 +224,10 @@ export function setActivityFliter(content_code,activityMore) {
payload
:
{
'activityMore'
:
activityMore
,
'content_code'
:
content_code
}
};
}
export
function
onPressFilter
(
content_code
,
value
)
{
return
{
type
:
SET_FLITER
,
payload
:
{
'value'
:
value
,
'content_code'
:
content_code
}
};
}
...
...
js/outlet/reducers/outlet/outletReducer.js
View file @
54349e9
...
...
@@ -5,6 +5,7 @@ import Immutable, {Map} from 'immutable';
const
{
SET_ACTIVITY_FLITER
,
SET_FLITER
,
GET_CATEGORY_REQUEST
,
GET_CATEGORY_SUCCESS
,
...
...
@@ -184,6 +185,17 @@ export default function outletReducer(state=initialState, action) {
})
return
state
.
setIn
([
'categoryList'
,
'list'
],
Immutable
.
fromJS
(
categoryList
.
list
))
}
case
SET_FLITER
:
{
let
categoryList
=
state
.
categoryList
.
toJS
();
let
content_code1
=
action
.
payload
.
content_code
;
categoryList
.
list
.
map
((
item
,
i
)
=>
{
let
content_code0
=
item
.
content_code
;
if
(
content_code1
==
content_code0
)
{
item
.
value
=
action
.
payload
.
value
;
}
})
return
state
.
setIn
([
'categoryList'
,
'list'
],
Immutable
.
fromJS
(
categoryList
.
list
))
}
}
return
state
;
...
...
Please
register
or
login
to post a comment