Authored by hf

modify layout header add dns-prefetch

... ... @@ -10,4 +10,8 @@ npm-debug.log
composer.lock
vendor/
.jscsrc
.jshintrc
\ No newline at end of file
.jshintrc
.tags
.tags_sorted_by_file
yohobuyP.sublime-project
yohobuyP.sublime-workspace
... ...
... ... @@ -354,6 +354,11 @@ class AbstractAction extends Controller_Abstract
{
$header = array();
// 判断是否是微信浏览器浏览
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false) {
$header['isShow'] = true;
}
if ($backUrl) {
$header['navBack'] = true;
}
... ...
... ... @@ -18,15 +18,15 @@ class Yohobuy
{
/* 正式环境 */
const API_URL = 'http://api2.open.yohobuy.com/';
const SERVICE_URL = 'http://service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
// /* 测试环境 */
// const API_URL = 'http://test2.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// const API_URL = 'http://api2.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// /* 测试环境 */
const API_URL = 'http://test2.open.yohobuy.com/';
const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
/**
* 私钥列表
*
... ...
... ... @@ -143,6 +143,7 @@ class SearchData
$param = array();
$param['status'] = 1; // 是否上架,1表示在架,2表示不在
$param['sales'] = 1; // 只搜索销售的产品
// $param['needFilter'] = 1; // 是否需要返回筛选条件
if (!isset($condition['order'])) {
$param['order'] = $orderMaps['s_t_desc'];
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -63,13 +63,13 @@ function hideSideBar() {
}
}
$('.overlay').on('touchend', function(e) {
$('.overlay').on('touchstart', function(e) {
hideSideBar();
return false;
});
//点击一级导航,弹出二级导航
$sideNav.on('touchend', 'li', function (e) {
$sideNav.on('touchstart', 'li', function (e) {
if ($(this).find('.sub-nav').size() > 0) {
$('.sub-nav').removeClass('show');
$(this).find('.sub-nav').addClass('show');
... ... @@ -83,12 +83,12 @@ $sideNav.on('touchend', 'li', function (e) {
//返回一级导航,收起二级导航
$subNav.each(function () {
$(this).find('li').eq(0).on('touchend', function (e) {
$(this).find('li').eq(0).on('touchstart', function (e) {
$('.sub-nav').removeClass('show');
e.stopPropagation();
return false;
});
}).on('touchend', function(e) {
}).on('touchstart', function(e) {
if (e.currentTarget !== e.target) {
$subNav.find('li').removeClass('current');
}
... ...
... ... @@ -41,3 +41,7 @@ $searchBox.children('.clear-text').on('touchstart', function() {
$searchBox.children('.search-icon').on('touchstart', function() {
$indexSearch.submit();
});
$('.index-channel img').on('load', function() {
window.rePosFooter();
});
... ...
... ... @@ -37,7 +37,7 @@ $input.on('input', function() {
$icon.css('color', '#b2b2b2');
$clear.addClass('hide');
} else {
$icon.css('color', '#000');
$icon.css('color', '#666');
$clear.removeClass('hide');
}
});
... ...
... ... @@ -26,6 +26,10 @@ var $goodsContainer = $('#goods-container'),
var winH = $(window).height();
var $input = $('#search-input input'),
$icon = $('.search-icon'),
$clear = $('#search-input .clear-input');
//默认筛选条件
var defaultOpt = {
gender: $('#gender').val(),
... ... @@ -69,6 +73,21 @@ var $listNav = $('#list-nav'),
btnIntroHammer,
introHammer,
brandColHammer;
$input.on('input', function() {
if ($input.val() === '') {
$icon.css('color', '#b2b2b2');
$clear.addClass('hide');
} else {
$icon.css('color', '#666');
$clear.removeClass('hide');
}
});
$clear.on('touchend', function() {
$input.val('').trigger('input');
});
/**
* 手动触发搜索
*/
... ...
... ... @@ -56,6 +56,10 @@
.good-detail-img {
position: relative;
display: table-cell;
height: 388rem / $pxConvertRem;
vertical-align: middle;
.good-islike {
position: absolute;
width: 60rem / $pxConvertRem;
... ... @@ -75,7 +79,7 @@
img {
display: block;
width: 100%;
max-height: 366rem / $pxConvertRem;
max-height: 388rem / $pxConvertRem;
}
.few-tag {
... ...
.brand-page {
.newbrand-search {
width: 93.75%;
height: 60rem / $pxConvertRem;
... ... @@ -44,7 +43,7 @@
border: none;
width: 95%;
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
// line-height: 1;
font-size: 1.2em;
padding: 0 10rem / $pxConvertRem;
}
... ... @@ -56,25 +55,24 @@
right: -74rem / $pxConvertRem;
font-size: 32rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
color: #bdbdbd;
color: #666;
}
.cancel-btn {
display: inline;
color: #bdbdbd;
font-size: 32rem / $pxConvertRem;
vertical-align: middle;
}
.clear-text {
margin-right: 20rem / $pxConvertRem;
color: #666;
}
}
}
.banner-top {
padding-top: 178rem / $pxConvertRem;
background-color:#f8f8f8;
}
.hot-brand {
... ...
... ... @@ -38,6 +38,10 @@ $clothes: sprite-map("guang/clothes/*.png");
&.has-head {
top: 90rem / $pxConvertRem;
+ .fixed-top {
top: 90rem / $pxConvertRem;
}
}
}
... ... @@ -131,7 +135,7 @@ $clothes: sprite-map("guang/clothes/*.png");
.thumb-container {
padding-top: 30rem / $pxConvertRem;
padding-left: 30rem / $pxConvertRem;
padding-left: 20rem / $pxConvertRem;
background: transparent image-url('guang/thumb-container-bg.png') no-repeat;
background-size: 200% 100%;
... ...
... ... @@ -10,13 +10,23 @@
line-height: 96rem / $pxConvertRem;
.index-logo {
display: table-cell;
float: left;
font-size: 50rem / $pxConvertRem;
width: 216rem / $pxConvertRem;
height: 96rem / $pxConvertRem;
color: #343434;
vertical-align: middle;
opacity: 1;
transition: all 400ms;
img {
display: inline;
vertical-align: middle;
width: 207rem / $pxConvertRem;
height: 49rem / $pxConvertRem;
}
&.action {
opacity: 0;
width: 0;
... ... @@ -82,7 +92,7 @@
}
.search-icon {
right: 10rem / $pxConvertRem;
color: #000;
color: #666;
&.empty {
color: #e6e6e6;
... ...
... ... @@ -16,9 +16,9 @@
input {
height: 56rem / $pxConvertRem;
width: 430rem / $pxConvertRem;
width: 378rem / $pxConvertRem;
border-radius: 28rem / $pxConvertRem;
padding-left: 52rem / $pxConvertRem;
padding: 0 52rem / $pxConvertRem;
font-size: 24rem / $pxConvertRem;
background: #fff;
border: none;
... ... @@ -26,7 +26,7 @@
.clear-input {
position: absolute;
top: 24rem / $pxConvertRem;
top: 20rem / $pxConvertRem;
right: 145rem / $pxConvertRem;
font-size: 32rem / $pxConvertRem;
color: #666;
... ... @@ -56,6 +56,8 @@
float: left;
margin-right: 20rem / $pxConvertRem;
margin-bottom: 20rem / $pxConvertRem;
max-width: 100%;
overflow: hidden;
}
a {
... ... @@ -66,6 +68,9 @@
font-size: 28rem / $pxConvertRem;
background: #f8f8f8;
color: #000;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.clear-history {
... ...
.yoho-footer {
font-size: 12px;
background-color: #fff;
margin-bottom: 2.5rem;
.op-row {
position: relative;
... ...
... ... @@ -6,6 +6,7 @@
overflow: hidden;
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
z-index: 1;
&.boys {
@include background-image(linear-gradient(#323232, #414141));
... ...
... ... @@ -16,10 +16,12 @@
}
input {
box-sizing: border-box;
padding-left: 26px;
height: 30px;
width: 85%;
border-radius: 15px;
text-indent: 26px;
// text-indent: 26px;
background: #fff;
border: none;
}
... ... @@ -33,11 +35,11 @@
.search {
position: absolute;
top: 2px;
right: -30px;
right: -4px;
border: none;
background: transparent;
font-size: 16px;
width: 3rem;
// width: 3rem;
height: 30px;
overflow: hidden;
line-height: 30px;
... ...
... ... @@ -2,7 +2,9 @@
<div class="index-page yoho-page">
<div class="index-container">
<div class="index-header clearfix">
<div class="iconfont index-logo">&#xe60e;</div>
<div class="index-logo">
<img src="http://static.dev.yohobuy.com/img/yohologo.png">
</div>
<div class="box">
<a href="javascript:void(0);" class="no-search">取消</a>
<form action="{{searchUrl}}" class="index-search">
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
<span class="spanTest">筛选</span>
<span class="iconfont">&#xe613;</span>
</a>
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods container clearfix">
{{# goods}}
{{> good}}
{{/ goods}}
</div>
<div class="price-goods container hide clearfix"></div>
<div class="discount-goods container hide clearfix"></div>
{{> filter}}
</div>
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
{{/if}}
{{#if gender}}
<input id="gender" type="hidden" value={{gender}}>
{{/if}}
{{#if sort}}
<input id="sort" type="hidden" value={{sort}}>
{{/if}}
{{#if msort}}
<input id="msort" type="hidden" value={{msort}}>
{{/if}}
{{#if misort}}
<input id="misort" type="hidden" value={{misort}}>
{{/if}}
{{#if color}}
<input id="color" type="hidden" value={{color}}>
{{/if}}
{{#if size}}
<input id="size" type="hidden" value={{size}}>
{{/if}}
{{#if price}}
<input id="price" type="hidden" value={{price}}>
{{/if}}
{{#if p_d}}
<input id="p_d" type="hidden" value={{p_d}}>
{{/if}}
{{#if channel}}
<input id="channel" type="hidden" value={{channel}}>
{{/if}}
{{#if limit}}
<input id="limit" type="hidden" value={{limit}}>
{{/if}}
{{#if page}}
<input id="page" type="hidden" value={{page}}>
{{/if}}
{{#if discount}}
<input id="discount" type="hidden" value={{discount}}>
{{/if}}
{{> product/suspend-cart}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -22,6 +22,10 @@
}());
})(document, window);
</script>
<link rel="dns-prefetch" href="//cdn.yoho.cn">
<link rel="dns-prefetch" href="//static.yohobuy.com">
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
{{#if rlsEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css">
{{/if}}
... ...
{{#pageHeader}}
{{# isShow}}
<header class="yoho-header{{#if boys}} boys{{/if}}{{#if girls}} girls{{/if}}{{#if kids}} kids{{/if}}{{#if lifeStyle}} life-style{{/if}}">
{{#if navBack}}
<a href="javascript:history.go(-1);" class="nav-back"></a>
... ... @@ -10,4 +11,5 @@
<p class="nav-title">{{.}}</p>
{{/navTitle}}
</header>
{{/ isShow}}
{{/pageHeader}}
\ No newline at end of file
... ...
... ... @@ -5,7 +5,7 @@
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" value="{{default}}" name="query">
<input type="hidden" value="search" name="from">
<i class="clear-input iconfont hide">&#xe61a;</i>
<i class="clear-input iconfont hide">&#xe626;</i>
<span id="search" class="search" type="submit">搜索</span>
</form>
</div>
... ...
... ... @@ -70,6 +70,33 @@ class NewsaleController extends AbstractAction
}
/**
* 热销排行榜
*
* @param int channel 1:男生,2:女生,3:潮童,4:创意生活
*/
public function hotrankAction()
{
$this->setTitle('热销排行榜');
$this->setNavHeader('热销排行榜');
// 设置一些默认参数
$data = array(
'discountPage' => true,
'showDownloadApp' => true,
'pageFooter' => true,
'brand' => '0',
'sort' => '0',
'gender' => Helpers::getGenderByCookie(),
'price' => '0',
'size' => '0',
'discount' => '0.1,0.9',
'cartUrl' => Helpers::url('/cart/index/index', null),
);
$this->_view->display('hotrank', $data);
}
/**
* Ajax方式筛选新品到着、折扣专区商品
*
* @return array 根据指定条件筛选之后的商品
... ...
... ... @@ -89,6 +89,13 @@ routes.productsale.route.module = Product
routes.productsale.route.controller = Newsale
routes.productsale.route.action = Discount
; 热销排行榜
routes.productsale.type = "rewrite"
routes.productsale.match = "/hotrank"
routes.productsale.route.module = Product
routes.productsale.route.controller = Newsale
routes.productsale.route.action = Hotrank
; 女生首页
routes.girls.type = "rewrite"
routes.girls.match = "/girl$"
... ...