Showing
6 changed files
with
215 additions
and
0 deletions
@@ -21,6 +21,33 @@ | @@ -21,6 +21,33 @@ | ||
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | <div class="list-right pull-right"> | 23 | <div class="list-right pull-right"> |
24 | + {{# newMain}} | ||
25 | + <div class="new-banner"> | ||
26 | + <a href="{{bannerHref}}"> | ||
27 | + <img src="{{banner}}"> | ||
28 | + </a> | ||
29 | + </div> | ||
30 | + <div class="new-brands clearfix"> | ||
31 | + <span class="iconfont pre"></span> | ||
32 | + <div class="brands-wrap"> | ||
33 | + <ul class="brands"> | ||
34 | + {{# brands}} | ||
35 | + <li> | ||
36 | + <a href="{{href}}"> | ||
37 | + <img src="{{logo}}"> | ||
38 | + </a> | ||
39 | + </li> | ||
40 | + {{/ brands}} | ||
41 | + </ul> | ||
42 | + </div> | ||
43 | + <span class="iconfont next"></span> | ||
44 | + </div> | ||
45 | + <div class="new-floor-title"> | ||
46 | + <span class="date">{{date}}</span> | ||
47 | + <span class="title">{{title}}</span> | ||
48 | + </div> | ||
49 | + {{/ newMain}} | ||
50 | + | ||
24 | {{> product/standard-content}} | 51 | {{> product/standard-content}} |
25 | </div> | 52 | </div> |
26 | </div> | 53 | </div> |
web-static/img/product/floor-title.png
0 → 100644
1.12 KB
@@ -16,3 +16,53 @@ require('./product'); | @@ -16,3 +16,53 @@ require('./product'); | ||
16 | 16 | ||
17 | //最近浏览的商品Lazyload | 17 | //最近浏览的商品Lazyload |
18 | lazyLoad($('.latest-walk .lazy')); | 18 | lazyLoad($('.latest-walk .lazy')); |
19 | + | ||
20 | +(function() { | ||
21 | + var $brands = $('.brands'); | ||
22 | + | ||
23 | + var wrapWidth, | ||
24 | + $firstBrand, | ||
25 | + totalWidth, | ||
26 | + perWidth; | ||
27 | + | ||
28 | + if ($brands.length === 0) { | ||
29 | + return; | ||
30 | + } | ||
31 | + | ||
32 | + wrapWidth = $('.brands-wrap').width(); | ||
33 | + | ||
34 | + $firstBrand = $brands.children('li:first-child'); | ||
35 | + perWidth = $firstBrand.width() + $firstBrand.css('margin-left').replace('px', '') * 1; | ||
36 | + | ||
37 | + totalWidth = perWidth * $brands.children('li').length; | ||
38 | + | ||
39 | + //针对NEW页面Header的brand banner切换 | ||
40 | + $('.new-brands').on('click', '.pre,.next', function() { | ||
41 | + var $this = $(this), | ||
42 | + left; | ||
43 | + | ||
44 | + left = $brands.css('left'); | ||
45 | + | ||
46 | + if (left === 'auto') { | ||
47 | + left = 0; | ||
48 | + } else { | ||
49 | + left = +left.replace('px', ''); | ||
50 | + } | ||
51 | + | ||
52 | + if (($this).hasClass('pre')) { | ||
53 | + | ||
54 | + //左边界 | ||
55 | + if (left + wrapWidth > 0) { | ||
56 | + return; | ||
57 | + } | ||
58 | + $brands.css('left', left + wrapWidth + 'px'); | ||
59 | + } else { | ||
60 | + | ||
61 | + //右边界 | ||
62 | + if (left - wrapWidth < -totalWidth) { | ||
63 | + return; | ||
64 | + } | ||
65 | + $brands.css('left', left - wrapWidth + 'px'); | ||
66 | + } | ||
67 | + }); | ||
68 | +}()); |
web-static/js/product/new-sale.js
0 → 100644
@@ -28,4 +28,110 @@ | @@ -28,4 +28,110 @@ | ||
28 | border-top: 1px dotted #999; | 28 | border-top: 1px dotted #999; |
29 | } | 29 | } |
30 | } | 30 | } |
31 | + | ||
32 | + .new-banner img { | ||
33 | + display: block; | ||
34 | + width: 100%; | ||
35 | + } | ||
36 | + | ||
37 | + .new-brands { | ||
38 | + position: relative; | ||
39 | + width: 100%; | ||
40 | + margin-top: 25px; | ||
41 | + | ||
42 | + > * { | ||
43 | + float: left; | ||
44 | + } | ||
45 | + | ||
46 | + .pre, .next { | ||
47 | + position: absolute; | ||
48 | + display: block; | ||
49 | + width: 40px; | ||
50 | + height: 40px; | ||
51 | + line-height: 40px; | ||
52 | + color: #fff; | ||
53 | + background: #e0e0e0; | ||
54 | + text-align: center; | ||
55 | + top: 50%; | ||
56 | + margin-top: -20px; | ||
57 | + cursor: pointer; | ||
58 | + | ||
59 | + opacity: 0.8; | ||
60 | + filter: Alpha(opacity=80); | ||
61 | + | ||
62 | + &:hover { | ||
63 | + opacity: 0.9; | ||
64 | + filter: Alpha(opacity=90); | ||
65 | + } | ||
66 | + } | ||
67 | + | ||
68 | + .pre { | ||
69 | + left: 0; | ||
70 | + } | ||
71 | + | ||
72 | + .next { | ||
73 | + right: 0; | ||
74 | + } | ||
75 | + | ||
76 | + .brands-wrap { | ||
77 | + position: relative; | ||
78 | + overflow: hidden; | ||
79 | + width: 890px; | ||
80 | + height: 76px; | ||
81 | + margin-left: 40px; | ||
82 | + } | ||
83 | + | ||
84 | + .brands { | ||
85 | + position: absolute; | ||
86 | + width: auto; | ||
87 | + height: 76px; | ||
88 | + } | ||
89 | + | ||
90 | + .brands li { | ||
91 | + float: left; | ||
92 | + margin-left: 14px; | ||
93 | + | ||
94 | + a { | ||
95 | + display: block; | ||
96 | + width: 164px; | ||
97 | + height: 76px; | ||
98 | + line-height: 76px; | ||
99 | + vertical-align: middle; | ||
100 | + text-align: center; | ||
101 | + } | ||
102 | + | ||
103 | + img { | ||
104 | + vertical-align: middle; | ||
105 | + max-width: 100%; | ||
106 | + max-height: 100%; | ||
107 | + border: none; | ||
108 | + } | ||
109 | + } | ||
110 | + } | ||
111 | + | ||
112 | + .new-floor-title { | ||
113 | + position: relative; | ||
114 | + margin: 35px auto; | ||
115 | + width: 300px; | ||
116 | + height: 31px; | ||
117 | + line-height: 31px; | ||
118 | + font-size: 18px; | ||
119 | + border: 1px solid #000; | ||
120 | + | ||
121 | + .date { | ||
122 | + position: absolute; | ||
123 | + left: -1px; | ||
124 | + top: -1px; | ||
125 | + width: 155px; | ||
126 | + height: 33px; | ||
127 | + color: #fff; | ||
128 | + text-align: center; | ||
129 | + background: image-url('product/floor-title.png'); | ||
130 | + } | ||
131 | + | ||
132 | + .title { | ||
133 | + float: right; | ||
134 | + margin-right: 40px; | ||
135 | + } | ||
136 | + } | ||
31 | } | 137 | } |
@@ -958,6 +958,7 @@ class IndexController extends AbstractAction | @@ -958,6 +958,7 @@ class IndexController extends AbstractAction | ||
958 | public function newSaleAction() | 958 | public function newSaleAction() |
959 | { | 959 | { |
960 | $data = array( | 960 | $data = array( |
961 | + 'productListPage' => true, | ||
961 | 'newSale' => array( | 962 | 'newSale' => array( |
962 | 'banner' => array( | 963 | 'banner' => array( |
963 | 'bannerHeight' => 350, | 964 | 'bannerHeight' => 350, |
@@ -966,6 +967,36 @@ class IndexController extends AbstractAction | @@ -966,6 +967,36 @@ class IndexController extends AbstractAction | ||
966 | 'title' => array( | 967 | 'title' => array( |
967 | 'name' => '全部商品', | 968 | 'name' => '全部商品', |
968 | 'count' => 540 | 969 | 'count' => 540 |
970 | + ), | ||
971 | + 'newMain' => array( | ||
972 | + 'banner' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/23/07/010a459d41b99a839cba9377532f1c19b2.jpg?imageView/3/w/970/h/200', | ||
973 | + 'date' => '12月16日', | ||
974 | + 'title' => '新品到着', | ||
975 | + 'brands' => array( | ||
976 | + array( | ||
977 | + 'href' => '', | ||
978 | + 'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/02/28/15/02b2b5ded161ab31e2e097a327ed475052.jpg?imageView/2/w/170/h/120' | ||
979 | + ), | ||
980 | + array( | ||
981 | + 'href' => '', | ||
982 | + 'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/11/09/09/023721f44182f775d79904010af421331e.jpg?imageView/2/w/170/h/120' | ||
983 | + ), | ||
984 | + array( | ||
985 | + 'href' => '', | ||
986 | + 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2012/12/13/17/01408fb72646c8f3fa59d870514f08a356.jpg?imageView/2/w/170/h/120' | ||
987 | + ), | ||
988 | + array( | ||
989 | + 'href' => '', | ||
990 | + 'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/12/24/13/0265b45e37af697c5ba12d5415fb341f27.jpg?imageView/2/w/170/h/120' | ||
991 | + ), | ||
992 | + array( | ||
993 | + 'href' => '', | ||
994 | + 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/11/15/012d09a5cae187af1f6f3ed246b9b5a4fc.jpg?imageView/2/w/170/h/120' | ||
995 | + ), | ||
996 | + array( | ||
997 | + 'href' => '', | ||
998 | + 'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/20/16/01047ffb3ca182871821d551af31ac2378.jpg?imageView/2/w/170/h/120' | ||
999 | + ) | ||
969 | ) | 1000 | ) |
970 | ), | 1001 | ), |
971 | 'filters' => array( | 1002 | 'filters' => array( |
@@ -1318,6 +1349,7 @@ class IndexController extends AbstractAction | @@ -1318,6 +1349,7 @@ class IndexController extends AbstractAction | ||
1318 | ), | 1349 | ), |
1319 | 'totalCount' => '2259', | 1350 | 'totalCount' => '2259', |
1320 | 'pager' => '<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="iconfont">></span></a>' | 1351 | 'pager' => '<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="iconfont">></span></a>' |
1352 | + ) | ||
1321 | ); | 1353 | ); |
1322 | 1354 | ||
1323 | $this->_view->display('new-sale', $data); | 1355 | $this->_view->display('new-sale', $data); |
-
Please register or login to post a comment