Showing 33 changed files with 1978 additions and 504 deletions
... ... @@ -465,7 +465,7 @@ class WebAction extends Controller_Abstract
*/
protected function setWebNavHeader($channel = '')
{
//TODO
//TODO
if(empty($channel)) {
$channel = \Index\HomeModel::getSwitchChannel();
}
... ... @@ -477,63 +477,63 @@ class WebAction extends Controller_Abstract
'gobytype'=> 'gobuy'.$channel,
'searchcate'=>'searchcate'.$channel,
'myyoho' => array(
'email'=>'hhh@126.com',
'viptype'=>'普通会员',
'currentscore' => 495,
'totalscore' => 600,
'cardtype' => '银卡',
'infolist' => array(
array(
'name' =>'待处理的订单',
'link' =>'',
'num' => '0'
),
array(
'name' =>'我的收藏',
'link' =>'',
'num' => '1'
),
'email'=>'hhh@126.com',
'viptype'=>'普通会员',
'currentscore' => 495,
'totalscore' => 600,
'cardtype' => '银卡',
'infolist' => array(
array(
'name' =>'我的优惠券',
'link' =>'',
'num' => '2'
),
'name' =>'待处理的订单',
'link' =>'',
'num' => '0'
),
array(
'name' =>'我的YOHO币',
'link' =>'',
'num' => '1'
),
'name' =>'我的收藏',
'link' =>'',
'num' => '1'
),
array(
'name' =>'我的退货换货',
'link' =>'',
'num' => '1'
)
),
'updlink' => ''
),
'gobuy'=> array(
'gobuynum' =>3
),
'breadcrumbnav'=> array(
array(
'notend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => 'BOYS首页'
)
),
array(
'notend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => '上衣'
)
),
array(
'isend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => '衬衫'
)
)
)
'name' =>'我的优惠券',
'link' =>'',
'num' => '2'
),
array(
'name' =>'我的YOHO币',
'link' =>'',
'num' => '1'
),
array(
'name' =>'我的退货换货',
'link' =>'',
'num' => '1'
)
),
'updlink' => ''
),
'gobuy'=> array(
'gobuynum' =>3
),
'breadcrumbnav'=> array(
array(
'notend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => 'BOYS首页'
)
),
array(
'notend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => '上衣'
)
),
array(
'isend'=>array(
'link' => 'http=>//www.baidu.com',
'name' => '衬衫'
)
)
)
);
$this->_view->assign('headerdata', $header);
}
... ...
... ... @@ -4,7 +4,6 @@ namespace LibModels\Web\Product;
use Api\Yohobuy;
class SearchData extends \LibModels\Wap\Product\SearchData
{
public static $shopsUrl = 'http://101.200.31.165/yohosearch/shops.json';
/**
* 获取搜索的服务地址
*
... ... @@ -94,10 +93,10 @@ class SearchData extends \LibModels\Wap\Product\SearchData
* @param integer $sell_channels 销售平台
* @param integer $p_d_int 促销折扣 int型如7
* @param integer $act_temp 活动模板
* @param integer $act_rec 活动模板是否推荐
* @param integer $act_status 活动模板商品状态
* @param integer $attribute_not 过滤商品属性,attribute_not=2过滤掉赠品
* @param integer $not_* not_字段名,过滤字段
* @param integer $act_rec 活动模板是否推荐
* @param integer $act_status 活动模板商品状态
* @param integer $attribute_not 过滤商品属性,attribute_not=2过滤掉赠品
* @param integer $not_* not_字段名,过滤字段
* @return array 搜索到的数据
*/
public static function getClassesData($classes = array(), $cache = false)
... ...
... ... @@ -392,16 +392,30 @@ class HelperSearch
//清空品牌参数
unset($params['brand']);
//设置已选中的品牌
$existBrandNum = 0;
$existName = '';
foreach ($brandIds as $key => $val) {
if (isset($brandAll[$val])) {
$brandParam = $brandIds;
unset($brandParam[$key]);
$params['brand'] = implode(',', $brandParam);
self::$selected['brand'] = array(
'name' => $brandAll[$val],
'href' => self::buildUrl($params)
);
if ($existBrandNum === 0) {
$existName .= $brandAll[$val].'、';
}
if ($existBrandNum === 1){
$existName .= substr($brandAll[$val], 0, 3).'...';
}
$existBrandNum++;
}
if ($existBrandNum > 1) {
break;
}
}
//设置选中
if (isset(self::$params['brand']) && !empty(self::$params['brand'])) {
self::$selected['brand'] = array(
'name' => rtrim($existName, '、'),
'href' => self::buildUrl($params)
);
}
ksort($brandList);
//品牌列表排序, 添加品牌索引
... ... @@ -432,9 +446,13 @@ class HelperSearch
* @param array $filter
* @return array
*/
public static function size($filter)
public static function size($filter, $isAjax = false)
{
$params = self::$params;
$paramsValue = array_filter($params);
if (!$isAjax && empty($paramsValue)) {
return array();
}
$sizeId = isset($params['size']) && !empty($params['size']) ? $params['size'] : '';
if (isset($params['size'])) {
unset($params['size']);
... ... @@ -694,7 +712,7 @@ class HelperSearch
$selected = true;
}
else {
$params['specialoffer'] = 1;
$params['specialoffer'] = 'Y';
}
return array(
'name' => '打折',
... ... @@ -731,12 +749,12 @@ class HelperSearch
{
$params = self::$params;
$selected = '';
if (isset($params['isNew']) && !empty($params['isNew'])) {
unset($params['isNew']);
if (isset($params['new']) && !empty($params['new'])) {
unset($params['new']);
$selected = true;
}
else {
$params['isNew'] = 'Y';
$params['new'] = 'Y';
}
return array(
'name' => '新品',
... ... @@ -843,7 +861,6 @@ class HelperSearch
)));
$active = '';
$desc = true;
}
else if (self::$params['order'] == 'p_d_asc') {
$url = self::buildUrl(array_merge($params, array(
... ... @@ -903,23 +920,13 @@ class HelperSearch
{
$result = array();
$data = array();
$is_array_key = array(
'brand',
'style'
);
foreach (self::$selected as $key => $val) {
if (in_array($key, $is_array_key)) {
foreach ($val as $k => $v) {
$data[] = $v;
}
}
else {
$data[] = $val;
}
}
if ($data) {
$result['conditions'] = $data;
}
// print_r($result); exit;
return $result;
}
... ... @@ -1305,7 +1312,8 @@ class HelperSearch
elseif ($type == 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
}
return 'http://192.168.10.64:8080/yohosearch/search-once.json';
return 'http://101.200.31.165/yohosearch/search.json';
// return 'http://192.168.10.64:8080/yohosearch/search-once.json';
}
}
... ...
... ... @@ -12,6 +12,16 @@
border: none;
border-bottom: 4px solid #fff;
}
#yohood:active {
background-image: image-url('yohood-tapped.png');
background-color: rgba(255,255,255,.4);
border-bottom-color: #000;
.right-icon {
color: #000;
}
}
.index-header {
box-sizing: border-box;
padding: 0 20rem / $pxConvertRem;
... ...
{{> layout/header}}
<div class="product-search-page product-page yoho-page center-content">
{{# search}}
{{> layout/path-nav}}
{{> product/standard-content}}
{{> product/latest-walk}}
{{/ search}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/header}}
<div class="sale-page yoho-page">
<h1>折扣页面</h1>
<div class="sale-page yoho-page center-content">
{{#topBanner}}
{{> index/slide-banner}}
{{/topBanner}}
{{> sale/activity-entry}}
{{> sale/brand-sale}}
</div>
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="new-sale-page product-page yoho-page">
{{# saleList}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{# saleTitle}}
<div class="header-title">
{{name}}
<p class="line-through"></p>
<p class="count-wrap">
<span class="count">共{{count}}个结果</span>
</p>
</div>
{{/ saleTitle}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{> product/standard-content}}
</div>
</div>
{{/ saleList}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
<div class="slide-container {{#if pagination}}slide-thumb-container{{/if}}">
<div class="slide-wrapper">
<div class="slide-wrapper">
<ul>
{{# list}}
<li style="background:{{bgColor}}">
<li style="{{#if bgColor}}background:{{bgColor}}{{/if}}">
<a href="{{href}}" target= "_blank">
<img class="lazy" data-original="{{img}}" alt="">
</a>
... ... @@ -13,7 +13,7 @@
</div>
{{/ tips}}
</li>
{{/ list}}
{{/ list}}
</ul>
<div class="slide-switch">
<a class="prev" href="javascript:;">
... ... @@ -31,11 +31,11 @@
{{# pagination}}
<li>
<a href="{{href}}" target="_blank"></a>
<img src="{{img}}" alt="">
<img src="{{img}}" alt="">
</li>
{{/ pagination}}
</ul>
</div>
{{/if}}
</div>
<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>
\ No newline at end of file
<div class="slide-container-placeholder {{#if pagination}}slide-thumb-container-placeholder{{/if}}"></div>
... ...
... ... @@ -83,8 +83,8 @@
<ul class="sub-nav-list">
{{# subnav}}
<li class="sub-nav-item">
<a href="{{link}}">{{name}} {{#is_new}}<span class="newlogo"></span>{{/is_new}}</a>
{{#if thirdnav}}
<a href="{{link}}">{{name}}</a>
{{#if thirdnav}}
<div class="third-nav-wrapper">
<div class="third-nav">
<div class="categorywrapper" id="category{{../index_main}}{{index_sub}}">
... ... @@ -94,8 +94,9 @@
<h1 class="category-title thirdnavbar">{{title}}</h1>
<ul class="category-list">
{{#branditems}}
<li class="category-item thirdnavbar">
<a href="{{link}}" class="{{hot}}">{{brandname}}</a>
<li class="category-
item thirdnavbar">
<a href="" hot={{hot}}>{{brandname}}</a>
</li>
{{/branditems}}
</ul>
... ... @@ -103,7 +104,7 @@
{{/thirdnav}}
</div>
</div>
<div class="showdetail" data-code="220eec926e0d2c48b2f7e36fb9c42b83">
<div class="showdetail" data-code="{{content_code}}">
<a href="http://list.yohobuy.com/?gender=1,3&amp;msort=8">
<img src="http://img12.static.yhbimg.com/yhb-img01/2015/10/30/06/02af834d146e3f00b1f5fcc8388f641922.jpg?imageView/1/w/337/h/250" alt="" style=""></a>
<a class="title" href="http://list.yohobuy.com/?gender=1,3&amp;msort=8">热门小物优选</a>
... ... @@ -299,8 +300,7 @@
<script type="text/html" id="tmpl-my-login-new">
<div class="myyoho-info-header clearfix">
\{\{# head_ico \}\}
<div class="myyoho-photo" style="display:none;"><img src="" alt="" data-url ="\{\{it.head_ico\}\}">
</div>
<div class="myyoho-photo" style="display:none;"><img src="" alt="" data-url ="\{\{it.head_ico\}\}"></div>
\{\{/ head_ico\}\}
<h3 class="user-email"><a href="<?php print QConfigs_Site_Config::$site_url?>/home?t=\{\{random\}\}">\{\{profile_name\}\}</a></h3>
<h3 class="user-level">
... ...
... ... @@ -68,6 +68,13 @@
</script>
{{/if}}
{{!-- SALE --}}
{{#if saleIndexPage}}
<script>
seajs.use('js/sale/index');
</script>
{{/if}}
{{!-- 登录注册找回密码--}}
{{#if loginPage}}
<script>
... ... @@ -132,3 +139,20 @@
seajs.use('js/order/save');
</script>
{{/if}}
{{!-- sale列表 --}}
{{#if saleListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
... ...
<div class="activity-entry clearfix">
{{#activityEnter}}
<a class="entry-item pull-left {{#if @first}}first{{/if}} {{#if @last}}last{{/if}}" href="{{link}}">
<img class="icon pull-left" src="{{icon}}">
<div class="entry-text">
<span class="title">{{title}}</span>
<p class="desc">{{desc}}</p>
</div>
</a>
{{/activityEnter}}
</div>
... ...
<div class="brand-sale">
<div class="floor-title">
折扣专场 SALE
</div>
<div class="sale-group-big clearfix">
{{#brandSale}}
{{#big}}
<a class="item pull-left {{#if @first}}first{{/if}} {{#if @last}}last{{/if}}" href="{{link}}">
<div class="pic">
<img class="" src="{{img}}">
<div class="time">{{time}}</div>
</div>
<div class="detail">
<img class="brand pull-left" src="{{brand}}">
<div class="text">
<div class="discount">
<span class="num">{{discount}}</span> Off
</div>
<div class="title">
{{title}}
</div>
</div>
</div>
</a>
{{/big}}
{{/brandSale}}
</div>
<div class="sale-group">
</div>
</div>
... ...
... ... @@ -472,7 +472,7 @@ function actionGoodsCart() {
return false;
}
key = encodeURI(key);
$.get(searchDomain + '?callback=?&query=' + key, function(htmlData) {
$.get(searchDomain + '?query=' + key, function(htmlData) {
$('.search-list').html(htmlData.data);
queryNum = $('.search-list').children('li').length;
listIndex = -1;
... ... @@ -486,7 +486,7 @@ function actionGoodsCart() {
}, function() {
$(this).css('background-color', '#fff');
});
}, 'jsonp');
}, 'json');
}
function getText(obj) {
... ... @@ -832,6 +832,248 @@ function actionTopLogoAnimate() {
window.setTimeout(fadeAnimate, 3000);
}
}
window.newArr = [];
window.wrapperindex = 0;
window.gindex = 0;
window.targetArr1 = [];
window.targetArr2 = [];
window.targetArr3 = [];
window.oh1 = 0;
window.oh2 = 0;
window.oh3 = 0;
window.valueIndex = 0;
window.nowIndex = 0;
window.inner1 = '';
window.inner2 = '';
window.inner3 = '';
window.finalresult = '';
function createNewArray(obj) {
var $thirdnavpanel = $(obj);
$thirdnavpanel.find('.thirdnavbar').each(function() {
var $that = $(this);
var $alink = $that.find('a');
var _href = $alink.attr('href');
var hottag = $alink.attr('hot') === 'hot' ? true : false;
var objt = {};
if ($that.hasClass('category-title')) {
objt = {
type: 'title',
height: 49,
content: $that.text(),
index: window.valueIndex,
href: _href,
hot: false
};
} else {
objt = {
type: 'catlist',
height: 36,
content: $alink.text(),
index: window.valueIndex,
href: _href,
hot: hottag
};
}
window.valueIndex++;
window.newArr.push(objt);
});
}
function createWrapper() {
var arrlength = window.newArr.length;
var i = 0;
var objnew = [];
var aobj = [];
var bobj = [];
var cobj = [];
var final1 = '',
final2 = '',
final3 = '';
var a = 0;
var b = 0;
var c = 0;
for (i; i < arrlength; i++) {
objnew = window.newArr[i];
if (window.gindex === 0) {
window.oh1 = (window.oh1 + objnew.height);
if (window.oh1 >= 340 && i !== (arrlength - 1)) {
window.targetArr1 = window.newArr.slice(0, objnew.index + 1);
window.nowIndex = objnew.index + 1;
window.gindex++;
}
if (i === (arrlength - 1)) {
window.targetArr1 = window.newArr.slice(0, arrlength + 1);
break;
}
}
if (window.gindex === 1) {
window.oh2 = (window.oh2 + objnew.height);
if (window.oh2 >= 340 && i !== (arrlength - 1)) {
window.targetArr2 = window.newArr.slice(window.nowIndex, objnew.index + 1);
window.nowIndex = objnew.index + 1;
window.gindex++;
}
if (i === (arrlength - 1)) {
window.targetArr2 = window.newArr.slice(window.nowIndex, arrlength + 1);
break;
}
}
if (window.gindex === 2) {
window.oh3 = (window.oh3 + objnew.height);
if (window.oh3 >= 340 && i !== (arrlength - 1)) {
window.targetArr3 = window.newArr.slice(window.nowIndex, objnew.index + 1);
window.nowIndex = objnew.index + 1;
window.gindex++;
break;
}
if (i === (arrlength - 1)) {
window.targetArr3 = window.newArr.slice(window.nowIndex, arrlength + 1);
break;
}
}
}
for (a; a < window.targetArr1.length; a++) {
aobj = window.targetArr1[a] || {};
if (aobj.type === 'title') {
window.inner1 = window.inner1 +
'<li class="cattitle"><h3><a href="' +
aobj.href +
'">' +
aobj.content +
'</a></h3></li>';
} else {
if (aobj.hot === true) {
window.inner1 = window.inner1 +
'<li class="catdetail"><a class="thirdcatelink hot" href="' +
aobj.href +
'">' +
aobj.content +
'</a></li>';
} else {
window.inner1 = window.inner1 +
'<li class="catdetail"><a class="thirdcatelink" href="' +
aobj.href + '">' +
aobj.content +
'</a></li>';
}
}
}
for (b; b < window.targetArr2.length; b++) {
bobj = window.targetArr2[b] || {};
if (bobj.type === 'title') {
window.inner2 = (window.inner2 +
'<li class="cattitle"><h3><a href="' +
bobj.href + '">' +
bobj.content +
'</a></h3></li>');
} else {
if (bobj.hot === true) {
window.inner2 = (window.inner2 +
'<li class="catdetail"><a class="thirdcatelink hot" href="' +
bobj.href + '">' + bobj.content + '</a></li>');
} else {
window.inner2 = (window.inner2 +
'<li class="catdetail"><a class="thirdcatelink" href="' +
bobj.href + '">' + bobj.content + '</a></li>');
}
}
}
for (c; c < window.targetArr3.length; c++) {
cobj = window.targetArr3[c] || {};
if (cobj.type === 'title') {
window.inner3 = (window.inner3 +
'<li class="cattitle"><h3><a href="' +
cobj.href +
'">' +
cobj.content +
'</a></h3></li>');
} else {
if (cobj.hot === true) {
window.inner3 = (window.inner3 +
'<li class="catdetail"><a class="thirdcatelink hot" href="' +
cobj.href + '">' +
cobj.content +
'</a></li>');
} else {
window.inner3 = (window.inner3 +
'<li class="catdetail"><a class="thirdcatelink" href="' +
cobj.href + '">' +
cobj.content +
'</a></li>');
}
}
}
if (window.inner1 !== '') {
final1 = '<ul class="cate_row1 cate_row">' +
window.inner1 +
'</ul>';
}
if (window.inner2 !== '') {
final2 = '<ul class="cate_row2 cate_row">' +
window.inner2 +
'</ul>';
}
if (window.inner3 !== '') {
final3 = '<ul class="cate_row3 cate_row">' +
window.inner3 +
'</ul>';
}
window.finalresult = final1 + final2 + final3;
$('#' + window.wrapperindex).empty().append(window.finalresult);
}
function actionNav() {
$('.categorywrapper').each(function(index) {
window.wrapperindex = $(this).attr('id');
window.newArr = [];
window.gindex = 0;
window.targetArr1 = [];
window.targetArr2 = [];
window.targetArr3 = [];
window.oh1 = 0;
window.oh2 = 0;
window.oh3 = 0;
window.valueIndex = 0;
window.nowIndex = 0;
window.inner1 = '';
window.inner2 = '';
window.inner3 = '';
createNewArray($(this).find('.category'));
createWrapper();
});
}
function actionTipPic() {
var $content_code = ''
var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code=';
var $img = '';
var $title = '';
var $link = '';
$(document).on('mouseenter','.sub-nav-item',function(){
$content_code = $(this).find('.showdetail').attr('data-code');
if($content_code){
$img = $(this).find('.showdetail').find('img');
$title = $(this).find('.showdetail').find('.title');
$link = $(this).find('.showdetail').find('a');
$.get(serverApi + $content_code+'&width=337&height=250&client_type=web', function(rsdata) {
$img.attr('src',rsdata.data.src);
$link.attr('href',rsdata.data.url);
$title.text(rsdata.data.title);
}, 'jsonp');
}
})
}
/**
* 查询跳转后保留关键字
* @return {[type]} [description]
... ... @@ -1282,7 +1524,7 @@ function actionExeTemplate() {
* @return {[type]} [description]
*/
function actionSearch() {
var searchDomain = 'http://search.yohobuy.com/api/suggest';
var searchDomain = 'http://search.yohobuy.com/product/search/suggest';
$('#query_key').search(searchDomain);
}
... ... @@ -1435,6 +1677,8 @@ function actionLoginInfo() {
* @return {[type]} [description]
*/
function init() {
actionNav(); //处理导航
actionTipPic();//鼠标移入后查询
actionExeTemplate(); //处理模板
actionInitCookie(); //初始化cookie
actionExeCookieMap(); //格式化cookie
... ... @@ -3837,7 +4081,8 @@ define("js/passport/entry", ["jquery","jquery.placeholder"], function(require, e
require("js/passport/reg");
require("js/passport/back");
require("js/passport/login");
require("js/passport/reset");
require("js/passport/reset");
require("js/passport/vertification");
});
define("js/passport/reg", ["jquery"], function(require, exports, module){
/*
... ... @@ -4560,17 +4805,19 @@ var $cr = $('#country-code-hide'),
emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,
acAccount = [
['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'], //数字顺序
'sohu.com', 'hotmail.com', '139.com', '189.com'
], //数字顺序
['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'] //组合顺序
'sohu.com', 'hotmail.com', '139.com', '189.com'
] //组合顺序
],
$ccList = $('#country-code-list'),
$cc = $('#country-code'),
$btn = $('#find-btn'),
$accErr = $('#account-err'),
$caErr = $('#captcha-err'),
time, //timeout-id
caCount = 4, //验证码位数
time, //timeout-id
caCount = 4, //验证码位数
hasPh = false,
hasCa = false;
... ... @@ -4588,8 +4835,9 @@ require("jquery.placeholder");
function imgcode() {
var time = new Date(),
$captchaImg = $('#captcha-img'),
captchaImgSrc = $captchaImg.attr('src').split('?')[0];
$captchaImg = $('#captcha-img'),
captchaImgSrc = $captchaImg.attr('src').split('?')[0];
$('#captcha-img').attr('src', captchaImgSrc + '?t=' + time.getTime());
//getSource('yoho_family_web', '换一张', 'homepage_man');
... ... @@ -4647,8 +4895,8 @@ function vaCa() {
type: 'POST',
url: '/passport/back/authcode',
data: {
verifyCode: v,
phoneNum: $('#phone-num').val(),
verifyCode: v,
phoneNum: $('#phone-num').val(),
area: $('#country-code-hide').val()
}
... ... @@ -5345,3 +5593,106 @@ $('#pwd, #repwd').keydown(function(e) {
});
});
define("js/passport/vertification", ["jquery"], function(require, exports, module){
/**
* 验证手机
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/14
*/
var $ = require("jquery");
var $sc = $('#send-captcha'),
$msgTip = $('#captcha-tip'),
$errTip = $('#err-tip'),
$next = $('#next-step'),
seconds,
itime;
$sc.click(function() {
$.post('/passport/register/authcode', {
mobile: $('#mobile').val(),
area: $('#area').val(),
captcha: $('#captchaPic').val(),
project: 'repassword'
}, function(jsonData) {
if (jsonData.code === 200) {
$errTip.hide();
if ($(this).hasClass('disable')) {
return;
}
seconds = 60;
//$sc.addClass('disable').prop('disabled', true);
$sc.addClass('disable').attr('disabled', true);
$msgTip.removeClass('hide');
$sc.val(seconds-- + '秒后可重新操作');
itime = setInterval(function() {
if (seconds === 0) {
clearInterval(itime);
//$sc.val('发送验证码').removeClass('disable').prop('disabled', false);
$sc.val('发送验证码').removeClass('disable').removeAttr('disabled');
} else {
$sc.val(seconds-- + '秒后可重新操作');
}
}, 1000);
} else {
$(this).addClass('error');
$errTip.removeClass('hide').text('发送失败');
}
});
});
if ($(this).hasClass('disable')) {
return;
}
seconds = 60;
//$sc.addClass('disable').prop('disabled', true);
$sc.addClass('disable').attr('disabled', true);
$msgTip.removeClass('hide');
$sc.val(seconds-- + '秒后可重新操作');
itime = setInterval(function() {
if (seconds === 0) {
clearInterval(itime);
//$sc.val('发送验证码').removeClass('disable').prop('disabled', false);
$sc.val('发送验证码').removeClass('disable').removeAttr('disabled');
} else {
$sc.val(seconds-- + '秒后可重新操作');
}
}, 1000);
$('#captcha').keyup(function() {
var v = $.trim($(this).val());
if (v !== '') {
//添加验证码正确验证
//$next.removeClass('disable').prop('disabled', false);
$next.removeClass('disable').removeAttr('disabled');
} else {
//$next.addClass('disable').prop('disabled', true);
$next.addClass('disable').attr('disabled', true);
}
}).blur(function() {
var v = $.trim($(this).val());
if (v === '') {
//添加验证码正确验证
$(this).addClass('error');
$errTip.removeClass('hide');
} else {
$(this).removeClass('error');
$errTip.addClass('hide');
}
}).focus(function() {
$(this).removeClass('error');
});
});
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -95,20 +95,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();
... ...
... ... @@ -142,7 +142,7 @@ function actionGoodsCart() {
return false;
}
key = encodeURI(key);
$.get(searchDomain + '?callback=?&query=' + key, function(htmlData) {
$.get(searchDomain + '?query=' + key, function(htmlData) {
$('.search-list').html(htmlData.data);
queryNum = $('.search-list').children('li').length;
listIndex = -1;
... ... @@ -156,7 +156,7 @@ function actionGoodsCart() {
}, function() {
$(this).css('background-color', '#fff');
});
}, 'jsonp');
}, 'json');
}
function getText(obj) {
... ... @@ -502,6 +502,254 @@ function actionTopLogoAnimate() {
window.setTimeout(fadeAnimate, 3000);
}
}
window.newArr = [];
window.wrapperindex = 0;
window.gindex = 0;
window.targetArr1 = [];
window.targetArr2 = [];
window.targetArr3 = [];
window.oh1 = 0;
window.oh2 = 0;
window.oh3 = 0;
window.valueIndex = 0;
window.nowIndex = 0;
window.inner1 = '';
window.inner2 = '';
window.inner3 = '';
window.finalresult = '';
function createNewArray(obj) {
var $thirdnavpanel = $(obj);
$thirdnavpanel.find('.thirdnavbar').each(function() {
var $that = $(this);
var $alink = $that.find('a');
var _href = $alink.attr('href');
var hottag = $alink.attr('hot') === 'hot' ? true : false;
var objt = {};
if ($that.hasClass('category-title')) {
objt = {
type: 'title',
height: 49,
content: $that.text(),
index: window.valueIndex,
href: _href,
hot: false
};
} else {
objt = {
type: 'catlist',
height: 36,
content: $alink.text(),
index: window.valueIndex,
href: _href,
hot: hottag
};
}
window.valueIndex++;
window.newArr.push(objt);
});
}
function createWrapper() {
var arrlength = window.newArr.length;
var i = 0;
var objnew = [];
var aobj = [];
var bobj = [];
var cobj = [];
var final1 = '',
final2 = '',
final3 = '';
var a = 0;
var b = 0;
var c = 0;
for (i; i < arrlength; i++) {
objnew = window.newArr[i];
if (window.gindex === 0) {
window.oh1 = (window.oh1 + objnew.height);
if (window.oh1 >= 340 && i !== (arrlength - 1)) {
window.targetArr1 = window.newArr.slice(0, objnew.index + 1);
window.nowIndex = objnew.index + 1;
window.gindex++;
}
if (i === (arrlength - 1)) {
window.targetArr1 = window.newArr.slice(0, arrlength + 1);
break;
}
}
if (window.gindex === 1) {
window.oh2 = (window.oh2 + objnew.height);
if (window.oh2 >= 340 && i !== (arrlength - 1)) {
window.targetArr2 = window.newArr.slice(window.nowIndex, objnew.index + 1);
window.nowIndex = objnew.index + 1;
window.gindex++;
}
if (i === (arrlength - 1)) {
window.targetArr2 = window.newArr.slice(window.nowIndex, arrlength + 1);
break;
}
}
if (window.gindex === 2) {
window.oh3 = (window.oh3 + objnew.height);
if (window.oh3 >= 340 && i !== (arrlength - 1)) {
window.targetArr3 = window.newArr.slice(window.nowIndex, objnew.index + 1);
window.nowIndex = objnew.index + 1;
window.gindex++;
break;
}
if (i === (arrlength - 1)) {
window.targetArr3 = window.newArr.slice(window.nowIndex, arrlength + 1);
break;
}
}
}
for (a; a < window.targetArr1.length; a++) {
aobj = window.targetArr1[a] || {};
if (aobj.type === 'title') {
window.inner1 = window.inner1 +
'<li class="cattitle"><h3><a href="' +
aobj.href +
'">' +
aobj.content +
'</a></h3></li>';
} else {
if (aobj.hot === true) {
window.inner1 = window.inner1 +
'<li class="catdetail"><a class="thirdcatelink hot" href="' +
aobj.href +
'">' +
aobj.content +
'</a></li>';
} else {
window.inner1 = window.inner1 +
'<li class="catdetail"><a class="thirdcatelink" href="' +
aobj.href + '">' +
aobj.content +
'</a></li>';
}
}
}
for (b; b < window.targetArr2.length; b++) {
bobj = window.targetArr2[b] || {};
if (bobj.type === 'title') {
window.inner2 = (window.inner2 +
'<li class="cattitle"><h3><a href="' +
bobj.href + '">' +
bobj.content +
'</a></h3></li>');
} else {
if (bobj.hot === true) {
window.inner2 = (window.inner2 +
'<li class="catdetail"><a class="thirdcatelink hot" href="' +
bobj.href + '">' + bobj.content + '</a></li>');
} else {
window.inner2 = (window.inner2 +
'<li class="catdetail"><a class="thirdcatelink" href="' +
bobj.href + '">' + bobj.content + '</a></li>');
}
}
}
for (c; c < window.targetArr3.length; c++) {
cobj = window.targetArr3[c] || {};
if (cobj.type === 'title') {
window.inner3 = (window.inner3 +
'<li class="cattitle"><h3><a href="' +
cobj.href +
'">' +
cobj.content +
'</a></h3></li>');
} else {
if (cobj.hot === true) {
window.inner3 = (window.inner3 +
'<li class="catdetail"><a class="thirdcatelink hot" href="' +
cobj.href + '">' +
cobj.content +
'</a></li>');
} else {
window.inner3 = (window.inner3 +
'<li class="catdetail"><a class="thirdcatelink" href="' +
cobj.href + '">' +
cobj.content +
'</a></li>');
}
}
}
if (window.inner1 !== '') {
final1 = '<ul class="cate_row1 cate_row">' +
window.inner1 +
'</ul>';
}
if (window.inner2 !== '') {
final2 = '<ul class="cate_row2 cate_row">' +
window.inner2 +
'</ul>';
}
if (window.inner3 !== '') {
final3 = '<ul class="cate_row3 cate_row">' +
window.inner3 +
'</ul>';
}
window.finalresult = final1 + final2 + final3;
$('#' + window.wrapperindex).empty().append(window.finalresult);
}
function actionNav() {
$('.categorywrapper').each(function(index) {
window.wrapperindex = $(this).attr('id');
window.newArr = [];
window.gindex = 0;
window.targetArr1 = [];
window.targetArr2 = [];
window.targetArr3 = [];
window.oh1 = 0;
window.oh2 = 0;
window.oh3 = 0;
window.valueIndex = 0;
window.nowIndex = 0;
window.inner1 = '';
window.inner2 = '';
window.inner3 = '';
createNewArray($(this).find('.category'));
createWrapper();
});
}
/**
* 获取三级导航的tip图标
* @return {[type]} [description]
*/
function actionTipPic() {
var tipscode = {};
var $contentcode = '';
var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code=';
var $img = '';
var $title = '';
var $link = '';
$(document).on('mouseenter', '.sub-nav-item', function() {
$contentcode = $(this).find('.showdetail').attr('data-code');
if ($contentcode) {
if (!tipscode[$contentcode]) {
tipscode[$contentcode] = $contentcode;
$img = $(this).find('.showdetail').find('img');
$title = $(this).find('.showdetail').find('.title');
$link = $(this).find('.showdetail').find('a');
$.get(serverApi + $contentcode + '&width=337&height=250&client_type=web', function(rsdata) {
$img.attr('src', rsdata.data.src);
$link.attr('href', rsdata.data.url);
$title.text(rsdata.data.title);
}, 'jsonp');
}
}
});
}
/**
* 查询跳转后保留关键字
* @return {[type]} [description]
... ... @@ -952,7 +1200,7 @@ function actionExeTemplate() {
* @return {[type]} [description]
*/
function actionSearch() {
var searchDomain = 'http://search.yohobuy.com/api/suggest';
var searchDomain = 'http://search.yohobuy.com/product/search/suggest';
$('#query_key').search(searchDomain);
}
... ... @@ -1105,6 +1353,8 @@ function actionLoginInfo() {
* @return {[type]} [description]
*/
function init() {
actionNav(); //处理导航
actionTipPic(); //鼠标移入后查询
actionExeTemplate(); //处理模板
actionInitCookie(); //初始化cookie
actionExeCookieMap(); //格式化cookie
... ...
... ... @@ -14,17 +14,19 @@ var $cr = $('#country-code-hide'),
emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,
acAccount = [
['qq.com', '163.com', '126.com', 'sina.com', 'gmail.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'], //数字顺序
'sohu.com', 'hotmail.com', '139.com', '189.com'
], //数字顺序
['gmail.com', 'qq.com', '163.com', '126.com', 'sina.com',
'sohu.com', 'hotmail.com', '139.com', '189.com'] //组合顺序
'sohu.com', 'hotmail.com', '139.com', '189.com'
] //组合顺序
],
$ccList = $('#country-code-list'),
$cc = $('#country-code'),
$btn = $('#find-btn'),
$accErr = $('#account-err'),
$caErr = $('#captcha-err'),
time, //timeout-id
caCount = 4, //验证码位数
time, //timeout-id
caCount = 4, //验证码位数
hasPh = false,
hasCa = false;
... ... @@ -42,8 +44,9 @@ require('yoho.placeholder');
function imgcode() {
var time = new Date(),
$captchaImg = $('#captcha-img'),
captchaImgSrc = $captchaImg.attr('src').split('?')[0];
$captchaImg = $('#captcha-img'),
captchaImgSrc = $captchaImg.attr('src').split('?')[0];
$('#captcha-img').attr('src', captchaImgSrc + '?t=' + time.getTime());
//getSource('yoho_family_web', '换一张', 'homepage_man');
... ... @@ -101,8 +104,8 @@ function vaCa() {
type: 'POST',
url: '/passport/back/authcode',
data: {
verifyCode: v,
phoneNum: $('#phone-num').val(),
verifyCode: v,
phoneNum: $('#phone-num').val(),
area: $('#country-code-hide').val()
}
... ...
... ... @@ -5,4 +5,5 @@
require('./reg');
require('./back');
require('./login');
require('./reset');
\ No newline at end of file
require('./reset');
require('./vertification');
\ No newline at end of file
... ...
/**
* 首页
* @author: bikai<kia.bi@yoho.cn>
* @date: 2016/1/18
*/
var $ = require('yoho.jquery'),
lazyLoad = require('yoho.lazyload');
require('../common/slider');
lazyLoad($('img.lazy'));
$('.slide-container').slider();
... ...
... ... @@ -532,7 +532,7 @@
.third-nav-wrapper {
box-sizing: border-box;
height: 300px;
height: 410px;
position: absolute;
left: 0;
top: 38px;
... ... @@ -602,8 +602,8 @@
box-sizing: border-box;
padding-left: 19px;
padding-right: 19px;
width: 268px;
height: 100%;
width: 337px;
height: 250px;
float: right;
}
... ... @@ -945,12 +945,12 @@
.showdetail img {
display: block;
box-sizing: border-box;
width: 226px;
height: 200px;
width: 337px;
height: 250px;
}
.showdetail .title {
display: block;
margin-top: 17px;
margin-top: 40px;
width: 100%;
height: 15px;
text-align: center;
... ...
@charset "utf-8";
@import "compass",
@import "compass",
"compass/reset",
"header",
"footer",
... ... @@ -9,7 +9,7 @@
"pager";
body {
font-family: arial,"Microsoft YaHei";
font-family: arial,"Microsoft YaHei";
}
@font-face {
... ... @@ -38,10 +38,10 @@ body {
}
.clearfix:after {
clear: both;
clear: both;
}
.clearfix {
.clearfix {
*zoom: 1;
}
... ... @@ -86,4 +86,4 @@ input,textarea {
}
}
@import "home/index", "product/index", "guang/index", "passport/index", "error","order/index";
@import "home/index", "product/index", "guang/index", "passport/index", "error", "order/index", "sale/index";
... ...
.sale-page {
margin-top: 10px;
.slide-container {
position: relative;
height: 450px;
overflow: hidden;
}
.activity-entry {
margin: 10px 0;
.entry-item {
display: block;
width: 377px;
margin-right: 10px;
padding: 24px 0;
background: #f5f5f5;
&.first,
&.last {
width: 376px;
}
&.last {
margin-right: 0;
}
}
.entry-text {
padding-left: 160px;
font-size: 16px;
}
.icon {
width: 72px;
height: 72px;
margin-left: 48px;
}
.title {
font-size: 26px;
font-weight: bold;
line-height: 48px;
}
}
.floor-title {
margin: 80px auto 40px;
width: 300px;
font-size: 16px;
line-height: 30px;
text-align: center;
border: 1px solid #000;
}
.brand-sale {
.sale-group-big {
.item {
width: 377px;
margin-right: 10px;
&.first,
&.last {
width: 376px;
}
&.last {
margin-right: 0;
}
}
.pic {
position: relative;
height: 400px;
}
.time {
@include box-sizing(border-box);
position: absolute;
left: 0;
bottom: 0;
width: 100%;
padding: 0 10px;
font-size: 16px;
line-height: 30px;
text-align: right;
color: #fff;
background: #4e4e4e;
}
.detail {
background: #f5f5f5;
}
.brand {
margin: 24px 10px;
}
.text {
padding: 24px 10px 24px 0;
font-size: 14px;
color: #fd5659;
}
.discount {
font-size: 28px;
font-weight: bold;
.num {
font-size: 40px;
}
}
}
}
}
... ...
<?php
/**
* 启动运行
*
*
* @name Bootstrap
* @author fei.hong
* @desc 所有在Bootstrap类中, 以_init开头的方法, 都会被Yaf调用,
... ... @@ -54,7 +54,7 @@ class Bootstrap extends Bootstrap_Abstract
// */
// public function _initPlugin(Dispatcher $dispatcher)
// {
//
//
// }
/**
... ... @@ -77,9 +77,10 @@ class Bootstrap extends Bootstrap_Abstract
case 'www': // 主站
case 'new': // 原新版
case 'dev': // 开发环境
case 'web':
break;
case 'search': // 搜索
$searchRequest = new Yaf\Request\Http('/product/search/index');
$searchRequest = new Yaf\Request\Http('/product/search/index');
$dispatcher->setRequest($searchRequest);
break;
case 'guang': // 逛
... ... @@ -89,10 +90,10 @@ class Bootstrap extends Bootstrap_Abstract
$module = 'Product';
$url = strtolower($dispatcher->getRequest()->getRequestUri());
//list列表的index
if(empty($url) || $url == '/index') {
$listRequest = new Yaf\Request\Http('/product/list/index');
$dispatcher->setRequest($listRequest);
}
if(empty($url) || $url == '/index' || $url == '/') {
$listRequest = new Yaf\Request\Http('/product/list/index');
$dispatcher->setRequest($listRequest);
}
break;
case 'sale'://促销
$module = 'Product';
... ... @@ -135,7 +136,7 @@ class Bootstrap extends Bootstrap_Abstract
$layout = new TemplateLayout();
$layout->setScriptPath($this->_config->application->template->path);
$dispatcher->setView($layout);
//}
//}
}
// /**
... ...
... ... @@ -85,6 +85,8 @@ class CommonController extends WebAction
$content_code = $this->get('content_code', '');
$client_type = $this->get('client_type', 'web');
$callback = $this->get('callback', '');
$width = $this->get('width', '');
$height = $this->get('height', '');
$params = array(
'content_code' => $content_code,
'client_type' => $client_type
... ... @@ -96,16 +98,23 @@ class CommonController extends WebAction
}
else
{
$banner = '';
if(isset($data['data'][0]['data']))
{
$banner = current($data['data'][0]['data']);
if(!empty($banner)) {
$banner['src'] = Images::getImageUrl($banner['src'], 2600, 60 ,2);
//str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']);
}
}
$banner = '';
if(isset($data['data'][0]['data']))
{
if($data['data'][0]['template_name'] == 'single_image') {
$banner = current($data['data'][0]['data']);
} else if($data['data'][0]['template_name'] == 'single_name_image') {
$banner = $data['data'][0]['data'];
}
if(!empty($banner)) {
if(empty($width) || empty($height) ) {
$width = 2600;//通栏广告
$height = 60;
}
$banner['src'] = Images::getImageUrl($banner['src'], $width, $height ,2);
//str_replace('?imageView/{mode}/w/{width}/h/{height}', '', $banner['src']);
}
}
}
return $this->helpJsonCallbackResult($callback, $data['code'], $data['message'], $banner);
}
... ...
... ... @@ -18,4 +18,4 @@ class LifestyleController extends WebAction
);
$this->_view->display('index', $data);
}
}
\ No newline at end of file
}
... ...
... ... @@ -66,56 +66,60 @@ class HomeModel
$key = sprintf('%s_%s_%s',CacheConfig::KEY_WEB_HOME_NAVBAR_DATA, md5(serialize($data)), $channel);
$menu = Cache::get($key);
if(empty($menu)) {
$item = array();
foreach ($data['data'] as $val) {
$item = array(
'name_cn' => $val['sort_name'], // 父级
'name_en' => $val['sort_name_en'],
'link' => $val['sort_url'],
'icon' => $val['sort_ico'],
'classname' => str_replace(' ', '', strtolower($val['sort_name_en'])) == $channel ? $channel : '',
'index_main' => 0,
'is_hot' => $val['is_hot'] == 'Y' ? true : false,
'is_new' => $val['is_new'] == 'Y' ? true : false,
// 'subnav' => array()
);
foreach ($val['sub'] as $sub) { // 二级
$index_sub = 0;
$subnav = array(
'name' => $sub['sort_name'],
'name_en' => $sub['sort_name_en'],
'link' => $sub['sort_url'],
'is_hot' => $sub['is_hot'] == 'Y' ? true : false,
'is_new' => $sub['is_new'] == 'Y' ? true : false,
// 'thirdnav' => array(),
'index_sub' => $index_sub ++
);
if (isset($sub['sub'])) {
foreach ($sub['sub'] as $thirdsub) { // 三级
$thirdnav = array(
'title' => $thirdsub['sort_name'],
'name_en' => $thirdsub['sort_name_en'],
'link' => $thirdsub['sort_url'],
// 'branditems' => array()
);
if (isset($thirdsub['sub'])) {
foreach ($thirdsub['sub'] as $fourthnav) { // 四级
$thirdnav['branditems'][] = array(
'brandname' => $fourthnav['sort_name'],
'link' => $fourthnav['sort_url'],
'hot' => $fourthnav['is_hot'] == 'Y' ? 'hot' : ''
);
}
}
$subnav['thirdnav'][] = $thirdnav;
}
}
$item['subnav'][] = $subnav;
}
$menu[] = $item;
}
Cache::set($key, $menu, 3600);
$item = array();
$index_main = 0;
foreach ($data['data'] as $val) {
$item = array(
'name_cn' => $val['sort_name'], // 父级
'name_en' => $val['sort_name_en'],
'link' => $val['sort_url'],
'icon' => $val['sort_ico'],
'classname' => str_replace(' ', '', strtolower($val['sort_name_en'])) == $channel ? $channel : '',
'index_main' => $index_main ++,
'content_code' => $val['content_code'],
'is_hot' => $val['is_hot'] == 'Y' ? true : false,
'is_new' => $val['is_new'] == 'Y' ? true : false,
// 'subnav' => array()
);
$index_sub = 0;
foreach ($val['sub'] as $sub) { // 二级
$subnav = array(
'name' => $sub['sort_name'],
'name_en' => $sub['sort_name_en'],
'link' => $sub['sort_url'],
'is_hot' => $sub['is_hot'] == 'Y' ? true : false,
'is_new' => $sub['is_new'] == 'Y' ? true : false,
'content_code' => $sub['content_code'],
// 'thirdnav' => array(),
'index_sub' => $index_sub ++
);
if (isset($sub['sub'])) {
foreach ($sub['sub'] as $thirdsub) { // 三级
$thirdnav = array(
'title' => $thirdsub['sort_name'],
'name_en' => $thirdsub['sort_name_en'],
'link' => $thirdsub['sort_url'],
'content_code' => $thirdsub['content_code'],
// 'branditems' => array()
);
if (isset($thirdsub['sub'])) {
foreach ($thirdsub['sub'] as $fourthnav) { // 四级
$thirdnav['branditems'][] = array(
'brandname' => $fourthnav['sort_name'],
'link' => $fourthnav['sort_url'],
'hot' => $fourthnav['is_hot'] == 'Y' ? 'hot' : ''
);
}
}
$subnav['thirdnav'][] = $thirdnav;
}
}
$item['subnav'][] = $subnav;
}
$menu[] = $item;
}
Cache::set($key, $menu, 3600);
}
return $menu;
}
... ... @@ -170,14 +174,14 @@ class HomeModel
*/
public static function getChannelResource($channel, $content_code)
{
$key = sprintf(CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_'.$channel);
$data = Cache::get($key);
if(empty($data)) {
$resource = IndexData::getResourceData($content_code);
// 格式化数据
$data = ChannelProcess::getFormat($channel, $resource['data']);
Cache::set($key, $data, 3600);
}
$key = sprintf(CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_'.$channel);
$data = Cache::get($key);
if(empty($data)) {
$resource = IndexData::getResourceData($content_code);
// 格式化数据
$data = ChannelProcess::getFormat($channel, $resource['data']);
Cache::set($key, $data, 3600);
}
return $data;
}
... ... @@ -227,47 +231,47 @@ class HomeModel
//缓存数据
$result = Cache::get($key);
if(empty($result)) {
$params = array(
'order' => 's_t_desc',
'shelve_time' => strtotime("-60 days") . ',' . time()
);
//男首频道最新上架参数是gender=1,3
if($channel == self::COOKIE_NAME_BOYS) {
$params['gender'] = '1,3';
}
//女首频道最新上架参数是gender=2,3
else if($channel == self::COOKIE_NAME_GIRLS) {
$params['gender'] = '2,3';
}
// 最新上架分类
if (isset(ChannelConfig::$newArrivalSortList[$channel])) {
$sortList = ChannelConfig::$newArrivalSortList[$channel];
// 获取分类列表获取商品信息
$goodsList = SearchData::getSearchDataBySort($params, $sortList);
$pos = 1;
foreach ($goodsList as $goods) {
// 格式化数据
$val = Helpers::formatProduct($goods, true, true, true, 280, 373);
if ($val['price'] == false) {
$val['price'] = $val['salePrice'];
}
$val['url'] = sprintf('%s?channel=%s&from=%s-n_%s', $val['url'], $channel , $channel, $pos++);
//TODO 字段要调整
$val['isFew'] = $val['is_soon_sold_out'];
$val['tags']['isLimit'] = $val['tags']['is_limited'];
$val['tags']['isSale'] = false;//$val['tags']['is_discount'];暂时不显示
$val['tags']['isNew'] = false;//$val['tags']['is_new'];暂时不显示
$val['tags']['isYearMidPromotion'] = $val['tags']['midYear'];
$val['tags']['isYearEndPromotion'] = $val['tags']['yearEnd'];
$val['tags']['isReNew'] = false;//$val['tags']['is_advance'];暂时不显示
unset($val['tags']['is_advance'], $val['tags']['is_discount'], $val['tags']['is_limited'], $val['tags']['is_new'],
$val['tags']['is_yohood'], $val['tags']['midYear'], $val['tags']['yearEnd']);
if (! empty($val)) {
$result[] = $val;
}
}
}
Cache::set($key, $result, 3600);
$params = array(
'order' => 's_t_desc',
'shelve_time' => strtotime("-60 days") . ',' . time()
);
//男首频道最新上架参数是gender=1,3
if($channel == self::COOKIE_NAME_BOYS) {
$params['gender'] = '1,3';
}
//女首频道最新上架参数是gender=2,3
else if($channel == self::COOKIE_NAME_GIRLS) {
$params['gender'] = '2,3';
}
// 最新上架分类
if (isset(ChannelConfig::$newArrivalSortList[$channel])) {
$sortList = ChannelConfig::$newArrivalSortList[$channel];
// 获取分类列表获取商品信息
$goodsList = SearchData::getSearchDataBySort($params, $sortList);
$pos = 1;
foreach ($goodsList as $goods) {
// 格式化数据
$val = Helpers::formatProduct($goods, true, true, true, 280, 373);
if ($val['price'] == false) {
$val['price'] = $val['salePrice'];
}
$val['url'] = sprintf('%s?channel=%s&from=%s-n_%s', $val['url'], $channel , $channel, $pos++);
//TODO 字段要调整
$val['isFew'] = $val['is_soon_sold_out'];
$val['tags']['isLimit'] = $val['tags']['is_limited'];
$val['tags']['isSale'] = false;//$val['tags']['is_discount'];暂时不显示
$val['tags']['isNew'] = false;//$val['tags']['is_new'];暂时不显示
$val['tags']['isYearMidPromotion'] = $val['tags']['midYear'];
$val['tags']['isYearEndPromotion'] = $val['tags']['yearEnd'];
$val['tags']['isReNew'] = false;//$val['tags']['is_advance'];暂时不显示
unset($val['tags']['is_advance'], $val['tags']['is_discount'], $val['tags']['is_limited'], $val['tags']['is_new'],
$val['tags']['is_yohood'], $val['tags']['midYear'], $val['tags']['yearEnd']);
if (! empty($val)) {
$result[] = $val;
}
}
}
Cache::set($key, $result, 3600);
}
return $result;
}
... ...
... ... @@ -40,7 +40,7 @@ class SearchModel
'gender' => FILTER_SANITIZE_STRING,
'p_d' => FILTER_DEFAULT,
'shelve_time' => FILTER_DEFAULT,
'isNew' => FILTER_DEFAULT,
'new' => FILTER_DEFAULT,
'specialoffer' => FILTER_DEFAULT,
'limited' => FILTER_DEFAULT,
'order' => FILTER_DEFAULT,
... ... @@ -175,7 +175,7 @@ class SearchModel
// 组合搜索分类url
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
// 组合搜索店铺url
if (isset($param['keyword'])) {
if (isset($searchCondition['condition']['query'])) {
$param['keyword'] = $searchCondition['condition']['query'];
$urlList['shop'] = HelperSearch::getShopUrl($param);
}
... ... @@ -210,11 +210,32 @@ class SearchModel
/**
* 查询搜索提示
* @param $query
* @return array
*/
public static function getSuggest($query)
{
$param = array();
$result = SearchData::getSuggest($param);
return $result;
$data = '';
$result = SearchData::getSuggest($query);
if (isset($result['code']) && $result['code'] == 200 && isset($result['suggest']['items']) && !empty($result['suggest']['items'])) {
foreach ($result['suggest']['items'] as $v) {
$data .= '<li><a style="display: block;" href="http://search.yohobuy.com/?query='.$v['item'].'" class="clearfix clear search-item" title="'.$v['item'].'" act="http://search.yohobuy.com/?query='.$v['item'].'"><span class="searchvalue" >'.$v['item'].'</span><span class="valuenum">约'.$v['frequency'].'个商品</span></a></li>';
}
}
echo $data;
}
/**
* 获取分类的尺码
*/
public static function getSortSize($condition)
{
$size = array();
//返回搜索条件
$condition['needFilter'] = 1;
$condition['viewNum'] = 1;
$result = SearchData::searchElasticByCondition($condition);
if (isset($result['code']) && $result['code'] == 200 && isset($result['data']['filter']) && !empty($result['data']['filter'])) {
return HelperSearch::size($result['data']['filter'], true);
}
}
}
\ No newline at end of file
... ...
... ... @@ -6,224 +6,225 @@ use Plugin\Helpers;
use LibModels\Wap\Passport\BackData;
use Plugin\AuthCode;
class BackController extends WebAction {
/**
* 找回密码
*/
public function indexAction() {
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader(false),
'backPage' => true,
'back' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countryCode' => '86',
'countryName' => '中国',
'captchaUrl' => '/passport/images?t=1449799445',
'countryList' => RegData::getAreasData()
)
);
$this->_view->display ( 'index', $data );
}
/**
* 校验验证码
*/
public function authcodeAction() {
$phoneNum = $this->post ('phoneNum', '');
$area = intval ($this->post( 'area', '86' ));
$verifyCode = $this->post ('verifyCode', '');
$data = array('code' => 400, 'message' =>'验证失败');
if ((Helpers::verifyEmail($phoneNum) || Helpers::verifyMobile($phoneNum))
&& PassportModel::verifyCode($verifyCode)) {
$data['code'] = 200;
$data['message'] = '验证成功';
}
echo $this->echoJson($data);
}
/**
* 邮箱
*/
public function emailAction() {
$phoneNum = $this->post ('phoneNum', '');
$area = intval ($this->post('area', '86'));
$verifyCode = $this->post('verifyCode', '');
if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱
$email = $phoneNum;
$data = BackData::sendCodeToEmail($email);
if ($data ['code'] == 200) {
$this->setSession('email', $email);
$this->redirect ('sendemail');
} else {
$this->redirect ('index');
}
} else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号
$mobile = $phoneNum;
$data = BackData::sendCodeToMobile($mobile, $area);
if ($data['code'] == 200) {
$this->setSession ('mobile', $mobile );
$this->setSession ('area', $area );
$this->setSession ('verifyCode', $verifyCode );
$this->redirect ('verification');
} else {
$this->redirect ('index');
}
}
}
/**
* 发送邮件页面
*/
public function sendemailAction() {
$email = $this->getSession ('email');
if (empty ( $email )) {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader(false),
'sendEmail' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countrys' => array ()
)
);
$this->_view->display('send-email', $data);
}
/**
* 重置密码页面
*/
public function backcodeAction() {
$code = $this->get('code');
$info = $this->checkCode($code);
if (empty ( $info )) {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader(false),
'resetPage' => true,
'resetPwd' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countrys' => array(),
'code' => $code
)
);
$this->_view->display('reset-pwd', $data);
}
/**
* 更新密码接口
*/
public function updateAction() {
$code = $this->post('code');
$password = $this->post('pwd');
$info = $this->checkCode($code);
if (Helpers::verifyPassword ($password) && ! empty ($info)) {
// 修改密码
if (isset ( $info ['mobile'] )) { // 手机号修改密码
$mobile = $info ['mobile'];
$token = $info ['token'];
$area = $info ['area'];
$data = BackData::modifyPasswordByMobile($mobile, $token, $password, $area);
if ($data ['code'] == 200) {
$this->redirect ( 'resetSuccess' );
}
} else if (isset ($info ['uid'])) { // 其他方式修改密码
$uid = $info ['uid'];
$this->redirect ( 'resetSuccess' );
}
}
// 跳转错误页面
$this->redirect('/error/index');
}
/**
* 重置密码成功
*/
public function resetSuccessAction() {
$banner = PassportModel::getLeftBanner ( PassportModel::BACK_LFFT_BANNER_CODE );
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader ( false ),
'resetSuccess' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countrys' => array ()
)
);
$this->_view->display ( 'reset-success', $data );
}
/**
* 手机验证页面
*/
public function verificationAction() {
$mobile = $this->getSession ('mobile');
$area = $this->getSession ('area');
$verifyCode = $this->getSession ('verifyCode');
if (empty ($mobile)) {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner (PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader ( false ),
'vertificationPage' => true,
'verification' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'mobile' => $mobile,
'area' => $area,
'verifyCode' => $verifyCode,
'countrys' => array ()
)
);
$this->_view->display ('verification', $data);
}
/**
* 手机找回密码验证
*/
public function backmobileAction() {
$mobile = $this->post ( 'mobile' );
$area = $this->post ( 'area' );
$verifyCode = $this->post ( 'verifyCode' );
$code = $this->post ( 'code' ); // code
if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area) {
$result = BackData::validateMobileCode ( $mobile, $code, $area );
if ($result ['code'] == 200) {
$str = json_encode ( array (
'mobile' => $mobile,
'area' => $area,
'token' => $result ['data'] ['token'],
'create_time' => time ()
) );
$code = AuthCode::encode ( $str, PassportModel::BACK_FIND_SECRET_KEY );
$url = '/passport/back/backcode?code=' . base64_encode ( $code );
$this->redirect ( SITE_MAIN . $url );
}
}
//出错直接跳到找回密码页
$this->redirect ('/passport/back/index');
}
/**
* 检查code
*
* @param string $code
* @return boolean
*/
private function checkCode($code) {
$code = base64_decode ( $code );
$info = json_decode ( AuthCode::decode ( $code, PassportModel::BACK_FIND_SECRET_KEY ), true );
if ($info ['create_time'] < 1 || (time () - $info ['create_time']) > 86400) {
return array ();
}
return $info;
}
/**
* 找回密码
*/
public function indexAction() {
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader(false),
'backPage' => true,
'back' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countryCode' => '86',
'countryName' => '中国',
'captchaUrl' => '/passport/images?t=1449799445',
'countryList' => RegData::getAreasData()
)
);
$this->_view->display ( 'index', $data );
}
/**
* 校验验证码
*/
public function authcodeAction() {
$phoneNum = $this->post ('phoneNum', '');
$area = intval ($this->post( 'area', '86' ));
$verifyCode = $this->post ('verifyCode', '');
$data = array('code' => 400, 'message' =>'验证失败');
if ((Helpers::verifyEmail($phoneNum) || Helpers::verifyMobile($phoneNum))
&& PassportModel::verifyCode($verifyCode)) {
$data['code'] = 200;
$data['message'] = '验证成功';
}
echo $this->echoJson($data);
}
/**
* 邮箱
*/
public function emailAction() {
$phoneNum = $this->post ('phoneNum', '');
$area = intval ($this->post('area', '86'));
$verifyCode = $this->post('verifyCode', '');
if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱
$email = $phoneNum;
$data = BackData::sendCodeToEmail($email);
if ($data ['code'] == 200) {
$this->setSession('email', $email);
$this->redirect ('sendemail');
} else {
$this->redirect ('index');
}
} else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号
$mobile = $phoneNum;
$data = BackData::sendCodeToMobile($mobile, $area);
if ($data['code'] == 200) {
$this->setSession ('mobile', $mobile );
$this->setSession ('area', $area );
$this->setSession ('verifyCode', $verifyCode );
$this->redirect ('verification');
} else {
$this->redirect ('index');
}
}
}
/**
* 发送邮件页面
*/
public function sendemailAction() {
$email = $this->getSession ('email');
if (empty ( $email )) {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader(false),
'sendEmail' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countrys' => array ()
)
);
$this->_view->display('send-email', $data);
}
/**
* 重置密码页面
*/
public function backcodeAction() {
$code = $this->get('code');
$info = $this->checkCode($code);
if (empty ( $info )) {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader(false),
'resetPage' => true,
'resetPwd' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countrys' => array(),
'code' => $code
)
);
$this->_view->display('reset-pwd', $data);
}
/**
* 更新密码接口
*/
public function updateAction() {
$code = $this->post('code');
$password = $this->post('pwd');
$info = $this->checkCode($code);
if (Helpers::verifyPassword ($password) && ! empty ($info)) {
// 修改密码
if (isset ( $info ['mobile'] )) { // 手机号修改密码
$mobile = $info ['mobile'];
$token = $info ['token'];
$area = $info ['area'];
$data = BackData::modifyPasswordByMobile($mobile, $token, $password, $area);
if ($data ['code'] == 200) {
$this->redirect ( 'resetSuccess' );
}
} else if (isset ($info ['uid'])) { // 其他方式修改密码
$uid = $info ['uid'];
$this->redirect ( 'resetSuccess' );
}
}
// 跳转错误页面
$this->redirect('/error/index');
}
/**
* 重置密码成功
*/
public function resetSuccessAction() {
$banner = PassportModel::getLeftBanner ( PassportModel::BACK_LFFT_BANNER_CODE );
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader ( false ),
'resetSuccess' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'countrys' => array ()
)
);
$this->_view->display ( 'reset-success', $data );
}
/**
* 手机验证页面
*/
public function verificationAction() {
$mobile = $this->getSession ('mobile');
$area = $this->getSession ('area');
$verifyCode = $this->getSession ('verifyCode');
if (empty ($mobile)) {
$this->redirect ('index');
}
$banner = PassportModel::getLeftBanner (PassportModel::BACK_LFFT_BANNER_CODE);
$data = array (
'simpleHeader' => PassportModel::getSimpleHeader ( false ),
'vertificationPage' => true,
'verification' => array (
'coverHref' => $banner ['url'],
'coverImg' => $banner ['img'],
'mobile' => $mobile,
'area' => $area,
'verifyCode' => $verifyCode,
'countrys' => array ()
)
);
$this->_view->display ('verification', $data);
}
/**
* 手机找回密码验证
*/
public function backmobileAction() {
$mobile = $this->post ( 'mobile' );
$area = $this->post ( 'area' );
$verifyCode = $this->post ( 'verifyCode' );
$code = $this->post ( 'code' ); // code
if ($this->getSession ( 'mobile' ) == $mobile && $this->getSession ( 'area' ) == $area) {
$result = BackData::validateMobileCode ( $mobile, $code, $area );
if ($result ['code'] == 200) {
$str = json_encode ( array (
'mobile' => $mobile,
'area' => $area,
'token' => $result ['data'] ['token'],
'create_time' => time ()
) );
$code = AuthCode::encode ( $str, PassportModel::BACK_FIND_SECRET_KEY );
$url = '/passport/back/backcode?code=' . base64_encode ( $code );
$this->redirect ( SITE_MAIN . $url );
return true;
}
}
//出错直接跳到找回密码页
$this->redirect ('/passport/back/index');
}
/**
* 检查code
*
* @param string $code
* @return boolean
*/
private function checkCode($code) {
$code = base64_decode ( $code );
$info = json_decode ( AuthCode::decode ( $code, PassportModel::BACK_FIND_SECRET_KEY ), true );
if ($info ['create_time'] < 1 || (time () - $info ['create_time']) > 86400) {
return array ();
}
return $info;
}
}
\ No newline at end of file
... ...
... ... @@ -2,16 +2,595 @@
// 前端开发添加的路由,对应需求 http://redmine.yoho.cn/issues/143, 后端开发完删除
// 首页 毕凯,赵彪
// 列表页 王成龙
use Action\AbstractAction;
use Action\WebAction;
use Plugin\Helpers;
class Sale1Controller extends AbstractAction
class Sale1Controller extends WebAction
{
public function indexAction()
{
$data = array(
'salePage' => true
'saleIndexPage' => true,
'topBanner' => array(
'list' => array(
array(
'href' => 'http://www.yohobuy.com',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01cd0659953f9f213213839c971406413c.jpg?imageView/1/w/1150/h/450'
),
array(
'href' => 'http://www.yohobuy.com',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01c571ce38e5d6cf5a0077bd11593bbdfe.jpg?imageView/1/w/1150/h/450'
),
array(
'href' => 'http://www.yohobuy.com',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01cd0659953f9f213213839c971406413c.jpg?imageView/1/w/1150/h/450'
),
array(
'href' => 'http://www.yohobuy.com',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/23/03/01c571ce38e5d6cf5a0077bd11593bbdfe.jpg?imageView/1/w/1150/h/450'
)
)
),
'activityEnter' => array(
array(
'icon' => '',
'title' => 'VIP会员专享',
'desc' => 'Only for VIP',
'link' => 'http://www.yohobuy.com'
),
array(
'icon' => '',
'title' => '断码区',
'desc' => 'Discount',
'link' => 'http://www.yohobuy.com'
),
array(
'icon' => '',
'title' => '最新降价',
'desc' => 'Off Price',
'link' => 'http://www.yohobuy.com'
)
),
'brandSale' => array(
'big' => array(
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
'title' => '2015春夏海量大促!',
'discount' => '70%',
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
'title' => '2015春夏海量大促!',
'discount' => '70%',
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
'title' => '2015春夏海量大促!',
'discount' => '70%',
)
),
'normal' => array()
)
);
$this->setWebNavHeader();
$this->_view->display('index', $data);
}
//列表页
public function saleListAction()
{
$data = array(
'saleListPage' => true,
'saleList' => array(
'saleBanner' => array(
'bannerHeight' => 350,
'img' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/08/02d4c26f19ca2e44359d69d5cff86167fb.jpg'
),
'saleTitle' => array(
'name' => '全部商品',
'count' => 540
),
'leftContent' => array(
array(
'allSort' => array(
'updateNum' => 145,
'list' => array(
array(
'name' => '裙装',
'num' => '10',
'childList' => array(
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
),
array(
'name' => '裙装BBB',
'num' => '10',
'childList' => array(
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
)
)
)
),
array(
'picLink' => array(
'title' => 'AAAA',
'list' => array(
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg'
),
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg'
)
)
)
),
array(
'advPic' => array(
'advPicTitle' => false,
'list' => array(
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img02.static.yohobuy.com/cms/2015/11/10/15/02ee7970deb68390b77cbf0685f26fc5bf.jpg'
),
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img02.static.yohobuy.com/cms/2015/11/10/15/02ee7970deb68390b77cbf0685f26fc5bf.jpg'
)
)
)
),
array(
'newSales' => array(
'updateNum' => 130,
'list' => array(
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
)
),
array(
'allDiscount' => array(
'updateNum' => 130,
'list' => array(
array(
'name' => '1~3折',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '4~6折',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '7折',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
)
)
),
'filters' => array(
'checkedConditions' => array(
'conditions' => array(
array(
'href' => '',
'name' => '暗黑'
),
array(
'href' => '',
'color' => '#f00'
),
array(
'href' => '',
'name' => 'CLOT'
)
),
'clearUrl' => ''
),
'channel' => array(
array(
'href' => '/?gender=1,3',
'name' => 'BOYS'
),
array(
'href' => '/?gender=2,3',
'name' => 'GIRLS'
),
array(
'href' => '',
'name' => 'KIDS'
),
array(
'href' => '',
'name' => 'LIFESTYLE'
)
),
'sort' => array(
array(
'id' => '1',
'name' => '上衣',
'sub' => array(
array(
'href' => '',
'name' => 'T恤'
),
array(
'href' => '',
'name' => '棉袄'
),
array(
'href' => '',
'name' => '外套'
)
)
),
array(
'id' => '2',
'name' => '裤子'
),
array(
'id' => '3',
'name' => '连衣裙'
),
array(
'id' => '4',
'name' => '鞋'
)
),
'brand' => array(
'default' => array(
array(
'href' => '',
'name' => 'CLOT'
),
array(
'href' => '',
'name' => 'ABLE JEANS'
),
array(
'href' => '',
'name' => 'Eight Guys'
),
array(
'href' => '',
'name' => 'FAIRWHALE JEANS'
),
array(
'href' => '',
'name' => '鬼洗'
),
array(
'href' => '',
'name' => '金银帝国Imperial Taels'
),
array(
'href' => '',
'name' => 'F.L.Y.D'
),
array(
'href' => '',
'name' => 'Tapenade特芙娜'
),
array(
'href' => '',
'name' => 'Adidas Originals'
)
),
'brandIndex' => array(
array(
'index' => 'all',
'name' => '全部'
),
array(
'index' => '0-9',
'name' => '0 ~ 9'
),
array(
'index' => 'a',
'name' => 'A'
)
),
'brandsShow' => array(
array(
'id' => '1',
'href' => '',
'index' => '0-9',
'name' => '5cm',
'key' => '5cm'
),
array(
'id' => '2',
'href' => '',
'index' => 'k',
'name' => 'KTZ',
'key' => 'ktz'
),
array(
'id' => '3',
'href' => '',
'index' => 't',
'name' => 'Tapenade特芙娜',
'key' => 'tapenade特芙娜'
),
array(
'id' => '4',
'href' => '',
'index' => 'j',
'name' => '金银帝国Imperial Taels',
'key' => '金银帝国imperial taels'
),
array(
'id' => '5',
'href' => '',
'index' => 'a',
'name' => 'ABLE JEANS',
'key' => 'able jeans'
)
)
),
'price' => array(
array(
'href' => '',
'name' => '0-239'
),
array(
'href' => '',
'name' => '240-329'
)
),
'color' => array(
array(
'href' => '',
'name' => '黑色',
'rgb' => '#000'
),
array(
'href' => '',
'name' => '红色',
'rgb' => '#f00'
)
),
'size' => array(
array(
'href' => '',
'name' => 'S'
),
array(
'href' => '',
'name' => 'L'
)
),
'seniorChose' => array(
array(
'attr' => 'style',
'name' => '风格',
'showMulti' => true,
'sub' => array(
array(
'id' => '1',
'href' => '',
'name' => '街头'
),
array(
'id' => '2',
'href' => '',
'name' => '简约'
)
)
),
array(
'attr' => 'weather',
'name' => '适用季节',
'sub' => array(
array(
'id' => '1',
'href' => '',
'name' => '春天'
),
array(
'id' => '2',
'href' => '',
'name' => '夏天'
)
)
)
)
),
'opts' => array(
'sortType' => array(
array(
'href' => '',
'name' => '默认'
),
array(
'active' => true,
'href' => '',
'name' => '最新',
'hasSortOrient' => true,
'desc' => true
),
array(
'href' => '',
'name' => '价格',
'hasSortOrient' => true
),
array(
'href' => '',
'name' => '折扣',
'hasSortOrient' => true
)
),
'checks' => array(
array(
'name' => '新品',
'checked' => true,
'href' => ''
),
array(
'name' => '打折',
'href' => ''
),
array(
'name' => '限量',
'checked' => true,
'href' => ''
)
),
'fivePerLine' => true,
'sixPerLineHref' => '',
'countPerPage' => '120',
'pageCounts' => array(
array(
'href' => '',
'count' => 60
),
array(
'href' => '',
'count' => 100
),
array(
'href' => '',
'count' => 120
)
),
'curPage' => 1,
'pageCount' => 30,
'nextHref' => 'hello'
),
'goods' => array(
array(
'tags' => array(
'isNew' => true,
'isYearEndPromotion' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899',
'isFew' => true
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899',
'showColBtn' => true
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
array(
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
)
),
'totalCount' => '2259',
'pager' => '<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="iconfont">&gt;</span></a>'
)
);
$this->_view->display('sale-list', $data);
}
}
... ...
... ... @@ -16,12 +16,26 @@ class SearchController extends WebAction
$this->_view->display('search', $data);
}
public function suggest()
/**
* 搜索提示
*/
public function suggestAction()
{
$query = rawurldecode($this->get('query'));
if ($query) {
$param['query'] = $query;
$result = SearchModel::getSuggest($param);
SearchModel::getSuggest($param);
}
}
/**
* 根据分类id,获取分类尺码
*/
public function sortSizeAction()
{
$condition['msort'] = $this->get('msort');
$size = SearchModel::getSortSize($condition);
print_r($size); exit;
$this->echoJson($size);
}
}
\ No newline at end of file
... ...