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
Plain Diff
Browse Files
Authored by
chenl
8 years ago
Commit
5dd86cd0426a7b7edac08fb9a8cca161a20baa0c
2 parents
bcb3a1fe
20bb3049
Merge branch 'local' into 5.4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
37 deletions
js/classify/components/categoryB/CategoryBList.js
js/classify/components/categoryB/HotBrandList.js
js/classify/components/categoryB/HotCategoryList.js
js/classify/containers/CategoryBContainer.js
js/classify/reducers/categoryB/categoryBActions.js
js/classify/services/CategoryBService.js
js/classify/components/categoryB/CategoryBList.js
View file @
5dd86cd
...
...
@@ -45,26 +45,6 @@ export default class CategoryBList extends Component {
}
}
// _pressLeftRow(value,rowID){
// if(value.sub.length==1){
// this.props.pressSubCateRow(value.sub[0], 0);
// return;
// }
// this.props.pressLeftRow(value,rowID);
// this.refs.subCategoryList && this.refs.subCategoryList.scrollTo({x: 0, y: 0, animated: false});
// if(rowID==this.props.currentCateId){
// LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
// if(this.state.offsetx<0){
// this.setState({offsetx:0});
// }else{
// this.setState({offsetx: -width/2});
// }
// }else{
// if(this.state.offsetx==0){
// this.setState({offsetx: -width/2});
// }
// }
// }
subRenderRow
(
rowData
,
sectionID
,
rowID
,
highlightRow
)
{
...
...
@@ -208,7 +188,7 @@ let styles = StyleSheet.create({
},
separator
:
{
width
:
width
,
height
:
0.5
,
height
:
0.5
*
DEVICE_WIDTH_RATIO
,
backgroundColor
:
'#e0e0e0'
,
},
title
:
{
...
...
js/classify/components/categoryB/HotBrandList.js
View file @
5dd86cd
...
...
@@ -72,9 +72,6 @@ export default class HotBrandList extends Component{
render
(){
let
{
data
}
=
this
.
props
;
console
.
log
(
"chenlin"
,
"data数据长度:"
+
data
.
length
);
return
(
<
View
style
=
{
styles
.
container
}
>
<
ListView
...
...
js/classify/components/categoryB/HotCategoryList.js
View file @
5dd86cd
...
...
@@ -56,16 +56,16 @@ export default class HotCategoryList extends Component{
}
let
imageUrl
=
getSlicedUrl
(
rowData
.
get
(
"default_images"
),
82
,
110
,
2
);
let
categoryName
=
rowData
.
get
(
"category_name"
);
//
let categoryName = rowData.get("category_name");
//数据类型,纯文字型和图片型,列表中会出现纯文本的情况,比如MORE
let
dataType
=
rowData
.
get
(
"data_type"
);
if
(
dataType
&&
dataType
==
'text'
)
return
(
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
onPressHotCategoryItem
&&
this
.
props
.
onPressHotCategoryItem
(
rowData
.
toJS
(),
rowID
)}
>
<
TouchableOpacity
activeOpacity
=
{
1
}
onPress
=
{()
=>
this
.
props
.
onPressHotCategoryItem
&&
this
.
props
.
onPressHotCategoryItem
(
rowData
.
toJS
(),
rowID
)}
>
<
View
style
=
{
styles
.
rowContainer
}
>
<
Text
style
=
{
styles
.
rowText
}
numberOfLines
=
{
1
}
>
{
categoryName
}
<
/Text
>
<
Text
style
=
{
styles
.
rowText
}
numberOfLines
=
{
1
}
>
{
rowData
.
get
(
"show_category_name"
)
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
);
...
...
@@ -74,7 +74,7 @@ export default class HotCategoryList extends Component{
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
onPressHotCategoryItem
&&
this
.
props
.
onPressHotCategoryItem
(
rowData
.
toJS
(),
rowID
)}
>
<
View
style
=
{
styles
.
rowContainer
}
>
<
Image
style
=
{
styles
.
rowThumbnail
}
source
=
{{
uri
:
imageUrl
}}
/>
<
Text
style
=
{
styles
.
rowText
}
numberOfLines
=
{
1
}
>
{
categoryName
}
<
/Text
>
<
Text
style
=
{
styles
.
rowText
}
numberOfLines
=
{
1
}
>
{
rowData
.
get
(
"category_name"
)
}
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
);
...
...
js/classify/containers/CategoryBContainer.js
View file @
5dd86cd
...
...
@@ -107,7 +107,6 @@ class CategoryBContainer extends Component {
}
_onPressHotBrandItem
(
data
){
console
.
log
(
"chenlin"
,
"调用点击事件:_onPressHotBrandItem,参数:"
+
JSON
.
stringify
(
data
));
ReactNative
.
NativeModules
.
YH_CommonHelper
.
pushBrandVC
(
data
);
}
...
...
js/classify/reducers/categoryB/categoryBActions.js
View file @
5dd86cd
...
...
@@ -63,12 +63,10 @@ export function getCategoryBSubCategoryDetail(category_id, category_value){
//未命中,访问网络数据
if
(
!
categoryData
)
{
// console.log("chenlin", "未命中缓存,调用接口访问数据:" + key);
dispatch
(
getCategoryBSubDetail
(
currentChannelId
,
category_id
));
}
//已命中,展示缓存数据
else
{
// console.log("chenlin", "命中缓存:" + JSON.stringify(categoryData));
dispatch
(
getCategoryBSubDetailData
(
categoryData
));
}
...
...
@@ -156,7 +154,7 @@ function parseCategoryBSubDetail(channel_id, category_id, subcategory_data, prop
}
//分类信息不为空时,添加more
if
(
subcategory_data
.
sortInfo
){
if
(
subcategory_data
.
sortInfo
&&
subcategory_data
.
sortInfo
.
length
>
0
){
//获取当前频道下一级分类列表信息
let
categoryData
=
props_data
.
categoryList
.
get
(
props_data
.
currentChannelValue
);
...
...
@@ -170,7 +168,8 @@ function parseCategoryBSubDetail(channel_id, category_id, subcategory_data, prop
});
let
more
=
{
category_name
:
'more'
,
show_category_name
:
'more'
,
category_name
:
"全部"
+
(
category
?
category
.
get
(
'category_name'
)
:
''
),
parent_id
:
category_id
,
relation_parameter
:
category
?
category
.
get
(
'relation_parameter'
)
:
{},
node_count
:
category
?
category
.
get
(
'node_count'
)
:
0
,
...
...
@@ -183,9 +182,6 @@ function parseCategoryBSubDetail(channel_id, category_id, subcategory_data, prop
let
key
=
getSubDetailCacheKey
(
channel_id
,
category_id
);
// console.log("chenlin", "parseCategoryBSubDetail处理后的JSON数据:" + JSON.stringify(data));
return
{
key
:
key
,
data
:
subcategory_data
};
}
...
...
js/classify/services/CategoryBService.js
View file @
5dd86cd
...
...
@@ -42,7 +42,6 @@ export default class CategoryBService {
}
})
.
then
((
json
)
=>
{
// console.log("chenlin", "app.sort.fromBigData返回JSON数据:" + JSON.stringify(json));
return
json
;
})
.
catch
((
error
)
=>
{
...
...
Please
register
or
login
to post a comment