Showing
10 changed files
with
270 additions
and
38 deletions
@@ -36,7 +36,7 @@ export default class KeywordCell extends React.Component { | @@ -36,7 +36,7 @@ export default class KeywordCell extends React.Component { | ||
36 | /> | 36 | /> |
37 | <View style={styles.textContainer}> | 37 | <View style={styles.textContainer}> |
38 | {list.toJS().map((item, i) => { | 38 | {list.toJS().map((item, i) => { |
39 | - return <KeywordText key={i} keyword={item.keyword} androiddata={item.androiddata} onPressKeyword={onPressKeyword}/>; | 39 | + return <KeywordText key={i} index={i} keyword={item.keyword} androiddata={item.androiddata} onPressKeyword={onPressKeyword}/>; |
40 | })} | 40 | })} |
41 | </View> | 41 | </View> |
42 | 42 |
@@ -23,14 +23,14 @@ export default class KeywordText extends React.Component { | @@ -23,14 +23,14 @@ export default class KeywordText extends React.Component { | ||
23 | } | 23 | } |
24 | 24 | ||
25 | render() { | 25 | render() { |
26 | - let {key, keyword, androiddata, onPressKeyword} = this.props; | 26 | + let {index, keyword, androiddata, onPressKeyword} = this.props; |
27 | let textColor = this.state.helight ? {color: 'rgb(66, 66, 66)'} : {color: 'rgb(191, 191, 191)'}; | 27 | let textColor = this.state.helight ? {color: 'rgb(66, 66, 66)'} : {color: 'rgb(191, 191, 191)'}; |
28 | return ( | 28 | return ( |
29 | <TouchableHighlight | 29 | <TouchableHighlight |
30 | style={styles.container} | 30 | style={styles.container} |
31 | underlayColor={'rgb(255, 255, 255)'} | 31 | underlayColor={'rgb(255, 255, 255)'} |
32 | onPress={() => { | 32 | onPress={() => { |
33 | - onPressKeyword && onPressKeyword(keyword, androiddata, key); | 33 | + onPressKeyword && onPressKeyword(keyword, androiddata, index); |
34 | }} | 34 | }} |
35 | onPressIn={() => { | 35 | onPressIn={() => { |
36 | this.setState({ | 36 | this.setState({ |
@@ -55,7 +55,7 @@ export default class InterestCell extends Component { | @@ -55,7 +55,7 @@ export default class InterestCell extends Component { | ||
55 | key={i} | 55 | key={i} |
56 | activeOpacity={1} | 56 | activeOpacity={1} |
57 | onPress={() => { | 57 | onPress={() => { |
58 | - this.props.onPressProduct && this.props.onPressProduct(item, i); | 58 | + this.props.onPressProduct && this.props.onPressProduct(item, i, rowID); |
59 | }} | 59 | }} |
60 | > | 60 | > |
61 | <View style={[styles.product, {marginLeft}]}> | 61 | <View style={[styles.product, {marginLeft}]}> |
@@ -84,7 +84,7 @@ class BrandContainer extends Component { | @@ -84,7 +84,7 @@ class BrandContainer extends Component { | ||
84 | } | 84 | } |
85 | 85 | ||
86 | //原生跳转 | 86 | //原生跳转 |
87 | - _onPressBrandItem(data){ | 87 | + _onPressBrandItem(data, fromSearch=false){ |
88 | ReactNative.NativeModules.YH_CommonHelper.pushBrandVC(data); | 88 | ReactNative.NativeModules.YH_CommonHelper.pushBrandVC(data); |
89 | 89 | ||
90 | let eventName = ''; | 90 | let eventName = ''; |
@@ -96,6 +96,10 @@ class BrandContainer extends Component { | @@ -96,6 +96,10 @@ class BrandContainer extends Component { | ||
96 | eventName = 'YB_CATEGORY_BRAND_LIST_TEXT'; | 96 | eventName = 'YB_CATEGORY_BRAND_LIST_TEXT'; |
97 | } | 97 | } |
98 | 98 | ||
99 | + if (fromSearch) { | ||
100 | + eventName = 'YB_CATEGORY_BRAND_LIST_TEXT'; | ||
101 | + } | ||
102 | + | ||
99 | let brandId = data.shop_id ? data.shop_id : ''; | 103 | let brandId = data.shop_id ? data.shop_id : ''; |
100 | if (!brandId) { | 104 | if (!brandId) { |
101 | brandId = data.id ? data.id : ''; | 105 | brandId = data.id ? data.id : ''; |
@@ -104,8 +108,8 @@ class BrandContainer extends Component { | @@ -104,8 +108,8 @@ class BrandContainer extends Component { | ||
104 | BR_ID: brandId, | 108 | BR_ID: brandId, |
105 | GDER: this.props.brand.selectedChannelId + '', | 109 | GDER: this.props.brand.selectedChannelId + '', |
106 | }; | 110 | }; |
107 | - | ||
108 | - console.log(params) | 111 | + // console.log(eventName) |
112 | + // console.log(params) | ||
109 | NativeModules.YH_CommonHelper.logEvent(eventName, params); | 113 | NativeModules.YH_CommonHelper.logEvent(eventName, params); |
110 | } | 114 | } |
111 | 115 | ||
@@ -114,11 +118,11 @@ class BrandContainer extends Component { | @@ -114,11 +118,11 @@ class BrandContainer extends Component { | ||
114 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | 118 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); |
115 | 119 | ||
116 | let params = { | 120 | let params = { |
117 | - BAN_NUM: index + 1 + '', | 121 | + BAN_NUM: parseInt(index) + 1 + '', |
118 | TOURL: url, | 122 | TOURL: url, |
119 | GDER: this.props.brand.selectedChannelId + '', | 123 | GDER: this.props.brand.selectedChannelId + '', |
120 | }; | 124 | }; |
121 | - console.log(params) | 125 | + |
122 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_BAN', params); | 126 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_BAN', params); |
123 | } | 127 | } |
124 | 128 | ||
@@ -126,17 +130,13 @@ class BrandContainer extends Component { | @@ -126,17 +130,13 @@ class BrandContainer extends Component { | ||
126 | let url = data.url; | 130 | let url = data.url; |
127 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | 131 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); |
128 | 132 | ||
129 | - let brandId = data.shop_id ? data.shop_id : ''; | ||
130 | - if (!brandId) { | ||
131 | - brandId = data.id ? data.id : ''; | ||
132 | - } | ||
133 | - | 133 | + let brandId = brandId = data.id ? data.id : ''; |
134 | let params = { | 134 | let params = { |
135 | - BAN_NUM: index + 1 + '', | 135 | + BAN_NUM: parseInt(index) + 1 + '', |
136 | BR_ID: brandId, | 136 | BR_ID: brandId, |
137 | GDER: this.props.brand.selectedChannelId + '', | 137 | GDER: this.props.brand.selectedChannelId + '', |
138 | }; | 138 | }; |
139 | - console.log(params) | 139 | + |
140 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_BR', params); | 140 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_BR', params); |
141 | } | 141 | } |
142 | 142 | ||
@@ -144,9 +144,9 @@ class BrandContainer extends Component { | @@ -144,9 +144,9 @@ class BrandContainer extends Component { | ||
144 | this.props.actions.setBrandFilter(value); | 144 | this.props.actions.setBrandFilter(value); |
145 | 145 | ||
146 | let params = { | 146 | let params = { |
147 | - CAT_NUM: value + 1 + '', | 147 | + CAT_NUM: parseInt(value) + 1 + '', |
148 | }; | 148 | }; |
149 | - console.log(params) | 149 | + |
150 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_SG', params); | 150 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_SG', params); |
151 | } | 151 | } |
152 | 152 | ||
@@ -195,7 +195,7 @@ class BrandContainer extends Component { | @@ -195,7 +195,7 @@ class BrandContainer extends Component { | ||
195 | let params = { | 195 | let params = { |
196 | CAT_NUM: channelId + '', | 196 | CAT_NUM: channelId + '', |
197 | }; | 197 | }; |
198 | - console.log(params) | 198 | + |
199 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_CH', params); | 199 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_CH', params); |
200 | } | 200 | } |
201 | 201 | ||
@@ -206,8 +206,8 @@ class BrandContainer extends Component { | @@ -206,8 +206,8 @@ class BrandContainer extends Component { | ||
206 | let params = { | 206 | let params = { |
207 | SEARCH_POS: '2', | 207 | SEARCH_POS: '2', |
208 | }; | 208 | }; |
209 | - console.log(params) | ||
210 | - [[YH_Analytics sharedInstance] logEvent:'YB_SEARCH_CLICK' parameters:params]; | 209 | + |
210 | + NativeModules.YH_CommonHelper.logEvent('YB_SEARCH_CLICK', params); | ||
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
@@ -235,7 +235,7 @@ class BrandContainer extends Component { | @@ -235,7 +235,7 @@ class BrandContainer extends Component { | ||
235 | } | 235 | } |
236 | 236 | ||
237 | _onPressBrandSearchItem(data) { | 237 | _onPressBrandSearchItem(data) { |
238 | - this._onPressBrandItem(data); | 238 | + this._onPressBrandItem(data, true); |
239 | this.props.actions.insertSearchHistory(data); | 239 | this.props.actions.insertSearchHistory(data); |
240 | this._onClickCancelSearch(); | 240 | this._onClickCancelSearch(); |
241 | 241 | ||
@@ -245,8 +245,9 @@ class BrandContainer extends Component { | @@ -245,8 +245,9 @@ class BrandContainer extends Component { | ||
245 | POS_ID: '0', | 245 | POS_ID: '0', |
246 | FLR_INDEX: '0', | 246 | FLR_INDEX: '0', |
247 | }; | 247 | }; |
248 | - console.log(params) | ||
249 | - [[YH_Analytics sharedInstance] logEvent:'YB_BRAND_KEYWORD_SEARCH_C' parameters:params]; | 248 | + // console.log('YB_BRAND_KEYWORD_SEARCH_C') |
249 | + // console.log(params) | ||
250 | + NativeModules.YH_CommonHelper.logEvent('YB_BRAND_KEYWORD_SEARCH_C', params); | ||
250 | } | 251 | } |
251 | 252 | ||
252 | _onPressSearchHistoryItem(keyword, androiddata, index, section){ | 253 | _onPressSearchHistoryItem(keyword, androiddata, index, section){ |
@@ -266,11 +267,12 @@ class BrandContainer extends Component { | @@ -266,11 +267,12 @@ class BrandContainer extends Component { | ||
266 | 267 | ||
267 | let params = { | 268 | let params = { |
268 | KEYWORD: keyword, | 269 | KEYWORD: keyword, |
269 | - POS_ID: section + 1 + '', | ||
270 | - FLR_INDEX: index + 1 + '', | 270 | + POS_ID: parseInt(section) + 1 + '', |
271 | + FLR_INDEX: parseInt(index) + 1 + '', | ||
271 | }; | 272 | }; |
272 | - console.log(params) | ||
273 | - [[YH_Analytics sharedInstance] logEvent:'YB_BRAND_KEYWORD_SEARCH_C' parameters:params]; | 273 | + // console.log('YB_BRAND_KEYWORD_SEARCH_C') |
274 | + // console.log(params) | ||
275 | + NativeModules.YH_CommonHelper.logEvent('YB_BRAND_KEYWORD_SEARCH_C', params); | ||
274 | } | 276 | } |
275 | 277 | ||
276 | render() { | 278 | render() { |
@@ -102,11 +102,11 @@ class CategoryContainer extends Component { | @@ -102,11 +102,11 @@ class CategoryContainer extends Component { | ||
102 | channel = 4; | 102 | channel = 4; |
103 | } | 103 | } |
104 | let params = { | 104 | let params = { |
105 | - CAT_NUM: catNum + 1 + '', | ||
106 | - NAV_CAT_ID: index + 2 + '', | 105 | + CAT_NUM: parseInt(catNum) + 1 + '', |
106 | + NAV_CAT_ID: parseInt(navCatId) + '', | ||
107 | GDER: channel + '', | 107 | GDER: channel + '', |
108 | }; | 108 | }; |
109 | - console.log(params) | 109 | + |
110 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_CAT_LIST', params); | 110 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_CAT_LIST', params); |
111 | } | 111 | } |
112 | 112 |
@@ -112,9 +112,11 @@ class InterestContainer extends Component { | @@ -112,9 +112,11 @@ class InterestContainer extends Component { | ||
112 | } | 112 | } |
113 | 113 | ||
114 | let params = { | 114 | let params = { |
115 | - CAT_NUM: index + 1 + '', | 115 | + CAT_NUM: parseInt(index) + 1 + '', |
116 | BR_ID: item.get('brand_id', ''), | 116 | BR_ID: item.get('brand_id', ''), |
117 | }; | 117 | }; |
118 | + // console.log('YB_CATEGORY_BRAND_TAB_FAV') | ||
119 | + // console.log(params) | ||
118 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_TAB_FAV', params); | 120 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_TAB_FAV', params); |
119 | } | 121 | } |
120 | 122 | ||
@@ -127,21 +129,25 @@ class InterestContainer extends Component { | @@ -127,21 +129,25 @@ class InterestContainer extends Component { | ||
127 | NativeModules.YH_CommonHelper.jumpToBrand(item.toJS()); | 129 | NativeModules.YH_CommonHelper.jumpToBrand(item.toJS()); |
128 | 130 | ||
129 | let params = { | 131 | let params = { |
130 | - CAT_NUM: index + 1 + '', | 132 | + CAT_NUM: parseInt(index) + 1 + '', |
131 | NAV_NUM: '1', | 133 | NAV_NUM: '1', |
132 | BR_ID: item.get('brand_id', ''), | 134 | BR_ID: item.get('brand_id', ''), |
133 | }; | 135 | }; |
136 | + // console.log('YB_CATEGORY_BRAND_LIST_ATT') | ||
137 | + // console.log(params) | ||
134 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_ATT', params); | 138 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_ATT', params); |
135 | } | 139 | } |
136 | 140 | ||
137 | - _onPressInterestProduct(item, index) { | 141 | + _onPressInterestProduct(item, index, section) { |
138 | let url = item.url ? item.url : ''; | 142 | let url = item.url ? item.url : ''; |
139 | NativeModules.YH_CommonHelper.jumpWithUrl(url); | 143 | NativeModules.YH_CommonHelper.jumpWithUrl(url); |
140 | 144 | ||
141 | let params = { | 145 | let params = { |
142 | - CAT_NUM: '1', | ||
143 | - NAV_NUM: index + 2 + '', | 146 | + CAT_NUM: parseInt(section) + 1 + '', |
147 | + NAV_NUM: parseInt(index) + 1 + '', | ||
144 | }; | 148 | }; |
149 | + // console.log('YB_CATEGORY_BRAND_LIST_ATT') | ||
150 | + // console.log(params) | ||
145 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_ATT', params); | 151 | NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_ATT', params); |
146 | } | 152 | } |
147 | 153 |
@@ -190,6 +190,8 @@ export function getBrandList(channel) { | @@ -190,6 +190,8 @@ export function getBrandList(channel) { | ||
190 | }else if (channel == 4) { | 190 | }else if (channel == 4) { |
191 | dispatch(getBrandListForLifeStyleSuccess(payload)); | 191 | dispatch(getBrandListForLifeStyleSuccess(payload)); |
192 | } | 192 | } |
193 | + | ||
194 | + dispatch(brandListDataExposure(json)); | ||
193 | }) | 195 | }) |
194 | .catch(error => { | 196 | .catch(error => { |
195 | if (channel == 1) { | 197 | if (channel == 1) { |
@@ -354,6 +356,8 @@ export function getBrandResource(channel) { | @@ -354,6 +356,8 @@ export function getBrandResource(channel) { | ||
354 | }else if (channel == 4) { | 356 | }else if (channel == 4) { |
355 | dispatch(getBrandResourceForLifeStyleSuccess(payload)); | 357 | dispatch(getBrandResourceForLifeStyleSuccess(payload)); |
356 | } | 358 | } |
359 | + | ||
360 | + dispatch(resourceDataExposure(json)); | ||
357 | }) | 361 | }) |
358 | .catch(error => { | 362 | .catch(error => { |
359 | if (channel == 1) { | 363 | if (channel == 1) { |
@@ -678,3 +682,78 @@ export function setInitialListSize(count) { | @@ -678,3 +682,78 @@ export function setInitialListSize(count) { | ||
678 | dispatch(setInitialListSizePar(count)); | 682 | dispatch(setInitialListSizePar(count)); |
679 | } | 683 | } |
680 | } | 684 | } |
685 | + | ||
686 | +function resourceDataExposure(json) { | ||
687 | + return (dispatch, getState) => { | ||
688 | + if (!json) { | ||
689 | + return; | ||
690 | + } | ||
691 | + | ||
692 | + let hot = []; | ||
693 | + let banner = []; | ||
694 | + json.map((item) => { | ||
695 | + if (item.template_name && item.template_name == 'focus') { | ||
696 | + item.data && item.data.map((item2, i) => { | ||
697 | + banner.push({ | ||
698 | + I_INDEX: i + 1, | ||
699 | + IMAGE_URL: item2.src ? item2.src : '', | ||
700 | + ACTION_URL: item2.url ? item2.url : '', | ||
701 | + }); | ||
702 | + }); | ||
703 | + | ||
704 | + } | ||
705 | + | ||
706 | + if (item.template_name && item.template_name == 'custom_brands') { | ||
707 | + item.data && item.data.list && item.data.list.map((item2, i) => { | ||
708 | + hot.push({ | ||
709 | + I_INDEX: i + 1, | ||
710 | + SHOP_ID: '', | ||
711 | + BRAND_ID: item2.id ? item2.id : '', | ||
712 | + BRAND_NAME: item2.name ? item2.name : '', | ||
713 | + IMAGE_URL: item2.src ? item2.src : '', | ||
714 | + | ||
715 | + }); | ||
716 | + }); | ||
717 | + | ||
718 | + } | ||
719 | + }); | ||
720 | + | ||
721 | + let params = { | ||
722 | + HOTBRAND: hot, | ||
723 | + BRANDBANNER: banner, | ||
724 | + }; | ||
725 | + | ||
726 | + // console.log('YB_SHOW_BRANDBANNER') | ||
727 | + // console.log(params) | ||
728 | + | ||
729 | + ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_SHOW_BRANDBANNER', params); | ||
730 | + }; | ||
731 | +} | ||
732 | + | ||
733 | +function brandListDataExposure(json) { | ||
734 | + return (dispatch, getState) => { | ||
735 | + if (!json) { | ||
736 | + return; | ||
737 | + } | ||
738 | + let {all_list, new_list, hot_list} = json; | ||
739 | + | ||
740 | + let logAllList = {}; | ||
741 | + let logNewList = []; | ||
742 | + let logHotList = []; | ||
743 | + | ||
744 | + all_list && all_listmap((item) => { | ||
745 | + | ||
746 | + }); | ||
747 | + | ||
748 | + | ||
749 | + let params = { | ||
750 | + HOTBRAND: hot, | ||
751 | + BRANDBANNER: banner, | ||
752 | + }; | ||
753 | + | ||
754 | + console.log('YB_SHOW_BRANDLIST') | ||
755 | + console.log(params) | ||
756 | + | ||
757 | + // ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_SHOW_BRANDLIST', params); | ||
758 | + }; | ||
759 | +} |
@@ -25,6 +25,8 @@ export function getCategory() { | @@ -25,6 +25,8 @@ export function getCategory() { | ||
25 | .then(json => { | 25 | .then(json => { |
26 | let payload=parseCategoryList(json); | 26 | let payload=parseCategoryList(json); |
27 | dispatch(getCategorySuccess(payload)); | 27 | dispatch(getCategorySuccess(payload)); |
28 | + | ||
29 | + dispatch(dataExposure(payload)); | ||
28 | }) | 30 | }) |
29 | .catch(error => { | 31 | .catch(error => { |
30 | dispatch(getCategoryFailure(error)); | 32 | dispatch(getCategoryFailure(error)); |
@@ -219,3 +221,95 @@ export function jumpToCategory(value, index, channel){ | @@ -219,3 +221,95 @@ export function jumpToCategory(value, index, channel){ | ||
219 | } | 221 | } |
220 | } | 222 | } |
221 | 223 | ||
224 | +function dataExposure(json) { | ||
225 | + return (dispatch, getState) => { | ||
226 | + if (!json) { | ||
227 | + return; | ||
228 | + } | ||
229 | + | ||
230 | + let {boy, girl, kids, lifestyle} = json; | ||
231 | + | ||
232 | + let newBoy = []; | ||
233 | + let newGirl = []; | ||
234 | + let newKids = []; | ||
235 | + let newLifestyle = []; | ||
236 | + | ||
237 | + boy.map((item, i) => { | ||
238 | + let subList = []; | ||
239 | + item.sub && item.sub.map((sub, k) => { | ||
240 | + subList.push({ | ||
241 | + I_INDEX: k + 1, | ||
242 | + CAT_ID: sub.category_id, | ||
243 | + }); | ||
244 | + }); | ||
245 | + | ||
246 | + newBoy.push({ | ||
247 | + I_INDEX: i + 1, | ||
248 | + CAT_ID: item.category_id, | ||
249 | + SUBLIST: subList, | ||
250 | + }); | ||
251 | + }); | ||
252 | + | ||
253 | + girl.map((item, i) => { | ||
254 | + let subList = []; | ||
255 | + item.sub && item.sub.map((sub, k) => { | ||
256 | + subList.push({ | ||
257 | + I_INDEX: k + 1, | ||
258 | + CAT_ID: sub.category_id, | ||
259 | + }); | ||
260 | + }); | ||
261 | + | ||
262 | + newGirl.push({ | ||
263 | + I_INDEX: i + 1, | ||
264 | + CAT_ID: item.category_id, | ||
265 | + SUBLIST: subList, | ||
266 | + }); | ||
267 | + }); | ||
268 | + | ||
269 | + kids.map((item, i) => { | ||
270 | + let subList = []; | ||
271 | + item.sub && item.sub.map((sub, k) => { | ||
272 | + subList.push({ | ||
273 | + I_INDEX: k + 1, | ||
274 | + CAT_ID: sub.category_id, | ||
275 | + }); | ||
276 | + }); | ||
277 | + | ||
278 | + newKids.push({ | ||
279 | + I_INDEX: i + 1, | ||
280 | + CAT_ID: item.category_id, | ||
281 | + SUBLIST: subList, | ||
282 | + }); | ||
283 | + }); | ||
284 | + | ||
285 | + lifestyle.map((item, i) => { | ||
286 | + let subList = []; | ||
287 | + item.sub && item.sub.map((sub, k) => { | ||
288 | + subList.push({ | ||
289 | + I_INDEX: k + 1, | ||
290 | + CAT_ID: sub.category_id, | ||
291 | + }); | ||
292 | + }); | ||
293 | + | ||
294 | + newLifestyle.push({ | ||
295 | + I_INDEX: i + 1, | ||
296 | + CAT_ID: item.category_id, | ||
297 | + SUBLIST: subList, | ||
298 | + }); | ||
299 | + }); | ||
300 | + | ||
301 | + | ||
302 | + let params = { | ||
303 | + YH_AppChannelBoy: newBoy, | ||
304 | + YH_AppChannelGirl: newGirl, | ||
305 | + YH_AppChannelKid: newKids, | ||
306 | + YH_AppChannelLifeStyle: newLifestyle, | ||
307 | + }; | ||
308 | + | ||
309 | + // console.log('YB_SHOW_CATEGORY') | ||
310 | + // console.log(params) | ||
311 | + | ||
312 | + ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_SHOW_CATEGORY', params); | ||
313 | + }; | ||
314 | +} | ||
315 | + |
@@ -155,6 +155,8 @@ export function interestList(reload=false) { | @@ -155,6 +155,8 @@ export function interestList(reload=false) { | ||
155 | } | 155 | } |
156 | 156 | ||
157 | dispatch(interestListSuccess(payload)); | 157 | dispatch(interestListSuccess(payload)); |
158 | + | ||
159 | + dispatch(dataExposure('YB_SHOW_CONCERN', payload.logList)); | ||
158 | }) | 160 | }) |
159 | .catch(error => { | 161 | .catch(error => { |
160 | dispatch(interestListFailure(error)); | 162 | dispatch(interestListFailure(error)); |
@@ -191,9 +193,41 @@ function parseInterestList(json) { | @@ -191,9 +193,41 @@ function parseInterestList(json) { | ||
191 | let total = json && json.total ? json.total : 0; | 193 | let total = json && json.total ? json.total : 0; |
192 | 194 | ||
193 | let list = json && json.list ? json.list : []; | 195 | let list = json && json.list ? json.list : []; |
196 | + let logList = []; | ||
197 | + list.map((item) => { | ||
198 | + let productList = []; | ||
199 | + let activityList = []; | ||
200 | + | ||
201 | + item.product && item.product.map((product, i) => { | ||
202 | + let logProduct = { | ||
203 | + I_INDEX: i + 1, | ||
204 | + PRD_ID: product.product_id ? product.product_id : '', | ||
205 | + PRD_IMAGE: product.product_img ? product.product_img : '', | ||
206 | + ACTION_URL: product.url ? product.url : '', | ||
207 | + }; | ||
208 | + productList.push(logProduct); | ||
209 | + }); | ||
210 | + | ||
211 | + if (item.brand_type == 'activity') { | ||
212 | + activityList.push({ | ||
213 | + I_INDEX: 1, | ||
214 | + ACT_IMAGE: item.img && item.img.src ? item.img.src : '', | ||
215 | + ACTION_URL: item.img && item.img.url ? item.img.url : '', | ||
216 | + }); | ||
217 | + } | ||
218 | + | ||
219 | + let logItem = { | ||
220 | + BRAND_ID: item.brand_id, | ||
221 | + BRAND_IMG: item.brand_img, | ||
222 | + PRD_LIST: productList, | ||
223 | + ACTIVITY_LIST: activityList, | ||
224 | + }; | ||
225 | + logList.push(logItem); | ||
226 | + }); | ||
194 | 227 | ||
195 | return { | 228 | return { |
196 | list, | 229 | list, |
230 | + logList, | ||
197 | currentPage, | 231 | currentPage, |
198 | pageCount, | 232 | pageCount, |
199 | total, | 233 | total, |
@@ -285,3 +319,20 @@ export function jumpWithUrl(url) { | @@ -285,3 +319,20 @@ export function jumpWithUrl(url) { | ||
285 | payload: url | 319 | payload: url |
286 | }; | 320 | }; |
287 | } | 321 | } |
322 | + | ||
323 | +function dataExposure(eventName, data) { | ||
324 | + return (dispatch, getState) => { | ||
325 | + if (!eventName || !data || data.length == 0) { | ||
326 | + return; | ||
327 | + } | ||
328 | + | ||
329 | + let params = { | ||
330 | + DATA: data, | ||
331 | + }; | ||
332 | + | ||
333 | + console.log(eventName) | ||
334 | + console.log(params) | ||
335 | + | ||
336 | + ReactNative.NativeModules.YH_CommonHelper.logEvent(eventName, params); | ||
337 | + }; | ||
338 | +} |
@@ -13,7 +13,7 @@ export default class BrandService { | @@ -13,7 +13,7 @@ export default class BrandService { | ||
13 | } | 13 | } |
14 | 14 | ||
15 | async getBrandList(yh_channel, fromPage='iFP_Brand'){ | 15 | async getBrandList(yh_channel, fromPage='iFP_Brand'){ |
16 | - return await this.api.post({ | 16 | + return await this.api.get({ |
17 | url: '', | 17 | url: '', |
18 | body: { | 18 | body: { |
19 | method: 'app.brand.newBrandList', | 19 | method: 'app.brand.newBrandList', |
@@ -30,7 +30,7 @@ export default class BrandService { | @@ -30,7 +30,7 @@ export default class BrandService { | ||
30 | } | 30 | } |
31 | 31 | ||
32 | async getBrandResource(content_code,fromPage='iFP_Brand'){ | 32 | async getBrandResource(content_code,fromPage='iFP_Brand'){ |
33 | - return await this.api.post({ | 33 | + return await this.api.get({ |
34 | url: '/operations/api/v5/resource/get', | 34 | url: '/operations/api/v5/resource/get', |
35 | body: { | 35 | body: { |
36 | content_code, | 36 | content_code, |
-
Please register or login to post a comment