Authored by 戴强

增加逛详情中点击商品详情的埋点.reviewedby sunkai

... ... @@ -283,6 +283,7 @@ export default class Detail extends Component {
{!isFetching?<Animated.View style={{flex: 1,top:this.state.viewMarginTop}}>
<ListView
ref={(ref)=>this.listView=ref}
yh_viewVisible = {true}//自动曝光开关
initialListSize={1}
contentContainerStyle={styles.contentContainer}
enableEmptySections={true}
... ...
... ... @@ -120,8 +120,7 @@ export default class GuangDetailProductCell extends Component {
render() {
let {data, sourceType, similarIndex, rowID} = this.props;
let name = data.get('product_name') ? data.get('product_name') : '';
let yh_exposureData = data.get('yh_exposureData', null);
let yh_exposureData = data.get('yh_exposureData', null).toJS();
let prd_id = data.get('product_id') ? data.get('product_id') : '';
let isGlobal = data.get('is_global') && data.get('is_global') == 'Y'; // 是否全球购商品
let is_limitbuy = data.get('is_limitbuy') && data.get('is_limitbuy') == 'Y'; // product.is_limitbuy=='Y'?true:false;
... ...
... ... @@ -44,8 +44,10 @@ export default class RecommentProducts extends React.Component {
let price = '¥' + salePrice.toFixed(2);
let product_id = rowData.get('product_id')?rowData.get('product_id'):0;
let rec_id = rowData.get('rec_id')?rowData.get('rec_id'):'';
let yh_exposureData = rowData.get('yh_exposureData', null).toJS();
return (
<TouchableOpacity activeOpacity={0.5} onPress={() => {
<TouchableOpacity activeOpacity={0.5} yh_exposureData={yh_exposureData} onPress={() => {
let pos_id = 104;
let params = {
REC_POSE: 100023,
... ...
... ... @@ -74,6 +74,8 @@ class DetailContainer extends Component {
this.props.actions.getWeChatAtten();
this.props.actions.getCommentsList();
this.props.actions.getPraiseForArtivle();
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_CONT', {});
}
componentWillUnmount() {
... ...
... ... @@ -4,6 +4,7 @@ import ReactNative from 'react-native';
import DetailService from '../../services/DetailService';
import md5 from 'md5';
import helper from '../../../common/utils/helper';
import {Platform} from 'react-native';
const {
SET_ARTICLE_ID,
... ... @@ -230,7 +231,7 @@ export function getArticleContent(reload = false) {
dispatch(getArticleContentRequest());
return new DetailService(app.serviceHost).getArticleContent(articleId)
.then(json => {
let payload = parseArticleContent(json);
let payload = parseArticleContent(json,articleId);
payload.map((item, i) => {
if (item.template_name == 'goods') {
dispatch(goodsProductBySkns(item, i));
... ... @@ -250,7 +251,7 @@ export function getArticleContent(reload = false) {
};
}
function parseArticleContent(json) {
function parseArticleContent(json,articleId) {
let contents = [];
json && json.map((item, i) => {
for (let i in item) {
... ... @@ -292,6 +293,15 @@ function parseArticleContent(json) {
}else {
prod_ids = prod_ids + ',' + pro_id;
}
let param = {
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
P_PARAM : articleId,
I_INDEX : j,
PRD_SKN : pro.product_skn,
// C_ID:
exposureEnd : 1,
}
pro.yh_exposureData = param;
}
let params = {
REC_POSE: 100023,
... ... @@ -388,6 +398,7 @@ export function goodsProductBySkns(item, contentIndex) {
}
let {app, detail} = getState();
let {articleId} = detail;
dispatch(productBySknsRequest());
return new DetailService(app.host).productInfoBySkns(skns)
... ... @@ -402,6 +413,15 @@ export function goodsProductBySkns(item, contentIndex) {
item3.tags = [];
}
item3.default_images = helper.image(item3.default_images, 235, 314);
let param = {
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
P_PARAM : articleId,
I_INDEX : i3,
PRD_SKN : item3.product_skn,
// C_ID:
exposureEnd : 1,
}
item3.yh_exposureData = param;
productList.push(item3);
});
dispatch(productBySknsSuccess({
... ... @@ -431,6 +451,7 @@ export function goodsGroupProductBySkns(item, contentIndex) {
}
let {app, detail} = getState();
let {articleId} = detail;
dispatch(productBySknsRequest());
return new DetailService(app.host).productInfoBySkns(skns)
... ... @@ -442,6 +463,17 @@ export function goodsGroupProductBySkns(item, contentIndex) {
} else {
item4.tags = [];
}
let param = {
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
P_PARAM : articleId,
// I_INDEX : i3,
PRD_SKN : item4.product_skn,
// C_ID:
exposureEnd : 1,
}
item4.yh_exposureData = param;
item4.default_images = helper.image(item4.default_images, 235, 314);
});
... ... @@ -499,6 +531,7 @@ export function recommendProductBySkns(item, contentIndex) {
}
let {app, detail} = getState();
let {articleId} = detail;
dispatch(productBySknsRequest());
return new DetailService(app.host).productInfoBySkns(skns)
... ... @@ -513,6 +546,17 @@ export function recommendProductBySkns(item, contentIndex) {
} else {
item3.tags = [];
}
let param = {
P_NAME : Platform.OS === 'ios'?'iFP_GuangDetail':'aFP_GuangDetail',
P_PARAM : articleId,
I_INDEX : i3,
PRD_SKN : item3.product_skn,
// C_ID:
exposureEnd : 1,
}
item3.yh_exposureData = param;
item3.default_images = helper.image(item3.default_images, 235, 314);
productList.push(item3);
});
... ...