...
|
...
|
@@ -272,7 +272,7 @@ export function getProductList(reload=false) { |
|
|
|
|
|
return new NewArrivalService(app.host).fetchProductList(channel, order, page, pageSize, allFilterFactors)
|
|
|
.then(json => {
|
|
|
let payload = parseProductList(json,order,channel);
|
|
|
let payload = parseProductList(json,order,channel,pageSize);
|
|
|
payload.endReached = payload.currentPage == payload.pageCount;
|
|
|
|
|
|
if (payload.currentPage > 1) {
|
...
|
...
|
@@ -632,20 +632,20 @@ export function goToRecommendForYou() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
function parseProductList(json,order,channel) {
|
|
|
function parseProductList(json,order,channel,pageSize) {
|
|
|
let list = json && json.product_list ? json.product_list : [];
|
|
|
let currentPage = json && json.page ? json.page : 1;
|
|
|
let pageCount = json && json.page_total ? json.page_total : 0;
|
|
|
let total = json && json.total ? json.total : 0;
|
|
|
|
|
|
try {
|
|
|
list = exposePruductListData(list,order,channel);
|
|
|
list = exposePruductListData(list,order,channel,currentPage,pageSize);
|
|
|
} catch (e) {
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
}
|
|
|
|
|
|
let currentPage = json && json.page ? json.page : 1;
|
|
|
let pageCount = json && json.page_total ? json.page_total : 0;
|
|
|
let total = json && json.total ? json.total : 0;
|
|
|
|
|
|
if (currentPage > 1) {
|
|
|
return {
|
|
|
list,
|
...
|
...
|
@@ -917,7 +917,7 @@ function exposeBannerData(data,type,channel) { |
|
|
return data;
|
|
|
}
|
|
|
|
|
|
function exposePruductListData(list,order,channel) {
|
|
|
function exposePruductListData(list,order,channel,currentPage,pageSize) {
|
|
|
if (!list) {
|
|
|
return list;
|
|
|
}
|
...
|
...
|
@@ -955,9 +955,10 @@ function exposePruductListData(list,order,channel) { |
|
|
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
let item = list[i];
|
|
|
let inFloorIndex = parseInt(i) + 1 + parseInt(currentPage - 1) * parseInt(pageSize) + '';
|
|
|
|
|
|
let recommend_type = item.recommend_type;
|
|
|
if (recommend_type == 'hotSearchTerm') {
|
|
|
let inFloorIndex = parseInt(i) + 1 + '';
|
|
|
let yh_exposureData = [];
|
|
|
for (var j = 0; j < item.data.length; j++) {
|
|
|
let f_item = item.data[j];
|
...
|
...
|
@@ -978,7 +979,6 @@ function exposePruductListData(list,order,channel) { |
|
|
}
|
|
|
item.yh_exposureDataList = yh_exposureData;
|
|
|
}else if (recommend_type == 'seasonSort') {
|
|
|
let inFloorIndex = parseInt(i) + 1 + '';
|
|
|
for (var j = 0; j < item.data.length; j++) {
|
|
|
let f_item = item.data[j];
|
|
|
let url = f_item.url;
|
...
|
...
|
@@ -998,7 +998,6 @@ function exposePruductListData(list,order,channel) { |
|
|
f_item.yh_exposureData = params;
|
|
|
}
|
|
|
}else if (recommend_type == 'hotShop') {
|
|
|
let inFloorIndex = parseInt(i) + 1 + '';
|
|
|
let brandID = item.data.brand_id;
|
|
|
let params = {
|
|
|
P_NAME: pageName,
|
...
|
...
|
@@ -1012,7 +1011,6 @@ function exposePruductListData(list,order,channel) { |
|
|
};
|
|
|
item.data.yh_exposureData = params;
|
|
|
}else if (recommend_type == 'fashionArticle') {
|
|
|
let inFloorIndex = parseInt(i) + 1 + '';
|
|
|
let article_id = item.data.id;
|
|
|
let params = {
|
|
|
P_NAME: pageName,
|
...
|
...
|
@@ -1027,7 +1025,6 @@ function exposePruductListData(list,order,channel) { |
|
|
item.data.yh_exposureData = params;
|
|
|
}else {
|
|
|
let skn = item.product_skn;
|
|
|
let inFloorIndex = parseInt(i) + 1 + '';
|
|
|
let params = {
|
|
|
P_NAME : pageName,
|
|
|
I_INDEX : inFloorIndex,
|
...
|
...
|
|