Authored by lore-w

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

Conflicts:
	framework
@@ -13,9 +13,9 @@ var goodsSwiper, @@ -13,9 +13,9 @@ var goodsSwiper,
13 // winH = $(window).height(), 13 // winH = $(window).height(),
14 sizeSwiper, 14 sizeSwiper,
15 refSwiper, 15 refSwiper,
  16 + commentsNum,
16 handleHelper; 17 handleHelper;
17 18
18 -  
19 lazyLoad($('img.lazy')); 19 lazyLoad($('img.lazy'));
20 20
21 goodsSwiper = new Swiper('.banner-swiper', { 21 goodsSwiper = new Swiper('.banner-swiper', {
@@ -28,22 +28,56 @@ goodsSwiper = new Swiper('.banner-swiper', { @@ -28,22 +28,56 @@ goodsSwiper = new Swiper('.banner-swiper', {
28 prevButton: '.my-swiper-button-prev' 28 prevButton: '.my-swiper-button-prev'
29 }); 29 });
30 30
  31 +//初始化tab
  32 +(function() {
  33 + var consultsNum = $('#nav-tab .consults-num').html() - 0;
31 34
32 -$('#nav-tab li').on('click', function() {  
33 - var index = $(this).index();  
34 35
  36 + commentsNum = $('#nav-tab .comments-num').html() - 0;
35 37
36 - if (!$(this).hasClass('focus')) { 38 + $('#nav-tab li').each(function() {
  39 + $(this).removeClass('focus');
  40 + });
  41 +
  42 + $('#feedback-content .content').each(function() {
  43 + $(this).addClass('hide');
  44 + });
  45 + if (0 !== commentsNum) {
  46 + $('#nav-tab .comment-nav').addClass('focus');
  47 + $('#feedback-content .comment-content').removeClass('hide');
  48 +
  49 + } else if (0 !== consultsNum) {
  50 + $('#nav-tab .consult-nav').addClass('focus');
  51 + $('#feedback-content .consult-content').removeClass('hide');
  52 + }
  53 +})();
37 54
38 - $('#nav-tab li').each(function() {  
39 - $(this).removeClass('focus');  
40 - });  
41 - $('#feedback-content .content').each(function() {  
42 - $(this).addClass('hide');  
43 - }); 55 +$('#nav-tab li').on('click', function() {
  56 + var index = $(this).index();
  57 +
  58 + if ($(this).hasClass('comment-nav') && 0 === commentsNum) {
  59 + alert('暂无商品评价');
  60 + } else {
  61 + if (!$(this).hasClass('focus')) {
  62 +
  63 + $('#nav-tab li').each(function() {
  64 + $(this).removeClass('focus');
  65 + });
  66 + $('#feedback-content .content').each(function() {
  67 + $(this).addClass('hide');
  68 + });
  69 +
  70 + $(this).addClass('focus');
  71 + $('#feedback-content .content:eq(' + index + ')').removeClass('hide');
  72 + }
  73 + }
  74 +});
44 75
45 - $(this).addClass('focus');  
46 - $('#feedback-content .content:eq(' + index + ')').removeClass('hide'); 76 +$('.goodsDiscount .dropdown').on('click', function() {
  77 + if ($('.goodsDiscount .discount-folder').is(':hidden')) {
  78 + $('.goodsDiscount .discount-folder').slideDown();
  79 + } else {
  80 + $('.goodsDiscount .discount-folder').slideUp();
47 } 81 }
48 }); 82 });
49 83
@@ -9,9 +9,10 @@ var Swiper = require('yoho.iswiper'); @@ -9,9 +9,10 @@ var Swiper = require('yoho.iswiper');
9 9
10 var recommendSwiper; 10 var recommendSwiper;
11 11
12 -recommendSwiper = new Swiper('.swiper-recommend', {  
13 -  
14 - // lazyLoading: true,  
15 - // lazyLoadingInPrevNext: true,  
16 - slidesPerView: 'auto' 12 +recommendSwiper = new Swiper('#swiper-recommend', {
  13 + slidesPerView: 'auto',
  14 + grabCursor: true,
  15 + slideElement: 'li',
  16 + lazyLoading: true,
  17 + watchSlidesVisibility: true
17 }); 18 });
@@ -12,25 +12,28 @@ @@ -12,25 +12,28 @@
12 font-weight: bold; 12 font-weight: bold;
13 } 13 }
14 14
15 - .swiper-recommend { 15 + .swiper-container {
16 padding: pxToRem(20px) 0; 16 padding: pxToRem(20px) 0;
17 width: 100%; 17 width: 100%;
  18 + height: pxToRem(252px);
18 overflow: hidden; 19 overflow: hidden;
19 20
20 - .swiper-slider {  
21 - margin: 0 pxToRem(10px); 21 + .swiper-slide {
  22 + padding: 0 pxToRem(10px);
  23 + float: left;
  24 + width: pxToRem(156px);
22 25
23 &:first-child { 26 &:first-child {
24 - margin-left: pxToRem(30px); 27 + padding-left: pxToRem(30px);
25 } 28 }
26 29
27 &:last-child { 30 &:last-child {
28 - margin-right: pxToRem(30px); 31 + padding-right: pxToRem(30px);
29 } 32 }
30 33
31 img { 34 img {
32 - width: pxToRem(156px);  
33 - max-width: none; 35 + width: 100%;
  36 + height: pxToRem(208px);
34 } 37 }
35 } 38 }
36 } 39 }
@@ -42,19 +45,21 @@ @@ -42,19 +45,21 @@
42 line-height: 1; 45 line-height: 1;
43 46
44 span { 47 span {
  48 + display: block;
45 // chrome 最小支持12px, 设计图是 10px ,用CSS3变换 49 // chrome 最小支持12px, 设计图是 10px ,用CSS3变换
46 @include transform(scale(0.875)); 50 @include transform(scale(0.875));
47 } 51 }
48 52
49 .sale-price { 53 .sale-price {
50 color: #d9134f; 54 color: #d9134f;
  55 + margin-left: pxToRem(-10px);
51 } 56 }
52 57
53 .old-price { 58 .old-price {
54 position: absolute; 59 position: absolute;
55 top: 0; 60 top: 0;
56 - right: 0;  
57 - color: #ededed; 61 + right: pxToRem(-6px);
  62 + color: #b0b0b0;
58 } 63 }
59 64
60 .no-price { 65 .no-price {
@@ -95,7 +95,9 @@ @@ -95,7 +95,9 @@
95 <span class="iconfont num">&#xe604;</span> 95 <span class="iconfont num">&#xe604;</span>
96 </a> 96 </a>
97 </div> 97 </div>
98 - 98 +
  99 + {{#isLogin}}
99 {{> product/recommend-for-you}} 100 {{> product/recommend-for-you}}
  101 + {{/isLogin}}
100 </div> 102 </div>
101 {{> layout/footer}} 103 {{> layout/footer}}
@@ -43,7 +43,15 @@ @@ -43,7 +43,15 @@
43 43
44 {{#goodsDiscount}} 44 {{#goodsDiscount}}
45 <div class="goodsDiscount"> 45 <div class="goodsDiscount">
46 - <h1>{{.}}<span class="iconfont">&#xe609;</span></h1> 46 + {{#each list}}
  47 + {{#if @first}}
  48 + <h1>{{this}}<span class="iconfont dropdown">&#xe609;</span></h1>
  49 + <div class="discount-folder">
  50 + {{else}}
  51 + <h1 class="folder-item">{{this}}</h1>
  52 + {{/if}}
  53 + {{/list}}
  54 + </div>
47 </div> 55 </div>
48 {{/goodsDiscount}} 56 {{/goodsDiscount}}
49 57
@@ -57,8 +65,8 @@ @@ -57,8 +65,8 @@
57 {{else}} 65 {{else}}
58 66
59 <ul id="nav-tab" class="nav-tab clearfix"> 67 <ul id="nav-tab" class="nav-tab clearfix">
60 - <li class="comment-nav focus">{{commentName}}({{commentsNum}})</li>  
61 - <li class="consult-nav">{{consultName}}({{consultsNum}})</li> 68 + <li class="comment-nav">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li>
  69 + <li class="consult-nav">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
62 </ul> 70 </ul>
63 <div id="feedback-content" > 71 <div id="feedback-content" >
64 72
@@ -189,7 +197,7 @@ @@ -189,7 +197,7 @@
189 <div class="swiper-container detail-swiper" id="size-swiper-container"> 197 <div class="swiper-container detail-swiper" id="size-swiper-container">
190 <div class="swiper-wrapper"> 198 <div class="swiper-wrapper">
191 {{#list}} 199 {{#list}}
192 - <div class="swiper-slide blue-slide" > 200 + <div class="swiper-slide " >
193 <div class="size-name cell">{{name}}</div> 201 <div class="size-name cell">{{name}}</div>
194 <div class="size-m cell">{{sizem}}</div> 202 <div class="size-m cell">{{sizem}}</div>
195 <div class="size-xl cell">{{sizexl}}</div> 203 <div class="size-xl cell">{{sizexl}}</div>
@@ -303,7 +311,11 @@ @@ -303,7 +311,11 @@
303 <div class="cart-bar"> 311 <div class="cart-bar">
304 <span class="num-tag">{{numInCart}}</span> 312 <span class="num-tag">{{numInCart}}</span>
305 <a href="" class="num-incart iconfont">&#xe62c;</a> 313 <a href="" class="num-incart iconfont">&#xe62c;</a>
  314 + {{#if goodsInstore}}
306 <a href="" class="addto-cart ">加入购物车</a> 315 <a href="" class="addto-cart ">加入购物车</a>
  316 + {{else}}
  317 + <a href="" class="sold-out">已售罄</a>
  318 + {{/if}}
307 <a href="" class="favorite iconfont">&#xe605;</a> 319 <a href="" class="favorite iconfont">&#xe605;</a>
308 </div> 320 </div>
309 {{/cartInfo}} 321 {{/cartInfo}}
@@ -16,6 +16,6 @@ @@ -16,6 +16,6 @@
16 </div> 16 </div>
17 17
18 <!-- 如果需要导航按钮 --> 18 <!-- 如果需要导航按钮 -->
19 - <div class="swiper-button-prev swiper-button-grey"></div>  
20 - <div class="swiper-button-next swiper-button-grey"></div> 19 + <div class="swiper-button-prev prev-grey"></div>
  20 + <div class="swiper-button-next next-grey"></div>
21 </div> 21 </div>
1 {{# recommendForYou}} 1 {{# recommendForYou}}
2 <div class="recommend-for-you"> 2 <div class="recommend-for-you">
3 <div class="title">为您优选新品</div> 3 <div class="title">为您优选新品</div>
4 - <div class="swiper-recommend">  
5 - <ul class="swiper-wrapper"> 4 + <div id="swiper-recommend" class="swiper-container">
  5 + <ul class="swiper-wrapper swiper-wrapper-recommend">
6 {{#recommendList}} 6 {{#recommendList}}
7 - <li class="swiper-slider">  
8 - <img class="img-box" src="{{thumb}}"> 7 + <li class="swiper-slide">
  8 + <img class="swiper-lazy img-box" data-src="{{thumb}}">
9 <div class="price"> 9 <div class="price">
10 <span class="sale-price {{^price}}no-price{{/price}}"{{salePrice}}</span> 10 <span class="sale-price {{^price}}no-price{{/price}}"{{salePrice}}</span>
11 {{#price}}<span class="old-price"{{.}}</span>{{/price}} 11 {{#price}}<span class="old-price"{{.}}</span>{{/price}}
12 </div> 12 </div>
  13 + <div class="swiper-lazy-preloader"></div>
13 </li> 14 </li>
14 {{/recommendList}} 15 {{/recommendList}}
15 </ul> 16 </ul>
@@ -423,13 +423,13 @@ class UserModel @@ -423,13 +423,13 @@ class UserModel
423 423
424 // 调用接口获取地址数据 424 // 调用接口获取地址数据
425 $suggest = UserData::suggestData($udid, $page, $limit); 425 $suggest = UserData::suggestData($udid, $page, $limit);
426 - //print_r($suggest);  
427 426
428 // 处理意见反馈数据 427 // 处理意见反馈数据
429 if (isset($suggest['data']) && !empty($suggest['data'])) { 428 if (isset($suggest['data']) && !empty($suggest['data'])) {
430 $one = array(); 429 $one = array();
431 foreach ($suggest['data']['list'] as $val) { 430 foreach ($suggest['data']['list'] as $val) {
432 $one = array(); 431 $one = array();
  432 + $one['suggest_id'] = $val['id'];
433 $one['imgUrl'] = Helpers::getImageUrl($val['cover_image'], 640, 240); 433 $one['imgUrl'] = Helpers::getImageUrl($val['cover_image'], 640, 240);
434 $one['title'] = $val['filter_content']; 434 $one['title'] = $val['filter_content'];
435 $one['content'] = $val['reply_content']; 435 $one['content'] = $val['reply_content'];
@@ -13,10 +13,6 @@ class DetailController extends AbstractAction @@ -13,10 +13,6 @@ class DetailController extends AbstractAction
13 */ 13 */
14 public function indexAction() 14 public function indexAction()
15 { 15 {
16 - $commentsNum = 0;  
17 - $consultsNum = 0;  
18 - $nodate =0;  
19 -  
20 $data = array ( 16 $data = array (
21 'goodsDetailPage' => true, 17 'goodsDetailPage' => true,
22 'pageHeader' => array ( 18 'pageHeader' => array (
@@ -68,16 +64,21 @@ SHOE BQT KEN BLOCK', @@ -68,16 +64,21 @@ SHOE BQT KEN BLOCK',
68 ) 64 )
69 ) 65 )
70 ), 66 ),
71 - 'goodsDiscount'=>'【summer final sale】满¥499立享6.8折', 67 + 'goodsDiscount'=>array(
  68 + 'list'=>array(
  69 + '【summer final sale】满¥499立享6.8折',
  70 + '【BACK TO SCHOOL】满¥499赠送Paul
  71 + Franke帽子一个,多买多送!',
  72 + '【BACK TO SCHOOL】满¥499赠送Paul
  73 + Franke帽子一个,多买多送!'
  74 + )
  75 + ),
72 'feedbacks'=>array( 76 'feedbacks'=>array(
73 'commentsNum'=>0, 77 'commentsNum'=>0,
74 - 'consultsNum'=>0,  
75 - 'nodata' =>0,  
76 - 'commentName'=>'商品评价',  
77 - 'consultName' =>'购买咨询',  
78 - 'moreComments'=>'http://www.baidu.com',  
79 - 'moreConsults'=>'http://www.baidu.com',  
80 - 'gotoConsults'=>'http://www.baidu.com', 78 + 'consultsNum'=>1,
  79 + // 'commentName'=>'商品评价',
  80 + // 'consultName' =>'购买咨询',
  81 + 'link'=>'',
81 'comments'=>array( 82 'comments'=>array(
82 array( 83 array(
83 'userName'=>'Lynnic', 84 'userName'=>'Lynnic',
@@ -233,7 +234,8 @@ SHOE BQT KEN BLOCK', @@ -233,7 +234,8 @@ SHOE BQT KEN BLOCK',
233 ), 234 ),
234 235
235 'cartInfo' =>array( 236 'cartInfo' =>array(
236 - 'numInCart' => 3 237 + 'numInCart' => 3,
  238 + 'goodsInstore'=>0
237 ) 239 )
238 240
239 ); 241 );
@@ -247,6 +249,7 @@ SHOE BQT KEN BLOCK', @@ -247,6 +249,7 @@ SHOE BQT KEN BLOCK',
247 249
248 public function commentsAction(){ 250 public function commentsAction(){
249 $data = array( 251 $data = array(
  252 +
250 'goodsCommentsPage' =>true, 253 'goodsCommentsPage' =>true,
251 'pageHeader' => array ( 254 'pageHeader' => array (
252 'navBack' => 'sss ', 255 'navBack' => 'sss ',