...
|
...
|
@@ -5,6 +5,7 @@ import Immutable, {Map} from 'immutable'; |
|
|
|
|
|
const {
|
|
|
Dimensions,
|
|
|
Platform,
|
|
|
} = ReactNative;
|
|
|
|
|
|
function channelCacheKey(channelKey) {
|
...
|
...
|
@@ -835,8 +836,14 @@ function parseBoyGirlFavorite(json, channel) { |
|
|
let total = json && json.total ? json.total : 0;
|
|
|
|
|
|
let list = json && json.product_list ? json.product_list : [];
|
|
|
list = exposePruductListData(list, channel);
|
|
|
let rec_id = json && json.rec_id ? json.rec_id : '';
|
|
|
try {
|
|
|
list = exposePruductListData(list, channel,rec_id,-1);
|
|
|
} catch (e) {
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
currentPage,
|
...
|
...
|
@@ -853,7 +860,13 @@ function parseKidsFavorite(json, channel) { |
|
|
let total = json && json.total ? json.total : 0;
|
|
|
|
|
|
let list = json && json.product_list ? json.product_list : [];
|
|
|
list = exposePruductListData(list, channel);
|
|
|
try {
|
|
|
list = exposePruductListData(list, channel,'',-1);
|
|
|
} catch (e) {
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
currentPage,
|
...
|
...
|
@@ -867,8 +880,15 @@ function parseLifeStyleFavorite(json, channel) { |
|
|
let product_list = json && json.product_list ? json.product_list : {};
|
|
|
let newList = product_list && product_list.new ? product_list.new : [];
|
|
|
let hotList = product_list && product_list.top ? product_list.top : [];
|
|
|
newList = exposePruductListData(newList, channel);
|
|
|
hotList = exposePruductListData(hotList, channel);
|
|
|
try {
|
|
|
newList = exposePruductListData(newList, channel,'',0);
|
|
|
hotList = exposePruductListData(hotList, channel,'',1);
|
|
|
} catch (e) {
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
newList,
|
|
|
hotList
|
...
|
...
|
@@ -1156,30 +1176,55 @@ function parseReportProductList(json) { |
|
|
return reportData;
|
|
|
}
|
|
|
|
|
|
function exposePruductListData(list, channel=1) {
|
|
|
function exposePruductListData(list, channel ,rec_id,tab_id) {
|
|
|
|
|
|
if (!list) {
|
|
|
return list;
|
|
|
}
|
|
|
let pageName = 'iFP_Home'
|
|
|
let channlStr = 'boy';
|
|
|
if (channel == 1) {
|
|
|
channlStr = 'boy';
|
|
|
}else if (channel == 2){
|
|
|
channlStr = 'girl';
|
|
|
}else if (channel == 3){
|
|
|
channlStr = 'kid';
|
|
|
}else if (channel == 4){
|
|
|
channlStr = 'lifestyle';
|
|
|
let rec_pose = '';
|
|
|
if (channel == '1') {
|
|
|
rec_pose = '100001';
|
|
|
}else if (channel == '2'){
|
|
|
rec_pose = '100002';
|
|
|
}else if (channel == '3'){
|
|
|
rec_pose = '100006';
|
|
|
}else if (channel == '4'){
|
|
|
rec_pose = '100011';
|
|
|
}
|
|
|
|
|
|
let pageName = 'iFP_Home';
|
|
|
|
|
|
if (Platform.OS === 'android') {
|
|
|
pageName = 'aFP_Home';
|
|
|
}
|
|
|
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
let item = list[i];
|
|
|
let skn = item.product_skn;
|
|
|
let inFloorIndex = parseInt(i) + 1 + '';
|
|
|
let params = autoReportData(channlStr,'','','',inFloorIndex,'',skn);
|
|
|
let params = {
|
|
|
P_NAME : pageName,
|
|
|
I_INDEX : inFloorIndex,
|
|
|
PRD_SKN : skn,
|
|
|
REC_POS : rec_pose,
|
|
|
REC_ID : rec_id,
|
|
|
exposureEnd : 1,
|
|
|
};
|
|
|
|
|
|
if (tab_id != -1) {
|
|
|
params = {
|
|
|
P_NAME : pageName,
|
|
|
I_INDEX : inFloorIndex,
|
|
|
PRD_SKN : skn,
|
|
|
REC_POS : rec_pose,
|
|
|
REC_ID : rec_id,
|
|
|
TAB_ID : tab_id,
|
|
|
exposureEnd : 1,
|
|
|
};
|
|
|
}
|
|
|
item.yh_exposureData = params;
|
|
|
}
|
|
|
|
|
|
return list;
|
|
|
}
|
|
|
|
...
|
...
|
|