Authored by yyq

Merge branch 'feature/newGolbal' into release/5.6

@@ -133,8 +133,11 @@ const _handelGlobalSort = (origin, params, originParams) => { @@ -133,8 +133,11 @@ const _handelGlobalSort = (origin, params, originParams) => {
133 }; 133 };
134 134
135 const getGlobalProductListData = (params, yoho) => { 135 const getGlobalProductListData = (params, yoho) => {
  136 + let limitNum = params.limit ? params.limit - 1 : 59;
136 let dps = {}; 137 let dps = {};
137 138
  139 + params.page = params.page || 1;
  140 +
138 if (params.brand) { 141 if (params.brand) {
139 dps.brand = params.brand; 142 dps.brand = params.brand;
140 } 143 }
@@ -147,7 +150,7 @@ const getGlobalProductListData = (params, yoho) => { @@ -147,7 +150,7 @@ const getGlobalProductListData = (params, yoho) => {
147 }, dps)), 150 }, dps)),
148 list: globalApi.getGlobalProductListAsync(Object.assign({ 151 list: globalApi.getGlobalProductListAsync(Object.assign({
149 physical_channel: yoho.channelNum 152 physical_channel: yoho.channelNum
150 - }, params, {limit: params.limit ? params.limit - 1 : 59})) 153 + }, params, {limit: limitNum}))
151 }).then(result => { 154 }).then(result => {
152 let resData = {}; 155 let resData = {};
153 156
@@ -157,6 +160,12 @@ const getGlobalProductListData = (params, yoho) => { @@ -157,6 +160,12 @@ const getGlobalProductListData = (params, yoho) => {
157 let listData = _.get(result.list, 'data', {}); 160 let listData = _.get(result.list, 'data', {});
158 let totalNum = _.get(listData, 'total', 0); 161 let totalNum = _.get(listData, 'total', 0);
159 162
  163 + let tip = {
  164 + start: (params.page - 1) * limitNum + 1,
  165 + total: listData.total || '',
  166 + end: _.min([listData.total, limitNum * params.page])
  167 + };
  168 +
160 // opts 显示新品、折扣 169 // opts 显示新品、折扣
161 listData.filter = listData.filter || {}; 170 listData.filter = listData.filter || {};
162 Object.assign(listData.filter, { 171 Object.assign(listData.filter, {
@@ -169,7 +178,7 @@ const getGlobalProductListData = (params, yoho) => { @@ -169,7 +178,7 @@ const getGlobalProductListData = (params, yoho) => {
169 filters: searchHandler.handleFilterDataAll(listData, params), 178 filters: searchHandler.handleFilterDataAll(listData, params),
170 opts: searchHandler.handleOptsData(params, totalNum, listData.filter), 179 opts: searchHandler.handleOptsData(params, totalNum, listData.filter),
171 totalCount: totalNum, 180 totalCount: totalNum,
172 - footPager: pager(_.get(listData, 'page_total', 0), params), 181 + footPager: Object.assign({tip: tip}, pager(_.get(listData, 'page_total', 0), params)),
173 goods: productProcess.processProductList(_.get(listData, 'product_list', []), 182 goods: productProcess.processProductList(_.get(listData, 'product_list', []),
174 Object.assign({showDiscount: false, isGlobal: true}, params)), 183 Object.assign({showDiscount: false, isGlobal: true}, params)),
175 hasNextPage: searchHandler.handleNextPage(params, totalNum), 184 hasNextPage: searchHandler.handleNextPage(params, totalNum),