Authored by lore-w

Merge branch 'feature/new-sale' of git.dev.yoho.cn:web/yohobuy into feature/new-sale

Conflicts:
	template/www.yohobuy.com/partials/product/standard-content.phtml
... ... @@ -297,6 +297,9 @@
}
]
}
### 无搜索/筛选结果提示
通过**goods**字段控制页面相关元素的渲染与否,若无结果,不要传goods字段
无搜索结果必须传递搜索的*searchActionUrl*,比如:search.yohobuy.com;可选字段为*keyWord*
### 标准页面内容
... ... @@ -462,12 +465,8 @@
href: ''
}
],
fivePerLine: true,
sixPerLineHref: '',
//or
sixPerLine: true,
fivePerLineHref: '',
//重要提示:页面筛选无结果时,接下来的参数不用传;
countPerPage => 120,
pageCounts => [
{
... ... @@ -482,8 +481,10 @@
pageCount: 30,
preHref: '', //若当前为第一页,不传此参数
nexHref: '' //若当前为最后一页,不传此参数
//重要提示END
},
//重要提示:若无搜索或者筛选结果,则不传goods,totalCount和pager也都不传字段
goods: [
{
...//good
... ... @@ -492,7 +493,13 @@
totalCount: 333, //共多少件商品
pager: '', //右下角分页HTML
//若为搜索导致的无结果,则传递关键词字段;筛选导致的不传
keyWord: '...',
searchActionUrl: ''
//重要提示END
//最近浏览<搜索无此内容>
latestWalk: [
{
... ...
{{> layout/header}}
<div class="new-sale-page product-page yoho-page">
{{# newSale}}
{{# banner}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
{{/ banner}}
{{/ saleBanner}}
<div class="center-content clearfix">
{{# title}}
{{> layout/path-nav}}
{{# saleTitle}}
<div class="header-title">
{{name}}
<p class="line-through"></p>
... ... @@ -14,7 +16,7 @@
<span class="count">共{{count}}个结果</span>
</p>
</div>
{{/ title}}
{{/ saleTitle}}
<div class="list-left pull-left">
{{> product/left-content}}
... ...
<div class="no-result">
<p class="no-title">
抱歉!没有找到{{# keyWord}}与"<b class="keyword">{{.}}</b>"{{/ keyWord}}相关的商品
</p>
<div class="search-again clearfix">
<form method="GET" action="{{searchActionUrl}}">
<input id="no-result-input" name="query" type="text" placeholder="换个关键词试试">
<span id="search-again-btn">
<i class="iconfont">&#xe611;</i>
</span>
</form>
</div>
<p class="no-tip">建议您:看看输入的文字是否有误 / 减少分类条件限制 / 重新搜索</p>
</div>
\ No newline at end of file
... ...
... ... @@ -35,69 +35,74 @@
</a>
{{/ checks}}
<div class="pager-wrap">
<div class="page-count">
<span id="count-per-page">
{{countPerPage}}
<i class="iconfont">&#xe604;</i>
</span>
每页
<ul>
{{# pageCounts}}
<li>
<a href="{{href}}">{{count}}</a>
</li>
{{/ pageCounts}}
</ul>
</div>
{{#if ../goods}}
<div class="pager-wrap">
<div class="page-count">
<span id="count-per-page">
{{countPerPage}}
<i class="iconfont">&#xe604;</i>
</span>
每页
<ul>
{{# pageCounts}}
<li>
<a href="{{href}}">{{count}}</a>
</li>
{{/ pageCounts}}
</ul>
</div>
<p class="pager">
{{#if preHref}}
<a href="{{preHref}}">
<span class="iconfont">&#xe615;</span>
</a>
{{^}}
<span class="dis-icon iconfont">&#xe615;</span>
{{/if}}
<p class="pager">
{{#if preHref}}
<a href="{{preHref}}">
<span class="iconfont">&#xe615;</span>
</a>
{{^}}
<span class="dis-icon iconfont">&#xe615;</span>
{{/if}}
<span>
<i>{{curPage}}</i>/{{pageCount}}
</span>
<span>
<i>{{curPage}}</i>/{{pageCount}}
</span>
{{#if nextHref}}
<a href="{{nextHref}}">
<span class="iconfont">&#xe601;</span>
</a>
{{^}}
<span class="dis-icon iconfont">&#xe601;</span>
{{/if}}
</p>
</div>
{{#if nextHref}}
<a href="{{nextHref}}">
<span class="iconfont">&#xe601;</span>
</a>
{{^}}
<span class="dis-icon iconfont">&#xe601;</span>
{{/if}}
</p>
</div>
{{/if}}
</div>
{{/ opts}}
<div class="goods-container clearfix">
{{#each goods}}
{{> product/good}}
{{/each}}
{{# hasNextPage}}
<div class="block-next-page">
<a href="{{href}}">
<img src="{{src}}" alt=""/>
</a>
</div>
{{/ hasNextPage}}
<div class="good-item-wrapper">
<div class="good-info-main"></div>
<div class="good-select-color"></div>
{{#if goods}}
<div class="goods-container clearfix">
{{#each goods}}
{{> product/good}}
{{/each}}
{{# hasNextPage}}
<div class="block-next-page">
<a href="{{href}}">
<img src="{{src}}" alt=""/>
</a>
</div>
{{/ hasNextPage}}
<div class="good-item-wrapper">
<div class="good-info-main"></div>
<div class="good-select-color"></div>
</div>
</div>
</div>
<div class="product-pager clearfix">
<span class="total">{{opts.curPage}} - {{opts.pageCount}} / {{totalCount}}件商品</span>
<div class="product-pager clearfix">
<span class="total">{{opts.curPage}} - {{opts.pageCount}} / {{totalCount}}件商品</span>
<div class="pager">
{{{pager}}}
<div class="pager">
{{{pager}}}
</div>
</div>
</div>
\ No newline at end of file
{{^}}
{{> product/no-result}}
{{/if}}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,8 @@
var $ = require('yoho.jquery'),
lazyLoad = require('yoho.lazyload');
require('yoho.placeholder');
require('./filter');
require('./sort-pager');
... ... @@ -17,6 +19,15 @@ require('./product');
//最近浏览的商品Lazyload
lazyLoad($('.latest-walk .lazy'));
//无搜索结果
if ($('.no-result').length > 0) {
$('#no-result-input').placeholder();
$('#search-again-btn').click(function() {
$(this).closest('form').submit();
});
}
//NEW页面图片轮播切换
(function() {
var $brands = $('.brands');
... ...
... ... @@ -16,7 +16,8 @@
"yoho.lazyload": "1.0.0",
"yoho.handlebars": "3.0.3",
"yoho.jquery": "1.8.3",
"json2": "1.0.0"
"json2": "1.0.0",
"yoho.placeholder": "0.0.1"
},
"devDependencies": {
"expect.js": "0.3.1"
... ...
@import "search", "list", "new-sale", "filter-box", "sort-pager", "good", "latest-walk", "left-content";
@import "search", "list", "new-sale", "filter-box", "sort-pager", "good", "latest-walk", "left-content", "no-result";
.product-page {
... ...
... ... @@ -3,7 +3,7 @@
position: relative;
width: 100%;
height: 42px;
margin-top: 20px;
margin: 20px 0;
text-align: center;
font-size: 20px;
... ...
.product-page .no-result {
border: 1px solid #eaeceb;
padding: 60px 0;
text-align: center;
margin-bottom: 20px;
.no-title {
font-size: 16px;
}
.keyword {
color: #ee0011;
}
.search-again {
width: 490px;
margin: 15px auto;
input {
float: left;
width: 380px;
height: 18px;
padding: 15px 5px;
border: 10px solid #343434;
color: #333;
outline: none;
}
span {
float: left;
display: block;
width: 80px;
height: 24px;
line-height: 24px;
padding: 22px 0;
background: #343434;
vertical-align: middle;
color: #fff;
}
.iconfont {
font-size: 26px;
}
}
.no-tip {
font-size: 12px;
color: #999;
}
}
\ No newline at end of file
... ...
... ... @@ -73,8 +73,7 @@
.pager {
float: left;
font-size: 14px;
line-height: 15px;
margin: 0 20px;
margin: -15px 20px 0;
.dis-icon {
color: #e6e6e6;
... ...
... ... @@ -290,8 +290,6 @@ class IndexController extends AbstractAction
'href' => ''
)
),
'fivePerLine' => true,
'sixPerLineHref' => '',
'countPerPage' => '120',
'pageCounts' => array(
array(
... ... @@ -311,6 +309,9 @@ class IndexController extends AbstractAction
'pageCount' => 30,
'nextHref' => 'hello'
),
// 无搜索结果字段
// 'keyWord' => '123'
// 'searchActionUrl' => ''
'goods' => array(
0 => array(
'tags' => array(
... ... @@ -968,6 +969,16 @@ class IndexController extends AbstractAction
$data = array(
'productListPage' => true,
'newSale' => array(
'pathNav' => array(
array(
'href' => 'new.yohobuy.com/girls',
'name' => 'GRILS首页'
),
array(
'href' => '/?sort=1',
'name' => '新品到着'
)
),
'leftContent' => array(
array(
'allSort' => array(
... ... @@ -1108,14 +1119,18 @@ class IndexController extends AbstractAction
)
)
),
'banner' => array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
'title' => array(
'name' => '全部商品',
'count' => 540
),
//SALE页面内容
// 'saleBanner' => array(
// 'bannerHeight' => 350,
// 'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
// ),
// 'saleTitle' => array(
// 'name' => '全部商品',
// 'count' => 540
// ),
//NEW页面内容
'newMain' => array(
'banner' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/23/07/010a459d41b99a839cba9377532f1c19b2.jpg?imageView/3/w/970/h/200',
'date' => '12月16日',
... ...