Authored by 郭成尧

del-yas

@@ -130,7 +130,6 @@ const shop = { @@ -130,7 +130,6 @@ const shop = {
130 130
131 let title = brandInfo.title; 131 let title = brandInfo.title;
132 let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', [])); 132 let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
133 - let goodsTotal = _.get(goodsListApi, 'data.total', 0);  
134 133
135 brandInfo.banner = banner; 134 brandInfo.banner = banner;
136 135
@@ -146,7 +145,6 @@ const shop = { @@ -146,7 +145,6 @@ const shop = {
146 keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰', 145 keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰',
147 description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。', 146 description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
148 brandId: brandId, 147 brandId: brandId,
149 - goodsTotal: goodsTotal,  
150 brandInfo: brandInfo, 148 brandInfo: brandInfo,
151 goodsList: goodsList, 149 goodsList: goodsList,
152 shopPage: true, 150 shopPage: true,
@@ -164,26 +162,17 @@ const shop = { @@ -164,26 +162,17 @@ const shop = {
164 let channel = req.yoho.channel || 'boys'; 162 let channel = req.yoho.channel || 'boys';
165 let uid = req.user.uid || 0; 163 let uid = req.user.uid || 0;
166 let udid = req.sessionID || 'yoho'; 164 let udid = req.sessionID || 'yoho';
167 - let searchParam = {  
168 - isApp: req.yoho.isApp,  
169 - shop_id: shopId,  
170 - app_type: req.query.app_type,  
171 - type: 'default',  
172 - order: '0',  
173 - page: 1  
174 - };  
175 165
176 if (!shopId) { 166 if (!shopId) {
177 return next(); 167 return next();
178 } 168 }
179 169
180 co(function* () { 170 co(function* () {
181 - let [bannerData, favCountData, decoratorsData, categoryData, goodsListApi] = yield Promise.all([ 171 + let [bannerData, favCountData, decoratorsData, categoryData] = yield Promise.all([
182 redsShopModel.getBanner(shopId), 172 redsShopModel.getBanner(shopId),
183 redsShopModel.favCount(shopId, uid, channel, udid), 173 redsShopModel.favCount(shopId, uid, channel, udid),
184 redsShopModel.getShopsdecorator(shopId), 174 redsShopModel.getShopsdecorator(shopId),
185 - redsShopModel.getShopCategory(shopId, channel),  
186 - searchModel.getShopGoods(searchParam) 175 + redsShopModel.getShopCategory(shopId, channel)
187 ]); 176 ]);
188 177
189 let banner = _.get(bannerData, 'data.banner'); 178 let banner = _.get(bannerData, 'data.banner');
@@ -193,7 +182,6 @@ const shop = { @@ -193,7 +182,6 @@ const shop = {
193 let category = redShopPrcs.category(_.get(categoryData, 'data', []), shopId); 182 let category = redShopPrcs.category(_.get(categoryData, 'data', []), shopId);
194 183
195 let goodsListBySkn = yield listModel.searchProductBySkn(decoratorsAll.skns); 184 let goodsListBySkn = yield listModel.searchProductBySkn(decoratorsAll.skns);
196 - let goodsTotal = _.get(goodsListApi, 'data.total', 0);  
197 let decorators = redShopPrcs.pushGoodsInfo(decoratorsAll.decorators, goodsListBySkn); 185 let decorators = redShopPrcs.pushGoodsInfo(decoratorsAll.decorators, goodsListBySkn);
198 186
199 res.render('newshop/shop-reds', { 187 res.render('newshop/shop-reds', {
@@ -224,7 +212,6 @@ const shop = { @@ -224,7 +212,6 @@ const shop = {
224 module: 'product', 212 module: 'product',
225 page: 'shop-reds', 213 page: 'shop-reds',
226 shopId, 214 shopId,
227 - goodsTotal,  
228 banner, shopInfo, favCount, decorators, category 215 banner, shopInfo, favCount, decorators, category
229 }); 216 });
230 })().catch(next); 217 })().catch(next);
@@ -45,5 +45,4 @@ @@ -45,5 +45,4 @@
45 45
46 {{> common/suspend-cart}} 46 {{> common/suspend-cart}}
47 <input type="hidden" id="brandId" value={{brandId}}> 47 <input type="hidden" id="brandId" value={{brandId}}>
48 - <input type="hidden" id="goodsTotal", value="{{goodsTotal}}">  
49 </div> 48 </div>
@@ -15,5 +15,4 @@ @@ -15,5 +15,4 @@
15 15
16 {{> common/suspend-cart}} 16 {{> common/suspend-cart}}
17 <input type="hidden" id="shopId" value={{shopId}}> 17 <input type="hidden" id="shopId" value={{shopId}}>
18 - <input type="hidden" id="goodsTotal", value="{{goodsTotal}}">  
19 </div> 18 </div>
@@ -62,5 +62,4 @@ @@ -62,5 +62,4 @@
62 </div> 62 </div>
63 </div> 63 </div>
64 <input type="hidden" id="shopId" name="shopId" class="shop-id" value="{{shopId}}"> 64 <input type="hidden" id="shopId" name="shopId" class="shop-id" value="{{shopId}}">
65 -<input type="hidden" id="goodsTotal", value="{{goodsTotal}}">  
66 {{> reds-shop/footer}} 65 {{> reds-shop/footer}}
@@ -11,7 +11,6 @@ @@ -11,7 +11,6 @@
11 const filter = require('plugin/filter'); 11 const filter = require('plugin/filter');
12 const noResultHbs = require('product/search/no-result-new.hbs'); 12 const noResultHbs = require('product/search/no-result-new.hbs');
13 const lazyLoad = require('yoho-jquery-lazyload'); 13 const lazyLoad = require('yoho-jquery-lazyload');
14 -const C_ID = window._ChannelVary[window.cookie('_Channel')];  
15 14
16 class ProductListWithFilter { 15 class ProductListWithFilter {
17 constructor(filterParams, searchUrl, extra) { 16 constructor(filterParams, searchUrl, extra) {
@@ -152,38 +151,8 @@ class ProductListWithFilter { @@ -152,38 +151,8 @@ class ProductListWithFilter {
152 151
153 let noResult = !result || result.length < 1 || (result.list && result.list.length < 1); 152 let noResult = !result || result.length < 1 || (result.list && result.list.length < 1);
154 153
155 - let yasParams = {  
156 - C_ID: C_ID,  
157 - BRAND_ID: this.defaultOpt.shop_id,  
158 - PAGE_NUM: this.page,  
159 - FILTER_VALUE: this.defaultOpt ? JSON.stringify(this.defaultOpt).replace(/\{|\}|\"/g, '') : '',  
160 - SORT_TYPE: this.defaultOpt && this.defaultOpt.type  
161 - };  
162 -  
163 // 没有结果输出没有结果页面 154 // 没有结果输出没有结果页面
164 if (noResult) { 155 if (noResult) {
165 - setTimeout(function() {  
166 - if (window._yas && window._yas.sendCustomInfo) {  
167 - let num = this.view.$container.find('.good-info').length;  
168 - let goodIds = [];  
169 -  
170 - this.view.$container.find('.good-info:gt(' + (num - 1) + ')').each(function() {  
171 - let goodid = $(this).data('good-id');  
172 -  
173 - if (goodid) {  
174 - goodIds.push(goodid);  
175 - }  
176 - });  
177 - Object.assign(yasParams, {  
178 - PRD_LIST: JSON.stringify(goodIds).replace(/\[|\]/g, ''),  
179 - RES_QTY: this.goodsTotal ? this.goodsTotal : 0  
180 - });  
181 - window._yas.sendCustomInfo({  
182 - op: 'YB_BRAND_GOODS_LIST_L',  
183 - param: JSON.stringify(yasParams)  
184 - }, true);  
185 - }  
186 - }, 200);  
187 if (this.isScrollLoad) { 156 if (this.isScrollLoad) {
188 this.view.container.after(() => { 157 this.view.container.after(() => {
189 return '<div class="search-divide">没有更多内容了...</div>'; 158 return '<div class="search-divide">没有更多内容了...</div>';
@@ -2,15 +2,12 @@ require('product/shop/shop.page.css'); @@ -2,15 +2,12 @@ require('product/shop/shop.page.css');
2 let ProductListWithFilter = require('product/list/product-list-with-filter'); 2 let ProductListWithFilter = require('product/list/product-list-with-filter');
3 3
4 const brandId = $('#brandId').val(); 4 const brandId = $('#brandId').val();
5 -const goodsTotal = $('#goodsTotal').val();  
6 5
7 let productListWithFilterModel = 6 let productListWithFilterModel =
8 new ProductListWithFilter({ 7 new ProductListWithFilter({
9 brand_id: brandId, 8 brand_id: brandId,
10 page: 2, // 首页服务端已经渲染 9 page: 2, // 首页服务端已经渲染
11 isShopBrand: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据 10 isShopBrand: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据
12 - }, 'product/search/brand/goods', {  
13 - goodsTotal: goodsTotal  
14 - }); 11 + }, 'product/search/brand/goods');
15 12
16 productListWithFilterModel.getFilter(); 13 productListWithFilterModel.getFilter();
@@ -2,15 +2,12 @@ require('product/shop/shop.page.css'); @@ -2,15 +2,12 @@ require('product/shop/shop.page.css');
2 let ProductListWithFilter = require('product/list/product-list-with-filter'); 2 let ProductListWithFilter = require('product/list/product-list-with-filter');
3 3
4 const shopId = $('#shopId').val(); 4 const shopId = $('#shopId').val();
5 -const goodsTotal = $('#goodsTotal').val();  
6 5
7 let productListWithFilterModel = 6 let productListWithFilterModel =
8 new ProductListWithFilter({ 7 new ProductListWithFilter({
9 shop_id: shopId, 8 shop_id: shopId,
10 page: 2, // 首页服务端已经渲染 9 page: 2, // 首页服务端已经渲染
11 isShopList: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据 10 isShopList: 'Y' // 传给 filter,表明调用哪个接口获取筛选面板的数据
12 - }, 'product/search/shop/goods', {  
13 - goodsTotal: goodsTotal  
14 - }); 11 + }, 'product/search/shop/goods');
15 12
16 productListWithFilterModel.getFilter(); 13 productListWithFilterModel.getFilter();
@@ -4,7 +4,6 @@ require('product/shop/redshop.page.css'); @@ -4,7 +4,6 @@ require('product/shop/redshop.page.css');
4 4
5 const $ = require('yoho-jquery'); 5 const $ = require('yoho-jquery');
6 const shopId = $('#shopId').val(); 6 const shopId = $('#shopId').val();
7 -const goodsTotal = $('#goodsTotal').val();  
8 const ProductListWithFilter = require('product/list/product-list-with-filter'); 7 const ProductListWithFilter = require('product/list/product-list-with-filter');
9 let Tab = require('../plugin/tab'); 8 let Tab = require('../plugin/tab');
10 9
@@ -17,8 +16,6 @@ let $listNav = $('#list-nav'); // 筛选项列表 @@ -17,8 +16,6 @@ let $listNav = $('#list-nav'); // 筛选项列表
17 */ 16 */
18 let productListWithFilter = new ProductListWithFilter({ 17 let productListWithFilter = new ProductListWithFilter({
19 shop_id: shopId 18 shop_id: shopId
20 -}, '', {  
21 - goodsTotal: goodsTotal  
22 }); 19 });
23 20
24 productListWithFilter.scrollActived = false; 21 productListWithFilter.scrollActived = false;