Authored by zhangxiaoru

editorial

@@ -69,14 +69,16 @@ @@ -69,14 +69,16 @@
69 </div> 69 </div>
70 </div> 70 </div>
71 </div> 71 </div>
72 -  
73 - <div class="related-goods goods">  
74 - {{# relatedGroup}}  
75 - {{> related-goods}}  
76 - {{/ relatedGroup}}  
77 - <span class="left iconfont">&#xe62c;</span>  
78 - <span class="right iconfont">&#xe629;</span> 72 +
  73 + <div class="related-groups">
  74 + <div class="related-goods goods">
  75 + {{# relatedGroup}}
  76 + {{> related-goods}}
  77 + {{/ relatedGroup}}
  78 + </div>
79 </div> 79 </div>
  80 + <span class="left iconfont hide">&#xe62c;</span>
  81 + <span class="right iconfont">&#xe629;</span>
80 </div> 82 </div>
81 {{/ related}} 83 {{/ related}}
82 {{/ content}} 84 {{/ content}}
@@ -107,22 +109,22 @@ @@ -107,22 +109,22 @@
107 </div> 109 </div>
108 110
109 {{# userInfo}} 111 {{# userInfo}}
110 - <div class="user-handle">  
111 - <ul class="clearfix">  
112 - <li id="prise-btn" class="like-status{{# isLike}} liked{{/ isLike}}">  
113 - <a href="javascript:;">  
114 - <i class="iconfont">&#xe60e;</i>  
115 - <span class="like-num">{{likeNum}}</span>  
116 - </a>  
117 - </li>  
118 - <li id="collect-btn" class="sort-collect{{# isCollected}} collected{{/ isCollected}}">  
119 - <a href="javascript:;">  
120 - <i class="iconfont">&#xe619;</i>  
121 - <span>收藏</span>  
122 - </a>  
123 - </li>  
124 - </ul>  
125 - </div> 112 + <div class="user-handle">
  113 + <ul class="clearfix">
  114 + <li id="prise-btn" class="like-status{{# isLike}} liked{{/ isLike}}">
  115 + <a href="javascript:;">
  116 + <i class="iconfont">&#xe60e;</i>
  117 + <span class="like-num">{{likeNum}}</span>
  118 + </a>
  119 + </li>
  120 + <li id="collect-btn" class="sort-collect{{# isCollected}} collected{{/ isCollected}}">
  121 + <a href="javascript:;">
  122 + <i class="iconfont">&#xe619;</i>
  123 + <span>收藏</span>
  124 + </a>
  125 + </li>
  126 + </ul>
  127 + </div>
126 {{/ userInfo}} 128 {{/ userInfo}}
127 129
128 {{> share}} 130 {{> share}}
@@ -17,9 +17,12 @@ var $commentList = $commentArea.find('.comments-wrap'), @@ -17,9 +17,12 @@ var $commentList = $commentArea.find('.comments-wrap'),
17 MAX_COMMENTS_WORDS = 100, 17 MAX_COMMENTS_WORDS = 100,
18 $wordCountTip = $('#word-count-tip'), 18 $wordCountTip = $('#word-count-tip'),
19 _alert = dialog.Alert, 19 _alert = dialog.Alert,
20 - tag = $('#tags').find('li').length; 20 + tag = $('#tags').find('li').length,
  21 + len = $('.goods').find('.good-info').length / 4,
  22 + pag = 0;
21 23
22 require('../plugins/share'); 24 require('../plugins/share');
  25 +//require('yoho-unslider');
23 26
24 $('#prise-btn').click(function() { 27 $('#prise-btn').click(function() {
25 var prising = false, 28 var prising = false,
@@ -192,10 +195,35 @@ if ($('.collocation').find('.good-info').length === 0) { @@ -192,10 +195,35 @@ if ($('.collocation').find('.good-info').length === 0) {
192 195
193 if ($('.goods').find('.good-info').length === 0) { 196 if ($('.goods').find('.good-info').length === 0) {
194 $('.related-group').hide(); 197 $('.related-group').hide();
  198 +} else if ($('.goods').find('.good-info').length < 5) {
  199 + $('.left').hide();
  200 + $('.right').hide();
195 } 201 }
196 202
197 -// $('.left').click(function {  
198 -// $('.goods').animate({ left: '+50px' }, "slow");  
199 -// }) 203 +$('.right').click(function() {
  204 + pag = pag + 1;
200 205
201 -// console.log($('.goods').offsetWidth() 206 + if (pag === len -1 ) {
  207 + $('.right').addClass('hide');
  208 + }
  209 +
  210 + if (pag !== 0 ) {
  211 + $('.left').removeClass('hide');
  212 + }
  213 +
  214 + $('.goods').animate({left: '+=' + '-930px'});
  215 +})
  216 +
  217 +$('.left').click(function() {
  218 + pag = pag - 1;
  219 +
  220 + if (pag === 0) {
  221 + $('.left').addClass('hide');
  222 + }
  223 +
  224 + if(pag !== len -1) {
  225 + $('.right').removeClass('hide');
  226 + }
  227 +
  228 + $(".goods").animate({left: '+=' + '930px'});
  229 +})
@@ -98,6 +98,10 @@ @@ -98,6 +98,10 @@
98 overflow: hidden; 98 overflow: hidden;
99 position: relative; 99 position: relative;
100 100
  101 + .collocation {
  102 + margin-left: 30px;
  103 + }
  104 +
101 .btn { 105 .btn {
102 position: relative; 106 position: relative;
103 } 107 }
@@ -137,8 +141,21 @@ @@ -137,8 +141,21 @@
137 } 141 }
138 } 142 }
139 143
  144 + .related-group {
  145 + position: relative;
  146 + height: 450px;
  147 + }
  148 +
  149 + .related-groups {
  150 + width: 930px;
  151 + overflow: hidden;
  152 + position: relative;
  153 + height: 420px;
  154 + margin-left: 30px;
  155 + }
  156 +
140 .related-goods { 157 .related-goods {
141 - padding: 60px 0 0 30px; 158 + padding-top: 60px;
142 159
143 .good-info { 160 .good-info {
144 width: 219px; 161 width: 219px;
@@ -173,6 +190,11 @@ @@ -173,6 +190,11 @@
173 .goods { 190 .goods {
174 height: 420px; 191 height: 420px;
175 overflow: hidden; 192 overflow: hidden;
  193 + position: absolute;
  194 +
  195 + .good-info:nth-child(4n) {
  196 + margin-right: 0;
  197 + }
176 } 198 }
177 199
178 .related-brand { 200 .related-brand {
@@ -500,4 +522,8 @@ @@ -500,4 +522,8 @@
500 padding-left: 30px; 522 padding-left: 30px;
501 width: 330px; 523 width: 330px;
502 } 524 }
  525 +
  526 + .hide {
  527 + display: none;
  528 + }
503 } 529 }