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
c3813e1384d3d023fac7aaf579ed696ed742d700
1 parent
c0f6c192
增加get 保护 review by yuliang。
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
js/classify/reducers/categoryB/categoryBActions.js
js/classify/reducers/categoryB/categoryBActions.js
View file @
c3813e1
...
...
@@ -74,12 +74,12 @@ export function pressCategoryBMore(category_id){
let
{
categoryB
}
=
getState
();
//获取当前频道下一级分类列表信息
let
categoryData
=
categoryB
.
categoryList
.
get
(
categoryB
.
currentChannelValue
)
;
let
categoryData
=
categoryB
.
categoryList
?
categoryB
.
categoryList
.
get
(
categoryB
.
currentChannelValue
)
:
[]
;
//获取指定category_id分类信息
let
category
=
null
;
categoryData
.
map
((
item
,
i
)
=>
{
if
(
category_id
==
item
.
get
(
'category_id'
)){
if
(
item
&&
(
category_id
==
item
.
get
(
'category_id'
)
)){
category
=
item
;
}
});
...
...
@@ -92,7 +92,7 @@ export function pressCategoryBMore(category_id){
};
//设置当前的类别信息
dispatch
(
setCurrentCateB
(
category_id
,
category
.
get
(
'category_name'
)
));
dispatch
(
setCurrentCateB
(
category_id
,
category
?
category
.
get
(
'category_name'
)
:
""
));
dispatch
(
jumpToCategory
(
all
,
0
,
categoryB
.
currentChannelId
));
};
...
...
@@ -113,7 +113,7 @@ export function getCategoryBSubCategoryDetail(category_id, category_value){
//检查缓存是否存在数据,如果不存在则获取
let
cache
=
categoryB
.
cacheSubCateData
;
let
key
=
getSubDetailCacheKey
(
currentChannelId
,
category_id
);
let
categoryData
=
cache
.
get
(
key
)
;
let
categoryData
=
cache
?
cache
.
get
(
key
)
:
""
;
//设置当前的类别信息
dispatch
(
setCurrentCateB
(
category_id
,
category_value
));
...
...
@@ -201,7 +201,10 @@ export function getCategoryBFirstSubCategoryDetail(channel_id) {
else
if
(
channel_id
==
'4'
){
category
=
categoryList
.
get
(
'lifestyle'
).
get
(
0
);
}
dispatch
(
getCategoryBSubCategoryDetail
(
category
.
get
(
'category_id'
),
category
.
get
(
'category_name'
)));
let
category_id
=
category
?
category
.
get
(
'category_id'
)
:
""
;
let
category_name
=
category
?
category
.
get
(
'category_name'
)
:
""
;
dispatch
(
getCategoryBSubCategoryDetail
(
category_id
,
category_name
));
};
}
...
...
Please
register
or
login
to post a comment