Authored by hongweigao

没数据,不显示页面,箭头隐藏

@@ -41,7 +41,7 @@ const recBrand = (params) => { @@ -41,7 +41,7 @@ const recBrand = (params) => {
41 const recList = (params) => { 41 const recList = (params) => {
42 let finalParams = { 42 let finalParams = {
43 method: 'app.newproduct.reclist', 43 method: 'app.newproduct.reclist',
44 - limit: 50 44 + limit: 60
45 }; 45 };
46 46
47 Object.assign(finalParams, params); 47 Object.assign(finalParams, params);
@@ -105,6 +105,7 @@ const index = (req) => { @@ -105,6 +105,7 @@ const index = (req) => {
105 } 105 }
106 //精彩想先看,左轮播右2图 106 //精彩想先看,左轮播右2图
107 if (ads.template_name === 'NL2R') { 107 if (ads.template_name === 'NL2R') {
  108 + Object.assign(respData.firstLook.lookBanner.list, ads.data.left);
108 Object.assign(respData.firstLook.lookTwoImg, ads.data.right); 109 Object.assign(respData.firstLook.lookTwoImg, ads.data.right);
109 } 110 }
110 }); 111 });
@@ -148,6 +149,23 @@ const index = (req) => { @@ -148,6 +149,23 @@ const index = (req) => {
148 // 列表数据 149 // 列表数据
149 Object.assign(respData.newProduct, _proListHandler(result[3].data, Object.assign({}, params, {channel: channel}) )); 150 Object.assign(respData.newProduct, _proListHandler(result[3].data, Object.assign({}, params, {channel: channel}) ));
150 } 151 }
  152 +
  153 + //数据为空,不显示页面模块
  154 + if(_.isEmpty(respData.slide.list)) {
  155 + delete respData.slide;
  156 + }
  157 + if(_.isEmpty(respData.recommond.dataList)) {
  158 + delete respData.recommond;
  159 + }
  160 + if(_.isEmpty(respData.newBrand.brandList)) {
  161 + delete respData.newBrand;
  162 + }
  163 + if(_.isEmpty(respData.newProduct.newProList) && _.isEmpty(respData.newProduct.ctyList)) {
  164 + delete respData.newProduct;
  165 + }
  166 + if(_.isEmpty(respData.firstLook.lookBanner.list) && _.isEmpty(respData.firstLook.lookTwoImg)) {
  167 + delete respData.firstLook;
  168 + }
