Authored by 郭成尧

new-product

... ... @@ -22,15 +22,15 @@
<div class="tab">
<ul class="shop-tabs tab-navs" data-sticky>
<li class="shop-tab-nav tab-nav active">
<span data-target="#red-index" data-trigger="tab" data-funFilterHide>首页</span>
<span data-target="#red-index" data-trigger="tab" data-funHome>首页</span>
</li>
<em>|</em>
<li class="shop-tab-nav tab-nav">
<span data-target="#red-new" data-trigger="tab" data-funFilterHide data-funGetNewGoods>上新</span>
<span data-target="#all-goods" data-trigger="tab" data-funGetNewGoods>上新</span>
</li>
<em>|</em>
<li class="shop-tab-nav tab-nav">
<span data-target="#all-goods" data-trigger="tab" data-funFilterShow>全部商品</span>
<span data-target="#all-goods" data-trigger="tab" data-funGetAllGoods>全部商品</span>
</li>
</ul>
{{!--筛选tab--}}
... ... @@ -44,12 +44,6 @@
<div class="shop-coupon coupon-group"></div>
{{> reds-shop/modules}}
</div>
{{!--shop-tab: 上新--}}
<div id="red-new">
<div class="new-good-list-page yoho-page">
</div>
</div>
{{!--shop-tab: 全部商品--}}
<div id="all-goods" class="tab-panel">
<div class="good-list-page yoho-page">
... ...
... ... @@ -4,23 +4,20 @@ require('product/shop/redshop.page.css');
const $ = require('yoho-jquery');
const allProduct = require('./shop/all-product');
const newProuct = require('./shop/new-product');
let Tab = require('../plugin/tab');
let $filterBox = $('.filter-box');
let $goodsContainer = $('#goods-container');
Tab.prototype.filterhide = function() { // 隐藏筛选 TAB
Tab.prototype.home = function() { // 隐藏筛选 TAB
$filterBox.css('display', 'none');
};
Tab.prototype.filtershow = function() { // 显示筛选 TAB
Tab.prototype.getallgoods = function() { // 显示筛选 TAB
$filterBox.css('display', 'block');
if ($goodsContainer.find('.good-info').length < 1) {
allProduct.getGoodsList();
}
allProduct.getGoodsList({type: 'default', page: 0});
};
Tab.prototype.getnewgoods = function() {
newProuct.getNewGoods();
$filterBox.css('display', 'none');
allProduct.getGoodsList({type: 'new', page: 0});
};
// 页面打开直接加载筛选项
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-24 13:43:55
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-24 17:57:30
* @Last Modified time: 2017-03-31 10:38:43
*/
/** *****************************
... ... @@ -70,7 +70,7 @@ const handleChoseFilter = function() {
/**
* 获取商品列表
*/
const getGoodsList = function() {
const getGoodsList = params => {
handleChoseFilter();
if (!onSearching) {
... ... @@ -79,6 +79,11 @@ const getGoodsList = function() {
});
}
// 有参数,参数优先
if (params) {
Object.assign(defaultOpt, params);
}
if (nav && nav.end) {
return false;
}
... ...
/*
* @Author: Targaryen
* @Date: 2017-03-30 16:03:01
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-30 16:03:55
*/
/* **************************
* 红人店铺-上新
************************** */
const getNewGoods = () => {
console.log('ok');
};
module.exports = {
getNewGoods
};