Authored by 盖剑秋

逛详情埋点,去掉列表图片标签。reviewed by孙凯。

... ... @@ -25,6 +25,8 @@ export default class Comments extends React.Component {
render() {
let {resource} = this.props;
console.log('ddddd');
console.log(resource.toJS());
let avator = resource?resource.get('avator'):'';
let username = resource?resource.get('username'):'';
let content = resource?resource.get('content'):'';
... ... @@ -40,6 +42,7 @@ export default class Comments extends React.Component {
let thumbsUpIcon = isPraise=='Y' ? require('../../image/g_z_ic_h.png') : require('../../image/g_z_ic.png');
let uid = resource? resource.get('uid'):'';
return (
<View style={styles.container}>
<View style={styles.rightContainer}>
... ... @@ -51,7 +54,7 @@ export default class Comments extends React.Component {
<View style={styles.headerContainer}>
<Text style={styles.name} numberOfLines={1}>{username}</Text>
<TouchableOpacity onPress={()=>{
this.props.onThumbsUp&&this.props.onThumbsUp(id,isPraise=='Y'?'N':'Y')
this.props.onThumbsUp&&this.props.onThumbsUp(id,isPraise=='Y'?'N':'Y', uid)
}}>
<View style={styles.thumbsUp}>
<Image style={styles.thumbsUpIcon} source={thumbsUpIcon}/>
... ...
... ... @@ -171,8 +171,12 @@ export default class Detail extends Component {
</View>
);
}else if (template_name == 'goods') {
let {resource} = this.props;
let {
articleId,
} = resource;
return (
<GoodsCell resource={rowData} onPressProduct={this.props.onPressProduct} onPressShopCar={this.props.onPressShopCar}/>
<GoodsCell resource={rowData} articleId={articleId} onPressProduct={this.props.onPressProduct} onPressShopCar={this.props.onPressShopCar}/>
);
}else if (template_name == 'link') {
return (
... ...
... ... @@ -13,6 +13,7 @@ const {
Dimensions,
TouchableOpacity,
Platform,
NativeModules,
} = ReactNative;
... ... @@ -33,7 +34,7 @@ export default class GoodsCell extends React.Component {
}
render() {
let {resource} = this.props;
let {resource, articleId} = this.props;
let originList = resource.get('productList');
let listSize = originList?originList.size:0;
if (!originList || listSize == 0) {
... ... @@ -101,6 +102,11 @@ export default class GoodsCell extends React.Component {
);
})}
{(this.state.moreProduct && listSize > 2) ? <TouchableOpacity style={styles.more} activeOpacity={0.5} onPress={() => {
let params = {
ID: articleId + '' ,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_MORE_GODS_C', params);
this.setState({moreProduct: !this.state.moreProduct});
}}>
<View style={styles.more}>
... ...
... ... @@ -63,10 +63,13 @@ export default class Header extends React.Component {
let pageViews = hasData?article_data.get('pageViews'):'99999';
let publishTime = hasData?article_data.get('publishTime'):'12月12日 12:00';
let author_id = hasData?article_data.get('author_id'):'';
let id = hasData?article_data.get('id'):'';
return(
<View style={styles.contentContainer}>
<TouchableOpacity activeOpacity={0.5} onPress={() => {
this.props.onPressAuthor && this.props.onPressAuthor(author_url);
this.props.onPressAuthor && this.props.onPressAuthor(author_url, author_id, id);
}}>
<View style={styles.header}>
<Image source={{uri: author_avatar}} style={styles.thumb}></Image>
... ...
... ... @@ -34,9 +34,9 @@ export default class OtherArticle extends React.Component {
}
_renderRow(rowData, sectionID, rowID) {
let {url} = rowData;
let {url, id} = rowData;
return (
<TouchableOpacity style={styles.cell} onPress={()=>{this.props.onPressArticle&&this.props.onPressArticle(rowData.get('url'))}}>
<TouchableOpacity style={styles.cell} onPress={()=>{this.props.onPressArticle&&this.props.onPressArticle(rowData.get('url'), rowData.get('id'))}}>
<Image style={styles.cellImage} source={{uri:rowData.get('thumb')}}/>
<View style={styles.cellContent}>
<Text style={styles.cellTitle} numberOfLines={2}>
... ...
... ... @@ -29,7 +29,7 @@ export default class Tags extends React.Component {
let tags = data ? data.tags : [];
if (!tags || !tags.length) {
return (<View style={{height:1,width:width,backgroundColor:'white'}}/>);
return (<View style={{height:1,width:width,backgroundColor:'white'}}/>);
}
return (
... ... @@ -42,7 +42,7 @@ export default class Tags extends React.Component {
key={i}
style={styles.tag}
onPress={()=>{
this.props.onPressTag && this.props.onPressTag(value.url)
this.props.onPressTag && this.props.onPressTag(value)
}}
>
{value.name}
... ...
... ... @@ -38,7 +38,7 @@ export default class List extends Component {
}
_renderHeader() {
let {author} = this.props.resource.toJS();
let {author, author_id, id} = this.props.resource.toJS();
if (this.props.type == 'editor' || !author) {
return null;
}
... ... @@ -48,7 +48,7 @@ export default class List extends Component {
name
} = author;
return (
<TouchableOpacity onPress={()=>{this.props.onPressHeader&&this.props.onPressHeader(url)}}>
<TouchableOpacity onPress={()=>{this.props.onPressHeader&&this.props.onPressHeader(url, author_id, id)}}>
<View style={styles.headerContainer}>
<Image style={styles.avatar} source={{uri:avatar}}/>
<Text style={styles.name}>{name}</Text>
... ... @@ -97,12 +97,6 @@ export default class List extends Component {
<View style={styles.sapatorView}/>
{this._renderHeader()}
<Image style={[styles.image,{width: this.state.width, height: this.state.height}]} source={{uri:bigPic}}>
{!hiddenTagView?
<Image style={styles.tagContainer} source={tagImg}>
<Text style={styles.tagText}>{category_name}</Text>
</Image>
:null
}
</Image>
<Text style={styles.titleText}>{title}</Text>
<Text style={styles.contentText} numberOfLines={3}>{intro}</Text>
... ...
... ... @@ -82,11 +82,31 @@ class DetailContainer extends Component {
_onSubmitForComment(content,replyTo){
this.props.actions.addCommentsForArtivle(content,replyTo);
if (replyTo.length) {
let articleId = this.props.detail.get('articleId');
let params = {
ID: articleId,
COMMENT_UID: replyTo,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_REPLY_C', params);
} else {
let articleId = this.props.detail.get('articleId');
let params = {
ID: articleId,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_COMMENT_C', params);
}
}
_onPressConcerns(isFav){
if (isFav == 'Y') {
this.props.actions.addFavorite();
let articleId = this.props.detail.get('articleId');
let params = {
ID: articleId,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_FAV_ART_C', params);
}else {
this.props.actions.cancelFavorite();
}
... ... @@ -99,14 +119,29 @@ class DetailContainer extends Component {
_addPraiseForArtivle(isPraise){
if (isPraise == 'Y') {
this.props.actions.praiseForArtivle();
let articleId = this.props.detail.get('articleId');
let params = {
ID: articleId,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_ART_LIKE_C', params);
}else {
this.props.actions.cancelPraiseForArtivle();
}
}
_addPraiseForComments(comment_id,praise){
_addPraiseForComments(comment_id,praise, uid){
this.props.actions.setPraiseForComments(comment_id,praise);
this.props.actions.addPraiseForComments(comment_id,praise);
if (praise == 'Y') {
let articleId = this.props.detail.get('articleId');
let params = {
ID: articleId,
COMMENT_UID: uid,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_USER_LIKE_C', params);
}
}
_onPressFilter(value) {
... ... @@ -117,9 +152,15 @@ class DetailContainer extends Component {
this.props.actions.setGoodsGroupY(y);
}
_onPressAuthor(url) {
_onPressAuthor(url, author_id, id) {
let authorUrl = urlAddParamOfType(url, '11')
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(authorUrl);
let params = {
ID: id + '' ,
UID: author_id,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_HEAD_C', params);
}
_onPressBrand(url,rowID,id) {
... ... @@ -140,17 +181,33 @@ class DetailContainer extends Component {
}
}
_onPressArticle(url) {
_onPressArticle(url, id) {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let articleId = this.props.detail.get('articleId');
let params = {
ID: articleId,
R_ART_ID: id + '',
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_R_ART_C', params);
}
_onPressLink(url) {
ReactNative.NativeModules.YH_CommonHelper.goLinkUrl(url);
}
_onPressTag(url) {
_onPressTag(value) {
let url = value.url;
let taggedUrl = urlAddParamOfType(url, '12')
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(taggedUrl);
let articleId = this.props.detail.get('articleId');
let params = {
ID: articleId,
LABEL_NAME: value.name,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_LABEL_C', params);
}
_onPressMoreLink(url) {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
... ...
... ... @@ -63,7 +63,7 @@ class ListContainer extends Component {
}
componentWillUnmount() {
}
_onPressCell(url, index, article_id) {
... ... @@ -85,9 +85,15 @@ class ListContainer extends Component {
NativeModules.YH_CommonHelper.logEvent(name, params);
}
_onPressHeader(url) {
_onPressHeader(url, author_id, id) {
let taggedUrl = urlAddParamOfType(url, '11')
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(taggedUrl);
let params = {
ID: id + '' ,
UID: author_id,
};
NativeModules.YH_CommonHelper.logEvent('YB_STROLL_LIST_HEAD_C', params);
}
_onRefresh() {
... ...