新品到着数据曝光添加资源位code reviewd by 朱傲哲
Showing
6 changed files
with
25 additions
and
9 deletions
@@ -79,7 +79,7 @@ class GroupPurchaseDetailContainer extends Component { | @@ -79,7 +79,7 @@ class GroupPurchaseDetailContainer extends Component { | ||
79 | this.props.actions.fetchResourceInfo(); | 79 | this.props.actions.fetchResourceInfo(); |
80 | 80 | ||
81 | if(Platform.OS === 'android' && this.props.popShare == "1"){ | 81 | if(Platform.OS === 'android' && this.props.popShare == "1"){ |
82 | - this.props.actions.showShareView(true); | 82 | + this.props.actions.fetchCouponInfo(); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 |
@@ -126,10 +126,11 @@ export default class NewArrival extends React.PureComponent { | @@ -126,10 +126,11 @@ export default class NewArrival extends React.PureComponent { | ||
126 | } | 126 | } |
127 | 127 | ||
128 | _renderHeader() { | 128 | _renderHeader() { |
129 | - let { resourceInfo } = this.props; | 129 | + let { resourceInfo, contentCode } = this.props; |
130 | return ( | 130 | return ( |
131 | <NewArrivalHeader | 131 | <NewArrivalHeader |
132 | data={resourceInfo} | 132 | data={resourceInfo} |
133 | + contentCode={contentCode} | ||
133 | resourceJumpWithUrl={this.props.resourceJumpWithUrl} | 134 | resourceJumpWithUrl={this.props.resourceJumpWithUrl} |
134 | onPressShop={this.props.onPressShop} | 135 | onPressShop={this.props.onPressShop} |
135 | goToRecommendForYou={this.props.goToRecommendForYou} | 136 | goToRecommendForYou={this.props.goToRecommendForYou} |
@@ -34,7 +34,7 @@ export default class NewArrivalHeader extends Component { | @@ -34,7 +34,7 @@ export default class NewArrivalHeader extends Component { | ||
34 | } | 34 | } |
35 | 35 | ||
36 | render() { | 36 | render() { |
37 | - let {data} = this.props; | 37 | + let {data, contentCode} = this.props; |
38 | if (!data) { return null; } | 38 | if (!data) { return null; } |
39 | let resourceList = data.resourceList ? data.resourceList : []; | 39 | let resourceList = data.resourceList ? data.resourceList : []; |
40 | if (!resourceList) { return null; } | 40 | if (!resourceList) { return null; } |
@@ -84,6 +84,7 @@ export default class NewArrivalHeader extends Component { | @@ -84,6 +84,7 @@ export default class NewArrivalHeader extends Component { | ||
84 | return ( | 84 | return ( |
85 | <JointCell | 85 | <JointCell |
86 | data={item.get('data')} | 86 | data={item.get('data')} |
87 | + contentCode={contentCode} | ||
87 | isExtends={item.get('is_extend')} | 88 | isExtends={item.get('is_extend')} |
88 | imageWidth={item.get('image_width')} | 89 | imageWidth={item.get('image_width')} |
89 | imageHeight={item.get('image_height')} | 90 | imageHeight={item.get('image_height')} |
@@ -37,7 +37,7 @@ export default class JointCell extends React.Component { | @@ -37,7 +37,7 @@ export default class JointCell extends React.Component { | ||
37 | } | 37 | } |
38 | 38 | ||
39 | render() { | 39 | render() { |
40 | - let {data, isExtends, imageWidth, imageHeight, floorId, floorName, fIndex} = this.props; | 40 | + let {data, isExtends, imageWidth, imageHeight, floorId, floorName, fIndex, contentCode} = this.props; |
41 | let source = this.props.data.toJS(); | 41 | let source = this.props.data.toJS(); |
42 | if (!source) { | 42 | if (!source) { |
43 | return null; | 43 | return null; |
@@ -63,6 +63,7 @@ export default class JointCell extends React.Component { | @@ -63,6 +63,7 @@ export default class JointCell extends React.Component { | ||
63 | F_URL: item, | 63 | F_URL: item, |
64 | F_INDEX: fIndex, | 64 | F_INDEX: fIndex, |
65 | I_INDEX: parseInt(i) + 1 + "", | 65 | I_INDEX: parseInt(i) + 1 + "", |
66 | + CONTENT_CODE: contentCode, | ||
66 | exposureEnd: 1, | 67 | exposureEnd: 1, |
67 | } | 68 | } |
68 | 69 |
@@ -116,20 +116,25 @@ class NewArrivalContainer extends Component { | @@ -116,20 +116,25 @@ class NewArrivalContainer extends Component { | ||
116 | if (!url) { return; } | 116 | if (!url) { return; } |
117 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | 117 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); |
118 | 118 | ||
119 | + let {contentCode} = this.props.app; | ||
120 | + | ||
119 | let param; | 121 | let param; |
120 | if (type === 'banner' && params) { | 122 | if (type === 'banner' && params) { |
121 | param = { | 123 | param = { |
122 | F_ID: this.state.focusFloorId, | 124 | F_ID: this.state.focusFloorId, |
123 | - F_URL: url | 125 | + F_URL: url, |
126 | + CONTENT_CODE: contentCode | ||
124 | }; | 127 | }; |
125 | } | 128 | } |
126 | 129 | ||
127 | if (type === 'icon' && params) { | 130 | if (type === 'icon' && params) { |
128 | param = { | 131 | param = { |
129 | F_ID: this.state.jointFloorId, | 132 | F_ID: this.state.jointFloorId, |
130 | - F_URL: url | 133 | + F_URL: url, |
134 | + CONTENT_CODE: contentCode | ||
131 | }; | 135 | }; |
132 | } | 136 | } |
137 | + | ||
133 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param); | 138 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param); |
134 | } | 139 | } |
135 | 140 | ||
@@ -301,6 +306,7 @@ class NewArrivalContainer extends Component { | @@ -301,6 +306,7 @@ class NewArrivalContainer extends Component { | ||
301 | shop_template_type, | 306 | shop_template_type, |
302 | is_red_shop, | 307 | is_red_shop, |
303 | } = data.toJS(); | 308 | } = data.toJS(); |
309 | + let {contentCode} = this.props.app; | ||
304 | 310 | ||
305 | if (!shops_id||!shop_name) { | 311 | if (!shops_id||!shop_name) { |
306 | return; | 312 | return; |
@@ -312,6 +318,7 @@ class NewArrivalContainer extends Component { | @@ -312,6 +318,7 @@ class NewArrivalContainer extends Component { | ||
312 | F_ID: this.state.shopFloorId, | 318 | F_ID: this.state.shopFloorId, |
313 | F_URL: url, | 319 | F_URL: url, |
314 | SHOP_ID: shops_id, | 320 | SHOP_ID: shops_id, |
321 | + CONTENT_CODE: contentCode, | ||
315 | } | 322 | } |
316 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param); | 323 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param); |
317 | } | 324 | } |
@@ -323,6 +330,7 @@ class NewArrivalContainer extends Component { | @@ -323,6 +330,7 @@ class NewArrivalContainer extends Component { | ||
323 | } | 330 | } |
324 | 331 | ||
325 | let { selectedTabIndex, selectedTabName } = this.props.newArrival; | 332 | let { selectedTabIndex, selectedTabName } = this.props.newArrival; |
333 | + let { contentCode } = this.props.app; | ||
326 | 334 | ||
327 | let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}","from_page_name":"${Platform.OS === 'ios'?'iFP_NewArrival':'aFP_NewArrival'}"}}`; | 335 | let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}","from_page_name":"${Platform.OS === 'ios'?'iFP_NewArrival':'aFP_NewArrival'}"}}`; |
328 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); | 336 | ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); |
@@ -332,7 +340,8 @@ class NewArrivalContainer extends Component { | @@ -332,7 +340,8 @@ class NewArrivalContainer extends Component { | ||
332 | F_URL: url, | 340 | F_URL: url, |
333 | PRD_SKN: productSkn, | 341 | PRD_SKN: productSkn, |
334 | TAB_ID: selectedTabIndex, | 342 | TAB_ID: selectedTabIndex, |
335 | - TAB_NAME: selectedTabName | 343 | + TAB_NAME: selectedTabName, |
344 | + CONTENT_CODE: contentCode, | ||
336 | } | 345 | } |
337 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param); | 346 | ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param); |
338 | } | 347 | } |
@@ -349,6 +358,7 @@ class NewArrivalContainer extends Component { | @@ -349,6 +358,7 @@ class NewArrivalContainer extends Component { | ||
349 | showSimilarGuider, | 358 | showSimilarGuider, |
350 | cart_goods_count, | 359 | cart_goods_count, |
351 | } = this.props.newArrival; | 360 | } = this.props.newArrival; |
361 | + let { contentCode } = this.props.app; | ||
352 | let isFetching = resourceInfo.isFetching || (productList.list.size == 0 && productList.isFetching)||(productList.list.size > 0 && productList.isFetching && productList.currentPage == 0); | 362 | let isFetching = resourceInfo.isFetching || (productList.list.size == 0 && productList.isFetching)||(productList.list.size > 0 && productList.isFetching && productList.currentPage == 0); |
353 | return ( | 363 | return ( |
354 | <View style={styles.container}> | 364 | <View style={styles.container}> |
@@ -359,6 +369,7 @@ class NewArrivalContainer extends Component { | @@ -359,6 +369,7 @@ class NewArrivalContainer extends Component { | ||
359 | resourceInfo={resourceInfo} | 369 | resourceInfo={resourceInfo} |
360 | cart_goods_count={cart_goods_count} | 370 | cart_goods_count={cart_goods_count} |
361 | showSimilarGuider={showSimilarGuider} | 371 | showSimilarGuider={showSimilarGuider} |
372 | + contentCode={contentCode} | ||
362 | goShopCar={this._goShopCar} | 373 | goShopCar={this._goShopCar} |
363 | 374 | ||
364 | onEndReached={this._onEndReached} | 375 | onEndReached={this._onEndReached} |
@@ -114,7 +114,7 @@ export function getResourceInfo(callback) { | @@ -114,7 +114,7 @@ export function getResourceInfo(callback) { | ||
114 | dispatch(getResourceInfoRequest()); | 114 | dispatch(getResourceInfoRequest()); |
115 | return new NewArrivalService(app.host).fetchResourceInfo(contentCode) | 115 | return new NewArrivalService(app.host).fetchResourceInfo(contentCode) |
116 | .then(json => { | 116 | .then(json => { |
117 | - let newJson = exposeResourceInfoData(json); | 117 | + let newJson = exposeResourceInfoData(json, contentCode); |
118 | 118 | ||
119 | for (let i = 0; i< json.length; i++) { | 119 | for (let i = 0; i< json.length; i++) { |
120 | let item = json[i] | 120 | let item = json[i] |
@@ -134,7 +134,7 @@ export function getResourceInfo(callback) { | @@ -134,7 +134,7 @@ export function getResourceInfo(callback) { | ||
134 | }; | 134 | }; |
135 | } | 135 | } |
136 | 136 | ||
137 | -function exposeResourceInfoData(json) { | 137 | +function exposeResourceInfoData(json, contentCode) { |
138 | 138 | ||
139 | if (!json) return json; | 139 | if (!json) return json; |
140 | 140 | ||
@@ -158,6 +158,7 @@ function exposeResourceInfoData(json) { | @@ -158,6 +158,7 @@ function exposeResourceInfoData(json) { | ||
158 | I_INDEX: parseInt(j) + 1 + "", | 158 | I_INDEX: parseInt(j) + 1 + "", |
159 | P_NAME: pageName, | 159 | P_NAME: pageName, |
160 | F_URL: subitem.url, | 160 | F_URL: subitem.url, |
161 | + CONTENT_CODE: contentCode, | ||
161 | exposureEnd: 1, | 162 | exposureEnd: 1, |
162 | } | 163 | } |
163 | } | 164 | } |
@@ -174,6 +175,7 @@ function exposeResourceInfoData(json) { | @@ -174,6 +175,7 @@ function exposeResourceInfoData(json) { | ||
174 | F_INDEX: i + 1, | 175 | F_INDEX: i + 1, |
175 | I_INDEX: parseInt(j) + 1 + "", | 176 | I_INDEX: parseInt(j) + 1 + "", |
176 | SHOP_ID: subitem.shops_id, | 177 | SHOP_ID: subitem.shops_id, |
178 | + CONTENT_CODE: contentCode, | ||
177 | exposureEnd: 1, | 179 | exposureEnd: 1, |
178 | } | 180 | } |
179 | } | 181 | } |
-
Please register or login to post a comment