Blame view

public/js/product/shop-reds.page.js 1.72 KB
郭成尧 authored
1
require('layout/_swiper.css');
郭成尧 authored
2 3 4
require('product/search/list.page.css');
require('product/shop/redshop.page.css');
郭成尧 authored
5
const $ = require('yoho-jquery');
郭成尧 authored
6
const shopId = $('#shopId').val();
郭成尧 authored
7
const ProductListWithFilter = require('product/list/product-list-with-filter');
郭成尧 authored
8 9
let Tab = require('../plugin/tab');
郭成尧 authored
10
let $filterBox = $('.filter-box');
郭成尧 authored
11
let $shopCategory = $('#shop-category');
郭成尧 authored
12
let $listNav = $('#list-nav'); // 筛选项列表
郭成尧 authored
13
郭成尧 authored
14 15 16 17 18
/**
 * 初始化全部商品 TAB 页
 */
let productListWithFilter = new ProductListWithFilter({
    shop_id: shopId
郭成尧 authored
19
}, 'product/search/shop/goods');
郭成尧 authored
20 21 22

productListWithFilter.scrollActived = false;
郭成尧 authored
23
Tab.prototype.home = function() { // 隐藏筛选 TAB
郭成尧 authored
24
    $filterBox.css('display', 'none');
郭成尧 authored
25
    $('.filter-mask').addClass('hide');
郭成尧 authored
26
    productListWithFilter.scrollActived = false;
郭成尧 authored
27
};
郭成尧 authored
28
Tab.prototype.getallgoods = function() { // 显示筛选 TAB
郭成尧 authored
29 30
    $listNav.find('li').removeClass('active');
    $listNav.find('.default').addClass('active');
郭成尧 authored
31
    $filterBox.css('display', 'block');
郭成尧 authored
32
    $('.filter-mask').addClass('hide');
郭成尧 authored
33 34
    productListWithFilter.getGoodsList({type: 'default', page: 1});
    productListWithFilter.scrollActived = true;
郭成尧 authored
35
};
郭成尧 authored
36
Tab.prototype.getnewgoods = function() {
郭成尧 authored
37
    $filterBox.css('display', 'none');
郭成尧 authored
38
    $('.filter-mask').addClass('hide');
郭成尧 authored
39 40
    productListWithFilter.getGoodsList({type: 'new', page: 1});
    productListWithFilter.scrollActived = true;
郭成尧 authored
41
};
郭成尧 authored
42
郭成尧 authored
43 44 45 46 47 48 49 50 51 52
/**
 * 商品分类展示隐藏
 */
if ($shopCategory.length > 0) {
    $shopCategory.on('click', function() {
        $('.sub-group').toggleClass('hide');
    });
}

郭成尧 authored
53
// 页面打开直接加载筛选项
郭成尧 authored
54
// productListWithFilter.getFilter();
郭成尧 authored
55 56 57 58

require('../plugin/sticky');
require('./shop/coupon');
require('./shop/red-shop');
zhangxiaoru authored
59
require('common/invite-share');