Authored by huangyCode

有赚列表上报 reviewed by yujianchao

... ... @@ -68,13 +68,19 @@ export default class Home extends Component {
this.sectionList.scrollToLocation(params);
}
// 2.P_PARAM:资源位code;
// 3.F_ID:楼层ID;
// 4.F_NAME:楼层名称;
// 5.F_INDEX:楼层顺序号;
// 6.TAB_ID:推荐TAB切ID,从0开始递增;
// 7.TAB_NAME:推荐TAB切名称;
_renderRow(item) {
let rowID = item.index;
let rowData = item.item;
let paddingLeft = rowID % 2 === 1 ? rowMarginHorizontal / 2 : rowMarginHorizontal;
let customStyle = rowID === 0 || rowID === 1 ? {paddingLeft} : {paddingLeft};
switch (item.section.title) {
case 'resourceList': {
return this._floorCellRender(rowData, rowID);
... ... @@ -92,11 +98,23 @@ export default class Home extends Component {
}
case 'categoryList': {
let row = item && item.item && item.item.toJS() || {}
let yh_exposureData = row.yh_exposureData || {}
yh_exposureData.F_INDEX = item.index;
let productList = this.props.data.productList;
let product = productList && productList.toJS() || {}
if(Object.keys(product).length){
yh_exposureData.TAB_ID = product.current_sort_id;
yh_exposureData.TAB_NAME = product.current_sort_name;
}
console.log(yh_exposureData)
return (
<ProductCell
style={[styles.listContainer, customStyle]}
key={'row' + rowID}
rowID={rowID}
yh_exposureData={yh_exposureData}
data={rowData}
onPressProduct={this.props.onPressProduct}
/>
... ... @@ -174,7 +192,6 @@ export default class Home extends Component {
data,
} = this.props;
let dataSource = [
{title: 'resourceList', data: resourceInfo.resourceList ? resourceInfo.resourceList.toArray() : []},
{title: 'categoryList', data: data.productList.product_list ? data.productList.product_list.toArray() : []},
... ...
... ... @@ -26,7 +26,7 @@ export default class ProductCell extends Component {
<TouchableOpacity
yh_exposureData={yh_exposureData} activeOpacity={1} style={[styles.container]}
onPress={() => {
this.props.onPressProduct && this.props.onPressProduct(data);
this.props.onPressProduct && this.props.onPressProduct(data,yh_exposureData);
}}>
<View style={styles.container}>
<YH_Image style={styles.prdImage} url={prdImage}/>
... ...
... ... @@ -7,7 +7,7 @@ import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as allianceActions from '../reducers/alliance/allianceActions';
import * as appActions from '../reducers/app/appActions';
import * as appActions from '../reducers/app/appActions';
import Home from '../components/Home'
import LoadingIndicator from '../../common/components/LoadingIndicator';
... ... @@ -77,18 +77,18 @@ class HomeContainer extends Component {
componentDidMount() {
let self = this;
this.props.actions.getResourceInfo(function (json) {
json && json.forEach(item => {
if (item.template_name === 'recommendGoodsGroup' && item.data) {
let productPool = item.data.recommendLogic;
let skns = item.data.skns;
self.props.actions.getProductList(productPool, skns);
let params = {
TAB_ID: '0',
TAB_NAME: '热门推荐'
};
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_CPS_MAIN_PRO_TAB_C', params);
}
})
json && json.forEach(item => {
if (item.template_name === 'recommendGoodsGroup' && item.data) {
let productPool = item.data.recommendLogic;
let skns = item.data.skns;
self.props.actions.getProductList(productPool, skns);
let params = {
TAB_ID: '0',
TAB_NAME: '热门推荐'
};
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_CPS_MAIN_PRO_TAB_C', params);
}
})
});
this.props.actions.getInviteCode();
}
... ... @@ -118,7 +118,7 @@ class HomeContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
_onPressProduct(product) {
_onPressProduct(product, yh_param) {
let productSkn = product && product.get('product_skn', 0);
let product_id = product && product.get('product_id', 0);
... ... @@ -148,6 +148,8 @@ class HomeContainer extends Component {
SKN: product.get('product_skn')
};
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_CPS_MAIN_PRO_C', params);
if (yh_param)
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_CHOOSE_FOR_YOU', yh_param);
}
onPressCategory(data, index) {
... ... @@ -172,7 +174,7 @@ class HomeContainer extends Component {
} = this.props.app;
// _onEndReached 事件会出现在 productPool返回前触发,可能会导致数据不一致,因此控制为0时不调用_onEndReached
if(productPool != 0){
if (productPool != 0) {
this.props.actions.getProductList(productPool, skns);
}
}
... ...
... ... @@ -68,10 +68,6 @@ export default function appReducer(state = initialState, action) {
case APP_SET_SELECTED_CATEGORY: {
let {index, sort_id, sort_name} = action.payload;
console.log('appReducer');
console.log(sort_id);
console.log(sort_name);
console.log('appReducer');
return state
.setIn(['productList', 'current_sort_name'], sort_name)
.setIn(['productList', 'current_sort_id'], sort_id)
... ...
... ... @@ -10,27 +10,27 @@
"build:android": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output index.android.bundle --assets-dest bundle/",
"bundle": "sh replace-custom-components-file.sh && node bundle.js"
},
"peerDependencies": {
"react": "^16.3.2"
},
"dependencies": {
"@react-native-community/cameraroll": "^1.2.1",
"apsl-react-native-button": "^3.1.1",
"babel": "^6.23.0",
"create-react-class": "^15.6.3",
"deprecated-react-native-listview": "^0.0.6",
"htmlparser2-without-node-native": "^3.9.2",
"immutable": "^3.8.2",
"key-mirror": "^1.0.1",
"lodash": "^4.17.10",
"md5": "^2.2.1",
"moment": "^2.22.1",
"object-assign": "^4.1.1",
"prop-types": "^15.6.1",
"query-string": "^6.1.0",
"react": "^16.9.0",
"react-immutable-proptypes": "^2.1.0",
"react-native": "^0.61.2",
"peerDependencies": {
"react": "^16.3.2"
},
"dependencies": {
"@react-native-community/cameraroll": "^1.2.1",
"apsl-react-native-button": "^3.1.1",
"babel": "^6.23.0",
"create-react-class": "^15.6.3",
"deprecated-react-native-listview": "^0.0.6",
"htmlparser2-without-node-native": "^3.9.2",
"immutable": "^3.8.2",
"key-mirror": "^1.0.1",
"lodash": "^4.17.10",
"md5": "^2.2.1",
"moment": "^2.22.1",
"object-assign": "^4.1.1",
"prop-types": "^15.6.1",
"query-string": "^6.1.0",
"react": "^16.9.0",
"react-immutable-proptypes": "^2.1.0",
"react-native": "^0.61.2",
"react-native-device-info": "^0.21.5",
"react-native-fabric": "^0.5.1",
"react-native-fetch-blob": "^0.10.8",
... ...