151 return respData; 169 return respData;
152 }); 170 });
153 }; 171 };
@@ -7,15 +7,15 @@ @@ -7,15 +7,15 @@
7 {{#recommond}} 7 {{#recommond}}
8 <div class="recommond-floor"> 8 <div class="recommond-floor">
9 {{> common/floor-header}} 9 {{> common/floor-header}}
10 - <div class="swiper-container new-arrival-swiper rec-swiper"> 10 + <div id="rec-swiper" class="swiper-container new-arrival-swiper rec-swiper">
11 <div class="swiper-wrapper"> 11 <div class="swiper-wrapper">
12 {{#dataList}} 12 {{#dataList}}
13 - <div class="swiper-slide"> 13 + <span class="swiper-slide">
14 <a class="rec-pro" href="{{url}}" target="_blank"> 14 <a class="rec-pro" href="{{url}}" target="_blank">
15 - <img class="lazy" data-original="{{image src 185 86}}" style="display: block; opacity: 1;"> 15 + <img src="{{image src 185 86}}">
16 <p class="new-num">上新<span>{{num}}</span></p> 16 <p class="new-num">上新<span>{{num}}</span></p>
17 </a> 17 </a>
18 - </div> 18 + </span>
19 {{/dataList}} 19 {{/dataList}}
20 </div> 20 </div>
21 21
@@ -31,14 +31,14 @@ @@ -31,14 +31,14 @@
31 {{#newBrand}} 31 {{#newBrand}}
32 <div class="newBrand-floor"> 32 <div class="newBrand-floor">
33 {{> common/floor-header}} 33 {{> common/floor-header}}
34 - <div class="swiper-container new-arrival-swiper brand-swiper"> 34 + <div id="brand-swiper" class="swiper-container new-arrival-swiper brand-swiper">
35 <div class="swiper-wrapper"> 35 <div class="swiper-wrapper">
36 {{#brandList}} 36 {{#brandList}}
37 - <div class="swiper-slide"> 37 + <span class="swiper-slide">
38 <a class="" href="{{url}}" target="_blank"> 38 <a class="" href="{{url}}" target="_blank">
39 - <img class="lazy" data-original="{{image src 185 86}}" style="display: block; opacity: 1;"> 39 + <img src="{{image src 185 86}}">
40 </a> 40 </a>
41 - </div> 41 + </span>
42 {{/brandList}} 42 {{/brandList}}
43 </div> 43 </div>
44 44
@@ -18,8 +18,8 @@ module.exports = { @@ -18,8 +18,8 @@ module.exports = {
18 domains: { 18 domains: {
19 favApi: 'http://192.168.102.31:8092/brower', 19 favApi: 'http://192.168.102.31:8092/brower',
20 20
21 - api: 'http://api-test3.yohops.com:9999/',  
22 - service: 'http://service-test3.yohops.com:9999/', 21 + api: 'http://api-test2.yohops.com:9999/',
  22 + service: 'http://service-test2.yohops.com:9999/',
23 23
24 // api: 'http://api.yoho.cn/', 24 // api: 'http://api.yoho.cn/',
25 // service: 'http://service.yoho.cn/', 25 // service: 'http://service.yoho.cn/',
@@ -59,3 +59,23 @@ $('#new-product-floor').on('click', '.catagory-navs li', function() { @@ -59,3 +59,23 @@ $('#new-product-floor').on('click', '.catagory-navs li', function() {
59 } 59 }
60 60
61 }); 61 });
  62 +/*
  63 + * 页面加载完
  64 + */
  65 +$(function() {
  66 + //轮播数量不够隐藏左右箭头
  67 + var $recSwiper = $('#rec-swiper');
  68 + var recNum = $recSwiper.find('.swiper-wrapper > .swiper-slide').length;
  69 +
  70 + if (recNum <= 12) {
  71 + $recSwiper.find('.prev,.next').addClass('hide');
  72 + }
  73 +
  74 + var $brandSwiper = $('#brand-swiper');
  75 + var brandNum = $brandSwiper.find('.swiper-wrapper > .swiper-slide').length;
  76 +
  77 + if (brandNum <= 6) {
  78 + $brandSwiper.find('.prev,.next').addClass('hide');
  79 + }
  80 +});
  81 +
@@ -88,11 +88,11 @@ @@ -88,11 +88,11 @@
88 } 88 }
89 89
90 .slide-switch a.prev { 90 .slide-switch a.prev {
91 - margin-left: -392px; 91 + margin-left: -393px;
92 } 92 }
93 93
94 .slide-switch a.next { 94 .slide-switch a.next {
95 - margin-right: -392px; 95 + margin-right: -393px;
96 } 96 }
97 } 97 }
98 98
@@ -361,6 +361,10 @@ @@ -361,6 +361,10 @@
361 } 361 }
362 } 362 }
363 363
  364 +.new-arrive-latest {
  365 + margin-top: 30px;
  366 +}
  367 +
364 .min-screen { 368 .min-screen {
365 .firstLook-floor { 369 .firstLook-floor {
366 .left-one { 370 .left-one {
@@ -372,11 +376,11 @@ @@ -372,11 +376,11 @@
372 } 376 }
373 377
374 .slide-switch a.prev { 378 .slide-switch a.prev {
375 - margin-left: -328px; 379 + margin-left: -338px;
376 } 380 }
377 381
378 .slide-switch a.next { 382 .slide-switch a.next {
379 - margin-right: -328px; 383 + margin-right: -338px;
380 } 384 }
381 } 385 }
382 386