Authored by yangyang

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

Showing 35 changed files with 649 additions and 736 deletions
... ... @@ -4,7 +4,7 @@ namespace LibModels\Web\Product;
use Api\Yohobuy;
class SearchData extends \LibModels\Wap\Product\SearchData
{
public static $shops_url = 'http://101.200.31.165/yohosearch/shops.json';
public static $shopsUrl = 'http://101.200.31.165/yohosearch/shops.json';
/**
* 获取搜索的服务地址
*
... ... @@ -136,7 +136,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData
*/
public static function getShop(array $params)
{
return Yohobuy::get(self::$shops_url,$params);
return Yohobuy::get(self::$shopsUrl,$params);
}
/**
... ...
... ... @@ -129,7 +129,8 @@ class HelperSearch
* @author sefon 2015-12-21 17:24:04
* @return array
*/
public static function getProductList($product,$imgSize){
public static function getProductList($product,$imgSize)
{
$goods = array();
foreach($product as $key => $val){
//NEW
... ... @@ -172,7 +173,8 @@ class HelperSearch
* @param $filter
* @return array
*/
public static function standard($filter) {
public static function standard($filter)
{
$params = self::$params;
$result = array();
foreach ($filter as $key => $val) {
... ... @@ -217,7 +219,8 @@ class HelperSearch
* 性别
* @return array
*/
public static function gender($filter) {
public static function gender($filter)
{
if (empty($filter) || !isset($filter['gender']) || empty($filter['gender'])) {
return array();
}
... ... @@ -343,7 +346,8 @@ class HelperSearch
* @param array $filter
* @return array
*/
public static function brand($filter) {
public static function brand($filter)
{
$options = self::$options;
//品牌列表返回空
if (isset($options['brandName'])) {
... ... @@ -447,7 +451,8 @@ class HelperSearch
* @param array $filter
* @return array
*/
public static function size($filter) {
public static function size($filter)
{
$params = self::$params;
$sizeId = isset($params['size']) && !empty($params['size']) ? $params['size'] : '';
if (isset($params['size'])) {
... ... @@ -484,7 +489,8 @@ class HelperSearch
* @param array $filter
* @return array
*/
public static function color($filter) {
public static function color($filter)
{
$params = self::$params;
$colorId = isset($params['color']) && !empty(self::$params['color']) ? self::$params['color'] : '';
if (isset($params['color'])) {
... ... @@ -520,7 +526,8 @@ class HelperSearch
* @param array $filter
* @return array
*/
public static function price($filter) {
public static function price($filter)
{
$params = self::$params;
$priceId = isset($params['price']) && !empty(self::$params['price']) ? self::$params['price'] : '';
if (isset($params['price'])) {
... ... @@ -562,7 +569,8 @@ class HelperSearch
/**
* 获取自定义价格要提交的地址
*/
public static function customPrice($filter) {
public static function customPrice($filter)
{
$params = self::$params;
$result = array(
'min' => '',
... ... @@ -585,7 +593,8 @@ class HelperSearch
* @param array $filter
* @return array
*/
public static function style($filter) {
public static function style($filter)
{
$params = self::$params;
$styleIds = isset($params['style']) && !empty($params['style']) ? explode(',', $params['style']) : array();
if (isset($params['style'])) {
... ... @@ -976,7 +985,8 @@ class HelperSearch
/**
* 当前页地址
*/
public static function current(){
public static function current()
{
$url = explode('?', $_SERVER['REQUEST_URI']);
self::$listnav[0]['href'] = $url[0];
return $url[0];
... ... @@ -984,7 +994,8 @@ class HelperSearch
/**
* 下一页
*/
public static function next($total){
public static function next($total)
{
$param = self::$params;
$page = self::$page;
$next = array();
... ... @@ -1025,13 +1036,14 @@ class HelperSearch
* @param $viewNum
* @return mixed
*/
public static function pager($total,$viewNum){
public static function pager($total, $viewNum){
$Paging = new Paging('Yoho');
return $Paging->setTotal($total)->setSize($viewNum)->view(0);
}
//组织静态资源数据格式
public static function formatNodeContent($code){
public static function formatNodeContent($code)
{
$nodeContent = BrandData::getByNodeContent($code);
if (isset($nodeContent['code']) && $nodeContent['code'] === 200) {
$result = array();
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015
Created by FontForge 20120731 at Wed Jan 13 13:50:02 2016
By Ads
</metadata>
<defs>
... ... @@ -16,10 +16,10 @@ Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015
ascent="896"
descent="-128"
x-height="792"
bbox="-0.75 -224 3943 893"
bbox="-0.75 -224 3943 896"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E641"
unicode-range="U+0078-E644"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -268,5 +268,15 @@ d="M522 893q-103 0 -197 -40t-162 -108t-108.5 -162t-40.5 -197.5t40.5 -197.5t108.5
t92.5 138.5t138.5 92.5t169 34.5t168.5 -34.5t138.5 -92.5t93 -138.5t34.5 -169t-34.5 -168.5t-93 -138.5t-138.5 -93t-169 -34.5zM775 268l-105 61q-11 4 -21 6.5t-18 2.5t-15 -0.5t-13 -4t-10 -5.5t-9 -6l-6 -7q-2 -2 -6 -7l-3 -4l-6 -10q-34 -4 -59 21l-51 50
q-24 25 -20 60l9 4q3 5 16 16t17 18t4 25t-11 43h-1l-60 105q-8 13 -20.5 20t-26 7t-27.5 -7l-62 -36q-3 -1 -6 -4l-6 -6l-6 -6q-3 -3 -5.5 -6t-4.5 -5t-3 -4l-1 -1q-14 -87 24.5 -183.5t121.5 -174.5q72 -68 157 -101.5t165 -29.5q4 1 10.5 2.5t20.5 10t21 20.5l36 62
q11 20 5.5 41.5t-25.5 32.5z" />
<glyph glyph-name="uniE642" unicode="&#xe642;"
d="M439 324h110l-54 148zM501 881q-101 0 -192.5 -39.5t-158 -105.5t-105.5 -158t-39 -193q0 -205 145 -350t350 -145q101 0 192.5 39t158 105.5t105.5 158.5t39 192.5t-39 192.5t-105.5 158t-158 105.5t-192.5 39.5zM656 180l-19 -9q-2 -1 -4 -1.5t-3.5 -1t-3.5 -0.5
q-5 0 -9 2q-5 2 -8.5 5.5t-5.5 8.5l-27 69h-163l-25 -69q-4 -10 -14.5 -14t-19.5 1l-20 9q-9 4 -12.5 13t-0.5 18l151 401q6 16 23 16t23 -16l151 -401q3 -9 -0.5 -18t-12.5 -13z" />
<glyph glyph-name="uniE643" unicode="&#xe643;" horiz-adv-x="1124"
d="M859 896h-595q-109 0 -186.5 -77.5t-77.5 -186.5v-760l200 135q18 14 49.5 24t63.5 14.5t71.5 6.5t66 2t57 -1t34.5 -1h317q109 0 186.5 77.5t77.5 186.5v316q0 109 -77.5 186.5t-186.5 77.5zM477 367q-42 0 -71.5 29.5t-29.5 70.5t29.5 70t71.5 29t71.5 -29t29.5 -70
q0 -14 -3.5 -27t-10 -23.5t-16 -20t-20.5 -15.5t-24 -10t-27 -4zM848 367q-42 0 -71.5 29.5t-29.5 70.5t29.5 70t71.5 29t71.5 -29t29.5 -70t-29.5 -70.5t-71.5 -29.5z" />
<glyph glyph-name="uniE644" unicode="&#xe644;"
d="M523 881q-101 0 -192.5 -39.5t-158 -105.5t-105.5 -158t-39 -193q0 -205 145 -350t350 -145q67 0 131.5 18t119 49.5t100 77.5t77.5 100.5t49.5 118.5t17.5 131q0 101 -39 193t-105.5 158t-158 105.5t-192.5 39.5zM739 224q8 -8 7 -19q0 -2 -0.5 -4.5t-1.5 -5t-2.5 -4.5
t-3.5 -3q-11 -10 -15 -14q-7 -7 -17 -7t-18 7l-34 34q-59 -42 -131 -42q-94 0 -160.5 66.5t-66.5 160.5q0 46 18 88t48.5 72.5t72.5 48.5t88 18t88 -18t72.5 -48.5t48.5 -72.5t18 -88q0 -75 -45 -135zM592 337q8 7 18 6.5t17 -7.5l27 -27q25 39 25 84q0 64 -45.5 109.5
t-110 45.5t-110 -45.5t-45.5 -109.5t45.5 -109.5t109.5 -45.5q44 0 80 21l-27 28q-8 7 -7.5 18t7.5 18z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
#thumb-row {
@include flexbox((
display: box,
box-pack: justify
), $version: 1);
@include flexbox((
display: flex,
justify-content: space-around
), $version: 3);
// @include flexbox((
// display: box,
// box-pack: justify
// ), $version: 1);
// @include flexbox((
// display: flex,
// justify-content: space-around
// ), $version: 3);
background-color: #f0f0f0;
text-align: center;
padding: 32rem/$pxConvertRem 14rem/$pxConvertRem 0;
padding: 32rem/$pxConvertRem 0 0;
.thumb-row-box {
display: inline-block;
width: 275rem/$pxConvertRem;
... ... @@ -19,5 +18,6 @@
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
margin: 0 14.4rem/$pxConvertRem;
}
}
... ...
... ... @@ -47,7 +47,7 @@
right: 0;
top: 0;
margin-right: pxToRem(30px);
font-size: pxToRem(28px);
font-size: pxToRem(34px);
font-weight: bold;
line-height: pxToRem(100px);
}
... ...
... ... @@ -12,14 +12,12 @@
}
.info {
width: auto;
color: #b0b0b0;
font-size: pxToRem(24px);
line-height: 1;
line-height: 1rem;
.dollar {
display: inline-block;
// margin-right: pxToRem(6px);
vertical-align: middle;
width: pxToRem(24px);
height: pxToRem(24px);
background: image-url("me/yoho-coin/dollar.png") center center;
... ... @@ -29,15 +27,15 @@
.more {
display: inline-block;
margin: pxToRem(30px) 0;
margin: pxToRem(20px) 0 pxToRem(30px);
color: #444;
font-size: pxToRem(24px);
line-height: pxToRem(40px);
width: pxToRem(152px);
height: pxToRem(36px);
font-size: pxToRem(28px);
line-height: pxToRem(44px);
width: pxToRem(168px);
height: pxToRem(42px);
text-align: center;
border: 1px solid #444;
border-radius: pxToRem(36px);
border-radius: pxToRem(22px);
}
.coin-tip {
... ... @@ -45,7 +43,7 @@
padding: pxToRem(20px) pxToRem(30px);
font-size: pxToRem(24px);
line-height: pxToRem(32px);
color: #dc6870;
color: #d0021b;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
... ... @@ -54,7 +52,7 @@
width: pxToRem(32px);
height: pxToRem(32px);
font-weight: bold;
border: 2px solid #dc6870;
border: 2px solid #d0021b;
border-radius: 50%;
}
}
... ...
... ... @@ -97,7 +97,7 @@
span {
display: block;
float: left;
font-size: inherit;
// font-size: inherit;
padding-right: pxToRem(15px);
}
p {
... ... @@ -118,7 +118,7 @@
span {
display: block;
float: left;
font-size: inherit;
// font-size: inherit;
color: $mainFontC;
padding-right: pxToRem(15px);
}
... ...
{{> layout/header}}
<div class="goods-consults-page yoho-page">
<div class="goto-consult tap-hightlight" id="goto-consult" data-href="{{link}}">
<i class="iconfont consult-logo">&#xe639;</i>
<i class="iconfont consult-logo">&#xe643;</i>
<span>我要咨询</span>
<a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a>
</div>
... ... @@ -10,7 +10,7 @@
{{#list}}
<div class="consult-item" data-id="{{id}}">
<div class="question">
<span class="iconfont">&#xe639;</span>
<span class="iconfont">&#xe644;</span>
<p>
{{question}}<br>
<span class="time">{{time}}</span>
... ... @@ -18,7 +18,7 @@
</div>
<div class="answer">
<span class="iconfont">&#xe63f;</span>
<span class="iconfont">&#xe642;</span>
<p>{{answer}}</p>
</div>
... ... @@ -58,14 +58,14 @@
{{#commonConsults}}
<div class="faq-item">
<div class="question">
<span class="iconfont">&#xe639;</span>
<span class="iconfont">&#xe644;</span>
<p>
{{question}}
</p>
</div>
<div class="answer">
<span class="iconfont">&#xe63f;</span>
<span class="iconfont">&#xe642;</span>
<p>{{answer}}</p>
</div>
</div>
... ...
... ... @@ -11,7 +11,7 @@
</span>
<ul id="country-code-list" class="country-code-list">
{{# countryList}}
<li data-cc="+{{code}}">{{name}} +{{code}}</li>
<li data-cc="{{areaCode}}">{{name}} {{areaCode}}</li>
{{/ countryList}}
</ul>
</div>
... ... @@ -28,7 +28,7 @@
</li>
<li class="input-container-li clearfix">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="http://web.dev.yohobuy.com/passport/images" alt="">
<img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
<a id="change-captcha" class="link change-captcha">换一张</a>
<span id="captcha-err" class="err-tip captcha-err hide">
<i></i>
... ...
{{> layout/header}}
<div class="product-list-page product-page yoho-page">
{{# list}}
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
</div>
</div>
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
{{> product/standard-content}}
{{> product/latest-walk}}
</div>
{{/ brandAbout}}
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/list}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-list-page product-page yoho-page">
{{# list}}
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
</div>
</div>
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{> product/standard-content}}
{{> product/latest-walk}}
</div>
{{/ brandAbout}}
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/list}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="new-sale-page product-page yoho-page">
{{# newSale}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# 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">
{{# newMain}}
<div class="new-banner">
<a href="{{bannerHref}}">
<img src="{{banner}}">
</a>
</div>
<div class="new-brands clearfix">
<span class="iconfont pre">&#xe607;</span>
<div class="brands-wrap">
<ul class="brands">
{{# brands}}
<li>
<a href="{{href}}">
<img src="{{logo}}">
</a>
</li>
{{/ brands}}
</ul>
</div>
<span class="iconfont next">&#xe608;</span>
</div>
<div class="new-floor-title">
<span class="date">{{date}}</span>
<span class="title">{{title}}</span>
</div>
{{/ newMain}}
{{> product/standard-content}}
</div>
</div>
{{/ newSale}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/new-sale}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="new-sale-page product-page yoho-page">
{{# newSale}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# 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">
{{# newMain}}
<div class="new-banner">
<a href="{{bannerHref}}">
<img src="{{banner}}">
</a>
</div>
<div class="new-brands clearfix">
<span class="iconfont pre">&#xe607;</span>
<div class="brands-wrap">
<ul class="brands">
{{# brands}}
<li>
<a href="{{href}}">
<img src="{{logo}}">
</a>
</li>
{{/ brands}}
</ul>
</div>
<span class="iconfont next">&#xe608;</span>
</div>
<div class="new-floor-title">
<span class="date">{{date}}</span>
<span class="title">{{title}}</span>
</div>
{{/ newMain}}
{{> product/standard-content}}
</div>
</div>
{{/ newSale}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> product/new-sale}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-search-page product-page yoho-page center-content">
{{# search}}
{{> layout/path-nav}}
{{> layout/path-nav}}
{{> product/shop-entry}}
{{> product/shop-entry}}
{{> product/standard-content}}
{{> product/standard-content}}
{{> product/latest-walk}}
{{> product/latest-walk}}
{{/ search}}
</div>
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="product-list-page product-page yoho-page">
{{# list}}
{{# brandBanner}}
<div class="brand-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="opt-wrap">
<p class="opt center-content">
<a href="{{brandHome}}">
<i class="iconfont">&#xe617;</i>
品牌首页
</a>
<a href="{{brandIntro}}">
<i class="iconfont">&#xe618;</i>
品牌介绍
</a>
<span id="brand-favor" class="brand-favor">
<i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
</span>
</p>
</div>
</div>
{{/ brandBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# brandAbout}}
<div class="brand-about">
{{{brandIntro}}}
</div>
{{^}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{> product/standard-content}}
{{> product/latest-walk}}
</div>
{{/ brandAbout}}
</div>
{{/ list}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="new-sale-page product-page yoho-page">
{{# newSale}}
{{# saleBanner}}
<div class="banner-img" style="height: {{bannerHeight}}px;background:url({{img}}) no-repeat top center;"></div>
{{/ saleBanner}}
<div class="center-content clearfix">
{{> layout/path-nav}}
{{# 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">
{{# newMain}}
<div class="new-banner">
<a href="{{bannerHref}}">
<img src="{{banner}}">
</a>
</div>
<div class="new-brands clearfix">
<span class="iconfont pre">&#xe607;</span>
<div class="brands-wrap">
<ul class="brands">
{{# brands}}
<li>
<a href="{{href}}">
<img src="{{logo}}">
</a>
</li>
{{/ brands}}
</ul>
</div>
<span class="iconfont next">&#xe608;</span>
</div>
<div class="new-floor-title">
<span class="date">{{date}}</span>
<span class="title">{{title}}</span>
</div>
{{/ newMain}}
{{> product/standard-content}}
</div>
</div>
{{/ newSale}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -84,11 +84,11 @@
{{> product/good}}
{{/each}}
{{# hasNextPage}}
<div class="block-next-page">
<a href="{{href}}">
<img src="{{src}}" alt=""/>
</a>
</div>
<div class="block-next-page">
<a href="{{href}}">
<img src="{{src}}" alt=""/>
</a>
</div>
{{/ hasNextPage}}
<div class="good-item-wrapper">
<div class="good-info-main"></div>
... ...
... ... @@ -1483,305 +1483,309 @@ require("js/product/sort-pager");
require("js/product/product");
});
define("js/product/filter", ["jquery"], function(require, exports, module){
/**
* 商品筛选逻辑
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/4
*/
var $ = require("jquery");
var checkUnicode = {
unchecked: '&#xe613;',
checked: '&#xe612;'
},
moreUnicode = {
up: '&#xe610;',
down: '&#xe600;'
};
//品牌相关变量
var $brandDefault = $('.brand .default'),
$brandPanel = $('.brand .brand-panel'),
$brandAttrs = $('.brand .attr'),
$brandMore = $('#brand-more'),
$brandMulti = $('#brand-multi');
var $brandMoreTxt, $brandMoreIcon;
//价格相关变量
var $udPrice = $('.ud-price-range'),
interReg = /^\d+$/,
$limit, $min, $max, $btn;
//分类相关变量
var $sortSub = $('.sort-sub-wrap');
//高级选项相关变量
var $seniorSubWrap = $('.senior-sub-wrap'),
$seniorAttrWrap = $('.senior-attr-wrap');
var seniorHoverTime, hoveredIndex;
//清除checkbox选中状态
function clearChecked($checkbox) {
$checkbox.removeClass('checked').html(checkUnicode.unchecked);
}
//显示更多品牌面板
function brandShowMore() {
$brandDefault.addClass('hide');
$brandPanel.removeClass('hide');
}
//隐藏更多品牌面板
function brandHideMore() {
$brandPanel.addClass('hide');
$brandDefault.removeClass('hide');
}
//url构造&跳转
function uriLoc(attr, val) {
var href = decodeURIComponent(window.location.search),
query = attr + '=' + val,
newHref;
if (href === '') {
newHref = '?' + query;
} else {
newHref = href + '&' + query;
}
window.location.href = newHref;
}
//隐藏高级选项面板
function hideSeniorPanel(index) {
$seniorSubWrap.children('.senior-sub:eq(' + hoveredIndex + ')').addClass('hide');
$seniorAttrWrap.children('.attr:eq(' + hoveredIndex + ')').removeClass('hover');
hoveredIndex = -1;
}
//屏蔽筛选项双击文字选中
$('.filter-box').on('selectstart', '.attr, .brands-index span', function() {
return false;
});
//【分类】
$('.sort-pre').on('click', 'li', function() {
var $this = $(this),
index = $this.index();
$this.siblings('.active').removeClass('active');
$this.addClass('active');
$sortSub.children(':not(.hide)').addClass('hide');
$sortSub.children(':eq(' + index + ')').removeClass('hide');
});
//【品牌】
if ($brandMore.length > 0) {
$brandMoreTxt = $brandMore.children('em');
$brandMoreIcon = $brandMore.children('.iconfont');
}
//【品牌】多选
$brandMulti.click(function() {
if ($brandPanel.css('display') === 'none') {
//显示品牌面板
brandShowMore();
}
$brandPanel.addClass('multi'); //显示出checkbox
$(this).addClass('hide');
});
//【品牌】更多
$brandMore.click(function() {
var $this = $(this);
if ($this.hasClass('more')) {
brandHideMore();
$brandMoreTxt.text('更多');
$brandMoreIcon.html(moreUnicode.down);
} else {
brandShowMore();
$brandMoreTxt.text('收起');
$brandMoreIcon.html(moreUnicode.up);
}
$(this).toggleClass('more');
});
//【品牌】索引
$('.brands-index').on('click', 'span', function() {
var $this = $(this),
index = $this.data('index');
if ($this.index() === 0) {
//全部
$brandAttrs.removeClass('hide');
} else {
$brandAttrs.addClass('hide').filter('[data-index=' + index + ']').removeClass('hide');
}
});
//【品牌】搜索
$('#brand-search-input').keyup(function() {
var val = $(this).val().toLowerCase();
if (val === '') {
$brandAttrs.removeClass('hide');
} else {
$brandAttrs.addClass('hide').filter('[data-key*=' + val + ']').removeClass('hide');
}
});
//【品牌】多选确定
$('#brand-multi-ok').click(function() {
var val = '';
if ($(this).hasClass('dis')) {
return;
}
$brandPanel.find('.checked').each(function() {
var id = $(this).data('id');
val += (val === '') ? id : (',' + id);
});
uriLoc('brand', val);
});
//【品牌/高级选项】多选取消
$('.multi-select-cancel').click(function() {
var $panel = $(this).closest('.multi');
if ($panel.hasClass('brand-panel')) {
brandHideMore();
$brandMulti.removeClass('hide'); //显示多选按钮
}
$panel.removeClass('multi');
clearChecked($panel.find('.checkbox.checked')); //清除选中状态
});
//【品牌/高级选项】checkbox
$('.check-container').on('click', '.attr', function() {
var $this = $(this),
$check = $this.find('.checkbox'),
$btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok');
$check.toggleClass('checked');
if ($check.hasClass('checked')) {
$check.html(checkUnicode.checked);
} else {
$check.html(checkUnicode.unchecked);
}
//更新按钮状态
if ($check.hasClass('checked') ||
$this.siblings('.attr').find('.checked').length > 0) {
$btnOk.removeClass('dis');
} else {
$btnOk.addClass('dis');
}
});
//【品牌/高级选项】当多选时阻止链接默认跳转
$('.brand, .senior').on('click', '.attr > a', function(e) {
if ($(this).closest('.multi').length > 0) {
e.preventDefault();
}
});
//【价格】用户定义价格处理
if ($udPrice.length > 0) {
$limit = $udPrice.find('.limit');
$min = $limit.filter('.min');
$max = $limit.filter('.max');
$btn = $udPrice.find('.price-sure');
//【价格】输入
$limit.keyup(function() {
var min = $.trim($min.val()),
max = $.trim($max.val()),
isMinInt = interReg.test(min),
isMaxInt = interReg.test(max);
if (isMaxInt && (min === '' || isMinInt) ||
isMinInt && (max === '' || isMaxInt)
) {
$btn.removeClass('hide');
} else {
$btn.addClass('hide');
}
});
//【价格】多项查询
$btn.click(function() {
var min = $.trim($min.val()),
max = $.trim($max.val()),
tmp;
//对于min大于max的情况,交换位置
if (min !== '' && max !== '' && +min > +max) {
tmp = max;
max = min;
min = tmp;
}
uriLoc('price', min + ',' + max);
});
}
//【高级选项】鼠标移入显示子项
$seniorAttrWrap.on('mouseenter', '.attr', function() {
var index = $(this).addClass('hover').index();
$seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide');
}).on('mouseleave', '.attr', function() {
var $this = $(this),
index = $this.index();
hoveredIndex = index;
seniorHoverTime = setTimeout(function() {
hideSeniorPanel();
}, 100);
});
//【高级选项】多选
$('.senior-sub').on('click', '.multi-select', function() {
$(this).closest('.senior-sub').addClass('multi');
}).on('click', '.multi-select-ok', function() {
var $btn = $(this),
$sub = $btn.closest('.senior-sub'),
val = '';
if ($btn.hasClass('dis')) {
return;
}
$sub.find('.checked').each(function() {
var id = $(this).data('id');
val += (val === '') ? id : (',' + id);
});
uriLoc($sub.data('attr'), val);
}).on('mouseenter', function() {
clearTimeout(seniorHoverTime);
}).on('mouseleave', function() {
hideSeniorPanel();
/**
* 商品筛选逻辑
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/12/4
*/
var $ = require("jquery");
var checkUnicode = {
unchecked: '&#xe613;',
checked: '&#xe612;'
},
moreUnicode = {
up: '&#xe610;',
down: '&#xe600;'
};
//品牌相关变量
var $brandDefault = $('.brand .default'),
$brandPanel = $('.brand .brand-panel'),
$brandAttrs = $('.brand .attr'),
$brandMore = $('#brand-more'),
$brandMulti = $('#brand-multi');
var $brandMoreTxt, $brandMoreIcon;
//价格相关变量
var $udPrice = $('.ud-price-range'),
interReg = /^\d+$/,
$limit, $min, $max, $btn;
//分类相关变量
var $sortSub = $('.sort-sub-wrap');
//高级选项相关变量
var $seniorSubWrap = $('.senior-sub-wrap'),
$seniorAttrWrap = $('.senior-attr-wrap');
var seniorHoverTime, hoveredIndex;
//清除checkbox选中状态
function clearChecked($checkbox) {
$checkbox.removeClass('checked').html(checkUnicode.unchecked);
}
//显示更多品牌面板
function brandShowMore() {
$brandDefault.addClass('hide');
$brandPanel.removeClass('hide');
}
//隐藏更多品牌面板
function brandHideMore() {
$brandPanel.addClass('hide');
$brandDefault.removeClass('hide');
}
//url构造&跳转
function uriLoc(attr, val) {
var href = decodeURIComponent(window.location.search),
query = attr + '=' + val,
newHref;
if (href === '') {
newHref = '?' + query;
} else {
newHref = href + '&' + query;
}
window.location.href = newHref;
}
//隐藏高级选项面板
function hideSeniorPanel(index) {
$seniorSubWrap.children('.senior-sub:eq(' + hoveredIndex + ')').addClass('hide');
$seniorAttrWrap.children('.attr:eq(' + hoveredIndex + ')').removeClass('hover');
hoveredIndex = -1;
}
//屏蔽筛选项双击文字选中
$('.filter-box').on('selectstart', '.attr, .brands-index span', function() {
return false;
});
//【分类】
$('.sort-pre').on('click', 'li', function() {
var $this = $(this),
index = $this.index();
$this.siblings('.active').removeClass('active');
$this.addClass('active');
$sortSub.children(':not(.hide)').addClass('hide');
$sortSub.children(':eq(' + index + ')').removeClass('hide');
});
//【品牌】
if ($brandMore.length > 0) {
$brandMoreTxt = $brandMore.children('em');
$brandMoreIcon = $brandMore.children('.iconfont');
}
//【品牌】多选
$brandMulti.click(function() {
if ($brandPanel.css('display') === 'none') {
//显示品牌面板
brandShowMore();
}
$brandPanel.addClass('multi'); //显示出checkbox
$(this).addClass('hide');
});
//【品牌】更多
$brandMore.click(function() {
var $this = $(this);
if ($this.hasClass('more')) {
brandHideMore();
$brandMoreTxt.text('更多');
$brandMoreIcon.html(moreUnicode.down);
} else {
brandShowMore();
$brandMoreTxt.text('收起');
$brandMoreIcon.html(moreUnicode.up);
}
$(this).toggleClass('more');
});
//【品牌】索引
$('.brands-index').on('click', 'span', function() {
var $this = $(this),
index = $this.data('index');
if ($this.index() === 0) {
//全部
$brandAttrs.removeClass('hide');
} else {
$brandAttrs.addClass('hide').filter('[data-index=' + index + ']').removeClass('hide');
}
});
//【品牌】搜索
$('#brand-search-input').keyup(function() {
var val = $(this).val().toLowerCase();
if (val === '') {
$brandAttrs.removeClass('hide');
} else {
$brandAttrs.addClass('hide').filter('[data-key*=' + val + ']').removeClass('hide');
}
});
//【品牌】多选确定
$('#brand-multi-ok').click(function() {
var val = '';
if ($(this).hasClass('dis')) {
return;
}
$brandPanel.find('.checked').each(function() {
var id = $(this).data('id');
val += (val === '') ? id : (',' + id);
});
uriLoc('brand', val);
});
//【品牌/高级选项】多选取消
$('.multi-select-cancel').click(function() {
var $panel = $(this).closest('.multi');
if ($panel.hasClass('brand-panel')) {
brandHideMore();
$brandMulti.removeClass('hide'); //显示多选按钮
}
$panel.removeClass('multi');
clearChecked($panel.find('.checkbox.checked')); //清除选中状态
});
//【品牌/高级选项】checkbox
$('.check-container').on('click', '.attr', function() {
var $this = $(this),
$check = $this.find('.checkbox'),
$btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok');
$check.toggleClass('checked');
if ($check.hasClass('checked')) {
$check.html(checkUnicode.checked);
} else {
$check.html(checkUnicode.unchecked);
}
//更新按钮状态
if ($check.hasClass('checked') ||
$this.siblings('.attr').find('.checked').length > 0) {
$btnOk.removeClass('dis');
} else {
$btnOk.addClass('dis');
}
});
//【品牌/高级选项】当多选时阻止链接默认跳转
$('.brand, .senior').on('click', '.attr > a', function(e) {
if ($(this).closest('.multi').length > 0) {
e.preventDefault();
}
});
//【价格】用户定义价格处理
if ($udPrice.length > 0) {
$limit = $udPrice.find('.limit');
$min = $limit.filter('.min');
$max = $limit.filter('.max');
$btn = $udPrice.find('.price-sure');
//【价格】输入
$limit.keyup(function() {
var min = $.trim($min.val()),
max = $.trim($max.val()),
isMinInt = interReg.test(min),
isMaxInt = interReg.test(max);
if (isMaxInt && (min === '' || isMinInt) ||
isMinInt && (max === '' || isMaxInt)
) {
$btn.removeClass('hide');
} else {
$btn.addClass('hide');
}
});
//【价格】多项查询
$btn.click(function() {
var min = $.trim($min.val()),
max = $.trim($max.val()),
tmp;
//对于min大于max的情况,交换位置
if (min !== '' && max !== '' && +min > +max) {
tmp = max;
max = min;
min = tmp;
}
uriLoc('price', min + ',' + max);
});
}
//【高级选项】鼠标移入显示子项
$seniorAttrWrap.on('mouseenter', '.attr', function() {
var $this = $(this);
var index = $this.index();
$this.addClass('hover').siblings().removeClass('hover');
$seniorSubWrap.children('.senior-sub:eq(' + index + ')').removeClass('hide').siblings().addClass('hide');
}).on('mouseleave', '.attr', function() {
var $this = $(this),
index = $this.index();
hoveredIndex = index;
seniorHoverTime = setTimeout(function() {
hideSeniorPanel();
}, 100);
});
//【高级选项】多选
$('.senior-sub').on('click', '.multi-select', function() {
$(this).closest('.senior-sub').addClass('multi');
}).on('click', '.multi-select-ok', function() {
var $btn = $(this),
$sub = $btn.closest('.senior-sub'),
val = '';
if ($btn.hasClass('dis')) {
return;
}
$sub.find('.checked').each(function() {
var id = $(this).data('id');
val += (val === '') ? id : (',' + id);
});
uriLoc($sub.data('attr'), val);
}).on('mouseenter', function() {
clearTimeout(seniorHoverTime);
}).on('mouseleave', function() {
hideSeniorPanel();
});
});
define("js/product/sort-pager", ["jquery"], function(require, exports, module){
/**
... ... @@ -3962,7 +3966,7 @@ function picCaptchaAjaxFn(page, callback) {
type: 'POST',
url: url,
data: {
code: $ca.val()
verifyCode: $ca.val()
//mobile: $pn.val(),
//area: $region.text().split('+')[1]
... ... @@ -3995,7 +3999,7 @@ function msgCaptchaAjaxFn(page, callback) {
type: 'POST',
url: url,
data: {
code: $ca.val(),
verifyCode: $ca.val(),
mobile: $pn.val(),
area: $region.text().split('+')[1]
}
... ... @@ -4291,7 +4295,7 @@ exports.init = function(page) {
$regionSelect.change(function() {
$region.text('+' + $('#region').val());
$region.text($('#region').val());
validateRule(page, $pn, showErrTip); //验证
});
... ... @@ -4319,7 +4323,7 @@ exports.init = function(page) {
data: {
area: $region.text().split('+')[1],
mobile: $pn.val(),
code: $ca.val()
verifyCode: $ca.val()
}
}).then(function(data) {
if (data.code === 200) {
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -218,10 +218,11 @@
.price-sure {
height: 24px;
width: 44px;
border: 1px solid #e0e0e0;
background: #fff;
color: #666;
background: #333;
color: #fff;
margin-left: 10px;
outline: none;
border: none;
}
.color-block {
... ... @@ -265,7 +266,7 @@
top: 39px;
background: #fff;
border: 1px solid #eaeceb;
z-index: 1;
z-index: 2;
ul {
max-width: 950px;
... ...
... ... @@ -43,6 +43,7 @@
color: #222;
cursor: pointer;
margin-right: 10px;
background: #fff;
}
.iconfont {
... ... @@ -54,14 +55,21 @@
> ul {
position: absolute;
display: none;
width: 42px;
padding: 0 3px;
width: 48px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
background: #fff;
z-index: 1;
}
li {
padding: 0 3px;
border-bottom: 1px solid #ccc;
&:hover {
background: #376cf7;
color: #fff;
}
}
a {
... ... @@ -84,4 +92,4 @@
color: #f00;
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -997,6 +997,7 @@ class HomeController extends AbstractAction
$this->_view->display('currency-detail', array(
'money' => $data['money'],
'pageFooter' => true,
'currencyPage' => true,
'currencyDetail' => true,
'currencyDetailPage' => true
));
... ...
<?php
namespace Product;
use Api\Yohobuy;
use Plugin\Helpers;
use Plugin\HelperSearch;
use \LibModels\Web\Product\SearchData;
... ... @@ -17,40 +19,141 @@ class SearchModel
{
/**
* 根据条件获取搜索数据
*
* @param $condition 搜索数据的条件
* @param $options Array([imgSize]
* => Array([0] => 235[1] => 314)[minImgSize] => Array([0] => 60[1] => 80)[gender] => 1[needPd] => Y[rowNum] => 5[viewNum] => 60)
* @author sefon 2015-12-17 16:12:18
* @return array
* 搜索相关页面公共条件处理
* @param $param
* @param $option
* @return mixed
*/
public static function getSearchData($condition, $options)
public static function SearchCondition($param, $option)
{
$data = array();
// 调用接口查询商品数据
$result = SearchData::searchElasticByCondition($condition);
if (isset($result['code']) && $result['code'] === 200) {
// 调用分类信息
$category = SearchData::getClassesData($condition);
if (isset($category['code']) && $category['code'] === 200) {
$result['data']['filter']['group_sort'] = $category['data']['sort'];
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
'query' => FILTER_SANITIZE_STRING,
'brand' => FILTER_VALIDATE_INT,
'sort' => FILTER_VALIDATE_INT,
'msort' => FILTER_VALIDATE_INT,
'misort' => FILTER_VALIDATE_INT,
'color' => FILTER_VALIDATE_INT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'gender' => FILTER_SANITIZE_STRING,
'p_d' => FILTER_DEFAULT,
'shelve_time' => FILTER_DEFAULT,
'isNew' => FILTER_DEFAULT,
'specialoffer' => FILTER_DEFAULT,
'limited' => FILTER_DEFAULT,
'order' => FILTER_DEFAULT,
'viewNum' => FILTER_VALIDATE_INT,
'rowNum' => FILTER_VALIDATE_INT,
'page' => FILTER_VALIDATE_INT), false);
//关键字
if (isset($condition['query']) && !empty($condition['query'])) {
$condition['query'] = rawurldecode($condition['query']);
}
//性别
if (isset($condition['gender']) && !empty($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
}
else {
$condition['gender'] = Helpers::getGenderByCookie();
}
//每页显示商品数
$viewNumArray = array(60, 100, 200);
if(!isset($condition['viewNum']) || empty($condition['viewNum'])){
$condition['viewNum'] =60;
}
if (!in_array($condition['viewNum'], $viewNumArray)) {
$condition['viewNum'] = 60;
}
//每行显示的商品数量
if(!isset($condition['rowNum']) || empty($condition['rowNum'])){
$condition['rowNum'] =5;
}
if ($condition['rowNum'] == 6) {
$imgSize = array(195, 260);
$minImgSize = array(50, 67);
}
else {
$condition['rowNum'] = 5;
$imgSize = array(235, 314);
$minImgSize = array(60, 80);
}
//自定义搜索价格
if (isset($condition['price']) && !empty($condition['price'])) {
$price = explode(',', $condition['price']);
if (!$price[0]) {
$price[0] = 0;
}
// 调用折扣区间
$discount = SearchData::getDiscount();
if (isset($discount['code']) && $discount['code'] === 200) {
$result['data']['filter']['discount'] = $discount['data']['discount'];
if (!$price[1]) {
$price[1] = 99999;
}
// 调用最新上架
$recent = SearchData::recentShelve();
if (isset($discount['code']) && $discount['code'] === 200) {
$result['data']['filter']['recent'] = $recent['data']['recent'];
$condition['price'] = implode(',', $price);
}
//返回搜索条件
$condition['needFilter'] = 1;
//过滤赠品
$condition['attribute_not'] = 2;
//默认排序
if (!isset($condition['order']) || empty($condition['order'])) {
$condition['order'] = 's_n_desc';
}
if (!isset($condition['p_d']) || empty($condition['p_d'])) {
$condition['p_d'] = '0,0.9';
}
$options = array(
'imgSize' => $imgSize,
'minImgSize' => $minImgSize,
'rowNum' =>$condition['rowNum'],
'viewNum' =>$condition['viewNum'],
);
//接收高级选项
foreach ($_GET as $key =>$val) {
if (strpos('parameter_',$key) !== false) {
$condition[$key] = (int) $val;
}
//用户浏览记录
$result['data']['filter']['review'] = SearchData::getRecentReview();
// 组织模板数据
$data = HelperSearch::getList($result, $options);
}
//每页记录数减1,下一页占位
$condition['viewNum'] = $condition['viewNum'] - 1;
$condition = array_merge($condition, $param);
$options = array_merge($options, $option);
$data['condition'] = $condition;
$data['options'] = $options;
return $data;
}
/**
* 根据条件获取搜索数据
* @param array $customCondition
* @param array $customOptions
* @return array
*/
public static function getSearchData($customCondition = array(), $customOptions = array())
{
$data = array();
$searchCondition = self::searchCondition($customCondition, $customOptions);
// 调用接口查询商品数据
$urlList['productUrl'] = HelperSearch::getProductUrl($searchCondition['condition']);
// 调用分类信息
$urlList['sortUrl'] = HelperSearch::getSortUrl($searchCondition['condition']);
// $result['data']['filter']['group_sort'] = $category['data']['sort'];
// 调用折扣区间
$urlList['discountUrl'] = HelperSearch::getDiscountUrl($searchCondition['condition']);
// $result['data']['filter']['discount'] = $discount['data']['discount'];
// 调用最新上架
$urlList['recentUrl'] = HelperSearch::getRecentUrl($searchCondition['condition']);
// $result['data']['filter']['recent'] = $recent['data']['recent'];
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result = Yohobuy::getMulti($urlList, array(), true);
// 组织模板数据
$data = HelperSearch::getList($result, $searchCondition['options']);
return $data;
}
... ... @@ -60,7 +163,8 @@ class SearchModel
* @param $options
* @return array
*/
public static function searchData($condition, $options){
public static function searchData($condition, $options)
{
$data = self::getSearchData($condition, $options);
//获取品牌店铺信息
if (isset($condition['query'])) {
... ...
... ... @@ -22,6 +22,7 @@ class BackController extends WebAction
'coverImg' => $banner['img'],
'countryCode' => '86',
'countryName' => '中国',
'captchaUrl'=>'/passport/images?t=1449799445',
'countryList' => RegData::getAreasData(),
)
);
... ... @@ -40,7 +41,7 @@ class BackController extends WebAction
{
$phoneNum = $this->post('phoneNum','');
$area = $this->post('area','86');
$captcha = $this->post('captcha','');
$verifyCode = $this->post('verifyCode','');
if(Helpers::verifyEmail($phoneNum)){ //验证邮箱
$email = $phoneNum;
$data = BackData::sendCodeToEmail($email);
... ... @@ -56,7 +57,7 @@ class BackController extends WebAction
$data = BackData::sendCodeToMobile($mobile);
$this->setSession('phoneNum', $phoneNum);
$this->setSession('area', $area);
$this->setSession('captcha', $captcha);
$this->setSession('verifyCode', $verifyCode);
if($data['code'] == 200) {
$this->redirect('verification');
}
... ... @@ -75,23 +76,6 @@ class BackController extends WebAction
$this->redirect('index');
}
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
$simpleHeader = array(
'logo' => array(
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
'url' => 'http://www.yohobuy.com'
),
'tool' => array(
'user' => '2586703@qq.com',
'userCenter' => '',
'loginHref' => '',
'logoutHref' => '',
'registerHref' => '',
'favoriteHref' => '',
'couponHref' => '',
'orderHref' => '',
'helpHref' => ''
)
);
$data = array(
'simpleHeader' => PassportModel::getSimpleHeader(false),
'sendEmail' => array(
... ... @@ -176,7 +160,7 @@ class BackController extends WebAction
public function verificationAction() {
$phoneNum = $this->getSession('phoneNum');
$area = $this->getSession('area');
$captcha = $this->getSession('captcha');
$verifyCode = $this->getSession('verifyCode');
if(empty($phoneNum)) {
$this->redirect('index');
}
... ...
... ... @@ -27,7 +27,7 @@ class RegisterController extends WebAction
'loginUrl' => '/signin.html?refer='.$refer,
'coverHref' => $cover['url'],
'coverImg' => $cover['img'],
'regBtnText' => '快速登录'
'regBtnText' => '立即注册'
)
);
$this->setCookie('refer', $refer);
... ...
... ... @@ -5,93 +5,9 @@ class SearchController extends WebAction
{
public function indexAction()
{
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
'query' => FILTER_SANITIZE_STRING,
'brand' => FILTER_VALIDATE_INT,
'sort' => FILTER_VALIDATE_INT,
'msort' => FILTER_VALIDATE_INT,
'misort' => FILTER_VALIDATE_INT,
'color' => FILTER_VALIDATE_INT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,
'shelve_time' => FILTER_DEFAULT,
'isNew' => FILTER_DEFAULT,
'specialoffer' => FILTER_DEFAULT,
'limited' => FILTER_DEFAULT,
'order' => FILTER_DEFAULT,
'viewNum' => FILTER_VALIDATE_INT,
'rowNum' => FILTER_VALIDATE_INT,
'page' => FILTER_VALIDATE_INT), false);
//字符转码
foreach($condition as $key => $val){
$condition[$key] = rawurldecode($val);
}
//性別(频道)
$gender_cookie = !isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender']=='2,3' ? 2 : 1);
$gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : $gender_cookie ;
$condition['gender'] = $gender;
//每页显示商品数
if(!isset($condition['viewNum']) || empty($condition['viewNum'])){
$condition['viewNum'] =60;
}
$view_num_arr = array(60, 100, 200);
if (!in_array($condition['viewNum'], $view_num_arr)) {
$condition['viewNum'] = 60;
}
//每行显示的商品数量
if(!isset($condition['rowNum']) || empty($condition['rowNum'])){
$condition['rowNum'] =5;
}
if ($condition['rowNum'] == 6) {
$imgSize = array(195, 260);
$minImgSize = array(50, 67);
} else {
$condition['rowNum'] = 5;
$imgSize = array(235, 314);
$minImgSize = array(60, 80);
}
//自定义搜索价格
if (isset($condition['price']) && !empty($condition['price'])) {
$price = explode(',', $condition['price']);
if (!$price[0]) {
$price[0] = 0;
}
if (!$price[1]) {
$price[1] = 99999;
}
$condition['price'] = implode(',', $price);
}
//返回搜索条件
$condition['needFilter'] = 1;
//过滤赠品
$condition['attribute_not'] = 2;
/*sale*/
//默认排序
if (!isset($condition['order']) || empty($condition['order'])) {
$condition['order'] = 's_n_desc';
}
if (!isset($condition['p_d']) || empty($condition['p_d'])) {
$condition['p_d'] = '0,0.9';
}
$options = array(
'imgSize' => $imgSize,
'minImgSize' => $minImgSize,
'rowNum' =>$condition['rowNum'],
'viewNum' =>$condition['viewNum'],
);
$params = $condition + $_GET;
$params = array_filter($params);
//每页记录数减1,下一页占位
$params['viewNum'] = $params['viewNum'] - 1;
$options['controller'] = $this->_request->controller;
$searchData = SearchModel::searchData($params,$options);
$cate = array('boys','girls','kids','lifestyle');
$this->setWebNavHeader($cate[$gender-1]);
$searchData = SearchModel::searchData('',$options);
$this->setWebNavHeader();
$data = array(
//初始化js
'searchListPage' => true,
... ...