reds-shop.page.js
1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require('layout/_swiper.css');
require('product/search/list.page.css');
require('product/shop/redshop.page.css');
const $ = require('yoho-jquery');
const allProduct = require('./shop/all-product');
let Tab = require('../plugin/tab');
let $filterBox = $('.filter-box');
let $shopCategory = $('#shop-category');
Tab.prototype.home = function() { // 隐藏筛选 TAB
$filterBox.css('display', 'none');
};
Tab.prototype.getallgoods = function() { // 显示筛选 TAB
$filterBox.css('display', 'block');
allProduct.getGoodsList({type: 'default', page: 1});
};
Tab.prototype.getnewgoods = function() {
$filterBox.css('display', 'none');
allProduct.getGoodsList({type: 'new', page: 1});
};
/**
* 商品分类展示隐藏
*/
if ($shopCategory.length > 0) {
$shopCategory.on('click', function() {
$('.sub-group').toggleClass('hide');
});
}
// 页面打开直接加载筛选项
allProduct.getFilter();
require('../plugin/sticky');
require('./shop/coupon');
require('./shop/red-shop');