Authored by xuqi

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

WAP
\ No newline at end of file
PC
\ No newline at end of file
Mobile
\ No newline at end of file
... ...
framework @ 119c247f
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
... ...
... ... @@ -18,6 +18,9 @@ class CacheConfig
const KEY_ACTION_GIRLS_INDEX = 'key_action_girls_index'; // 女生首页
const KEY_ACTION_KIDS_INDEX = 'key_action_kids_index'; // 潮童首页
const KEY_ACTION_LIFESTYLE_INDEX = 'key_action_lifestyle_index'; // 创意生活首页
const KEY_ACTION_BOYS_BOTTOM_BANNER = 'key_action_boys_bottom_banner'; // 男生首页底部banner
const KEY_ACTION_GRILS_BOTTOM_BANNER = 'key_action_girls_bottom_banner';// 女生首页底部banner
const KEY_ACTION_GUANG_PLUSSTAR_INDEX = 'key_action_guang_plusstar_index'; // 国际优选
const KEY_ACTION_GUANG_PLUSSTAR_LIST = 'key_action_guang_plusstar_list'; // 明星原创
... ...
... ... @@ -82,6 +82,7 @@ class NewsaleData
*/
public static function selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit = null, $limit = 60, $page = 1, $order = 's_t_desc')
{
$selectItems = array(
'gender' => $gender,
'brand' => $brand,
... ...
... ... @@ -9,9 +9,6 @@ use Plugin\Helpers;
*/
class FloorProcess
{
private static $guangUrl = 'http://guang.m.yohobuy.com';
/**
* 频道参数
*
... ... @@ -209,6 +206,7 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
isset(self::$channel[$type]) && $one['url'] .= '?gender='.self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ...
... ... @@ -82,6 +82,9 @@ class ListProcess
$filters['classify'][] = $build;
}
// 按照指定字段进行排序筛选数据
self::sortArrByField($filters['classify'], 'sort_col');
return $filters;
}
... ... @@ -91,6 +94,7 @@ class ListProcess
$result = array(
'title' => '品牌',
'name' => '所有品牌',
'sort_col' => 1,
'dataType' => 'brand',
'subs' => array(
array(
... ... @@ -120,6 +124,7 @@ class ListProcess
$result = array(
'title' => '颜色',
'name' => '所有颜色',
'sort_col' => 3,
'dataType' => 'color',
'subs' => array(
array(
... ... @@ -146,6 +151,7 @@ class ListProcess
$result = array(
'title' => '折扣',
'name' => '所有商品',
'sort_col' => 6,
'dataType' => 'discount',
'subs' => array(
array(
... ... @@ -172,6 +178,7 @@ class ListProcess
$result = array(
'title' => '性别',
'name' => '所有性别',
'sort_col' => 0,
'dataType' => 'gender',
'subs' => array(
array(
... ... @@ -180,12 +187,12 @@ class ListProcess
'name' => '所有性别'
),
array(
'dataId' => 'boys',
'name' => '男'
'dataId' => '1,3',
'name' => 'BOYS'
),
array(
'dataId' => 'girls',
'name' => '女'
'dataId' => '2,3',
'name' => 'GIRLS'
),
)
);
... ... @@ -198,6 +205,7 @@ class ListProcess
$result = array(
'title' => '品类',
'name' => '所有品类',
'sort_col' => 2,
'dataType' => 'sort',
'subs' => array(
array(
... ... @@ -237,6 +245,7 @@ class ListProcess
$result = array(
'title' => '价格',
'name' => '所有价格',
'sort_col' => 5,
'dataType' => 'price',
'subs' => array(
array(
... ... @@ -263,6 +272,7 @@ class ListProcess
$result = array(
'title' => '尺码',
'name' => '所有尺码',
'sort_col' => 4,
'dataType' => 'size',
'subs' => array(
array(
... ...
... ... @@ -117,6 +117,32 @@ class Helpers
}
/**
* 根据排序类型和类型值获得正确的排序参数
* @param integer $order 类型值
* @param string $type 排序类型
* @return string 转换之后的排序参数
*/
public static function transOrder($order, $type)
{
$result = '';
switch ($type) {
case 'price':
$result = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$result = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$result = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
return $result;
}
/**
* 格式化商品信息
*
* @param array $productData 需要格式化的商品数据
... ...
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 Fri Oct 23 16:38:57 2015
Created by FontForge 20120731 at Fri Oct 30 10:27:45 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Fri Oct 23 16:38:57 2015
bbox="-0.75 -224 3943 812.871"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E628"
unicode-range="U+0078-E62D"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -152,5 +152,19 @@ d="M866.5 663.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t13
<glyph glyph-name="uniE628" unicode="&#xe628;"
d="M505 776q77 0 148.5 -23.5t129 -67t101 -101.5t67.5 -129.5t24 -147.5q0 -64 -17 -125t-47.5 -112t-74 -94.5t-94.5 -74t-112 -47.5t-125 -17q-95 0 -182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -104q112 0 206.5 55t149.5 149.5
t55 206.5q0 37 -6.5 73.5t-19.5 69.5t-30.5 64t-40.5 57.5t-49.5 49.5t-57.5 40.5t-64 30t-69.5 19t-73.5 6.5q-111 0 -205.5 -55t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 138v-59h-58v59h58zM470 564h58v-349h-58v349z" />
<glyph glyph-name="uniE629" unicode="&#xe629;"
d="M442 274h-84v-76h-230v76h-81q-20 0 -33.5 -12.5t-13.5 -31.5v-395q0 -20 13.5 -33.5t33.5 -13.5h395q19 0 31.5 13.5t12.5 33.5v395q0 13 -5.5 23t-15.5 15.5t-23 5.5zM977 812h-81v-77h-230v77h-84q-10 0 -18 -3.5t-14 -10t-9 -15t-3 -18.5v-395q0 -13 5.5 -23
t15.5 -15.5t23 -5.5h395q20 0 33.5 12.5t13.5 31.5v395q0 20 -13.5 33.5t-33.5 13.5zM977 274h-81v-76h-230v76h-84q-13 0 -23 -5.5t-15.5 -15.5t-5.5 -23v-395q0 -13 5.5 -23.5t15.5 -17t23 -6.5h395q20 0 33.5 13.5t13.5 33.5v395q0 19 -13.5 31.5t-33.5 12.5z" />
<glyph glyph-name="uniE62A" unicode="&#xe62a;"
d="M497 806l-451 -386q-6 -6 -11 -13t-7 -15t-2 -17v-500q0 -32 22.5 -54.5t53.5 -22.5h256v333h308v-333h256q31 0 53.5 22.5t22.5 54.5v500q0 27 -20 45l-451 386q-15 13 -30 0z" />
<glyph glyph-name="uniE62B" unicode="&#xe62b;"
d="M761 539q0 -104 -73 -177t-177 -73q-51 0 -97 19.5t-79.5 53t-53.5 80t-20 97.5q0 104 73.5 177t177 73t176.5 -73t73 -177zM888 -164q11 22 9 48q-3 43 -15 83.5t-32 76t-46.5 66.5t-59.5 55t-69.5 42t-78.5 27t-85 9q-100 0 -186.5 -47.5t-139.5 -130t-60 -181.5
q-1 -26 10 -48q5 -12 16 -18.5t24 -6.5h673q12 0 23 6.5t17 18.5z" />
<glyph glyph-name="uniE62C" unicode="&#xe62c;" horiz-adv-x="1048"
d="M832 -127q0 -23 -11.5 -42.5t-31 -31t-43 -11.5t-43 11.5t-31 31t-11.5 42.5q0 36 25 61t60.5 25t60.5 -25t25 -61zM533 -126.5q0 -35.5 -25 -60.5t-60 -25t-60 25t-25 60.5t25 60.5t60 25t60 -25t25 -60.5zM277 620l-35 159q-3 14 -15 23.5t-27 9.5h-147
q-22 0 -37.5 -15.5t-15.5 -37.5t15.5 -38t37.5 -16h54l157 -627q3 -12 9.5 -22.5t16 -17.5t21 -11t23.5 -4h527q16 0 30.5 7t25 19.5t14.5 28.5l113 452q9 34 -13 62t-57 28h-697z" />
<glyph glyph-name="uniE62D" unicode="&#xe62d;"
d="M442 274h-84v-76h-230v76h-81q-20 0 -33.5 -12.5t-13.5 -31.5v-395q0 -20 13.5 -33.5t33.5 -13.5h395q19 0 31.5 13.5t12.5 33.5v395q0 13 -5.5 23t-15.5 15.5t-23 5.5zM977 812h-81v-77h-230v77h-84q-10 0 -18 -3.5t-14 -10t-9 -15t-3 -18.5v-395q0 -13 5.5 -23
t15.5 -15.5t23 -5.5h395q20 0 33.5 12.5t13.5 31.5v395q0 20 -13.5 33.5t-33.5 13.5zM977 274h-81v-76h-230v76h-84q-13 0 -23 -5.5t-15.5 -15.5t-5.5 -23v-395q0 -13 5.5 -23.5t15.5 -17t23 -6.5h395q20 0 33.5 13.5t13.5 33.5v395q0 19 -13.5 31.5t-33.5 12.5z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -197,5 +197,4 @@ function tsAnimate() {
}
}
tsAnimate();
setTimeout(tsAnimate, 3000);
... ...
... ... @@ -2,7 +2,7 @@
position: absolute;
left: 0;
right: 0;
top: 0;
top: 2px;
}
.filter-mask {
... ...
.good-info {
float: left;
width: 44%;
width: 46.4%;
height: 486rem / $pxConvertRem;
margin: 28rem / $pxConvertRem 3% 0;
margin: 28rem / $pxConvertRem 0 0 2.4%;
.tag-container {
... ...
... ... @@ -24,6 +24,10 @@ $clothes: sprite-map("guang/clothes/*.png");
}
.guang-detail-page {
#wrapper {
background: #f0f0f0;
}
#wrapper.ios {
position: absolute;
top: 0;
... ...
... ... @@ -73,6 +73,7 @@
.info-list-container {
overflow-x: hidden;
background: #f0f0f0;
}
.info-list.hide {
... ...
... ... @@ -29,8 +29,8 @@
}
} */
.home-header {
height: 88rem / $pxConvertRem;
line-height: 88rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
@include background-image(linear-gradient(#323232, #414141));
position: relative;
.iconfont {
... ...
... ... @@ -14,16 +14,18 @@
border-right: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
overflow: hidden;
background: #fff;
.brand-logo {
width: 100%;
display: table-cell;
width: 3.95rem;
height: 128rem / $pxConvertRem;
line-height: 128rem / $pxConvertRem;
text-align: center;
font-size: 0;
vertical-align: middle;
img {
vertical-align: middle;
max-width: 100%;
max-height: 100%;
}
... ... @@ -52,7 +54,8 @@
width: 317rem / $pxConvertRem;
height: 174rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
background: #fff;
a {
display: block;
width: 100%;
... ... @@ -68,7 +71,7 @@
background: #fff;
width: 100%;
height: 140rem / $pxConvertRem;
margin-bottom: 28rem / $pxConvertRem;
// margin-bottom: 28rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
overflow: hidden;
... ...
... ... @@ -30,11 +30,11 @@
.nav-icon, .nav-img {
position: absolute;
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
width: 48rem / $pxConvertRem;
height: 48rem / $pxConvertRem;
top: 50%;
margin-top: -30rem / $pxConvertRem;
left: 24rem / $pxConvertRem;
margin-top: -24rem / $pxConvertRem;
left: 30rem / $pxConvertRem;
}
.enter-subnav {
... ...
... ... @@ -4,8 +4,8 @@
color: #fff;
width: 100%;
overflow: hidden;
height: 88rem / $pxConvertRem;
line-height: 88rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
&.boys {
@include background-image(linear-gradient(#323232, #414141));
... ...
.discount-page {
background-color: #f0f0f0;
background-color: #fff;
.swiper-container {
width: 100%;
... ... @@ -32,6 +32,7 @@
}
.list-nav {
border:1px solid #e6e6e6;
> li {
float: left;
width: 25%;
... ... @@ -50,9 +51,14 @@
}
.active > a {
border-bottom: 2px solid #000;
color: #000;
.spanTest{
width: auto;
height: 100%;
border-bottom: 2px solid #000;
display: inline-block;
box-sizing:border-box;
}
.iconfont {
color: #999;
... ...
... ... @@ -3,7 +3,7 @@
.swiper-container {
width: 100%;
height: 240rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
img {
height: 100%;
... ... @@ -23,7 +23,7 @@
.banner-top-single{
width: 100%;
height: 240rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
img {
display: block;
height: 100%;
... ...
{{> filter}}
\ No newline at end of file
... ...
... ... @@ -7,13 +7,13 @@
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
最新
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
价格
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
... ... @@ -22,7 +22,7 @@
</li>
<li class="discount">
<a href="javascript:void(0);">
折扣
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
... ... @@ -31,7 +31,7 @@
</li>
<li class="filter">
<a href="javascript:void(0);">
筛选
<span class="spanTest">筛选</span>
<span class="iconfont">&#xe613;</span>
</a>
</li>
... ...
{{# showFooterTab}}
<div class="footer-tab">
<div class="tab-item {{#if grilsHomePage}}current{{/if}}{{#if boysHomePage}}current{{/if}}{{#if kidsHomePage}}current{{/if}}{{#if lifestyleHomePage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe611;</p>
<p class="iconfont tab-icon">&#xe62a;</p>
<p class="tab-name">首页</p>
</div>
<div class="tab-item {{#if categoryPage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe611;</p>
<p class="iconfont tab-icon">&#xe62d;</p>
<p class="tab-name">分类</p>
</div>
<div class="tab-item {{#if guangHome}}current{{/if}}">
... ... @@ -13,11 +13,11 @@
<p class="tab-name">逛</p>
</div>
<div class="tab-item {{#if shoppingCartPage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe611;</p>
<p class="iconfont tab-icon">&#xe62c;</p>
<p class="tab-name">购物车</p>
</div>
<div class="tab-item {{#if minePage}}current{{/if}}">
<p class="iconfont tab-icon">&#xe611;</p>
<p class="iconfont tab-icon">&#xe62b;</p>
<p class="tab-name">我的</p>
</div>
</div>
... ...
<?php
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 男生首页
... ... @@ -34,4 +35,31 @@ class BoysController extends AbstractAction
}
/**
* 异步获取男首底部banner数据
* @return string 底部Banner数据
*/
public function bottomBannerAction()
{
do
{
if(!$this->isAjax())
{
break;
}
$channel = Helpers::getChannelByCookie();
$bottomBanner = Index\HomeModel::getBottomBanner($channel);
if($bottomBanner)
{
$this->echoJson($bottomBanner);
}
}
while(false);
echo ' ';
}
}
... ...
<?php
use Action\AbstractAction;
use Plugin\Helpers;
/**
* 女生首页
... ... @@ -33,4 +34,31 @@ class GirlsController extends AbstractAction
));
}
/**
* 异步获取女首底部banner数据
* @return string 底部Banner数据
*/
public function bottomBannerAction()
{
do
{
if(!$this->isAjax())
{
break;
}
$channel = Helpers::getChannelByCookie();
$bottomBanner = Index\HomeModel::getBottomBanner($channel);
if($bottomBanner)
{
$this->echoJson($bottomBanner);
}
}
while(false);
echo ' ';
}
}
... ...
... ... @@ -46,7 +46,7 @@ class ClassModel
$oneClass = array();
$item = array();
foreach ($data['data'] as $k => $v) {
$oneClass = array('name' => $k, 'ca' => array());
$oneClass = array('name' => ucfirst($k), 'ca' => array());
foreach ($v as $val) {
$item = array();
... ...
... ... @@ -45,6 +45,11 @@ class HomeModel
/* COOKIE标识访问的是创意生活频道 */
const COOKIE_NAME_LIFESTYLE = 'lifestyle';
/* COOKIE标识访问的是男生频道底部Banner */
const COOKIE_NAME_BOYS_BOTTOM_BANNER = '8c48745a39373d621bf5fd80edf59b5e';
/* COOKIE标识访问的是女生频道频道底部Banner */
const COOKIE_NAME_GIRLS_BOTTOM_BANNER = 'c63939b2ad458e9cb51147940c1da2e5';
/**
* 选择频道
*
... ... @@ -112,6 +117,56 @@ class HomeModel
}
/**
* 获取男生,女生底部banner
*
* @return string | false
*/
public static function getBottomBanner($channel)
{
$result = false;
if($channel == 2) {
$resource = self::COOKIE_NAME_GIRLS_BOTTOM_BANNER;
$cache = CacheConfig::KEY_ACTION_GRILS_BOTTOM_BANNER;
} else {
$resource = self::COOKIE_NAME_BOYS_BOTTOM_BANNER;
$cache = CacheConfig::KEY_ACTION_BOYS_BOTTOM_BANNER;
}
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($cache, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口获取数据
$banner = IndexData::getBannerStart($resource);
if (isset($banner['code']) && $banner['code'] == 200) {
// 构建数据
$data = array();
foreach ($banner['data'] as $val) {
$data['list'][] = $val;
}
$result = FloorProcess::getContent($data, $channel);
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($cache, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($cache, $result);
}
}
return $result;
}
/**
* 获取男生首页的楼层数据
*
* @return array | false
... ...
... ... @@ -48,7 +48,7 @@ class SideModel
$result[$key]['textEn'] = $value['sort_name_en'];
$result[$key]['styleClass'] = strtolower($value['sort_name_en']);
$result[$key]['url'] = Helpers::getFilterUrl($value['sort_url']);
$result[$key]['img'] = Helpers::getImageUrl($value['sort_ico'], 60, 60);
$result[$key]['img'] = Helpers::getImageUrl($value['sort_ico'], 60, 60, 1);
}
}
... ...
... ... @@ -5,6 +5,7 @@ namespace Product;
use Configs\CacheConfig;
use LibModels\Wap\Product\NewsaleData;
use Plugin\DataProcess\NewSaleProcess;
use Plugin\DataProcess\ListProcess;
use Plugin\Helpers;
use Plugin\Cache;
... ... @@ -219,4 +220,22 @@ class NewsaleModel
return $result;
}
/**
* 获取筛选数据
* @param array $data 接口返回的数据
* @return array 处理之后的数据
*/
public static function filterData($data)
{
$result = array();
/* 格式化筛选数据 */
if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['filter'])) {
$result['filter'] = ListProcess::getFilterData($data['data']['filter']);
}
return $result;
}
}
... ...
... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use LibModels\Wap\Passport\BackData;
use LibModels\Wap\Passport\RegData;
use Plugin\Helpers;
/**
* 频道选择
... ... @@ -31,9 +32,21 @@ class BackController extends AbstractAction
*/
public function sendemailAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '邮箱格式不正确,请重新输入', 'data' => '');
do
{
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
break;
}
$email = $this->post('email', '');
// 判断邮箱是否有效
if(!Helpers::verifyEmail($email))
{
break;
}
// 发送邮箱验证码
$result = BackData::sendCodeToEmail($email);
... ... @@ -42,8 +55,10 @@ class BackController extends AbstractAction
$result['data'] = '/passport/back/success?email='.$email;
}
$this->echoJson($result);
}
while (false);
$this->echoJson($result);
}
/**
... ... @@ -51,15 +66,28 @@ class BackController extends AbstractAction
*/
public function resendemailAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '重发邮件失败');
do
{
if(!$this->isAjax())
{
break;
}
$email = $this->get('email', '');
// 发送邮箱验证码
$result = BackData::sendCodeToEmail($email);
$return = BackData::sendCodeToEmail($email);
if(!empty($return))
{
$result = $return;
}
$this->echoJson($result);
}
while(false);
$this->echoJson($result);
}
public function successAction()
... ... @@ -72,7 +100,7 @@ class BackController extends AbstractAction
$domain_name = 'http://' . (($domain == 'gmail.com') ? 'mail.google.com' : 'mail.' . $domain);
$data = array(
'backUrl' => 'emailback.html',
'backUrl' => '/emailback.html',
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmailSuccess' => true,
... ... @@ -133,20 +161,34 @@ class BackController extends AbstractAction
*/
public function sendcodeAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '手机号码格式不正确,请重新输入', 'data' => '');
do
{
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
break;
}
$phoneNum = $this->post('phoneNum', '');
$areaCode = $this->post('areaCode', 86);
if(!Helpers::verifyMobile($phoneNum))
{
break;
}
// 发送手机验证码
$result = BackData::sendCodeToMobile($phoneNum, $areaCode);
if($result['code'] === 200)
$return = BackData::sendCodeToMobile($phoneNum, $areaCode);
if($return && $return['code'] === 200)
{
$result = $return;
$result['data'] = '/passport/back/mobilecode?phoneNum='.$phoneNum.'&areaCode='.$areaCode;
}
$this->echoJson($result);
}
while (false);
$this->echoJson($result);
}
/**
... ...
... ... @@ -78,7 +78,7 @@ class NewsaleController extends AbstractAction
public function selectNewSaleAction()
{
if ($this->isAjax()) {
$gender = $this->get('gender', 'boys');
$gender = $this->get('gender', null);
$brand = $this->get('brand', null);
$sort = $this->get('sort', null);
$color = $this->get('color', null);
... ... @@ -89,30 +89,10 @@ class NewsaleController extends AbstractAction
$limit = $this->get('limit', 60);
$page = $this->get('page', 1);
// 转换性别
if ($gender === 'boys') {
$gender = '1,3';
} elseif ($gender === 'girls') {
$gender = '2,3';
} else {
$gender = '1,2,3';
}
// 转换排序方式
$order = $this->get('order', null);
$orderVal = $this->get('order', null);
$type = $this->get('type', '');
switch ($type) {
case 'price':
$order = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$order = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$order = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
$order = Helpers::transOrder($orderVal, $type);
// 转换频道
$channel = Helpers::getChannelByCookie();
... ... @@ -132,4 +112,45 @@ class NewsaleController extends AbstractAction
}
}
/**
* Ajax方式查询筛选数据
*
* @return array 筛选数据
*/
public function filterAction()
{
if ($this->isAjax()) {
$gender = $this->get('gender', null);
$brand = $this->get('brand', null);
$sort = $this->get('sort', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('discount', null);
$dayLimit = $this->get('dayLimit', null);
$limit = $this->get('limit', 60);
$page = $this->get('page', 1);
// 转换排序方式
$orderVal = $this->get('order', null);
$type = $this->get('type', '');
$order = Helpers::transOrder($orderVal, $type);
$channel = Helpers::getChannelByCookie();
$data = NewsaleData::selectNewSaleProducts(
$gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
);
$result = \Product\NewsaleModel::filterData($data);
if (empty($result)) {
echo ' ';
} else {
$this->_view->display('filter', $result);
}
} else {
echo ' ';
}
}
}
... ...