Authored by 张丽霞

店铺模块化埋点,review by 孙凯

... ... @@ -160,7 +160,7 @@ export default class BrandProductFilter extends React.Component {
});
let value = filter.isAsc ? filter.value['asc'] : filter.value['desc'];
this.props.onPressFilter && this.props.onPressFilter(value,filter.name);
this.props.onPressFilter && this.props.onPressFilter(value);
}}>
<View key={'row' + rowID} style={styles.rowContainer}>
<Text style={[styles.name, colorStyle]}>{rowData.name}</Text>
... ...
... ... @@ -80,7 +80,7 @@ export default class BrandProductMoreFilter extends React.Component {
render() {
let {style} = this.props;
return (
<View style={[styles.container, style]}>
<View style={styles.line}/>
... ...
... ... @@ -62,9 +62,9 @@ export default class RedBrand extends Component {
this.props.onPressLaunchProfile && this.props.onPressLaunchProfile(value);
}
_onPressProductFilter(value,name){
_onPressProductFilter(value){
this.refs.redBrandList && this.refs.redBrandList.scrollTo({x: 0, y: yPosition, animated: false});
this.props.onPressProductFilter && this.props.onPressProductFilter(value, name);
this.props.onPressProductFilter && this.props.onPressProductFilter(value);
}
_onPressFilter(value){
... ...
... ... @@ -37,6 +37,24 @@ function mapDispatchToProps(dispatch) {
};
}
function orderWithString(str) {
if (str.indexOf('s_w')>=0) {
return 0;
}
if (str.indexOf('s_t')>=0) {
return 2;
}
if (str.indexOf('s_p')>=0) {
return 3;
}
if (str.indexOf('p_d')>=0) {
return 4;
}
return 0;
}
class RedPersonBrandContainer extends Component {
constructor(props) {
super(props);
... ... @@ -188,15 +206,6 @@ class RedPersonBrandContainer extends Component {
} else if (tabID == '2') {
tabName = '全部商品';
}
let orderName = this.props.redBrand.productList.orderName;
let sortType = 0;
if (orderName == '最新') {
sortType = 1;
}else if (orderName == '价格') {
sortType = 2;
}else if (orderName == '折扣') {
sortType = 3;
}
let param = {
SHOP_ID: this.props.redBrand.shopId,
TAB_ID: tabID,
... ... @@ -208,11 +217,11 @@ class RedPersonBrandContainer extends Component {
}
if (tabID != '1') {
param.FILTER_VALUE = this.props.redBrand.filterNameFactors.toJS();
param.SORT_TYPE = sortType;
param.SORT_TYPE = orderWithString(this.props.redBrand.productList.order);
}
console.log('------点击品牌店铺页中全部TAB中的商品列表时---red---');
console.log(param);
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_HOME_FLR_C', param);
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_GOODS_LIST_C', param);
}
_onPressProduct(linkType,linkReource,moduleOrder,moduleType,i_index){
... ... @@ -243,7 +252,7 @@ class RedPersonBrandContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_BRAND_SHOP_HOME_FLR_C', param);
}
_onPressProductFilter(value, name) {
_onPressProductFilter(value) {
if (value === 'filter') {
this.props.actions.setFilterView(!this.props.redBrand.productList.isFilter);
... ... @@ -255,7 +264,7 @@ class RedPersonBrandContainer extends Component {
this.props.actions.setFilterMoreView(false);
this.props.actions.setFilterView(false);
this.props.actions.resetListPageInfo();
this.props.actions.setProductListFilter(value,name);
this.props.actions.setProductListFilter(value);
this.props.actions.getProductList(true);
}
}
... ...
... ... @@ -111,10 +111,10 @@ export function setFilter(value) {
};
}
export function setProductListFilter(value,name) {
export function setProductListFilter(value) {
return {
type: SET_PRODUCT_LIST_FILTER,
payload: {value,name}
payload: value
}
}
... ...
... ... @@ -43,7 +43,6 @@ let InitialState = Record({
error: null,
list: List(),
order: 's_n_desc',
orderName: '默认',
currentPage: 0,
pageCount: 0,
pageSize: 60,//60,
... ...