search-list.page.js 1.01 KB
/**
 * 搜索商品列表页
 */
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';

class Search extends Page {
    constructor() {
        super();

        this.selector = {
            goodsContainer: $('#goods-container'),
            defaultGoods: $('.default-goods')
        };

        this.firstScreen = this.selector.defaultGoods.children().size() > 0;
        if (!this.firstScreen) {
            this.selector.goodsContainer.html(noResultHbs());
        }

        let initParams = {
            page: 2
        };

        if (qs) {
            $.extend(initParams, qs);
        }

        new ProductListWithFilter(initParams, null, {
            scrollActived: this.firstScreen
        });

        new SearchListExtra();
    }
}

export default new Search();