Authored by lore-w

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

... ... @@ -473,7 +473,8 @@ class WebAction extends Controller_Abstract
$header = array(
'navbars'=> \Index\HomeModel::getNavBars($channel),
'gobytype'=> 'gobuy'.$channel,
'searchcate'=>'searchcate'.$channel
'searchcate'=>'searchcate'.$channel,
'header'=> true,
);
$this->_view->assign('headerdata', $header);
}
... ...
... ... @@ -17,15 +17,16 @@ class HelperSearch
public static $options = array();
//当前页
public static $page = 1;
//总页数
public static $pageTotal;
//总记录数
public static $total;
//接口返回搜索条件
public static $filter;
//选中的条件
public static $selected = array();
//list分类面包屑
public static $listNav = array();
//设置导航
private static function setListNav()
{
... ... @@ -78,9 +79,9 @@ class HelperSearch
//总页数
$result['page_total'] = isset($data['product']['page_total']) ? $data['product']['page_total'] : '';
self::$pageTotal = $result['page_total'];
self::$total = $data['product']['total'];
//当前页
$result['page'] = isset($data['product']['page']) ? $data['product']['page'] : '';
self::$page = $result['page'];
self::$page = $result['page'] = isset($data['product']['page']) ? $data['product']['page'] : '';
//筛选条件
$result['filters'] = isset($data['product']['filter']) ? self::filter() : array();
//排序方式、显示数量等其他选项
... ... @@ -145,7 +146,7 @@ class HelperSearch
* @author sefon 2015-12-21 17:24:04
* @return array
*/
public static function getProductList($product,$imgSize)
public static function getProductList($product, $imgSize)
{
$params = self::$params;
$goods = array();
... ... @@ -160,12 +161,26 @@ class HelperSearch
//即将售罄
$isFew = $val['is_soon_sold_out'] === 'Y' ? true : false;
//SALE
$isSale = ($val['is_discount'] == 'Y') ? true : false;
//新品节
//再到着
//年终大促
// 年中大促
$gender = 0;
if (isset(self::$options['gender'])) {
$genderArr = explode(',', self::$options['gender']);
$gender = $genderArr[0];
}
foreach($val['goods_list'] as $k => $v){
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
//女封
if (isset($v['cover_1']) && $gender == 1) {
$val['default_images'] = $v['images_url'];
}
//男封
if (isset($v['cover_2']) && $gender == 2) {
$val['default_images'] = $v['images_url'];
}
//筛选符合颜色条件的封面图片
if (isset($params['color']) && $params['color'] == $v['color_id']) {
$val['default_images'] = $v['images_url'];
... ... @@ -175,11 +190,19 @@ class HelperSearch
if (!empty($val['default_images'])) {
$val['default_images'] = Images::getImageUrl($val['default_images'],$imgSize[0],$imgSize[1]);
}
//搜索关键字高亮
if (isset(self::$params['query']) && !empty(self::$params['query']) && preg_match("/".self::$params['query']."/i", $val['product_name'], $match)) {
foreach ($match as $k => &$v) {
$replace[$k] = '<span style="color: #cc0000">'.$v.'</span>';
$v = '/'.$v.'/';
}
$val['product_name'] = preg_replace($match, $replace, $val['product_name']);
}
$good = array(
'tags' => array(
'isNew' => $isNew,
'isLimit' => $isLimit
'isLimit' => $isLimit,
'isSale' => $isSale
),
'url' => self::fromPram($goods_list[0]['url'],++$key),
'thumb' => $val['default_images'],
... ... @@ -422,7 +445,7 @@ class HelperSearch
//已选中品牌数量
$existBrandNum = 0;
//已选中品牌标签名
$existName = '';
$existName = array();
foreach ($brand as $key => $v) {
$selectBrandIds = $brandIds;
//品牌已被选中
... ... @@ -433,10 +456,10 @@ class HelperSearch
'brand' => implode(',', $selectBrandIds)
)));
if ($existBrandNum === 0) {
$existName .= $v['brand_name'].'、';
$existName[] = $v['brand_name'];
}
if ($existBrandNum === 1){
$existName .= substr($v['brand_name'], 0, 3).'...';
$existName[]= substr($v['brand_name'], 0, 3).'...';
}
$existBrandNum++;
}
... ... @@ -474,7 +497,7 @@ class HelperSearch
//设置选中
if (isset(self::$params['brand']) && !empty(self::$params['brand'])) {
self::$selected['brand'] = array(
'name' => rtrim($existName, '、'),
'name' => implode($existName,'、'),
'href' => self::buildUrl($params)
);
}
... ... @@ -487,7 +510,6 @@ class HelperSearch
$result['brandIndex'][] = $index;
}
unset($brandList);
//搜索页已选中,返回空
if (self::checkSearch('brand')) {
return array();
... ... @@ -586,12 +608,16 @@ class HelperSearch
*/
public static function price($filter)
{
$result = array();
//商品记录小于10,不显示价格区间
if (self::$total < 10) {
return $result;
}
$params = self::$params;
$priceId = isset($params['price']) && !empty(self::$params['price']) ? self::$params['price'] : '';
if (isset($params['price'])) {
unset($params['price']);
}
$result = array();
//设置已选中价格
if (!empty($priceId)) {
$price = explode(',' ,$priceId);
... ...
... ... @@ -11,39 +11,15 @@
<title>{{title}}</title>
{{#if rlsEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
<!--[if lt IE 9]>
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
{{#if preEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
<!--[if lt IE 9]>
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.min.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.js"></script>
<link href="http://cdn.yoho.cn/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
{{#if testEnv}}
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/yohobuy/{{version}}/index.css">
<!--[if lt IE 9]>
<script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.min.js"></script>
<link href="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.proxy.js"></script>
<link href="http://static.buy.test.yoho.cn/dist/yohobuy/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="http://webstatic.dev.yohobuy.com/css/index.css">
<!--[if lt IE 9]>
<script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.min.js"></script>
<link href="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<script src="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.proxy.js"></script>
<link href="http://webstatic.dev.yohobuy.com/plugin/page/respond/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<![endif]-->
{{/if}}
</head>
<body>
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -5,9 +5,9 @@
*/
var $ = require('yoho.jquery');
require('./footer');
var $body = $('body');
require('./footer');
function cookie(name) {
... ... @@ -96,20 +96,20 @@ function getShoppingKey() {
}
//YAS统计代码
//(function(w, d, s, j, f) {
// var a = d.createElement(s);
// var m = d.getElementsByTagName(s)[0];
//
// w.YohoAcquisitionObject = f;
//
// w[f] = function() {
// w[f].p = arguments;
// };
//
// a.async = 1;
// a.src = j;
// m.parentNode.insertBefore(a, m);
//})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
(function(w, d, s, j, f) {
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
w.YohoAcquisitionObject = f;
w[f] = function() {
w[f].p = arguments;
};
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
(function() {
var uid = getUid();
... ... @@ -123,6 +123,25 @@ function getShoppingKey() {
}
}());
//window.resize在width<1180时适配成990
$(window).on('resize', function() {
var w = $(this).width();
//return top
if (w < 1360) {
$('.return-top').addClass('min');
} else {
$('.return-top').removeClass('min');
}
//body
if (w < 1180) {
$body.addClass('min-screen');
} else {
$body.removeClass('min-screen');
}
}).trigger('resize');
window.cookie = cookie;
window.setCookie = setCookie;
... ... @@ -132,9 +151,3 @@ window.getUser = getUser;
window.getUid = getUid;
window.getShoppingKey = getShoppingKey;
if($('.simple-header').hasClass('simple-header')){
require('./simple-header');
}else{
require('./header');
}
... ...
... ... @@ -10,11 +10,6 @@ $('#brand-favor').on('click', function() {
var $this = $(this),
uid = window.getUid();
if (!uid) {
location.href = '/signin.html?refer=' + encodeURIComponent(location.href);
return;
}
$.ajax({
type: 'post',
url: '/product/index/favoriteBrand',
... ... @@ -29,6 +24,8 @@ $('#brand-favor').on('click', function() {
} else {
$this.find('i').removeClass('coled');
}
} else if (res.code === 403) {
location.href = '/signin.html?refer=' + encodeURIComponent(location.href);
}
});
});
... ...
... ... @@ -95,11 +95,6 @@ exports.init = function(num) {
wrapperPt, //鼠标移入时弹层的上内边距
containerPt; //商品列表容器的上内边距
// 获取图片之前,先把获取上一张图片的ajax请求取消。 网络差的时候会出现错误
// if (getProductAjax && getProductAjax.readyState!= 4) {
// getProductAjax.abort();
// }
$.ajax({
type: 'POST',
url: '/product/list/getProductPic',
... ... @@ -174,11 +169,6 @@ $(document).on('hover', '.good-select-color li', function() {
$goodInfoMain.on('click', '.col-btn', function() {
var $this = $(this);
if (!window.getUid()) {
location.href = '/signin.html?refer=' + encodeURIComponent(location.href);
return;
}
$.ajax({
type: 'POST',
url: '/product/list/changeFavorite',
... ... @@ -189,6 +179,8 @@ $goodInfoMain.on('click', '.col-btn', function() {
}).then(function(res) {
if (res.code === 200) {
$this.toggleClass('coled');
} else if (res.code === 403) {
location.href = '/signin.html?refer=' + encodeURIComponent(location.href);
}
});
});
... ...
... ... @@ -355,17 +355,13 @@
}
}
@media (max-width: 1360px) {
.yoho-footer .return-top {
.yoho-footer .return-top.min {
left: 100%;
right: 20px;
margin-left: auto;
}
}
@media (max-width:1180px) {
.yoho-footer {
.min-screen .yoho-footer {
.index-foot dd {
width: 316px;
... ... @@ -401,5 +397,4 @@
.footer-help li {
width: 150px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -80,10 +80,8 @@ input,textarea {
margin-right: auto;
}
@media (max-width: 1180px) {
.center-content {
.min-screen .center-content {
width: 990px;
}
}
@import "home/index", "product/index", "guang/index", "passport/index", "error", "order/index", "sale/index";
... ...
... ... @@ -387,8 +387,6 @@
}
}
@media (max-width: 1180px) {
.filter-box .brand .attr {
.min-screen .filter-box .brand .attr {
width: 25%;
}
}
... ...
... ... @@ -51,9 +51,7 @@
}
/*990px*/
@media (max-width: 1180px) {
.product-list-page, .new-sale-page {
.min-screen .product-list-page, .new-sale-page {
.list-right {
width: 810px;
... ... @@ -82,5 +80,4 @@
.filter-box .brand .attr-content {
max-width: 570px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -9,7 +9,6 @@
}
.goods {
width: 984px;
height: 241px;
margin: 30px 0;
overflow: hidden;
... ... @@ -49,9 +48,16 @@
}
}
@media (max-width: 1180px) {
@media (min-width: 1180px) {
.latest-walk {
.goods {
min-width: 984px;
}
}
}
.min-screen .latest-walk {
.goods {
width: 820px;
height: 301px;
}
... ... @@ -64,5 +70,4 @@
width: 195px;
height: 261px;
}
}
}
... ...
... ... @@ -212,8 +212,7 @@
}
}
@media (max-width: 1180px) {
.product-list-page .sort-intro {
.min-screen .product-list-page .sort-intro {
.texts {
width: 346px;
height: 248px;
... ... @@ -228,5 +227,4 @@
width: 400px;
height: 250px;
}
}
}
... ...
... ... @@ -190,8 +190,6 @@
}
}
@media (max-width: 1180px) {
.new-sale-page .new-brands .brands-wrap {
.min-screen .new-sale-page .new-brands .brands-wrap {
width: 730px;
}
}
\ No newline at end of file
... ...
... ... @@ -19,8 +19,7 @@
/*990px*/
@media (max-width: 1180px) {
.product-search-page {
.min-screen .product-search-page {
.goods-container {
height: auto;
padding-top: 25px;
... ... @@ -44,5 +43,4 @@
.filter-box .brand .attr-content {
max-width: 750px;
}
}
}
... ...
... ... @@ -36,7 +36,7 @@ class PassportModel
'orderHref' => Helpers::url('/home/orders?t=' . time()), //订单中心连接
'helpHref' => Helpers::url('/help'),
);
$tool+=array(
$tool += array(
'loginHref' => Helpers::url('/signin.html'), //登录链接,已登录不传
'registerHref' => Helpers::url('/reg.html'), //注册链接,已登录不传
);
... ... @@ -45,7 +45,8 @@ class PassportModel
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
'url' => SITE_MAIN
),
'tool' => $tool
'tool' => $tool,
'simpleHeader' => true,
);
return $simpleHeader;
}
... ... @@ -110,7 +111,7 @@ class PassportModel
$ret = current($data['data']);
}
}
return $ret;
return array();
}
/**
... ...
... ... @@ -155,7 +155,6 @@ class SearchModel
$urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']);
// 组合搜索折扣区间url
$urlList['discount'] = SearchData::getDiscountUrl($searchCondition['condition']);
$result = Yohobuy::getMulti($urlList);
// 组织模板数据
$data = HelperSearch::getList($result, $searchCondition['options']);
... ... @@ -192,7 +191,7 @@ class SearchModel
$param['keyword'] = $searchCondition['condition']['query'];
$urlList['shop'] = SearchData::getShopUrl($param);
}
$data = Yohobuy::getMulti($urlList, array(), true);
$data = Yohobuy::getMulti($urlList);
//获取品牌商品分类
if (isset($data['shop']) && !empty($data['shop'])) {
$shopSortParam['brand'] = $data['shop']['id'];
... ...
... ... @@ -20,7 +20,7 @@ class BackController extends WebAction {
'coverImg' => $banner ['img'],
'countryCode' => '86',
'countryName' => '中国',
'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445',
'captchaUrl' => Helpers::url('/passport/images?t='.time()),
'countryList' => RegData::getAreasData()
)
);
... ... @@ -282,7 +282,7 @@ class BackController extends WebAction {
$area = $this->post ( 'area' );
$verifyCode = $this->post ( 'verifyCode' );//图形验证码
$code = $this->post ( 'code' ); //手机验证码
$data = array('code'=> 400, 'message' => '验证码错误!','data' => SITE_MAIN.'/passport/back/index');
$data = array('code'=> 400, 'message' => '验证码错误!','data' => Helpers::url('/passport/back/index'));
if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area && ! empty($code)
&& PassportModel::verifyCode($verifyCode)) {
$result = BackData::validateMobileCode ( $mobile, $code, $area );
... ... @@ -297,7 +297,7 @@ class BackController extends WebAction {
$url = '/passport/back/backcode?code=' . base64_encode ( $code );
$data ['code'] = 200;
$data['message'] = '验证成功';
$data['data'] = SITE_MAIN . $url;
$data['data'] = Helpers::url($url);
}
}
$this->echoJson($data);
... ...
... ... @@ -19,13 +19,13 @@ class RegisterController extends WebAction
'registerPage' => true,
'simpleHeader' => PassportModel::getSimpleHeader(),
'passport' => array(
'actionUrl' => SITE_MAIN.'/passport/register/mobileregister',
'actionUrl' => Helpers::url('/passport/register/mobileregister'),
'region' => RegData::getAreasData(),
'location' => '+86',
'captchaUrl' => SITE_MAIN.'/passport/images?t=1449799445',
'itemUrl' => 'http://www.yohobuy.com/help/?category_id=9',
'captchaUrl' => Helpers::url('/passport/images?t='.time()),
'itemUrl' => Helpers::url('/help/?category_id=9'),
'referUrl' => $refer,
'loginUrl' => SITE_MAIN.'/signin.html?refer='.$refer,
'loginUrl' => Helpers::url('/signin.html?refer='.$refer),
'coverHref' => $cover['url'],
'coverImg' => $cover['img'],
'regBtnText' => '立即注册'
... ...
... ... @@ -47,8 +47,10 @@ class SearchController extends WebAction
*/
public function sortSizeAction()
{
if (!$this->isAjax()) {
$condition['msort'] = $this->get('msort');
$size = SearchModel::getSortSize($condition);
$this->echoJson($size);
}
}
}
\ No newline at end of file
... ...
... ... @@ -25,3 +25,11 @@ routes.searchsuggest.match = "/api/suggest"
routes.searchsuggest.route.module = Product
routes.searchsuggest.route.controller = Search
routes.searchsuggest.route.action = suggest
;about(品牌介绍)
routes.brandabout.type = "rewrite"
routes.brandabout.match = "/about"
routes.brandabout.route.module = Product
routes.brandabout.route.controller = Index
routes.brandabout.route.action = brandIntro
\ No newline at end of file
... ...