Authored by 盖剑秋

Exposure in browse. reviewed by Boss Lin.

... ... @@ -67,10 +67,14 @@ export default class Browse extends Component {
let rowData = item.item;
let rowID = item.index;
let {yh_exposureData} = rowData.toJS();
return (
<ProductCell
key={'row' + rowID}
data={rowData}
yh_exposureData={yh_exposureData}
onPressProduct={this.props.onPressProduct}
onPressFindSimilar={this.props.onPressFindSimilar}
/>
... ... @@ -111,6 +115,7 @@ export default class Browse extends Component {
scrollEnabled={!this.state.isSwiping}
enableEmptySections={true}
disableRightSwipe={true}
yh_viewVisible = {true}
sections={[{data:selectedProductList.toArray(),key:'browse'}]}
renderItem={this.renderItem}
renderSectionHeader={this.renderSectionHeader}
... ...
... ... @@ -93,6 +93,7 @@ export default class Browse extends Component {
renderRow(rowData, sectionID, rowID) {
let {yh_exposureData} = rowData.toJS();
return (
<Swipeable
rightButtons={this.rightButtons(rowData, rowID)}
... ... @@ -105,6 +106,7 @@ export default class Browse extends Component {
<ProductCell
key={'row' + rowID}
data={rowData}
yh_exposureData={yh_exposureData}
onPressProduct={this.props.onPressProduct}
onPressFindSimilar={this.props.onPressFindSimilar}
/>
... ... @@ -140,6 +142,7 @@ export default class Browse extends Component {
}}
scrollEnabled={!this.state.isSwiping}
enableEmptySections={true}
yh_viewVisible = {true}
dataSource={this.dataSource.cloneWithRows(selectedProductList.toArray())}
renderRow={this.renderRow}
renderSectionHeader={this.renderSectionHeader}
... ...
... ... @@ -35,6 +35,19 @@ export function setSelectedCategory(catId, index, catName) {
});
}
for (var i = 0; i < newProductList.length; i++) {
let item = newProductList[i];
let yh_exposureData = {
'P_NAME': '浏览记录',
'TAB_ID': index + 1,
'TAB_NAME': catName,
'I_INDEX': i + 1,
'PRD_SKN': item.product_skn?item.product_skn:'',
exposureEnd : 1,
};
item.yh_exposureData = yh_exposureData;
}
dispatch({
type: SET_SELECTED_CATEGORY,
payload: {productList: newProductList, index}
... ... @@ -111,6 +124,19 @@ function parseHistoryList(json) {
let productList = json && json.product_list ? json.product_list : [];
let categoryList = json && json.category_list ? json.category_list : [];
for (var i = 0; i < productList.length; i++) {
let item = productList[i];
let yh_exposureData = {
'P_NAME': '浏览记录',
'TAB_ID': '1',
'TAB_NAME': '全部',
'I_INDEX': i + 1 + '',
'PRD_SKN': item.product_skn?item.product_skn:'',
exposureEnd : 1,
};
item.yh_exposureData = yh_exposureData;
}
if (categoryList.length > 0) {
categoryList = [{category_id: -1, category_name: '全部'} , ...categoryList];
}
... ...
... ... @@ -81,14 +81,14 @@ export function setSelectedCategory(catId, index, catName) {
}
for (var i = 0; i < newProductList.length; i++) {
let item = productList[i];
let item = newProductList[i];
let yh_exposureData = {
'P_NAME': '收藏商品',
'TAB_ID': '1',
'TAB_NAME': '普通商品',
'L2_TAB_ID': index + 1 + '',
'L2_TAB_ID': index + 1,
'L2_TAB_NAME': catName?catName:'',
'I_INDEX': i + 1 + '',
'I_INDEX': i + 1,
'PRD_SKN': item.product_skn?item.product_skn:'',
exposureEnd : 1,
};
... ... @@ -178,7 +178,7 @@ function parseCommonList(json) {
'TAB_NAME': '普通商品',
'L2_TAB_ID': '1',
'L2_TAB_NAME': '全部',
'I_INDEX': i + 1 + '',
'I_INDEX': i + 1,
'PRD_SKN': item.product_skn?item.product_skn:'',
exposureEnd : 1,
};
... ...