逛详情埋点,去掉列表图片标签。reviewed by孙凯。
Showing
9 changed files
with
95 additions
and
22 deletions
@@ -25,6 +25,8 @@ export default class Comments extends React.Component { | @@ -25,6 +25,8 @@ export default class Comments extends React.Component { | ||
25 | 25 | ||
26 | render() { | 26 | render() { |
27 | let {resource} = this.props; | 27 | let {resource} = this.props; |
28 | + console.log('ddddd'); | ||
29 | + console.log(resource.toJS()); | ||
28 | let avator = resource?resource.get('avator'):''; | 30 | let avator = resource?resource.get('avator'):''; |
29 | let username = resource?resource.get('username'):''; | 31 | let username = resource?resource.get('username'):''; |
30 | let content = resource?resource.get('content'):''; | 32 | let content = resource?resource.get('content'):''; |
@@ -40,6 +42,7 @@ export default class Comments extends React.Component { | @@ -40,6 +42,7 @@ export default class Comments extends React.Component { | ||
40 | 42 | ||
41 | let thumbsUpIcon = isPraise=='Y' ? require('../../image/g_z_ic_h.png') : require('../../image/g_z_ic.png'); | 43 | let thumbsUpIcon = isPraise=='Y' ? require('../../image/g_z_ic_h.png') : require('../../image/g_z_ic.png'); |
42 | 44 | ||
45 | + let uid = resource? resource.get('uid'):''; | ||
43 | return ( | 46 | return ( |
44 | <View style={styles.container}> | 47 | <View style={styles.container}> |
45 | <View style={styles.rightContainer}> | 48 | <View style={styles.rightContainer}> |
@@ -51,7 +54,7 @@ export default class Comments extends React.Component { | @@ -51,7 +54,7 @@ export default class Comments extends React.Component { | ||
51 | <View style={styles.headerContainer}> | 54 | <View style={styles.headerContainer}> |
52 | <Text style={styles.name} numberOfLines={1}>{username}</Text> | 55 | <Text style={styles.name} numberOfLines={1}>{username}</Text> |
53 | <TouchableOpacity onPress={()=>{ | 56 | <TouchableOpacity onPress={()=>{ |
54 | - this.props.onThumbsUp&&this.props.onThumbsUp(id,isPraise=='Y'?'N':'Y') | 57 | + this.props.onThumbsUp&&this.props.onThumbsUp(id,isPraise=='Y'?'N':'Y', uid) |
55 | }}> | 58 | }}> |
56 | <View style={styles.thumbsUp}> | 59 | <View style={styles.thumbsUp}> |
57 | <Image style={styles.thumbsUpIcon} source={thumbsUpIcon}/> | 60 | <Image style={styles.thumbsUpIcon} source={thumbsUpIcon}/> |
@@ -171,8 +171,12 @@ export default class Detail extends Component { | @@ -171,8 +171,12 @@ export default class Detail extends Component { | ||
171 | </View> | 171 | </View> |
172 | ); | 172 | ); |
173 | }else if (template_name == 'goods') { | 173 | }else if (template_name == 'goods') { |
174 | + let {resource} = this.props; | ||
175 | + let { | ||
176 | + articleId, | ||
177 | + } = resource; | ||
174 | return ( | 178 | return ( |
175 | - <GoodsCell resource={rowData} onPressProduct={this.props.onPressProduct} onPressShopCar={this.props.onPressShopCar}/> | 179 | + <GoodsCell resource={rowData} articleId={articleId} onPressProduct={this.props.onPressProduct} onPressShopCar={this.props.onPressShopCar}/> |
176 | ); | 180 | ); |
177 | }else if (template_name == 'link') { | 181 | }else if (template_name == 'link') { |
178 | return ( | 182 | return ( |
@@ -13,6 +13,7 @@ const { | @@ -13,6 +13,7 @@ const { | ||
13 | Dimensions, | 13 | Dimensions, |
14 | TouchableOpacity, | 14 | TouchableOpacity, |
15 | Platform, | 15 | Platform, |
16 | + NativeModules, | ||
16 | } = ReactNative; | 17 | } = ReactNative; |
17 | 18 | ||
18 | 19 | ||
@@ -33,7 +34,7 @@ export default class GoodsCell extends React.Component { | @@ -33,7 +34,7 @@ export default class GoodsCell extends React.Component { | ||
33 | } | 34 | } |
34 | 35 | ||
35 | render() { | 36 | render() { |
36 | - let {resource} = this.props; | 37 | + let {resource, articleId} = this.props; |
37 | let originList = resource.get('productList'); | 38 | let originList = resource.get('productList'); |
38 | let listSize = originList?originList.size:0; | 39 | let listSize = originList?originList.size:0; |
39 | if (!originList || listSize == 0) { | 40 | if (!originList || listSize == 0) { |
@@ -101,6 +102,11 @@ export default class GoodsCell extends React.Component { | @@ -101,6 +102,11 @@ export default class GoodsCell extends React.Component { | ||
101 | ); | 102 | ); |
102 | })} | 103 | })} |
103 | {(this.state.moreProduct && listSize > 2) ? <TouchableOpacity style={styles.more} activeOpacity={0.5} onPress={() => { | 104 | {(this.state.moreProduct && listSize > 2) ? <TouchableOpacity style={styles.more} activeOpacity={0.5} onPress={() => { |
105 | + let params = { | ||
106 | + ID: articleId + '' , | ||
107 | + }; | ||
108 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_MORE_GODS_C', params); | ||
109 | + | ||
104 | this.setState({moreProduct: !this.state.moreProduct}); | 110 | this.setState({moreProduct: !this.state.moreProduct}); |
105 | }}> | 111 | }}> |
106 | <View style={styles.more}> | 112 | <View style={styles.more}> |
@@ -63,10 +63,13 @@ export default class Header extends React.Component { | @@ -63,10 +63,13 @@ export default class Header extends React.Component { | ||
63 | let pageViews = hasData?article_data.get('pageViews'):'99999'; | 63 | let pageViews = hasData?article_data.get('pageViews'):'99999'; |
64 | let publishTime = hasData?article_data.get('publishTime'):'12月12日 12:00'; | 64 | let publishTime = hasData?article_data.get('publishTime'):'12月12日 12:00'; |
65 | 65 | ||
66 | + let author_id = hasData?article_data.get('author_id'):''; | ||
67 | + let id = hasData?article_data.get('id'):''; | ||
68 | + | ||
66 | return( | 69 | return( |
67 | <View style={styles.contentContainer}> | 70 | <View style={styles.contentContainer}> |
68 | <TouchableOpacity activeOpacity={0.5} onPress={() => { | 71 | <TouchableOpacity activeOpacity={0.5} onPress={() => { |
69 | - this.props.onPressAuthor && this.props.onPressAuthor(author_url); | 72 | + this.props.onPressAuthor && this.props.onPressAuthor(author_url, author_id, id); |
70 | }}> | 73 | }}> |
71 | <View style={styles.header}> | 74 | <View style={styles.header}> |
72 | <Image source={{uri: author_avatar}} style={styles.thumb}></Image> | 75 | <Image source={{uri: author_avatar}} style={styles.thumb}></Image> |
@@ -34,9 +34,9 @@ export default class OtherArticle extends React.Component { | @@ -34,9 +34,9 @@ export default class OtherArticle extends React.Component { | ||
34 | } | 34 | } |
35 | 35 | ||
36 | _renderRow(rowData, sectionID, rowID) { | 36 | _renderRow(rowData, sectionID, rowID) { |
37 | - let {url} = rowData; | 37 | + let {url, id} = rowData; |
38 | return ( | 38 | return ( |
39 | - <TouchableOpacity style={styles.cell} onPress={()=>{this.props.onPressArticle&&this.props.onPressArticle(rowData.get('url'))}}> | 39 | + <TouchableOpacity style={styles.cell} onPress={()=>{this.props.onPressArticle&&this.props.onPressArticle(rowData.get('url'), rowData.get('id'))}}> |
40 | <Image style={styles.cellImage} source={{uri:rowData.get('thumb')}}/> | 40 | <Image style={styles.cellImage} source={{uri:rowData.get('thumb')}}/> |
41 | <View style={styles.cellContent}> | 41 | <View style={styles.cellContent}> |
42 | <Text style={styles.cellTitle} numberOfLines={2}> | 42 | <Text style={styles.cellTitle} numberOfLines={2}> |
@@ -29,7 +29,7 @@ export default class Tags extends React.Component { | @@ -29,7 +29,7 @@ export default class Tags extends React.Component { | ||
29 | let tags = data ? data.tags : []; | 29 | let tags = data ? data.tags : []; |
30 | 30 | ||
31 | if (!tags || !tags.length) { | 31 | if (!tags || !tags.length) { |
32 | - return (<View style={{height:1,width:width,backgroundColor:'white'}}/>); | 32 | + return (<View style={{height:1,width:width,backgroundColor:'white'}}/>); |
33 | } | 33 | } |
34 | 34 | ||
35 | return ( | 35 | return ( |
@@ -42,7 +42,7 @@ export default class Tags extends React.Component { | @@ -42,7 +42,7 @@ export default class Tags extends React.Component { | ||
42 | key={i} | 42 | key={i} |
43 | style={styles.tag} | 43 | style={styles.tag} |
44 | onPress={()=>{ | 44 | onPress={()=>{ |
45 | - this.props.onPressTag && this.props.onPressTag(value.url) | 45 | + this.props.onPressTag && this.props.onPressTag(value) |
46 | }} | 46 | }} |
47 | > | 47 | > |
48 | {value.name} | 48 | {value.name} |
@@ -38,7 +38,7 @@ export default class List extends Component { | @@ -38,7 +38,7 @@ export default class List extends Component { | ||
38 | } | 38 | } |
39 | 39 | ||
40 | _renderHeader() { | 40 | _renderHeader() { |
41 | - let {author} = this.props.resource.toJS(); | 41 | + let {author, author_id, id} = this.props.resource.toJS(); |
42 | if (this.props.type == 'editor' || !author) { | 42 | if (this.props.type == 'editor' || !author) { |
43 | return null; | 43 | return null; |
44 | } | 44 | } |
@@ -48,7 +48,7 @@ export default class List extends Component { | @@ -48,7 +48,7 @@ export default class List extends Component { | ||
48 | name | 48 | name |
49 | } = author; | 49 | } = author; |
50 | return ( | 50 | return ( |
51 | - <TouchableOpacity onPress={()=>{this.props.onPressHeader&&this.props.onPressHeader(url)}}> | 51 | + <TouchableOpacity onPress={()=>{this.props.onPressHeader&&this.props.onPressHeader(url, author_id, id)}}> |
52 | <View style={styles.headerContainer}> | 52 | <View style={styles.headerContainer}> |
53 | <Image style={styles.avatar} source={{uri:avatar}}/> | 53 | <Image style={styles.avatar} source={{uri:avatar}}/> |
54 | <Text style={styles.name}>{name}</Text> | 54 | <Text style={styles.name}>{name}</Text> |
@@ -97,12 +97,6 @@ export default class List extends Component { | @@ -97,12 +97,6 @@ export default class List extends Component { | ||
97 | <View style={styles.sapatorView}/> | 97 | <View style={styles.sapatorView}/> |
98 | {this._renderHeader()} | 98 | {this._renderHeader()} |
99 | <Image style={[styles.image,{width: this.state.width, height: this.state.height}]} source={{uri:bigPic}}> | 99 | <Image style={[styles.image,{width: this.state.width, height: this.state.height}]} source={{uri:bigPic}}> |
100 | - {!hiddenTagView? | ||
101 | - <Image style={styles.tagContainer} source={tagImg}> | ||
102 | - <Text style={styles.tagText}>{category_name}</Text> | ||
103 | - </Image> | ||
104 | - :null | ||
105 | - } | ||
106 | </Image> | 100 | </Image> |
107 | <Text style={styles.titleText}>{title}</Text> | 101 | <Text style={styles.titleText}>{title}</Text> |
108 | <Text style={styles.contentText} numberOfLines={3}>{intro}</Text> | 102 | <Text style={styles.contentText} numberOfLines={3}>{intro}</Text> |
@@ -82,11 +82,31 @@ class DetailContainer extends Component { | @@ -82,11 +82,31 @@ class DetailContainer extends Component { | ||
82 | 82 | ||
83 | _onSubmitForComment(content,replyTo){ | 83 | _onSubmitForComment(content,replyTo){ |
84 | this.props.actions.addCommentsForArtivle(content,replyTo); | 84 | this.props.actions.addCommentsForArtivle(content,replyTo); |
85 | + if (replyTo.length) { | ||
86 | + let articleId = this.props.detail.get('articleId'); | ||
87 | + let params = { | ||
88 | + ID: articleId, | ||
89 | + COMMENT_UID: replyTo, | ||
90 | + }; | ||
91 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_REPLY_C', params); | ||
92 | + } else { | ||
93 | + let articleId = this.props.detail.get('articleId'); | ||
94 | + let params = { | ||
95 | + ID: articleId, | ||
96 | + }; | ||
97 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_COMMENT_C', params); | ||
98 | + } | ||
85 | } | 99 | } |
86 | 100 | ||
87 | _onPressConcerns(isFav){ | 101 | _onPressConcerns(isFav){ |
88 | if (isFav == 'Y') { | 102 | if (isFav == 'Y') { |
89 | this.props.actions.addFavorite(); | 103 | this.props.actions.addFavorite(); |
104 | + | ||
105 | + let articleId = this.props.detail.get('articleId'); | ||
106 | + let params = { | ||
107 | + ID: articleId, | ||
108 | + }; | ||
109 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_FAV_ART_C', params); | ||
90 | }else { | 110 | }else { |
91 | this.props.actions.cancelFavorite(); | 111 | this.props.actions.cancelFavorite(); |
92 | } | 112 | } |
@@ -99,14 +119,29 @@ class DetailContainer extends Component { | @@ -99,14 +119,29 @@ class DetailContainer extends Component { | ||
99 | _addPraiseForArtivle(isPraise){ | 119 | _addPraiseForArtivle(isPraise){ |
100 | if (isPraise == 'Y') { | 120 | if (isPraise == 'Y') { |
101 | this.props.actions.praiseForArtivle(); | 121 | this.props.actions.praiseForArtivle(); |
122 | + | ||
123 | + let articleId = this.props.detail.get('articleId'); | ||
124 | + let params = { | ||
125 | + ID: articleId, | ||
126 | + }; | ||
127 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_ART_LIKE_C', params); | ||
102 | }else { | 128 | }else { |
103 | this.props.actions.cancelPraiseForArtivle(); | 129 | this.props.actions.cancelPraiseForArtivle(); |
104 | } | 130 | } |
105 | } | 131 | } |
106 | 132 | ||
107 | - _addPraiseForComments(comment_id,praise){ | 133 | + _addPraiseForComments(comment_id,praise, uid){ |
108 | this.props.actions.setPraiseForComments(comment_id,praise); | 134 | this.props.actions.setPraiseForComments(comment_id,praise); |
109 | this.props.actions.addPraiseForComments(comment_id,praise); | 135 | this.props.actions.addPraiseForComments(comment_id,praise); |
136 | + | ||
137 | + if (praise == 'Y') { | ||
138 | + let articleId = this.props.detail.get('articleId'); | ||
139 | + let params = { | ||
140 | + ID: articleId, | ||
141 | + COMMENT_UID: uid, | ||
142 | + }; | ||
143 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_USER_LIKE_C', params); | ||
144 | + } | ||
110 | } | 145 | } |
111 | 146 | ||
112 | _onPressFilter(value) { | 147 | _onPressFilter(value) { |
@@ -117,9 +152,15 @@ class DetailContainer extends Component { | @@ -117,9 +152,15 @@ class DetailContainer extends Component { | ||
117 | this.props.actions.setGoodsGroupY(y); | 152 | this.props.actions.setGoodsGroupY(y); |
118 | } | 153 | } |
119 | 154 | ||
120 | - _onPressAuthor(url) { | 155 | + _onPressAuthor(url, author_id, id) { |
121 | let authorUrl = urlAddParamOfType(url, '11') | 156 | let authorUrl = urlAddParamOfType(url, '11') |
122 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(authorUrl); | 157 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(authorUrl); |
158 | + | ||
159 | + let params = { | ||
160 | + ID: id + '' , | ||
161 | + UID: author_id, | ||
162 | + }; | ||
163 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_HEAD_C', params); | ||
123 | } | 164 | } |
124 | 165 | ||
125 | _onPressBrand(url,rowID,id) { | 166 | _onPressBrand(url,rowID,id) { |
@@ -140,17 +181,33 @@ class DetailContainer extends Component { | @@ -140,17 +181,33 @@ class DetailContainer extends Component { | ||
140 | } | 181 | } |
141 | } | 182 | } |
142 | 183 | ||
143 | - _onPressArticle(url) { | 184 | + _onPressArticle(url, id) { |
144 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | 185 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); |
186 | + | ||
187 | + let articleId = this.props.detail.get('articleId'); | ||
188 | + let params = { | ||
189 | + ID: articleId, | ||
190 | + R_ART_ID: id + '', | ||
191 | + }; | ||
192 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_R_ART_C', params); | ||
145 | } | 193 | } |
146 | 194 | ||
147 | _onPressLink(url) { | 195 | _onPressLink(url) { |
148 | ReactNative.NativeModules.YH_CommonHelper.goLinkUrl(url); | 196 | ReactNative.NativeModules.YH_CommonHelper.goLinkUrl(url); |
149 | } | 197 | } |
150 | 198 | ||
151 | - _onPressTag(url) { | 199 | + _onPressTag(value) { |
200 | + | ||
201 | + let url = value.url; | ||
152 | let taggedUrl = urlAddParamOfType(url, '12') | 202 | let taggedUrl = urlAddParamOfType(url, '12') |
153 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(taggedUrl); | 203 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(taggedUrl); |
204 | + | ||
205 | + let articleId = this.props.detail.get('articleId'); | ||
206 | + let params = { | ||
207 | + ID: articleId, | ||
208 | + LABEL_NAME: value.name, | ||
209 | + }; | ||
210 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_DETAIL_LABEL_C', params); | ||
154 | } | 211 | } |
155 | _onPressMoreLink(url) { | 212 | _onPressMoreLink(url) { |
156 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | 213 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); |
@@ -63,7 +63,7 @@ class ListContainer extends Component { | @@ -63,7 +63,7 @@ class ListContainer extends Component { | ||
63 | } | 63 | } |
64 | 64 | ||
65 | componentWillUnmount() { | 65 | componentWillUnmount() { |
66 | - | 66 | + |
67 | } | 67 | } |
68 | 68 | ||
69 | _onPressCell(url, index, article_id) { | 69 | _onPressCell(url, index, article_id) { |
@@ -85,9 +85,15 @@ class ListContainer extends Component { | @@ -85,9 +85,15 @@ class ListContainer extends Component { | ||
85 | NativeModules.YH_CommonHelper.logEvent(name, params); | 85 | NativeModules.YH_CommonHelper.logEvent(name, params); |
86 | } | 86 | } |
87 | 87 | ||
88 | - _onPressHeader(url) { | 88 | + _onPressHeader(url, author_id, id) { |
89 | let taggedUrl = urlAddParamOfType(url, '11') | 89 | let taggedUrl = urlAddParamOfType(url, '11') |
90 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(taggedUrl); | 90 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(taggedUrl); |
91 | + | ||
92 | + let params = { | ||
93 | + ID: id + '' , | ||
94 | + UID: author_id, | ||
95 | + }; | ||
96 | + NativeModules.YH_CommonHelper.logEvent('YB_STROLL_LIST_HEAD_C', params); | ||
91 | } | 97 | } |
92 | 98 | ||
93 | _onRefresh() { | 99 | _onRefresh() { |
-
Please register or login to post a comment