|
|
/**
|
|
|
* 搜索商品列表页
|
|
|
* @author: wsl<shuiling.wang@yoho.cn>
|
|
|
* @date: 2016/7/21
|
|
|
*/
|
|
|
require('product/search/list.page.css');
|
|
|
import 'product/search/list.page.css';
|
|
|
import Page from 'yoho-page';
|
|
|
import noResultHbs from 'product/search/no-result-new.hbs';
|
|
|
import ProductListWithFilter from './list/product-list-with-filter';
|
|
|
import qs from 'yoho-qs';
|
|
|
import SearchListExtra from './search/search-list-extra';
|
|
|
import 'common/footer';
|
|
|
|
|
|
const ProductListWithFilter = require('./list/product-list-with-filter');
|
|
|
const qs = require('yoho-qs');
|
|
|
class Search extends Page {
|
|
|
constructor() {
|
|
|
super();
|
|
|
|
|
|
let initParams = {
|
|
|
page: 2,
|
|
|
currentUrl: location.pathname
|
|
|
};
|
|
|
this.selector = {
|
|
|
goodsContainer: $('#goods-container'),
|
|
|
defaultGoods: $('.default-goods')
|
|
|
};
|
|
|
|
|
|
if (qs) {
|
|
|
$.extend(initParams, qs);
|
|
|
}
|
|
|
this.firstScreen = this.selector.defaultGoods.children().size() > 0;
|
|
|
if (!this.firstScreen) {
|
|
|
this.selector.goodsContainer.html(noResultHbs());
|
|
|
}
|
|
|
|
|
|
let initParams = {
|
|
|
page: 2,
|
|
|
currentUrl: location.pathname
|
|
|
};
|
|
|
|
|
|
if (qs) {
|
|
|
$.extend(initParams, qs);
|
|
|
}
|
|
|
|
|
|
new ProductListWithFilter(initParams);
|
|
|
new ProductListWithFilter(initParams, null, {
|
|
|
scrollActived: this.firstScreen
|
|
|
});
|
|
|
|
|
|
new SearchListExtra();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
require('./search/search-list');
|
|
|
require('common/footer');
|
|
|
require('./shop/coupon'); |
|
|
export default new Search(); |
...
|
...
|
|