Authored by 孙凯

add 大数据曝光 review by hongmo

... ... @@ -182,6 +182,7 @@ export default class BrandStore extends Component {
TAB_NAM : '首页',
TAB_ID : 0,
F_NAME : 'coupon',
P_PARAM : this.props.shopId?this.props.shopId:'0',
exposureEnd : 1,
};
return(
... ... @@ -199,6 +200,7 @@ export default class BrandStore extends Component {
TAB_NAM : '首页',
TAB_ID : 0,
F_NAME : 'brandBrowse',
P_PARAM : this.props.shopId?this.props.shopId:'0',
exposureEnd : 1,
};
return (
... ... @@ -216,6 +218,7 @@ export default class BrandStore extends Component {
TAB_NAM : '首页',
TAB_ID : 0,
F_NAME : 'largeSlideImg_APP',
P_PARAM : this.props.shopId?this.props.shopId:'0',
exposureEnd : 1,
};
return (
... ... @@ -233,6 +236,7 @@ export default class BrandStore extends Component {
TAB_NAM : '首页',
TAB_ID : 0,
F_NAME : 'oneRowTwoColImages_APP',
P_PARAM : this.props.shopId?this.props.shopId:'0',
exposureEnd : 1,
};
return (
... ... @@ -250,6 +254,7 @@ export default class BrandStore extends Component {
TAB_NAM : '首页',
TAB_ID : 0,
F_NAME : 'recommend_APP',
P_PARAM : this.props.shopId?this.props.shopId:'0',
exposureEnd : 1,
};
return (
... ...
... ... @@ -384,6 +384,7 @@ class BrandStoreContainer extends Component {
let {
info,
shopId,
receiveCouponResult,
resource,
coupon,
... ... @@ -406,6 +407,7 @@ class BrandStoreContainer extends Component {
return (
<BrandStore
shopId={shopId}
isFetching={isFetching}
info={info}
receiveCouponResult={receiveCouponResult}
... ...
... ... @@ -434,6 +434,7 @@ export function getHotProduct() {
return (dispatch, getState) => {
let {app, brandStore} = getState();
let {productSkn} = brandStore.resource.hotProducts_APP;
let {shopId, productListForPerson,resource} = brandStore;
if (!productSkn) {
return;
}
... ... @@ -449,7 +450,7 @@ export function getHotProduct() {
let payload = json.product_list;
let order = '';
try {
payload = exposePruductListData(payload,order,app.channel,0);
payload = exposePruductListData(payload,order,app.channel,0,shopId);
} catch (e) {
} finally {
... ... @@ -578,7 +579,7 @@ export function getProductList(reload=false) {
dispatch(productListRequest());
return new BrandStoreService(app.host).productList(shopId, channel, order, page, pageSize, allFilterFactors,brandId)
.then(json => {
let payload = parseProductList(json,order,app.channel,0);
let payload = parseProductList(json,order,app.channel,0,shopId);
payload.endReached = payload.currentPage == payload.pageCount || payload.list.length < pageSize;
// 数据曝光 新格式
... ... @@ -654,10 +655,10 @@ function randomString(len) {
  return pwd;
}
function parseProductList(json,order,channel,index) {
function parseProductList(json,order,channel,index,shopId) {
let list = json && json.product_list ? json.product_list : [];
try {
list = exposePruductListData(list,order,channel,index);
list = exposePruductListData(list,order,channel,index,shopId);
} catch (e) {
} finally {
... ... @@ -857,7 +858,7 @@ function parseProductList(json,order,channel,index) {
}
function exposePruductListData(list,order,channel,index) {
function exposePruductListData(list,order,channel,index,shopId) {
if (!list) {
... ... @@ -918,6 +919,7 @@ function exposePruductListData(list,order,channel,index) {
C_ID: channel,
L2_TAB_ID: index,
L2_TAB_NAM: l2_TAB_NAM,
P_PARAM : shopId?shopId:'0',
exposureEnd : 1,
};
item.yh_exposureData = params;
... ... @@ -1022,7 +1024,7 @@ export function getProductListForPersopn(reload=false) {
return new BrandStoreService(app.host).productListForPerson(shopId, channel, order, page, pageSize,brandId)
.then(json => {
let payload = parseProductList(json,order,app.channel,2);
let payload = parseProductList(json,order,app.channel,2,shopId);
payload.endReached = payload.currentPage == payload.pageCount;
if (payload.currentPage > 1) {
... ... @@ -1094,7 +1096,7 @@ export function getProductListForNew(reload=false) {
return new BrandStoreService(app.host).productListForNew(shopId, channel, order, page, pageSize,brandId)
.then(json => {
let payload = parseProductList(json,order,app.channel,1);
let payload = parseProductList(json,order,app.channel,1,shopId);
payload.endReached = payload.currentPage == payload.pageCount;
if (payload.currentPage > 1) {
... ...
... ... @@ -132,6 +132,7 @@ export default class RedBrand extends Component {
TAB_NAM : '首页',
TAB_ID : 0,
F_NAME : rowData.get('module_type'),
P_PARAM: this.props.shopId,
exposureEnd : 1,
};
if (rowData.get('module_type') == 'coupon') {
... ... @@ -213,6 +214,7 @@ export default class RedBrand extends Component {
render() {
let {
shopId,
productList,
launchProfile,
productListForNew,
... ...
... ... @@ -307,6 +307,7 @@ class RedPersonBrandContainer extends Component {
return (
<RedBrand
shopId={shopId}
similarIndex = {similarIndex}
productList={productList}
productListForNew={productListForNew}
... ...
... ... @@ -258,7 +258,7 @@ export function getProductList(reload=false) {
dispatch(productListRequest());
return new RedBrandService(app.host).productList(shopId, channel, order, page, pageSize, allFilterFactors)
.then(json => {
let payload = parseProductList(json,order,app.channel,0);
let payload = parseProductList(json,order,app.channel,0,shopId);
payload.endReached = payload.currentPage == payload.pageCount || payload.list.length < pageSize;
if (payload.currentPage > 1) {
let oldList = productList.list.toJS();
... ... @@ -293,7 +293,7 @@ export function getProductListForNew(reload=false) {
dispatch(productListForNewRequest());
return new RedBrandService(app.host).productList(shopId, channel, order, page, pageSize)
.then(json => {
let payload = parseProductList(json,order,app.channel,1);
let payload = parseProductList(json,order,app.channel,1,shopId);
payload.endReached = payload.currentPage == payload.pageCount || payload.list.length < pageSize;
if (payload.currentPage > 1) {
let oldList = productList.list.toJS();
... ... @@ -308,9 +308,7 @@ export function getProductListForNew(reload=false) {
};
}
function exposePruductListData(list,order,channel,index) {
function exposePruductListData(list,order,channel,index,shopId) {
if (!list) {
return list;
}
... ... @@ -356,18 +354,18 @@ function exposePruductListData(list,order,channel,index) {
TAB_ID : tab_num,
L2_TAB_ID: index,
L2_TAB_NAM: l2_TAB_NAM,
P_PARAM: shopId?shopId:'0',
exposureEnd : 1,
};
item.yh_exposureData = params;
}
return list;
}
function parseProductList(json,order,channel,index) {
function parseProductList(json,order,channel,index,shopId) {
let list = json && json.product_list ? json.product_list : [];
try {
list = exposePruductListData(list,order,channel,index);
list = exposePruductListData(list,order,channel,index,shopId);
} catch (e) {
} finally {
... ... @@ -793,6 +791,7 @@ export function appRecommendProduct(dataSource) {
L2_TAB_ID: 0,
L2_TAB_NAM: '首页',
F_NAME: 'AppRecommendProduct',
P_PARAM: shopId?shopId:'0',
exposureEnd : 1,
};
items.yh_exposureData = params;
... ... @@ -824,6 +823,7 @@ export function appRecommendProduct(dataSource) {
L2_TAB_ID: 0,
L2_TAB_NAM: '首页',
F_NAME: 'AppRecommendProduct',
P_PARAM: shopId?shopId:'0',
exposureEnd : 1,
};
items.yh_exposureData = params;
... ...