Authored by unknown

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

1 -<div class="good-info" data-skn="{{skn}}"> 1 +<div class="good-info {{#if goodListLast}}good-list-{{goodListLast}}{{/if}}" data-skn="{{skn}}">
2 <div class="tag-container clearfix"> 2 <div class="tag-container clearfix">
3 {{# tags}} 3 {{# tags}}
4 {{# isNew}} 4 {{# isNew}}
5 - <p class="good-tag new-tag">NEW</p> 5 + <span class="good-tag new-tag">NEW</span>
6 {{/ isNew}} 6 {{/ isNew}}
7 {{# isReNew}} 7 {{# isReNew}}
8 - <p class="good-tag renew-tag">再到着</p> 8 + <span class="good-tag renew-tag">再到着</span>
9 {{/ isReNew}} 9 {{/ isReNew}}
10 {{# isSale}} 10 {{# isSale}}
11 - <p class="good-tag sale-tag">SALE</p> 11 + <span class="good-tag sale-tag">SALE</span>
12 {{/ isSale}} 12 {{/ isSale}}
13 {{# isNewFestival}} 13 {{# isNewFestival}}
14 - <p class="good-tag new-festival-tag">新品节</p> 14 + <span class="good-tag new-festival-tag">新品节</span>
15 {{/ isNewFestival}} 15 {{/ isNewFestival}}
16 {{# isLimit}} 16 {{# isLimit}}
17 - <p class="good-tag limit-tag">限量商品</p> 17 + <span class="good-tag limit-tag">限量商品</span>
18 {{/ isLimit}} 18 {{/ isLimit}}
19 {{# isYearEndPromotion}} 19 {{# isYearEndPromotion}}
20 - <p class="good-tag yep-tag">年终大促</p> 20 + <span class="good-tag yep-tag">年终大促</span>
21 {{/ isYearEndPromotion}} 21 {{/ isYearEndPromotion}}
22 {{# isYearMidPromotion}} 22 {{# isYearMidPromotion}}
23 - <p class="good-tag ymp-tag">年中热促</p> 23 + <span class="good-tag ymp-tag">年中热促</span>
24 {{/ isYearMidPromotion}} 24 {{/ isYearMidPromotion}}
25 {{/ tags}} 25 {{/ tags}}
26 </div> 26 </div>
@@ -24,6 +24,10 @@ var $brandDefault = $('.brand .default'), @@ -24,6 +24,10 @@ var $brandDefault = $('.brand .default'),
24 24
25 var $brandMoreTxt, $brandMoreIcon; 25 var $brandMoreTxt, $brandMoreIcon;
26 26
  27 +//商品相关变量
  28 +var $goodsContainer = $('.goods-container'),
  29 + $goodItem = $goodsContainer.find('.good-info');
  30 +
27 //价格相关变量 31 //价格相关变量
28 var $udPrice = $('.ud-price-range'), 32 var $udPrice = $('.ud-price-range'),
29 interReg = /^\d+$/, 33 interReg = /^\d+$/,
@@ -316,4 +320,52 @@ $('.senior-sub').on('click', '.multi-select', function() { @@ -316,4 +320,52 @@ $('.senior-sub').on('click', '.multi-select', function() {
316 $countChose.slideUp(SLIDETIME); 320 $countChose.slideUp(SLIDETIME);
317 } 321 }
318 }); 322 });
319 -}());  
  323 +}());
  324 +
  325 +
  326 +/*
  327 + * Description: 商品列表移入效果
  328 + * Added by wangchenglong at 2015/12/1
  329 + */
  330 +
  331 +//todo
  332 +$goodItem.hover(function() {
  333 + var $cloneStr,
  334 + $goodItemWrapper,
  335 + activeIndex,
  336 + X,
  337 + left,
  338 + Y,
  339 + top,
  340 + colNum = 5,
  341 + itemW = 222,
  342 + itemH = 400,
  343 + itemMr = 10,
  344 + itemMb = 35;
  345 +
  346 + $('.good-item-wrapper').remove();
  347 +
  348 + activeIndex = $(this).index() + 1;
  349 +
  350 + X = (activeIndex % colNum) === 0 ? colNum : activeIndex % colNum;
  351 + Y = Math.ceil(activeIndex / colNum);
  352 + left = (X - 1) * (itemW + itemMr) + 15 - 21;
  353 + top = (Y - 1) * (itemH + itemMb) - 19;
  354 +
  355 + $cloneStr = $(this).clone();
  356 + $goodItemWrapper =
  357 + '<div class="good-item-wrapper" style="left:' + left + 'px;top:' + top + 'px;position:absolute;">' +
  358 + '<div class="good-select-color">' +
  359 + '</div>' +
  360 + '</div>';
  361 +
  362 +
  363 +
  364 + $goodsContainer.append($goodItemWrapper);
  365 +
  366 + $('.good-item-wrapper').prepend($cloneStr);
  367 +
  368 +}, function() {
  369 +
  370 + //todo
  371 +});
@@ -286,6 +286,100 @@ @@ -286,6 +286,100 @@
286 display: inline; 286 display: inline;
287 } 287 }
288 288
  289 + /*商品列表
  290 + *added by wangchenglong at 2015.12.1
  291 + */
  292 + .goods-container {
  293 + height: auto;
  294 + padding: 0 15px;
  295 + margin-top: 25px;
  296 + position: relative;
  297 +
  298 + /*测试*/
  299 + width: 1150px;
  300 +
  301 + .good-info {
  302 + height: 400px; //todo
  303 + margin-bottom: 35px;
  304 + width: 222px;
  305 + margin-right: 10px;
  306 + float: left;
  307 +
  308 + &.good-list-five {
  309 + margin-right: 0;
  310 + }
  311 +
  312 + /*标签*/
  313 + .tag-container {
  314 + font-size: 12px;
  315 + height: 22px;
  316 + line-height: 22px;
  317 +
  318 + .good-tag {
  319 + padding: 0 7px;
  320 + display: block;
  321 + float: left;
  322 + margin-right: 3px;
  323 +
  324 + &:nth-last-of-type(1) {
  325 + margin-right: 0;
  326 + }
  327 +
  328 + &.new-tag {
  329 + background: #78dc7d;
  330 + color: #fff;
  331 + }
  332 + &.yep-tag, .sale-tag {
  333 + background: #ff565b;
  334 + color: #fff;
  335 + }
  336 + &.limit-tag {
  337 + color: #4e4e4e;
  338 + border: 1px solid #4e4e4e;
  339 + }
  340 + }
  341 + }
  342 +
  343 + /*图片*/
  344 + .good-detail-img {
  345 + width: 100%;
  346 + height: 300px;
  347 +
  348 + .good-thumb, img.lazy {
  349 + display: block;
  350 + overflow: hidden;
  351 + width: 100%;
  352 + height: 100%;
  353 + }
  354 + }
  355 +
  356 + /*文本*/
  357 + .good-detail-text {
  358 + color: #222;
  359 + font-size: 12px;
  360 + text-align: center;
  361 +
  362 + > a {
  363 + margin-top: 16px;
  364 + line-height: 1.5;
  365 + display: block;
  366 + }
  367 +
  368 + > .price {
  369 + margin-top: 10px;
  370 + }
  371 + }
  372 + }
  373 +
  374 + /*弹层*/
  375 + .good-item-wrapper {
  376 + border: 1px solid red;
  377 + padding-left: 20px;
  378 + padding-top: 18px;
  379 + }
  380 + }
  381 + /*商品列表end*/
  382 +
289 .opt-banner { 383 .opt-banner {
290 height: 48px; 384 height: 48px;
291 background: #f5f7f6; 385 background: #f5f7f6;
@@ -302,6 +302,70 @@ class IndexController extends AbstractAction @@ -302,6 +302,70 @@ class IndexController extends AbstractAction
302 'pageCount' => 30, 302 'pageCount' => 30,
303 'nextHref' => 'hello' 303 'nextHref' => 'hello'
304 ) 304 )
  305 + ),
  306 + 'goods' => array(
  307 + 0 => array(
  308 + 'tags' => array(
  309 + 'isNew' => true,
  310 + 'isYearEndPromotion' => true
  311 + ),
  312 + 'url' => 'http://adidas.yohobuy.com/?gender=1,3',
  313 + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  314 + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
  315 + 'salePrice' => '899',
  316 + 'goodListLast' => false
  317 + ),
  318 + 1 => array(
  319 + 'tags' => array(
  320 + 'isNew' => true,
  321 + 'isReNew' => true
  322 + ),
  323 + 'url' => 'http://adidas.yohobuy.com/?gender=1,3',
  324 + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  325 + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
  326 + 'salePrice' => '899',
  327 + 'goodListLast' => false
  328 + ),
  329 + 2 => array(
  330 + 'tags' => array(
  331 + 'isNew' => true,
  332 + 'isReNew' => true
  333 + ),
  334 + 'url' => 'http://adidas.yohobuy.com/?gender=1,3',
  335 + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  336 + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
  337 + 'salePrice' => '899',
  338 + 'goodListLast' => false
  339 + ),
  340 + 3 => array(
  341 + 'url' => 'http://adidas.yohobuy.com/?gender=1,3',
  342 + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  343 + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
  344 + 'salePrice' => '899',
  345 + 'goodListLast' => false
  346 + ),
  347 + 4 => array(
  348 + 'tags' => array(
  349 + 'isNew' => true,
  350 + 'isReNew' => true
  351 + ),
  352 + 'url' => 'http://adidas.yohobuy.com/?gender=1,3',
  353 + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  354 + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
  355 + 'salePrice' => '899',
  356 + 'goodListLast' => 'five'
  357 + ),
  358 + 5 => array(
  359 + 'tags' => array(
  360 + 'isNew' => true,
  361 + 'isReNew' => true
  362 + ),
  363 + 'url' => 'http://adidas.yohobuy.com/?gender=1,3',
  364 + 'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  365 + 'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
  366 + 'salePrice' => '899',
  367 + 'goodListLast' => false
  368 + )
305 ) 369 )
306 ); 370 );
307 $this->_view->display('list', $data); 371 $this->_view->display('list', $data);