Authored by yoho-js001

5.4.1埋点。reviewed by 煤老板。

... ... @@ -90,18 +90,14 @@ export default class Brand extends Component {
}
renderRow(rowData, sectionID, rowID, highlightRow) {
if (this.props.brandFliter == 0) {
let title = sectionID == '0-9' ? '0' : sectionID;
return (
<View onLayout={this.onLayout.bind(this, sectionID)}>
<BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
</View>
);
} else {
return (
<NewHotBannerListCell rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
);
}
let title = sectionID == '0-9' ? '0' : sectionID;
// console.log(sectionID);
// console.log(rowData);
return (
<View onLayout={this.onLayout.bind(this, sectionID)}>
<BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
</View>
);
}
render() {
... ... @@ -136,37 +132,21 @@ export default class Brand extends Component {
}
let list;
let listDataSource;
let contentContainerStyle;
let renderSectionHeader = null;
let showIndexForListView = false;
let showsVerticalScrollIndicator = false;
if (brandFliter == 0) {
list = data ? data.get('all_list') : null;
let newList = {};
list && list.map((value, key) => {
newList[key] = [value.toArray()];
});
listDataSource = newList ? this.dataSource.cloneWithRowsAndSections(newList) : null;
contentContainerStyle = styles.contentContainerOne;
renderSectionHeader = this.renderSectionHeader;
showIndexForListView = true;
this.sectionData = newList;
this.sectionDataKey = data.get('all_list_key').toJS();
} else if (brandFliter == 1) {
list = data ? data.get('new_list') : null;
listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;
contentContainerStyle = styles.contentContainerTwo;
showsVerticalScrollIndicator = true;
} else if (brandFliter == 2) {
list = data ? data.get('hot_list') : null;
listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;
contentContainerStyle = styles.contentContainerTwo;
showsVerticalScrollIndicator = true;
}
list = data ? data.get('all_list') : null;
let newList = {};
list && list.map((value, key) => {
newList[key] = [value.toArray()];
});
// console.log(newList);
// console.log('aaaaa');
// console.log(data?data.toJS():'null');
contentContainerStyle = styles.contentContainerOne;
this.sectionData = newList;
this.sectionDataKey = data.get('all_list_key').toJS();
if (!list) {
return null;
... ... @@ -180,26 +160,16 @@ export default class Brand extends Component {
ref={(ref)=>this.listView=ref}
initialListSize={1000}
contentContainerStyle={contentContainerStyle}
enableEmptySections={true}
dataSource={listDataSource}
enableEmptySections={false}
dataSource={this.dataSource.cloneWithRowsAndSections(newList)}
renderRow={this.renderRow}
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
renderHeader={this.renderHeader}
/>
{showIndexForListView ? <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/> : null}
<IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/>
<LoadingIndicator
isVisible={isFetching}
/>
{showSearch ? <BrandSearch
data={search}
onTextChange={this.props.onTextChange}
onClickCancel={this.props.onClickCancel}
onPressClearHistory={this.props.onPressClearHistory}
onPressBrandSearchItem={this.props.onPressBrandSearchItem}
onPressSearchHistoryItem={this.props.onPressSearchHistoryItem} /> : null}
</View>
);
}
... ...
... ... @@ -378,8 +378,6 @@ export function getBrandResource(channel) {
return new BrandService(app.serviceHost).getBrandResource(channel, content_code)
.then(json => {
let payload = parseResourceResources(json);
console.log('aaaaa');
console.log(payload);
if (channel == 1) {
dispatch(getBrandResourceForBoySuccess(payload));
}else if (channel == 2) {
... ...
... ... @@ -385,7 +385,7 @@ class NewArrivalContainer extends Component {
F_NM: '最新上架',
F_INDEX,
I_INDEX,
SORT_NM: this.props.newArrival.productList.order,
SORT_NM: this.sortNameWithParam(this.props.newArrival.productList.order),
FILTER_VALUE: this.props.newArrival.filterFactors.toJS(),
PRD_SKN: productSkn,
}
... ... @@ -393,6 +393,16 @@ class NewArrivalContainer extends Component {
}
sortNameWithParam(param) {
if (param == 's_p_asc' || param == 's_p_desc') {
return '价格';
}
if (param == 'p_d_asc' || param == 'p_d_desc') {
return '折扣';
}
return '最新';
}
_goToRecommendForYou() {
this.props.actions.goToRecommendForYou();
}
... ...