Authored by zzzzzzz

部分接口

... ... @@ -150,6 +150,18 @@ let bottomBanner = (req, res, next) => {
}).catch(next);
};
/**
* 店铺推荐收藏状态人数
*/
let shopRecom = (req, res, next) => {
channelModel.shopRecom({
shopIds: req.body.shopIds || '',
uid: req.user.uid || 0,
}).then(result => {
res.send(result);
}).catch(next);
}
module.exports = {
switchChannel,
index,
... ... @@ -157,5 +169,6 @@ module.exports = {
girls,
kids,
lifestyle,
bottomBanner
bottomBanner,
shopRecom,
};
... ...
... ... @@ -29,4 +29,6 @@ router.post('/brands/searchAsync', brandController.searchAsync); // 品牌搜索
router.post('/brands/addBrandSearch', brandController.addBrandSearch); // 添加品牌搜索记录
router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删除品牌搜索记录
// 5.2新楼层功能
router.post('/shopRecom', channel.shopRecom); // 店铺推荐收藏状态
module.exports = router;
... ...
... ... @@ -72,16 +72,22 @@
{{#if sixLinesFloor}}
{{> resources/six-lines-floor}}
{{/if}}
{{! vip专属}}
{{#if vipUse}}
{{> resources/vip-only}}
{{/if}}
{{! 店铺推荐}}
{{#if shopRecommend}}
{{> resources/shop-recommand}}
{{/if}}
{{/content}}
{{! 新新人专享}}
{{> resources/new-user-floor}}
{{! 人气单品}}
{{> resources/hot-single}}
{{! vip专属}}
{{> resources/vip-only}}
{{! 新品首发楼层}}
{{> resources/new-first}}
{{! 店铺推荐}}
{{> resources/shop-recommand}}
{{! SALE}}
{{> resources/sale-floor}}
... ...
{{#data}}
<div class="shop-recom">
{{! title不传不显示}}
{{#if title}}
{{> common/floor-header-more}}
{{/if}}
<div class="shop-recom-container shop-recom-swiper-container">
<ul class="swiper-wrapper">
<li class="swiper-slide recom-shop">
<div class="fav-container">
<div class="shop-fav"></div><span>已收藏</span>
</div>
<span class="faved-num">1234人以收藏</span>
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90" alt="banner" class="top">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90" alt="left" class="bottom">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90" alt="right" class="bottom">
</li>
<li class="swiper-slide recom-shop">
<div class="fav-container">
{{#list}}
<li class="swiper-slide recom-shop" shopId={{shopId}}>
<div class="fav-container fav-no">
<div class="shop-notfav"></div><span>收藏</span>
</div>
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90" alt="banner" class="top">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90" alt="left" class="bottom">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90" alt="right" class="bottom">
</li>
<li class="swiper-slide recom-shop">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90" alt="banner" class="top">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90" alt="left" class="bottom">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90" alt="right" class="bottom">
</li>
<li class="swiper-slide recom-shop">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90" alt="banner" class="top">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90" alt="left" class="bottom">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90" alt="right" class="bottom">
</li>
<li class="swiper-slide recom-shop">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/21/13/0149f69bae453be2b9766205c360611a7b.jpg?imageView2/2/w/411/h/239/q/90" alt="banner" class="top">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/017deb63b74900161d516b506370066877.jpg?imageView2/2/w/206/h/168/q/90" alt="left" class="bottom">
<img src="//img10.static.yhbimg.com/yhb-img01/2016/10/27/10/01907c964b9c98ba8b37606c4963508bc9.jpg?imageView2/2/w/206/h/168/q/90" alt="right" class="bottom">
<div class="fav-container fav-yes" style="display:none">
<div class="shop-fav"></div><span>已收藏</span>
</div>
<span class="faved-num"></span>
<a href="{{url}}">
<img src="{{image src 640 208}}" alt="banner" class="top">
</a>
{{#goods0}}
<a href="{{url}}">
<img src="{{image src 320 146}}" alt="left" class="bottom">
</a>
{{/goods0}}
{{#goods1}}
<a href="{{url}}">
<img src="{{image src 320 146}}" alt="right" class="bottom">
</a>
{{/goods1}}
</li>
{{/list}}
</ul>
</div>
</div>
\ No newline at end of file
</div>
{{/data}}
\ No newline at end of file
... ...
{{#data}}
<div class="vip-only">
{{> common/floor-header-more}}
<a>
<img src="" alt="vip-only-banner" class="vip-only-banner" />
{{#banner_image}}
<a href="{{url}}">
<img src="{{image src 640 200}}" alt="vip-only-banner" class="vip-only-banner" />
</a>
<div class="vip-only-goods-list" style="background: #000013">
{{/banner_image}}
<div class="vip-only-goods-list" {{#background}} style="background: url({{src}})" {{/background}}>
<ul>
{{#list}}
<a href="//m.yohobuy.com/product/show_{{product_skn}}">
<li class="vip-only-goods">
<img src="" alt="goods" class="goods-pic">
<img src="{{image default_images 153 206}}" alt="goods" class="goods-pic">
<div class="goods-info">
<h3 class="vip-price">&yen; 3988.00</h3>
<p class="sale-price">&yen; 9999.00 <span class="vip-icon"></span></p>
</div>
</li>
<li class="vip-only-goods">
<img src="" alt="goods" class="goods-pic">
<div class="goods-info">
<h3 class="vip-price">&yen; 3988.00</h3>
<p class="sale-price">&yen; 9999.00 <span class="vip-icon"></span></p>
</div>
</li>
<li class="vip-only-goods">
<img src="" alt="goods" class="goods-pic">
<div class="goods-info">
<h3 class="vip-price">&yen; 3988.00</h3>
<p class="sale-price">&yen; 9999.00 <span class="vip-icon"></span></p>
</div>
</li>
<li class="vip-only-goods">
<img src="" alt="goods" class="goods-pic">
<div class="goods-info">
<h3 class="vip-price">&yen; 3988.00</h3>
<p class="sale-price">&yen; 9999.00 <span class="vip-icon"></span></p>
</div>
</li>
<li class="vip-only-goods">
<img src="" alt="goods" class="goods-pic">
<div class="goods-info">
<h3 class="vip-price">&yen; 3988.00</h3>
<p class="sale-price">&yen; 9999.00 <span class="vip-icon"></span></p>
</div>
</li>
<li class="vip-only-goods">
<img src="" alt="goods" class="goods-pic">
<div class="goods-info">
<h3 class="vip-price">&yen; 3988.00</h3>
<p class="sale-price">&yen; 9999.00 <span class="vip-icon"></span></p>
<h3 class="vip-price">&yen; {{vip1_price}}</h3>
<p class="sale-price">&yen; {{market_price}} <span class="vip-icon"></span></p>
</div>
</li>
</a>
{{/list}}
</ul>
</div>
</div>
\ No newline at end of file
</div>
{{/data}}
\ No newline at end of file
... ...
... ... @@ -235,4 +235,32 @@ var shopSwiper = new Swiper('.shop-recom-swiper-container', {
paginationClickable: true,
slideActiveClass : 'recom-active',
});
// 店铺推荐人数和收藏初始查询
var checkShop = function() {
var shopIds = [];
$('.recom-shop').each(function() {
shopIds.push($(this).attr('shopId'));
});
$.ajax({
type: 'POST',
url: '/shopRecom',
data: {
shopIds: shopIds.join(','),
},
}).then(function(result) {
if (result.code === 200) {
for (var i = 0, elem; (elem = result.data[i]) != null; i++) {
var a = $('.recom-shop[shopId = '+ elem.id + ']');
a.find('.faved-num').text(elem.collectionNum + "人已收藏");
if (elem.favorite) {
a.find('.fav-no').hide();
a.find('.fav-yes').show();
}
}
}
});
}
checkShop();
require('./maybe-like')();
... ...
'use strict';
const _ = require('lodash');
const processTime = require('./time-process');
... ... @@ -73,6 +75,13 @@ module.exports = (list) => {
floor.data.length === 1 &&
(floor.singleOne = true);
// vip专享
if (floor.vipUse && floor.data && floor.data.background) {
let a = floor.data.background.src;
a = a.substr(0, a.indexOf('?'));
floor.data.background.src = a;
}
formatData.push(floor);
});
... ...