Authored by 毕凯

SALE 页面banner and 活动入口

1 {{> layout/header}} 1 {{> layout/header}}
2 -<div class="sale-page yoho-page">  
3 - <h1>折扣页面</h1> 2 +<div class="sale-page yoho-page center-content">
  3 + {{#topBanner}}
  4 + {{> index/slide-banner}}
  5 + {{/topBanner}}
  6 +
  7 + {{> sale/activity-entry}}
4 </div> 8 </div>
5 {{> layout/footer}} 9 {{> layout/footer}}
1 <div class="slide-container {{#if pagination}}slide-thumb-container{{/if}}"> 1 <div class="slide-container {{#if pagination}}slide-thumb-container{{/if}}">
2 - <div class="slide-wrapper"> 2 + <div class="slide-wrapper">
3 <ul> 3 <ul>
4 {{# list}} 4 {{# list}}
5 - <li style="background:{{bgColor}}"> 5 + <li style="{{#if bgColor}}background:{{bgColor}}{{/if}}">
6 <a href="{{href}}" target= "_blank"> 6 <a href="{{href}}" target= "_blank">
7 <img class="lazy" data-original="{{img}}" alt=""> 7 <img class="lazy" data-original="{{img}}" alt="">
8 </a> 8 </a>
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 </div> 13 </div>
14 {{/ tips}} 14 {{/ tips}}
15 </li> 15 </li>
16 - {{/ list}} 16 + {{/ list}}
17 </ul> 17 </ul>
18 <div class="slide-switch"> 18 <div class="slide-switch">
19 <a class="prev" href="javascript:;"> 19 <a class="prev" href="javascript:;">
@@ -31,11 +31,11 @@ @@ -31,11 +31,11 @@
31 {{# pagination}} 31 {{# pagination}}
32 <li> 32 <li>
33 <a href="{{href}}" target="_blank"></a> 33 <a href="{{href}}" target="_blank"></a>
34 - <img src="{{img}}" alt=""> 34 + <img src="{{img}}" alt="">
35 </li> 35 </li>
36 {{/ pagination}} 36 {{/ pagination}}
37 </ul> 37 </ul>
38 </div> 38 </div>
39 {{/if}} 39 {{/if}}
40 </div> 40 </div>
41 -<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>  
  41 +<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>
@@ -68,6 +68,13 @@ @@ -68,6 +68,13 @@
68 </script> 68 </script>
69 {{/if}} 69 {{/if}}
70 70
  71 +{{!-- SALE --}}
  72 +{{#if saleIndexPage}}
  73 + <script>
  74 + seajs.use('js/sale/index');
  75 + </script>
  76 +{{/if}}
  77 +
71 {{!-- 登录注册找回密码--}} 78 {{!-- 登录注册找回密码--}}
72 {{#if loginPage}} 79 {{#if loginPage}}
73 <script> 80 <script>
  1 +<div class="activity-entry clearfix">
  2 + {{#activityEnter}}
  3 + <a class="entry-item pull-left {{#if @first}}first{{/if}} {{#if @last}}last{{/if}}" href="link">
  4 + <img class="icon pull-left" src="{{icon}}">
  5 + <div class="entry-text">
  6 + <span class="title">{{title}}</span>
  7 + <p class="desc">{{desc}}</p>
  8 + </div>
  9 + </a>
  10 + {{/activityEnter}}
  11 +</div>
  1 +/**
  2 + * 首页
  3 + * @author: bikai<kia.bi@yoho.cn>
  4 + * @date: 2016/1/18
  5 + */
  6 +
  7 +var $ = require('yoho.jquery'),
  8 + lazyLoad = require('yoho.lazyload');
  9 +
  10 +require('../common/slider');
  11 +
  12 +lazyLoad($('img.lazy'));
  13 +$('.slide-container').slider();
1 @charset "utf-8"; 1 @charset "utf-8";
2 2
3 -@import "compass", 3 +@import "compass",
4 "compass/reset", 4 "compass/reset",
5 "header", 5 "header",
6 "footer", 6 "footer",
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 "pager"; 9 "pager";
10 10
11 body { 11 body {
12 - font-family: arial,"Microsoft YaHei"; 12 + font-family: arial,"Microsoft YaHei";
13 } 13 }
14 14
15 @font-face { 15 @font-face {
@@ -38,10 +38,10 @@ body { @@ -38,10 +38,10 @@ body {
38 } 38 }
39 39
40 .clearfix:after { 40 .clearfix:after {
41 - clear: both; 41 + clear: both;
42 } 42 }
43 43
44 -.clearfix { 44 +.clearfix {
45 *zoom: 1; 45 *zoom: 1;
46 } 46 }
47 47
@@ -86,4 +86,4 @@ input,textarea { @@ -86,4 +86,4 @@ input,textarea {
86 } 86 }
87 } 87 }
88 88
89 -@import "home/index", "product/index", "guang/index", "passport/index", "error","order/index"; 89 +@import "home/index", "product/index", "guang/index", "passport/index", "error", "order/index", "sale/index";
  1 +.sale-page {
  2 + margin-top: 10px;
  3 +
  4 + .slide-container {
  5 + position: relative;
  6 + height: 450px;
  7 + overflow: hidden;
  8 + }
  9 +
  10 + .activity-entry {
  11 + margin: 10px 0;
  12 +
  13 + .entry-item {
  14 + display: block;
  15 + width: 377px;
  16 + margin-right: 10px;
  17 + padding: 24px 0;
  18 + background: #f5f5f5;
  19 +
  20 + &.first,
  21 + &.last {
  22 + width: 376px;
  23 + }
  24 +
  25 + &.last {
  26 + margin-right: 0;
  27 + }
  28 + }
  29 +
  30 + .entry-text {
  31 + padding-left: 160px;
  32 + font-size: 16px;
  33 + }
  34 +
  35 + .icon {
  36 + width: 72px;
  37 + height: 72px;
  38 + margin-left: 48px;
  39 + }
  40 +
  41 + .title {
  42 + font-size: 26px;
  43 + font-weight: bold;
  44 + line-height: 48px;
  45 + }
  46 + }
  47 +}
1 <?php 1 <?php
2 /** 2 /**
3 * 启动运行 3 * 启动运行
4 - * 4 + *
5 * @name Bootstrap 5 * @name Bootstrap
6 * @author fei.hong 6 * @author fei.hong
7 * @desc 所有在Bootstrap类中, 以_init开头的方法, 都会被Yaf调用, 7 * @desc 所有在Bootstrap类中, 以_init开头的方法, 都会被Yaf调用,
@@ -54,7 +54,7 @@ class Bootstrap extends Bootstrap_Abstract @@ -54,7 +54,7 @@ class Bootstrap extends Bootstrap_Abstract
54 // */ 54 // */
55 // public function _initPlugin(Dispatcher $dispatcher) 55 // public function _initPlugin(Dispatcher $dispatcher)
56 // { 56 // {
57 -// 57 +//
58 // } 58 // }
59 59
60 /** 60 /**
@@ -77,6 +77,7 @@ class Bootstrap extends Bootstrap_Abstract @@ -77,6 +77,7 @@ class Bootstrap extends Bootstrap_Abstract
77 case 'www': // 主站 77 case 'www': // 主站
78 case 'new': // 原新版 78 case 'new': // 原新版
79 case 'dev': // 开发环境 79 case 'dev': // 开发环境
  80 + case 'web':
80 break; 81 break;
81 case 'search': // 搜索 82 case 'search': // 搜索
82 $searchRequest = new Yaf\Request\Http('/product/search/index'); 83 $searchRequest = new Yaf\Request\Http('/product/search/index');
@@ -129,7 +130,7 @@ class Bootstrap extends Bootstrap_Abstract @@ -129,7 +130,7 @@ class Bootstrap extends Bootstrap_Abstract
129 $layout = new TemplateLayout(); 130 $layout = new TemplateLayout();
130 $layout->setScriptPath($this->_config->application->template->path); 131 $layout->setScriptPath($this->_config->application->template->path);
131 $dispatcher->setView($layout); 132 $dispatcher->setView($layout);
132 - //} 133 + //}
133 } 134 }
134 135
135 // /** 136 // /**
@@ -18,4 +18,4 @@ class LifestyleController extends WebAction @@ -18,4 +18,4 @@ class LifestyleController extends WebAction
18 ); 18 );
19 $this->_view->display('index', $data); 19 $this->_view->display('index', $data);
20 } 20 }
21 -}  
  21 +}
@@ -2,16 +2,57 @@ @@ -2,16 +2,57 @@
2 // 前端开发添加的路由,对应需求 http://redmine.yoho.cn/issues/143, 后端开发完删除 2 // 前端开发添加的路由,对应需求 http://redmine.yoho.cn/issues/143, 后端开发完删除
3 // 首页 毕凯,赵彪 3 // 首页 毕凯,赵彪
4 // 列表页 王成龙 4 // 列表页 王成龙
5 -use Action\AbstractAction; 5 +use Action\WebAction;
6 use Plugin\Helpers; 6 use Plugin\Helpers;
7 7
8 -class Sale1Controller extends AbstractAction 8 +class Sale1Controller extends WebAction
9 { 9 {
10 public function indexAction() 10 public function indexAction()
11 { 11 {
12 $data = array( 12 $data = array(
13 - 'salePage' => true 13 + 'saleIndexPage' => true,
  14 + 'topBanner' => array(
  15 + 'list' => array(
  16 + array(
  17 + 'href' => 'http://www.yohobuy.com',
  18 + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01cd0659953f9f213213839c971406413c.jpg?imageView/1/w/1150/h/450'
  19 + ),
  20 + array(
  21 + 'href' => 'http://www.yohobuy.com',
  22 + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01c571ce38e5d6cf5a0077bd11593bbdfe.jpg?imageView/1/w/1150/h/450'
  23 + ),
  24 + array(
  25 + 'href' => 'http://www.yohobuy.com',
  26 + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01cd0659953f9f213213839c971406413c.jpg?imageView/1/w/1150/h/450'
  27 + ),
  28 + array(
  29 + 'href' => 'http://www.yohobuy.com',
  30 + 'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01c571ce38e5d6cf5a0077bd11593bbdfe.jpg?imageView/1/w/1150/h/450'
  31 + )
  32 + )
  33 + ),
  34 + 'activityEnter' => array(
  35 + array(
  36 + 'icon' => '',
  37 + 'title' => 'VIP会员专享',
  38 + 'desc' => 'Only for VIP',
  39 + 'link' => 'http://www.yohobuy.com'
  40 + ),
  41 + array(
  42 + 'icon' => '',
  43 + 'title' => '断码区',
  44 + 'desc' => 'Discount',
  45 + 'link' => 'http://www.yohobuy.com'
  46 + ),
  47 + array(
  48 + 'icon' => '',
  49 + 'title' => '最新降价',
  50 + 'desc' => 'Off Price',
  51 + 'link' => 'http://www.yohobuy.com'
  52 + )
  53 + )
14 ); 54 );
  55 + $this->setWebNavHeader();
15 $this->_view->display('index', $data); 56 $this->_view->display('index', $data);
16 } 57 }
17 } 58 }