Authored by 李奇

详情页ssr修改

@@ -64,6 +64,8 @@ const component = { @@ -64,6 +64,8 @@ const component = {
64 product.formatPrice = product.format_sales_price !== '0' ? product.format_sales_price : product.format_market_price;//eslint-disable-line 64 product.formatPrice = product.format_sales_price !== '0' ? product.format_sales_price : product.format_market_price;//eslint-disable-line
65 product.isDiscount = product.market_price > product.sales_price; 65 product.isDiscount = product.market_price > product.sales_price;
66 66
  67 + product.coverImage = product.goods_list[0].color_image;
  68 +
67 res.render('pdetail', { 69 res.render('pdetail', {
68 module: 'product', 70 module: 'product',
69 page: 'detail', 71 page: 'detail',
@@ -4,15 +4,11 @@ @@ -4,15 +4,11 @@
4 <div class="ssr show-box first-box"> 4 <div class="ssr show-box first-box">
5 <div class="image-swipe"> 5 <div class="image-swipe">
6 <div class="swipe-wrap"> 6 <div class="swipe-wrap">
7 - <div class="swiper-container swiper-container-horizontal"> 7 + <div class="ssr-swiper-container">
8 <div class="swiper-wrapper"> 8 <div class="swiper-wrapper">
9 - {{#each goods_list}}  
10 - {{#if color_image}}  
11 - <div class="swiper-slide" style="width: 300px;" data-swiper-slide-index="0">  
12 - <img width="100%" src="{{image2 color_image w=580 h=770 q=80}}/interlace/1"> 9 + <div class="ssr-swiper">
  10 + <img width="100%" src="{{image2 coverImage w=580 h=770 q=80}}/interlace/1">
13 </div> 11 </div>
14 - {{/if}}  
15 - {{/each}}  
16 </div> 12 </div>
17 </div> 13 </div>
18 </div> 14 </div>
@@ -25,7 +25,7 @@ yoho.ready(() => { @@ -25,7 +25,7 @@ yoho.ready(() => {
25 if (ssrs) { 25 if (ssrs) {
26 ssrs.remove(); 26 ssrs.remove();
27 } 27 }
28 - }, 500); 28 + }, 100);
29 } 29 }
30 }); 30 });
31 }); 31 });
@@ -112,6 +112,28 @@ @@ -112,6 +112,28 @@
112 }; 112 };
113 </script> 113 </script>
114 <style> 114 <style>
  115 +
  116 +
  117 +#ssr {
  118 + .ssr-swiper-container {
  119 + background-color: #f7f7f7;
  120 + }
  121 + .ssr-swiper {
  122 + width: 620px;
  123 + padding: 0 20px;
  124 + background-color: #fff;
  125 + transform: translateX(590px);
  126 + font-size: 0;
  127 +
  128 + img {
  129 + width: 580px;
  130 + height: 700px;
  131 + }
  132 + }
  133 +}
  134 +
  135 +
  136 +
115 .image-swipe { 137 .image-swipe {
116 overflow: hidden; 138 overflow: hidden;
117 139