Authored by 郭成尧

del-yas

... ... @@ -130,7 +130,6 @@ const shop = {
let title = brandInfo.title;
let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
let goodsTotal = _.get(goodsListApi, 'data.total', 0);
brandInfo.banner = banner;
... ... @@ -146,7 +145,6 @@ const shop = {
keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰',
description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
brandId: brandId,
goodsTotal: goodsTotal,
brandInfo: brandInfo,
goodsList: goodsList,
shopPage: true,
... ... @@ -164,26 +162,17 @@ const shop = {
let channel = req.yoho.channel || 'boys';
let uid = req.user.uid || 0;
let udid = req.sessionID || 'yoho';
let searchParam = {
isApp: req.yoho.isApp,
shop_id: shopId,
app_type: req.query.app_type,
type: 'default',
order: '0',
page: 1
};
if (!shopId) {
return next();
}
co(function* () {
let [bannerData, favCountData, decoratorsData, categoryData, goodsListApi] = yield Promise.all([
let [bannerData, favCountData, decoratorsData, categoryData] = yield Promise.all([
redsShopModel.getBanner(shopId),
redsShopModel.favCount(shopId, uid, channel, udid),
redsShopModel.getShopsdecorator(shopId),
redsShopModel.getShopCategory(shopId, channel),
searchModel.getShopGoods(searchParam)
redsShopModel.getShopCategory(shopId, channel)
]);
let banner = _.get(bannerData, 'data.banner');
... ... @@ -193,7 +182,6 @@ const shop = {
let category = redShopPrcs.category(_.get(categoryData, 'data', []), shopId);
let goodsListBySkn = yield listModel.searchProductBySkn(decoratorsAll.skns);
let goodsTotal = _.get(goodsListApi, 'data.total', 0);
let decorators = redShopPrcs.pushGoodsInfo(decoratorsAll.decorators, goodsListBySkn);
res.render('newshop/shop-reds', {
... ... @@ -224,7 +212,6 @@ const shop = {
module: 'product',
page: 'shop-reds',
shopId,
goodsTotal,
banner, shopInfo, favCount, decorators, category
});
})().catch(next);
... ...
... ... @@ -45,5 +45,4 @@
{{> common/suspend-cart}}
<input type="hidden" id="brandId" value={{brandId}}>
<input type="hidden" id="goodsTotal", value="{{goodsTotal}}">
</div>
... ...
... ... @@ -15,5 +15,4 @@
{{> common/suspend-cart}}
<input type="hidden" id="shopId" value={{shopId}}>
<input type="hidden" id="goodsTotal", value="{{goodsTotal}}">
</div>
\ No newline at end of file
... ...
... ... @@ -62,5 +62,4 @@
</div>
</div>
<input type="hidden" id="shopId" name="shopId" class="shop-id" value="{{shopId}}">
<input type="hidden" id="goodsTotal", value="{{goodsTotal}}">
{{> reds-shop/footer}}
\ No newline at end of file
... ...
... ... @@ -11,7 +11,6 @@
const filter = require('plugin/filter');
const noResultHbs = require('product/search/no-result-new.hbs');
const lazyLoad = require('yoho-jquery-lazyload');
const C_ID = window._ChannelVary[window.cookie('_Channel')];
class ProductListWithFilter {
constructor(filterParams, searchUrl, extra) {
... ... @@ -152,38 +151,8 @@ class ProductListWithFilter {
let noResult = !result || result.length < 1 || (result.list && result.list.length < 1);
let yasParams = {
C_ID: C_ID,
BRAND_ID: this.defaultOpt.shop_id,
PAGE_NUM: this.page,
FILTER_VALUE: this.defaultOpt ? JSON.stringify(this.defaultOpt).replace(/\{|\}|\"/g, '') : '',
SORT_TYPE: this.defaultOpt && this.defaultOpt.type
};
// 没有结果输出没有结果页面
if (noResult) {
setTimeout(function() {
if (window._yas && window._yas.sendCustomInfo) {
let num = this.view.$container.find('.good-info').length;
let goodIds = [];
this.view.$container.find('.good-info:gt(' + (num - 1) + ')').each(function() {
let goodid = $(this).data('good-id');
if (goodid) {
goodIds.push(goodid);
}
});
Object.assign(yasParams, {
PRD_LIST: JSON.stringify(goodIds).replace(/\[|\]/g, ''),
RES_QTY: this.goodsTotal ? this.goodsTotal : 0
});
window._yas.sendCustomInfo({
op: 'YB_BRAND_GOODS_LIST_L',
param: JSON.stringify(yasParams)
}, true);
}
}, 200);
if (this.isScrollLoad) {
this.view.container.after(() => {
return '<div class="search-divide">没有更多内容了...</div>';
... ...
... ... @@ -2,15 +2,12 @@ require('product/shop/shop.page.css');
let ProductListWithFilter = require('product/list/product-list-with-filter');
const brandId = $('#brandId').val();
const goodsTotal = $('#goodsTotal').val();
let productListWithFilterModel =
new ProductListWithFilter({
brand_id: brandId,
page: 2, // 首页服务端已经渲染
isShopBrand: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据
}, 'product/search/brand/goods', {
goodsTotal: goodsTotal
});
}, 'product/search/brand/goods');
productListWithFilterModel.getFilter();
... ...
... ... @@ -2,15 +2,12 @@ require('product/shop/shop.page.css');
let ProductListWithFilter = require('product/list/product-list-with-filter');
const shopId = $('#shopId').val();
const goodsTotal = $('#goodsTotal').val();
let productListWithFilterModel =
new ProductListWithFilter({
shop_id: shopId,
page: 2, // 首页服务端已经渲染
isShopList: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据
}, 'product/search/shop/goods', {
goodsTotal: goodsTotal
});
}, 'product/search/shop/goods');
productListWithFilterModel.getFilter();
... ...
... ... @@ -4,7 +4,6 @@ require('product/shop/redshop.page.css');
const $ = require('yoho-jquery');
const shopId = $('#shopId').val();
const goodsTotal = $('#goodsTotal').val();
const ProductListWithFilter = require('product/list/product-list-with-filter');
let Tab = require('../plugin/tab');
... ... @@ -17,8 +16,6 @@ let $listNav = $('#list-nav'); // 筛选项列表
*/
let productListWithFilter = new ProductListWithFilter({
shop_id: shopId
}, '', {
goodsTotal: goodsTotal
});
productListWithFilter.scrollActived = false;
... ...