Showing
1 changed file
with
17 additions
and
10 deletions
@@ -15,6 +15,7 @@ const searchHandler = require('./search-handler'); | @@ -15,6 +15,7 @@ const searchHandler = require('./search-handler'); | ||
15 | const listHandler = require('./list-handler'); | 15 | const listHandler = require('./list-handler'); |
16 | const headerModel = require('../../../doraemon/models/header'); | 16 | const headerModel = require('../../../doraemon/models/header'); |
17 | const productProcess = require('../../../utils/product-process-simple'); | 17 | const productProcess = require('../../../utils/product-process-simple'); |
18 | +const handleStaticUrl = require(`${global.utils}/parameter`).fullParamToMinPath; | ||
18 | 19 | ||
19 | const DEFAULT_IMG = '01091c21f2317a64f123f1649fbbccf7ba'; | 20 | const DEFAULT_IMG = '01091c21f2317a64f123f1649fbbccf7ba'; |
20 | 21 | ||
@@ -397,10 +398,14 @@ function getShopInfoAsync(domain, channel, params) { | @@ -397,10 +398,14 @@ function getShopInfoAsync(domain, channel, params) { | ||
397 | 398 | ||
398 | function _getShopListData(channel, params, shopInfo) { | 399 | function _getShopListData(channel, params, shopInfo) { |
399 | let gender = _getGender(channel), | 400 | let gender = _getGender(channel), |
400 | - shopId = params.shopId, | 401 | + shopId = params.shopId|| params.shop_id, |
402 | + domain = params.domain, | ||
401 | navBar = params.navBar || 1; | 403 | navBar = params.navBar || 1; |
402 | - | ||
403 | let searchParams = searchHandler.getSearchParams(params); | 404 | let searchParams = searchHandler.getSearchParams(params); |
405 | + const baseUrl = `/shop/${domain}-${shopId}`; | ||
406 | + | ||
407 | + params.shopId && delete params.shopId; | ||
408 | + params.domain && delete params.domain; | ||
404 | 409 | ||
405 | return co(function* () { | 410 | return co(function* () { |
406 | let result = yield Promise.props({ | 411 | let result = yield Promise.props({ |
@@ -455,20 +460,22 @@ function _getShopListData(channel, params, shopInfo) { | @@ -455,20 +460,22 @@ function _getShopListData(channel, params, shopInfo) { | ||
455 | let totalPage = _.get(info, 'data.total', 1); | 460 | let totalPage = _.get(info, 'data.total', 1); |
456 | 461 | ||
457 | Object.assign(resData, { | 462 | Object.assign(resData, { |
458 | - filters: searchHandler.handleFilterDataAll(info.data, params), | ||
459 | - opts: searchHandler.handleOptsData(params, totalPage), | 463 | + filters: listHandler.handleFilterData(info.data, params, baseUrl), |
464 | + opts: listHandler.handleOptsData(params, totalPage, baseUrl), | ||
460 | goods: productProcess.processProductList(goodsList, { | 465 | goods: productProcess.processProductList(goodsList, { |
461 | newCoverSort: true, | 466 | newCoverSort: true, |
462 | showDiscount: false, | 467 | showDiscount: false, |
463 | gender: _getGender(channel), | 468 | gender: _getGender(channel), |
464 | query: params.query | 469 | query: params.query |
465 | }), | 470 | }), |
466 | - hasNextPage: searchHandler.handleNextPage(params, totalPage), | ||
467 | - footPager: searchHandler.handlePagerData(totalPage, params) | 471 | + hasNextPage: listHandler.handleNextPage(params, totalPage, baseUrl), |
472 | + footPager: listHandler.handlePagerData(totalPage, params, true, baseUrl) | ||
468 | }); | 473 | }); |
469 | 474 | ||
470 | - _.set(resData, 'filters.checkedConditions.clearUrl', | ||
471 | - `?navBar=${params.navBar}&shopId=${params.shopId}`); | 475 | + if (_.has(resData, 'filters.checkedConditions')) { |
476 | + _.set(resData, 'filters.checkedConditions.clearUrl', | ||
477 | + handleStaticUrl(baseUrl, {navBar: params.navBar})); | ||
478 | + } | ||
472 | } else { | 479 | } else { |
473 | resData.searchEmpty = true; | 480 | resData.searchEmpty = true; |
474 | 481 | ||
@@ -478,7 +485,7 @@ function _getShopListData(channel, params, shopInfo) { | @@ -478,7 +485,7 @@ function _getShopListData(channel, params, shopInfo) { | ||
478 | if (params.query && plist.length) { | 485 | if (params.query && plist.length) { |
479 | resData.allGoods = { | 486 | resData.allGoods = { |
480 | name: '全部商品 ALL', | 487 | name: '全部商品 ALL', |
481 | - sort: searchHandler.handleOptsData(params, data.total || 0), | 488 | + sort: listHandler.handleOptsData(params, data.total || 0, baseUrl), |
482 | list: productProcess.processProductList(plist, { | 489 | list: productProcess.processProductList(plist, { |
483 | newCoverSort: true, | 490 | newCoverSort: true, |
484 | showDiscount: false, | 491 | showDiscount: false, |
@@ -495,7 +502,7 @@ function _getShopListData(channel, params, shopInfo) { | @@ -495,7 +502,7 @@ function _getShopListData(channel, params, shopInfo) { | ||
495 | let groupSort = _.get(result.sort, 'data', []), | 502 | let groupSort = _.get(result.sort, 'data', []), |
496 | noPageQs = Object.assign({}, params, {page: 1}); | 503 | noPageQs = Object.assign({}, params, {page: 1}); |
497 | 504 | ||
498 | - resData.leftContent = searchHandler.handleSortData(groupSort, noPageQs, params); | 505 | + resData.leftContent = listHandler.handleSortData(groupSort, noPageQs, params, baseUrl); |
499 | 506 | ||
500 | _.set(resData, 'brandShopAd', {baseUrl: shopListUrl}); | 507 | _.set(resData, 'brandShopAd', {baseUrl: shopListUrl}); |
501 | 508 |
-
Please register or login to post a comment