Authored by xuqi

latest walk

@@ -144,6 +144,7 @@ @@ -144,6 +144,7 @@
144 </div> 144 </div>
145 </div> 145 </div>
146 {{> product/pager}} 146 {{> product/pager}}
  147 + {{> product/latest-walk}}
147 </div> 148 </div>
148 {{/ brandAbout}} 149 {{/ brandAbout}}
149 </div> 150 </div>
  1 +{{#if latestWalk}}
  2 + <div class="latest-walk">
  3 + <h2>最近浏览的商品</h2>
  4 + <div class="goods clearfix">
  5 + {{# latestWalk}}
  6 + <div class="good">
  7 + <a href="{{href}}">
  8 + <img class="lazy" data-original="{{img}}">
  9 + </a>
  10 + <a class="name" href="{{href}}">{{name}}</a>
  11 + <p class="price">
  12 + {{#if salePrice}}
  13 + <span class="market-price">¥{{marketPrice}}</span>
  14 + {{/if}}
  15 + <span class="sale-price">¥{{salePrice}}</span>
  16 + </p>
  17 + </div>
  18 + {{/ latestWalk}}
  19 + </div>
  20 + </div>
  21 +{{/if}}
@@ -4,8 +4,15 @@ @@ -4,8 +4,15 @@
4 * @date: 2015/11/23 4 * @date: 2015/11/23
5 */ 5 */
6 6
  7 + var $ = require('yoho.jquery'),
  8 + lazyLoad = require('yoho.lazyload');
  9 +
7 require('./filter'); 10 require('./filter');
8 11
9 require('./sort-pager'); 12 require('./sort-pager');
10 13
11 -require('./product');  
  14 +require('./product');
  15 +
  16 +
  17 +//最近浏览的商品Lazyload
  18 +lazyLoad($('.latest-walk .lazy'));
1 -@import "search", "list", "filter-box", "sort-pager", "good"; 1 +@import "search", "list", "filter-box", "sort-pager", "good", "latest-walk";
2 2
3 .product-pager { 3 .product-pager {
4 padding: 20px 0; 4 padding: 20px 0;
5 font-size: 12px; 5 font-size: 12px;
6 color: #6a6a6a; 6 color: #6a6a6a;
7 - border-top: 1px solid #e7e9e8; 7 + border-top: 2px solid #eaeceb;
8 8
9 .pager { 9 .pager {
10 float: right; 10 float: right;
  1 +.latest-walk {
  2 + overflow: hidden;
  3 + border-top: 2px solid #eaeceb;
  4 + font-size: 12px;
  5 +
  6 + h2 {
  7 + padding-top: 15px;
  8 + font-size: 14px;
  9 + }
  10 +
  11 + .goods {
  12 + width: 984px;
  13 + margin: 30px 0;
  14 + }
  15 +
  16 + .good {
  17 + float: left;
  18 + margin-right: 14px;
  19 + }
  20 +
  21 + img {
  22 + display: block;
  23 + width: 150px;
  24 + height: 201px;
  25 + }
  26 +
  27 + .name {
  28 + display: block;
  29 + height: 18px;
  30 + line-height: 18px;
  31 + max-width: 150px;
  32 + margin: 5px 0;
  33 + overflow: hidden;
  34 + text-overflow: ellipsis;
  35 + white-space: nowrap;
  36 + }
  37 +
  38 + .market-price {
  39 + color: #999;
  40 + margin-right: 5px;
  41 + text-decoration: line-through;
  42 + }
  43 +
  44 + .sale-price {
  45 + color: #000;
  46 + font-weight: bold;
  47 + }
  48 +}
@@ -896,7 +896,45 @@ class IndexController extends AbstractAction @@ -896,7 +896,45 @@ class IndexController extends AbstractAction
896 ) 896 )
897 ), 897 ),
898 'totalCount' => '2259', 898 'totalCount' => '2259',
899 - 'pager' => '<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="ifont10">&gt;</span></a>' 899 + 'pager' => '<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="iconfont">&gt;</span></a>',
  900 + 'latestWalk' => array(
  901 + array(
  902 + 'img' => 'http://img11.static.yhbimg.com/goodsimg/2015/08/24/11/018fd5cbe604b37ea35336257fcbff8114.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90',
  903 + 'name' => 'Life·After Life 牛角扣夹棉连帽大衣(M51款)【吴亦凡亲身试着】',
  904 + 'marketPrice' => '939',
  905 + 'salePrice' => '679'
  906 + ),
  907 + array(
  908 + 'img' => 'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90',
  909 + 'name' => 'th:字母撞色毛衣',
  910 + 'marketPrice' => '698',
  911 + 'salePrice' => '209'
  912 + ),
  913 + array(
  914 + 'img' => 'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90',
  915 + 'name' => 'th:字母撞色毛衣',
  916 + 'marketPrice' => '698',
  917 + 'salePrice' => '209'
  918 + ),
  919 + array(
  920 + 'img' => 'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90',
  921 + 'name' => 'th:字母撞色毛衣',
  922 + 'marketPrice' => '698',
  923 + 'salePrice' => '209'
  924 + ),
  925 + array(
  926 + 'img' => 'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90',
  927 + 'name' => 'th:字母撞色毛衣',
  928 + 'marketPrice' => '698',
  929 + 'salePrice' => '209'
  930 + ),
  931 + array(
  932 + 'img' => 'http://img10.static.yhbimg.com/goodsimg/2014/11/05/08/0110a09053658b079265a553ee20a5779d.jpg?imageMogr2/thumbnail/195x260/extent/195x260/background/d2hpdGU=/position/center/quality/90',
  933 + 'name' => 'th:字母撞色毛衣',
  934 + 'marketPrice' => '698',
  935 + 'salePrice' => '209'
  936 + )
  937 + )
900 938
901 ) 939 )
902 ); 940 );