Authored by zzzzzzz

新人专享,人气单品

@@ -8,6 +8,7 @@ const utils = '../../../utils'; @@ -8,6 +8,7 @@ const utils = '../../../utils';
8 const contentCodeConfig = require('../../../config/content-code'); 8 const contentCodeConfig = require('../../../config/content-code');
9 const _ = require('lodash'); 9 const _ = require('lodash');
10 const api = global.yoho.ServiceAPI; 10 const api = global.yoho.ServiceAPI;
  11 +const API = global.yoho.API;
11 const logger = global.yoho.logger; 12 const logger = global.yoho.logger;
12 const resourcesProcess = require(`${utils}/resources-process`); 13 const resourcesProcess = require(`${utils}/resources-process`);
13 14
@@ -279,8 +280,20 @@ let getBottomBannerData = (gender) => { @@ -279,8 +280,20 @@ let getBottomBannerData = (gender) => {
279 }); 280 });
280 }; 281 };
281 282
  283 +/**
  284 + * 获取店铺推荐收藏和人数
  285 + */
  286 +let shopRecom = (params) => {
  287 + return API.get('', {
  288 + method: 'app.shops.floorNewInfo',
  289 + shop_ids: params.shopIds,
  290 + uid: params.uid,
  291 + });
  292 +}
  293 +
