...
|
...
|
@@ -186,6 +186,12 @@ export function getShopInfo() { |
|
|
return new BrandStoreService(app.host).fetchShopInfo(shopId, uid)
|
|
|
.then(json => {
|
|
|
dispatch(shopInfoSuccess(json));
|
|
|
|
|
|
// 数据曝光
|
|
|
let params = {
|
|
|
SHOP_ID: json.shops_id ? json.shops_id : '0',
|
|
|
}
|
|
|
dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_INFO', params));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(shopInfoFailure(error));
|
...
|
...
|
@@ -202,6 +208,16 @@ export function getShopInfo() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
function shopDataExposure(eventName, data) {
|
|
|
return (dispatch, getState) => {
|
|
|
let params = {
|
|
|
DATA: data,
|
|
|
};
|
|
|
// console.log(eventName)
|
|
|
// console.log(params)
|
|
|
ReactNative.NativeModules.YH_CommonHelper.logEvent(eventName, params);
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function shopResourceRequest() {
|
|
|
return {
|
...
|
...
|
@@ -243,6 +259,8 @@ export function getShopResources() { |
|
|
dispatch(getHotProduct());
|
|
|
dispatch(getProductList());
|
|
|
|
|
|
// 数据曝光
|
|
|
dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_RESOURCE_LIST', ''));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(shopResourcesFailure(error));
|
...
|
...
|
@@ -296,7 +314,8 @@ export function getShopCouponList() { |
|
|
return new BrandStoreService(app.host).fetchShopCouponList(shopId, uid)
|
|
|
.then(json => {
|
|
|
let payload = parseCouponList(json);
|
|
|
dispatch(shopCouponListSuccess(payload));
|
|
|
dispatch(shopCouponListSuccess(payload.shopCoupons));
|
|
|
dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_COUPON_LIST', payload.logShopCoupons))
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(shopCouponListFailure(error));
|
...
|
...
|
@@ -319,6 +338,7 @@ function parseCouponList(json) { |
|
|
}
|
|
|
|
|
|
let shopCoupons = [];
|
|
|
let logShopCoupons = [];
|
|
|
|
|
|
_.forEach(json, value => {
|
|
|
let couPonstatus = parseInt(value.status, 10);
|
...
|
...
|
@@ -332,10 +352,17 @@ function parseCouponList(json) { |
|
|
money: parseInt(value.money, 10),
|
|
|
status: couPonstatus === 1
|
|
|
});
|
|
|
|
|
|
logShopCoupons.push({
|
|
|
COUPON_ID: value.coupon_id,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return shopCoupons;
|
|
|
return {
|
|
|
shopCoupons,
|
|
|
logShopCoupons,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function hotProductRequest() {
|
...
|
...
|
@@ -379,6 +406,17 @@ export function getHotProduct() { |
|
|
});
|
|
|
let payload = json.product_list;
|
|
|
dispatch(hotProductSuccess(payload));
|
|
|
|
|
|
// 数据曝光
|
|
|
let logData = [];
|
|
|
payload && payload.map((item, i) => {
|
|
|
logData.push({
|
|
|
I_INDEX: i,
|
|
|
IMAGE_URL: item.default_images ? item.default_images : '',
|
|
|
PRODUCT_SKN: item.product_skn ? item.product_skn : 0,
|
|
|
});
|
|
|
});
|
|
|
dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_HOT_PRODUCT_LIST', logData))
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(hotProductFailure(error));
|
...
|
...
|
@@ -805,6 +843,17 @@ export function getProductListForPersopn(reload=false) { |
|
|
payload.list = list;
|
|
|
}
|
|
|
dispatch(productListForPersonSuccess(payload));
|
|
|
|
|
|
// 数据曝光
|
|
|
let logData = [];
|
|
|
payload.list && payload.list.map((item, i) => {
|
|
|
logData.push({
|
|
|
I_INDEX: i,
|
|
|
IMAGE_URL: item.default_images ? item.default_images : '',
|
|
|
PRODUCT_SKN: item.product_skn ? item.product_skn : 0,
|
|
|
});
|
|
|
});
|
|
|
dispatch(shopDataExposure('YB_SHOW_CLASSICAL_SHOP_HOT_TAB_PRODUCT_LIST', logData));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(productListForPersonFailure(error));
|
...
|
...
|
@@ -867,6 +916,18 @@ export function getProductListForNew(reload=false) { |
|
|
payload.list = list;
|
|
|
}
|
|
|
dispatch(productListForNewSuccess(payload));
|
|
|
|
|
|
// 数据曝光
|
|
|
let logData = [];
|
|
|
payload.list && payload.list.map((item, i) => {
|
|
|
logData.push({
|
|
|
I_INDEX: i,
|
|
|
IMAGE_URL: item.default_images ? item.default_images : '',
|
|
|
PRODUCT_SKN: item.product_skn ? item.product_skn : 0,
|
|
|
});
|
|
|
});
|
|
|
dispatch(shopDataExposure('YB_SHOW_CLASSICAL_NEW_TAB_PRODUCT_LIST', logData));
|
|
|
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(productListForNewFailure(error));
|
...
|
...
|
|