...
|
...
|
@@ -922,17 +922,7 @@ export function getResourceInfo(callback) { |
|
|
dispatch(getResourceRequest());
|
|
|
return new AllianceService(app.host).fetchResourceInfo(CODE_ALLIANCE_BANNER_RESOURCE_CODE)
|
|
|
.then(json => {
|
|
|
let bannerList = json.length > 0 && json[0].data ? json[0].data : [];
|
|
|
bannerList.forEach(function (item, index) {
|
|
|
item.yh_exposureData = {
|
|
|
P_NAME: Platform.OS === 'ios' ? 'iFP_Alliance' : 'aFP_Alliance',
|
|
|
P_PARAM: CODE_ALLIANCE_BANNER_RESOURCE_CODE,
|
|
|
F_URL: item.url,
|
|
|
I_INDEX: index + 1,
|
|
|
exposureEnd: 1
|
|
|
};
|
|
|
return item
|
|
|
})
|
|
|
json = exposeHomeResource(json);
|
|
|
dispatch(getResourceSuccess(json));
|
|
|
callback && typeof callback === 'function' && callback(json)
|
|
|
|
...
|
...
|
@@ -951,6 +941,66 @@ export function getResourceInfo(callback) { |
|
|
};
|
|
|
}
|
|
|
|
|
|
function exposeHomeResource(json) {
|
|
|
if (!json) return json;
|
|
|
let pageName = 'iFP_Alliance';
|
|
|
if (Platform.OS === 'android') {
|
|
|
pageName = 'aFP_Alliance';
|
|
|
}
|
|
|
for (let i = 0; i < json.length; i++) {
|
|
|
let item = json[i]
|
|
|
let floorname = item.template_name;
|
|
|
let floorid = item.template_id;
|
|
|
let list = item.data;
|
|
|
if (floorname === 'image_list' || floorname === 'newSingleImage' || floorname === 'twoPicture') {
|
|
|
list = list && list.list;
|
|
|
}
|
|
|
|
|
|
if (list instanceof Array) {
|
|
|
for (let j = 0; j < list.length; j++) {
|
|
|
let subItem = list[j];
|
|
|
let url = subItem.url;
|
|
|
subItem.yh_exposureData = {
|
|
|
P_NAME: pageName,
|
|
|
P_PARAM: CODE_ALLIANCE_BANNER_RESOURCE_CODE,
|
|
|
F_ID: floorid,
|
|
|
F_NAME: floorname,
|
|
|
F_INDEX: +i + 1,
|
|
|
I_INDEX: parseInt(j) + 1 + "",
|
|
|
F_URL: url,
|
|
|
exposureEnd: 1,
|
|
|
}
|
|
|
subItem.yh_clickData = {
|
|
|
P_NAME: pageName,
|
|
|
P_PARAM: CODE_ALLIANCE_BANNER_RESOURCE_CODE,
|
|
|
F_ID: floorid,
|
|
|
F_NAME: floorname,
|
|
|
F_INDEX: +i + 1,
|
|
|
I_INDEX: parseInt(j) + 1 + "",
|
|
|
F_URL: url,
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
item.yh_exposureData = {
|
|
|
P_NAME: pageName,
|
|
|
P_PARAM: CODE_ALLIANCE_BANNER_RESOURCE_CODE,
|
|
|
F_ID: floorid,
|
|
|
F_NAME: floorname,
|
|
|
F_INDEX: +i + 1,
|
|
|
exposureEnd: 1,
|
|
|
}
|
|
|
item.yh_clickData = {
|
|
|
P_NAME: pageName,
|
|
|
P_PARAM: CODE_ALLIANCE_BANNER_RESOURCE_CODE,
|
|
|
F_ID: floorid,
|
|
|
F_NAME: floorname,
|
|
|
F_INDEX: +i + 1,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return json
|
|
|
}
|
|
|
|
|
|
export function getMessageResourceInfo() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, alliance} = getState();
|
...
|
...
|
|