Authored by 张文文

新品到着数据曝光添加资源位code reviewd by 朱傲哲

... ... @@ -79,7 +79,7 @@ class GroupPurchaseDetailContainer extends Component {
this.props.actions.fetchResourceInfo();
if(Platform.OS === 'android' && this.props.popShare == "1"){
this.props.actions.showShareView(true);
this.props.actions.fetchCouponInfo();
}
}
... ...
... ... @@ -126,10 +126,11 @@ export default class NewArrival extends React.PureComponent {
}
_renderHeader() {
let { resourceInfo } = this.props;
let { resourceInfo, contentCode } = this.props;
return (
<NewArrivalHeader
data={resourceInfo}
contentCode={contentCode}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
onPressShop={this.props.onPressShop}
goToRecommendForYou={this.props.goToRecommendForYou}
... ...
... ... @@ -34,7 +34,7 @@ export default class NewArrivalHeader extends Component {
}
render() {
let {data} = this.props;
let {data, contentCode} = this.props;
if (!data) { return null; }
let resourceList = data.resourceList ? data.resourceList : [];
if (!resourceList) { return null; }
... ... @@ -84,6 +84,7 @@ export default class NewArrivalHeader extends Component {
return (
<JointCell
data={item.get('data')}
contentCode={contentCode}
isExtends={item.get('is_extend')}
imageWidth={item.get('image_width')}
imageHeight={item.get('image_height')}
... ...
... ... @@ -37,7 +37,7 @@ export default class JointCell extends React.Component {
}
render() {
let {data, isExtends, imageWidth, imageHeight, floorId, floorName, fIndex} = this.props;
let {data, isExtends, imageWidth, imageHeight, floorId, floorName, fIndex, contentCode} = this.props;
let source = this.props.data.toJS();
if (!source) {
return null;
... ... @@ -63,6 +63,7 @@ export default class JointCell extends React.Component {
F_URL: item,
F_INDEX: fIndex,
I_INDEX: parseInt(i) + 1 + "",
CONTENT_CODE: contentCode,
exposureEnd: 1,
}
... ...
... ... @@ -116,20 +116,25 @@ class NewArrivalContainer extends Component {
if (!url) { return; }
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let {contentCode} = this.props.app;
let param;
if (type === 'banner' && params) {
param = {
F_ID: this.state.focusFloorId,
F_URL: url
F_URL: url,
CONTENT_CODE: contentCode
};
}
if (type === 'icon' && params) {
param = {
F_ID: this.state.jointFloorId,
F_URL: url
F_URL: url,
CONTENT_CODE: contentCode
};
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
... ... @@ -301,6 +306,7 @@ class NewArrivalContainer extends Component {
shop_template_type,
is_red_shop,
} = data.toJS();
let {contentCode} = this.props.app;
if (!shops_id||!shop_name) {
return;
... ... @@ -312,6 +318,7 @@ class NewArrivalContainer extends Component {
F_ID: this.state.shopFloorId,
F_URL: url,
SHOP_ID: shops_id,
CONTENT_CODE: contentCode,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
... ... @@ -323,6 +330,7 @@ class NewArrivalContainer extends Component {
}
let { selectedTabIndex, selectedTabName } = this.props.newArrival;
let { contentCode } = this.props.app;
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'}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
... ... @@ -332,7 +340,8 @@ class NewArrivalContainer extends Component {
F_URL: url,
PRD_SKN: productSkn,
TAB_ID: selectedTabIndex,
TAB_NAME: selectedTabName
TAB_NAME: selectedTabName,
CONTENT_CODE: contentCode,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
... ... @@ -349,6 +358,7 @@ class NewArrivalContainer extends Component {
showSimilarGuider,
cart_goods_count,
} = this.props.newArrival;
let { contentCode } = this.props.app;
let isFetching = resourceInfo.isFetching || (productList.list.size == 0 && productList.isFetching)||(productList.list.size > 0 && productList.isFetching && productList.currentPage == 0);
return (
<View style={styles.container}>
... ... @@ -359,6 +369,7 @@ class NewArrivalContainer extends Component {
resourceInfo={resourceInfo}
cart_goods_count={cart_goods_count}
showSimilarGuider={showSimilarGuider}
contentCode={contentCode}
goShopCar={this._goShopCar}
onEndReached={this._onEndReached}
... ...
... ... @@ -114,7 +114,7 @@ export function getResourceInfo(callback) {
dispatch(getResourceInfoRequest());
return new NewArrivalService(app.host).fetchResourceInfo(contentCode)
.then(json => {
let newJson = exposeResourceInfoData(json);
let newJson = exposeResourceInfoData(json, contentCode);
for (let i = 0; i< json.length; i++) {
let item = json[i]
... ... @@ -134,7 +134,7 @@ export function getResourceInfo(callback) {
};
}
function exposeResourceInfoData(json) {
function exposeResourceInfoData(json, contentCode) {
if (!json) return json;
... ... @@ -158,6 +158,7 @@ function exposeResourceInfoData(json) {
I_INDEX: parseInt(j) + 1 + "",
P_NAME: pageName,
F_URL: subitem.url,
CONTENT_CODE: contentCode,
exposureEnd: 1,
}
}
... ... @@ -174,6 +175,7 @@ function exposeResourceInfoData(json) {
F_INDEX: i + 1,
I_INDEX: parseInt(j) + 1 + "",
SHOP_ID: subitem.shops_id,
CONTENT_CODE: contentCode,
exposureEnd: 1,
}
}
... ...