282 module.exports = { 294 module.exports = {
283 getChannelData, 295 getChannelData,
284 getChannelSwitchData, 296 getChannelSwitchData,
285 - getBottomBannerData 297 + getBottomBannerData,
  298 + shopRecom,
286 }; 299 };
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 {{> resources/plus-star}} 53 {{> resources/plus-star}}
54 {{/if}} 54 {{/if}}
55 {{! 新人专享}} 55 {{! 新人专享}}
56 - {{#if newUserFloor}} 56 + {{#if oldNewUserFloor}}
57 {{> resources/fresh-only}} 57 {{> resources/fresh-only}}
58 {{/if}} 58 {{/if}}
59 {{! 秒杀}} 59 {{! 秒杀}}
@@ -80,11 +80,15 @@ @@ -80,11 +80,15 @@
80 {{#if shopRecommend}} 80 {{#if shopRecommend}}
81 {{> resources/shop-recommand}} 81 {{> resources/shop-recommand}}
82 {{/if}} 82 {{/if}}
83 -{{/content}}  
84 -{{! 新新人专享}} 83 + {{! 新新人专享}}
  84 + {{#if newUserFloor}}
85 {{> resources/new-user-floor}} 85 {{> resources/new-user-floor}}
86 -{{! 人气单品}} 86 + {{/if}}
  87 + {{! 人气单品}}
  88 + {{#if popularSingleProduct}}
87 {{> resources/hot-single}} 89 {{> resources/hot-single}}
  90 + {{/if}}
  91 +{{/content}}
88 92
89 {{! 新品首发楼层}} 93 {{! 新品首发楼层}}
90 {{> resources/new-first}} 94 {{> resources/new-first}}
  1 +{{#data}}
1 <div class="hot-single"> 2 <div class="hot-single">
2 {{> common/floor-header-more}} 3 {{> common/floor-header-more}}
3 - <a>  
4 - <img src="" alt="hot-single-banner" class="hot-single-banner" /> 4 + {{#banner_image}}
  5 + <a href="{{url}}">
  6 + <img src="{{image src 640 200}}" alt="hot-single-banner" class="hot-single-banner" />
5 </a> 7 </a>
6 - <div class="hot-single-goods-list" style="background: #A9ECF2"> 8 + {{/banner_image}}
  9 + <div class="hot-single-goods-list" {{#background}}style="background: url({{src}})"{{/background}}>
7 <ul> 10 <ul>
  11 + {{#list}}
8 <li class="hot-single-goods"> 12 <li class="hot-single-goods">
9 - <img src="" alt="goods" class="goods-pic"> 13 + <a href="//m.yohobuy.com/product/show_{{product_skn}}">
  14 + <img src="{{image default_images 153 206}}" alt="goods" class="goods-pic">
10 <div class="goods-info"> 15 <div class="goods-info">
11 - <h3 class="price">&yen; 188.00</h3>  
12 - <p class="view-num">12人</p> 16 + <h3 class="price">&yen; {{sales_price}}</h3>
  17 + <p class="view-num">{{view_num}}</p>
13 <p class="view-status">正在浏览</p> 18 <p class="view-status">正在浏览</p>
14 </div> 19 </div>
  20 + </a>
15 </li> 21 </li>
16 - <li class="hot-single-goods"> 22 + {{/list}}
  23 + <!--<li class="hot-single-goods">
17 <img src="" alt="goods" class="goods-pic"> 24 <img src="" alt="goods" class="goods-pic">
18 <div class="goods-info"> 25 <div class="goods-info">
19 <h3 class="price">&yen; 188.00</h3> 26 <h3 class="price">&yen; 188.00</h3>
@@ -54,7 +61,8 @@ @@ -54,7 +61,8 @@
54 <p class="view-num view-margin">大大王</p> 61 <p class="view-num view-margin">大大王</p>
55 <p class="view-status view-margin">10分钟前购买</p> 62 <p class="view-status view-margin">10分钟前购买</p>
56 </div> 63 </div>
57 - </li> 64 + </li>-->
58 </ul> 65 </ul>
59 </div> 66 </div>
60 </div> 67 </div>
  68 +{{/data}}
  1 +{{#data}}
1 <div class="new-user-floor"> 2 <div class="new-user-floor">
2 {{> common/floor-header-more}} 3 {{> common/floor-header-more}}
3 <div class="new-user-icon">新人专享</div> 4 <div class="new-user-icon">新人专享</div>
4 - <a>  
5 - <img src="" alt="new-user-banner" class="new-user-banner" /> 5 + {{#banner_image}}
  6 + <a href="{{url}}">
  7 + <img src="{{image src 640 200}}" alt="new-user-banner" class="new-user-banner" />
6 </a> 8 </a>
7 - <div class="new-user-goods-container" style="background: #A9D4F3"> 9 + {{/banner_image}}
  10 + <div class="new-user-goods-container" {{#background}} style="background-image: url({{src}})" {{/background}}>
8 <ul> 11 <ul>
  12 + {{#list}}
9 <li class="new-user-good"> 13 <li class="new-user-good">
10 - <img src="" alt="" class="goods-pic" /> 14 + <a href="//m.yohobuy.com/product/show_{{product_skn}}">
  15 + <img src="{{image default_images 128 171}}" alt="goods-pic" class="goods-pic" />
11 <div class="goods-info"> 16 <div class="goods-info">
12 - <h3 class="title">冠军牌教练衫夹克</h3>  
13 - <p class="price">&yen; 130.00</p>  
14 - <p class="buy-now">立即购买></p>  
15 - </div>  
16 - </li>  
17 - <li class="new-user-good">  
18 - <img src="" alt="" class="goods-pic" />  
19 - <div class="goods-info">  
20 - <h3 class="title">冠军牌教练衫夹克你大爷的</h3>  
21 - <p class="price">&yen; 130.00</p>  
22 - <p class="buy-now">立即购买></p>  
23 - </div>  
24 - </li>  
25 - <li class="new-user-good">  
26 - <img src="" alt="" class="goods-pic" />  
27 - <div class="goods-info">  
28 - <h3 class="title">冠军牌教练衫夹克</h3>  
29 - <p class="price">&yen; 130.00</p>  
30 - <p class="buy-now">立即购买></p>  
31 - </div>  
32 - </li>  
33 - <li class="new-user-good">  
34 - <img src="" alt="" class="goods-pic" />  
35 - <div class="goods-info">  
36 - <h3 class="title">冠军牌教练衫夹克</h3>  
37 - <p class="price">&yen; 130.00</p>  
38 - <p class="buy-now">立即购买></p>  
39 - </div>  
40 - </li>  
41 - <li class="new-user-good">  
42 - <img src="" alt="" class="goods-pic" />  
43 - <div class="goods-info">  
44 - <h3 class="title">冠军牌教练衫夹克</h3>  
45 - <p class="price">&yen; 130.00</p>  
46 - <p class="buy-now">立即购买></p>  
47 - </div>  
48 - </li>  
49 - <li class="new-user-good">  
50 - <img src="" alt="" class="goods-pic" />  
51 - <div class="goods-info">  
52 - <h3 class="title">冠军牌教练衫夹克</h3>  
53 - <p class="price">&yen; 130.00</p> 17 + <h3 class="title">{{product_name}}</h3>
  18 + <p class="price">&yen; {{sales_price}}</p>
54 <p class="buy-now">立即购买></p> 19 <p class="buy-now">立即购买></p>
55 </div> 20 </div>
  21 + </a>
56 </li> 22 </li>
  23 + {{/list}}
57 </ul> 24 </ul>
58 </div> 25 </div>
59 </div> 26 </div>
  27 +{{/data}}
@@ -261,6 +261,7 @@ var checkShop = function() { @@ -261,6 +261,7 @@ var checkShop = function() {
261 } 261 }
262 }); 262 });
263 } 263 }
264 -  
265 checkShop(); 264 checkShop();
  265 +
  266 +// 店铺推荐收藏
266 require('./maybe-like')(); 267 require('./maybe-like')();
@@ -75,8 +75,8 @@ module.exports = (list) => { @@ -75,8 +75,8 @@ module.exports = (list) => {
75 floor.data.length === 1 && 75 floor.data.length === 1 &&
76 (floor.singleOne = true); 76 (floor.singleOne = true);
77 77
78 - // vip专享  
79 - if (floor.vipUse && floor.data && floor.data.background) { 78 + // vip专享 人气单品背景处理
  79 + if ((floor.vipUse || floor.popularSingleProduct || floor.newUserFloor) && floor.data && floor.data.background) {
80 let a = floor.data.background.src; 80 let a = floor.data.background.src;
81 a = a.substr(0, a.indexOf('?')); 81 a = a.substr(0, a.indexOf('?'));
82 floor.data.background.src = a; 82 floor.data.background.src = a;