Authored by Rock Zhang

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

... ... @@ -752,14 +752,7 @@
],
filter: {
.. //筛选数据结构
},
brand: '',
gender: '',
sort: '',
color: '',
size: '',
price: '',
discount: ''
}
}
}
... ...
... ... @@ -283,6 +283,9 @@ class AbstractAction extends Controller_Abstract
*/
protected function getUid($useSession = false)
{
// @todo
$useSession = false;
if (!$this->_uid) {
$cookie = $this->getCookie('_UID');
if (!empty($cookie)) {
... ...
... ... @@ -491,8 +491,10 @@ class Helpers
return false;
}
//格式化订单商品
public static function formatOrderGoods($orderGoods)
/**
* 格式化订单商品
*/
public static function formatOrderGoods($orderGoods, &$count = 0)
{
$arr = array();
foreach ($orderGoods as $key => $vo) {
... ... @@ -512,6 +514,8 @@ class Helpers
if (!empty($vo['expect_arrival_time'])) {
$arr[$key]['appearDate'] = $vo['expect_arrival_time'];
}
// 累计购买数
$count += intval($vo['buy_number']);
}
return $arr;
}
... ...
... ... @@ -17,6 +17,7 @@ var $icon = $('.search-icon');
var $form = $('#search-form');
var $history = $('.history');
var $historySearch = $('.history-search');
var $clearHistory = $('#clear-history');
... ... @@ -31,6 +32,8 @@ chHammer.on('tap', function() {
localStorage.removeItem('historys');
$history.html('');
$historySearch.hide();
$clearHistory.hide();
window.rePosFooter();
});
... ... @@ -80,7 +83,7 @@ $('#search').on('touchend', function() {
$history.html(html);
$clearHistory.removeClass('hide');
$historySearch.removeClass('hide');
window.rePosFooter();
}
}
... ...
... ... @@ -15,7 +15,11 @@ var $loading,
// 初始化
function init($container) {
var html = '<div class="loading-mask hide"><div class="loading"></div></div>';
var html = '<div class="loading-mask hide">' +
'<div class="loading">' +
'<div></div><div></div><div></div>' +
'</div>' +
'</div>';
hasInit = true;
if ($container === undefined) {
... ...
... ... @@ -9,7 +9,7 @@ var $ = require('jquery'),
var commentsNum,consultsNum;
var consultFooterEle = document.getElementById('consult-content-footer'),
var consultFooterEle = $('.consult-content-footer')[0],
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
navtabEle = document.getElementById('nav-tab'),
... ... @@ -68,13 +68,13 @@ if (navtabHammer) {
if (consultFooterHammer) {
consultFooterHammer.on('tap', function() {
location.href = $(consultFooterEle).find('a').attr('href');
location.href = $(consultFooterEle).data('href');
});
}
if (gotoConsultHammer) {
gotoConsultHammer.on('tap', function() {
location.href = $(gotoConsultEle).find('a').attr('href');
location.href = $(gotoConsultEle).data('href');
});
}
... ...
/**
* 提取URL中的参数
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/19
*/
var opt = {};
var paramStr = window.location.search.split('?')[1];
var keyVal = paramStr ? paramStr.split('&') : [];
var i, key, val;
for (i = keyVal.length; i > 0; i--) {
key = keyVal[i - 1].split('=');
val = key[1];
key = key[0];
//初始化默认参数
opt[key] = val;
//discount = p_d,同时需要两个参数
if (key === 'discount' || key === 'p_d') {
opt.discount = val;
opt.p_d = val;
}
}
if (typeof opt.gender === 'undefined') {
switch (window.cookie('_Channel')) {
case 'boys':
opt.gender = '1,3';
break;
case 'girls':
opt.gender = '2,3';
break;
default:
opt.gender = '1,2,3';
}
}
module.exports = opt;
\ No newline at end of file
... ... @@ -31,7 +31,7 @@ var $input = $('#search-input input'),
$clear = $('#search-input .clear-input');
//默认筛选条件
var defaultOpt = require('./extract-url');
var defaultOpt = require('./query-param');
var $listNav = $('#list-nav'),
... ...
... ... @@ -24,7 +24,7 @@ var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
//默认筛选条件
var defaultOpt = require('../extract-url');
var defaultOpt = require('../query-param');
var $listNav = $('#list-nav'),
... ...
... ... @@ -27,7 +27,7 @@ var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
//默认筛选条件
var defaultOpt = require('../extract-url');
var defaultOpt = require('../query-param');
var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置
... ...
/**
* 提取查询参数
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/19
*/
var $ = require('jquery'),
opt = {};
$('.query-param').each(function() {
var $this = $(this);
opt[$this.data('attr')] = $this.val();
});
module.exports = opt;
\ No newline at end of file
... ...
... ... @@ -5,16 +5,73 @@
bottom: 0;
right: 0;
left: 0;
@-webkit-keyframes scale {
0% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
45% {
-webkit-transform: scale(0.1);
transform: scale(0.1);
opacity: 0.7;
}
80% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
}
@keyframes scale {
0% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
45% {
-webkit-transform: scale(0.1);
transform: scale(0.1);
opacity: 0.7;
}
80% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
}
.loading {
position: absolute;
width: 100rem / $pxConvertRem;
height: 40rem / $pxConvertRem;
background: image-url('loading.gif') no-repeat;
background-size: 100% 100%;
width: 60px;
height: 20px;
top: 50%;
left: 50%;
margin-left: -50rem / $pxConvertRem;
margin-top: -20rem / $pxConvertRem;
margin-top: -10px;
margin-left: -30px;
> div {
display: inline-block;
background: #fff;
width: 15px;
height: 15px;
@include border-radius(100%);
margin: 2px;
$init: 0.12;
@for $i from 1 through 3 {
&:nth-child(#{$i}) {
-webkit-animation: scale .75s #{$init}s infinite cubic-bezier(.2,.68,.18,1.08);
animation: scale .75s #{$init}s infinite cubic-bezier(.2,.68,.18,1.08);
}
$init: ($i + 1) * 0.12;
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -202,7 +202,7 @@ $basicBtnC:#eb0313;
.goodsName {
box-sizing: border-box;
width: 100%;
min-height: pxToRem(83px);
min-height: pxToRem(88px);
font-size: pxToRem(28px);
color: #fff;
padding-left: pxToRem(28px);
... ... @@ -236,7 +236,7 @@ $basicBtnC:#eb0313;
.price-date {
// width: 100%;
color: $subFontC;
min-height: pxToRem(88px);
height: pxToRem(88px);
padding-left: pxToRem(28px);
padding-right: pxToRem(28px);
background-color: #fff;
... ...
... ... @@ -21,7 +21,7 @@
{{/ hot}}
</ul>
</div>
<div class="history-search">
<div class="history-search hide">
<h3>历史搜索</h3>
<ul class="history clearfix"></ul>
</div>
... ... @@ -29,4 +29,4 @@
</div>
{{/ search}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="goods-consults-page yoho-page">
<div class="goto-consult" id="goto-consult">
<div class="goto-consult" id="goto-consult" data-href="{{link}}">
<i class="iconfont consult-logo">&#xe639;</i>
<span>我要咨询</span>
<a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a>
<a href="javascript:;" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults" id="goods-consults">
... ...
... ... @@ -4,58 +4,6 @@
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<div id="hotRank"></div>
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
{{/if}}
{{#if gender}}
<input id="gender" type="hidden" value={{gender}}>
{{/if}}
{{#if sort}}
<input id="sort" type="hidden" value={{sort}}>
{{/if}}
{{#if msort}}
<input id="msort" type="hidden" value={{msort}}>
{{/if}}
{{#if misort}}
<input id="misort" type="hidden" value={{misort}}>
{{/if}}
{{#if color}}
<input id="color" type="hidden" value={{color}}>
{{/if}}
{{#if size}}
<input id="size" type="hidden" value={{size}}>
{{/if}}
{{#if price}}
<input id="price" type="hidden" value={{price}}>
{{/if}}
{{#if p_d}}
<input id="p_d" type="hidden" value={{p_d}}>
{{/if}}
{{#if channel}}
<input id="channel" type="hidden" value={{channel}}>
{{/if}}
{{#if limit}}
<input id="limit" type="hidden" value={{limit}}>
{{/if}}
{{#if page}}
<input id="page" type="hidden" value={{page}}>
{{/if}}
{{#if discount}}
<input id="discount" type="hidden" value={{discount}}>
{{/if}}
{{> product/suspend-cart}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -37,6 +37,9 @@
<div class="container hide clearfix"></div>
{{> filter}}
</div>
{{> product/query-param}}
{{> product/suspend-cart}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -48,6 +48,9 @@
{{> filter}}
</div>
{{> product/query-param}}
{{> product/suspend-cart}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -49,8 +49,8 @@
</div>
{{/ consults}}
</div>
<div class="consult-content-footer" id="consult-content-footer">
<a href="{{link}}">
<div class="consult-content-footer" data-href="{{link}}">
<a href="javascript:;">
查看更多
<span class="iconfont">&#xe604;</span></a>
</div>
... ... @@ -58,8 +58,9 @@
<div class="consult-content-main content-main no-item">
<span class="iconfont">&#xe63f;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="{{link}}">
<div class="consult-content-footer" data-href="{{link}}">
<a href="javascript:;">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -89,5 +89,8 @@
{{> filter}}
</div>
{{> product/query-param}}
{{> product/suspend-cart}}
{{/ goodList}}
\ No newline at end of file
... ...
{{#if brand}}
<input class="query-param" type="hidden" data-attr="brand" value="{{brand}}">
{{/if}}
{{#if gender}}
<input class="query-param" type="hidden" data-attr="gender" value="{{gender}}">
{{/if}}
{{#if sort}}
<input class="query-param" type="hidden" data-attr="sort" value="{{sort}}">
{{/if}}
{{#if msort}}
<input class="query-param" type="hidden" data-attr="msort" value="{{msort}}">
{{/if}}
{{#if misort}}
<input class="query-param" type="hidden" data-attr="misort" value="{{misort}}">
{{/if}}
{{#if color}}
<input class="query-param" type="hidden" data-attr="color" value="{{color}}">
{{/if}}
{{#if size}}
<input class="query-param" type="hidden" data-attr="size" value="{{size}}">
{{/if}}
{{#if price}}
<input class="query-param" type="hidden" data-attr="price" value="{{price}}">
{{/if}}
{{#if discount}}
<input class="query-param" type="hidden" data-attr="discount" value="{{discount}}">
{{/if}}
{{#if query}}
<input class="query-param" type="hidden" data-attr="query" value="{{query}}">
{{/if}}
{{#if style}}
<input class="query-param" type="hidden" data-attr="style" value="{{style}}">
{{/if}}
{{#if p_d}}
<input class="query-param" type="hidden" data-attr="p_d" value="{{p_d}}">
{{/if}}
{{#if channel}}
<input class="query-param" type="hidden" data-attr="channel" value="{{channel}}">
{{/if}}
{{#if dayLimit}}
<input class="query-param" type="hidden" data-attr="dayLimit" value="{{dayLimit}}">
{{/if}}
{{#if limit}}
<input class="query-param" type="hidden" data-attr="limit" value="{{limit}}">
{{/if}}
\ No newline at end of file
... ...
... ... @@ -32,36 +32,33 @@ class SearchController extends AbstractAction
*/
public function listAction()
{
// // 过滤请求参数
// $condition = filter_input_array(INPUT_GET, array(
// 'query' => FILTER_DEFAULT,
// 'brand' => FILTER_DEFAULT,
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
//
// $query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// // unset($condition['discount']); 为了兼容js中传参的discount
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// if (isset($condition['query'])) {
// $condition['query'] = rawurlencode($condition['query']);
// }
$query = $this->get('query', '');
$query = is_string($query) ? '' : strtolower(trim($query));
// 过滤请求参数
$condition = filter_input_array(INPUT_GET, array(
'query' => FILTER_DEFAULT,
'brand' => FILTER_DEFAULT,
'sort' => FILTER_DEFAULT,
'msort' => FILTER_DEFAULT,
'misort' => FILTER_DEFAULT,
'color' => FILTER_DEFAULT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
// unset($condition['discount']); 为了兼容js中传参的discount
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['discount'] = rawurldecode($condition['p_d']);
}
if (isset($condition['query'])) {
$condition['query'] = rawurlencode($condition['query']);
}
// 标识用户是否有输入搜索内容
$haveQuery = $query !== '';
... ... @@ -133,13 +130,13 @@ class SearchController extends AbstractAction
$classNames = array();
}
// else {
// $condition['query'] = '';
// }
else {
$condition['query'] = '';
}
$data = array();
$data['goodListPage'] = true;
//$data['goodList'] = $condition;
$data['goodList'] = $condition;
$data['query'] = $query;
// 搜索是一级品类
if ($isQueryFirstClass) {
... ...
... ... @@ -70,20 +70,21 @@ class OrderModel
if (!empty($data['data']['order_list'])) {
// 订单的状态列表
//$orderStatus = Helpers::getOrderStatus();
$count = 0;
foreach ($data['data']['order_list'] as $key => $vo) {
// if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) {
// $vo['status'] = 1;
// }
$count = 0;
//订单号,支付状态,订单商品数量,订单总价格
$result[$key]['orderNum'] = $vo['order_code'];
//$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ];
$result[$key]['orderStatus'] = $vo['status_str'];
$result[$key]['count'] = count($vo['order_goods']);
$result[$key]['sumCost'] = $vo['amount'];
//类内调用格式化订单商品数据方法
$result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods']);
$result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods'], $count);
$result[$key]['detailUrl'] = Helpers::url('/home/orders/detail', array('order_code' => $vo['order_code'], 't' => time()));
$result[$key]['count'] = $count;
//根据订单status判断订单处于什么状态。
do {
//订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。
... ...
... ... @@ -304,7 +304,7 @@ class DetailModel
/* 参考尺码 */
$boyReference = !empty($sizeInfo['productExtra']['boyReference']);
$girlReference = !empty($sizeInfo['productExtra']['girlReference']);
$gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3;
$gender = isset($sizeInfo['productDescBo']['gender']) ? $sizeInfo['productDescBo']['gender'] : 3;
$referenceName = '参考尺码';
if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) {
$referenceName = '参考尺码';
... ...
... ... @@ -23,66 +23,66 @@ class IndexController extends AbstractAction
*/
public function indexAction()
{
// // 过滤请求参数
// $condition = filter_input_array(INPUT_GET, array(
// 'brand' => FILTER_DEFAULT,
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
//
// // 转义品牌
// if (isset($condition['brand'])) {
// $condition['brand'] = rawurldecode($condition['brand']);
// }
// // 转义分类
// if (isset($condition['sort'])) {
// $condition['sort'] = rawurldecode($condition['sort']);
// }
// // 转义一级分类
// if (isset($condition['msort'])) {
// $condition['msort'] = rawurldecode($condition['msort']);
// }
// // 转义二级分类
// if (isset($condition['misort'])) {
// $condition['misort'] = rawurldecode($condition['misort']);
// }
// // 转义颜色
// if (isset($condition['color'])) {
// $condition['color'] = rawurldecode($condition['color']);
// }
// // 转义尺码
// if (isset($condition['size'])) {
// $condition['size'] = rawurldecode($condition['size']);
// }
// // 转义风格
// if (isset($condition['style'])) {
// $condition['style'] = rawurldecode($condition['style']);
// }
// // 转义价格
// if (isset($condition['price'])) {
// $condition['price'] = rawurldecode($condition['price']);
// }
// // 转换折扣
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// // 性别参数,不传则从COOKIE获取
// if (!isset($condition['gender'])) {
// $condition['gender'] = Helpers::getGenderByCookie();
// } else {
// $condition['gender'] = rawurldecode($condition['gender']);
// }
// 过滤请求参数
$condition = filter_input_array(INPUT_GET, array(
'brand' => FILTER_DEFAULT,
'sort' => FILTER_DEFAULT,
'msort' => FILTER_DEFAULT,
'misort' => FILTER_DEFAULT,
'color' => FILTER_DEFAULT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
// 转义品牌
if (isset($condition['brand'])) {
$condition['brand'] = rawurldecode($condition['brand']);
}
// 转义分类
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
}
// 转义一级分类
if (isset($condition['msort'])) {
$condition['msort'] = rawurldecode($condition['msort']);
}
// 转义二级分类
if (isset($condition['misort'])) {
$condition['misort'] = rawurldecode($condition['misort']);
}
// 转义颜色
if (isset($condition['color'])) {
$condition['color'] = rawurldecode($condition['color']);
}
// 转义尺码
if (isset($condition['size'])) {
$condition['size'] = rawurldecode($condition['size']);
}
// 转义风格
if (isset($condition['style'])) {
$condition['style'] = rawurldecode($condition['style']);
}
// 转义价格
if (isset($condition['price'])) {
$condition['price'] = rawurldecode($condition['price']);
}
// 转换折扣
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['discount'] = rawurldecode($condition['p_d']);
}
// 性别参数,不传则从COOKIE获取
if (!isset($condition['gender'])) {
$condition['gender'] = Helpers::getGenderByCookie();
} else {
$condition['gender'] = rawurldecode($condition['gender']);
}
// 品类名称参数, 不传则默认为全部
$name = $this->get('sort_name');
... ... @@ -92,11 +92,10 @@ class IndexController extends AbstractAction
$this->setTitle($name);
$this->setNavHeader($name, true, SITE_MAIN);
// if (!$condition) {
// $condition = array();
// }
// $goodList = $condition;
$goodList = array();
if (!$condition) {
$condition = array();
}
$goodList = $condition;
$goodList['cartUrl'] = Helpers::url('/cart/index/index', null);
$this->_view->display('index', array(
... ... @@ -133,13 +132,6 @@ class IndexController extends AbstractAction
$brandId = $brandLogo['id'];
}
/* 通过品牌域名找到对应的品牌ID */
// $domainList = Product\ListModel::getAllBrandDomains();
// $brandIds = array_keys($domainList, $domain);
// $brandId = 0;
// if (isset($brandIds[0])) {
// $brandId = $brandIds[0];
// }
// 当前的登录用户UID
$uid = $this->getUid();
... ... @@ -147,64 +139,64 @@ class IndexController extends AbstractAction
$from = $this->get('from');
$query = $this->get('query');
// /* 过滤请求参数 */
// $condition = filter_input_array(INPUT_GET, array(
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
// $condition['brand'] = $brandId;
// // 转义分类
// if (isset($condition['sort'])) {
// $condition['sort'] = rawurldecode($condition['sort']);
// }
// // 转义一级分类
// if (isset($condition['msort'])) {
// $condition['msort'] = rawurldecode($condition['msort']);
// }
// // 转义二级分类
// if (isset($condition['misort'])) {
// $condition['misort'] = rawurldecode($condition['misort']);
// }
// // 转义颜色
// if (isset($condition['color'])) {
// $condition['color'] = rawurldecode($condition['color']);
// }
// // 转义尺码
// if (isset($condition['size'])) {
// $condition['size'] = rawurldecode($condition['size']);
// }
// // 转义风格
// if (isset($condition['style'])) {
// $condition['style'] = rawurldecode($condition['style']);
// }
// // 转义价格
// if (isset($condition['price'])) {
// $condition['price'] = rawurldecode($condition['price']);
// }
// // 转换折扣
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// if ($brandId === 0) {
// $condition['query'] = $domain;
// }
//
// if (isset($condition['gender'])) {
// $condition['gender'] = rawurldecode($condition['gender']);
// } else {
// $condition['gender'] = Helpers::getGenderByCookie();
// }
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
'sort' => FILTER_DEFAULT,
'msort' => FILTER_DEFAULT,
'misort' => FILTER_DEFAULT,
'color' => FILTER_DEFAULT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$condition['brand'] = $brandId;
// 转义分类
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
}
// 转义一级分类
if (isset($condition['msort'])) {
$condition['msort'] = rawurldecode($condition['msort']);
}
// 转义二级分类
if (isset($condition['misort'])) {
$condition['misort'] = rawurldecode($condition['misort']);
}
// 转义颜色
if (isset($condition['color'])) {
$condition['color'] = rawurldecode($condition['color']);
}
// 转义尺码
if (isset($condition['size'])) {
$condition['size'] = rawurldecode($condition['size']);
}
// 转义风格
if (isset($condition['style'])) {
$condition['style'] = rawurldecode($condition['style']);
}
// 转义价格
if (isset($condition['price'])) {
$condition['price'] = rawurldecode($condition['price']);
}
// 转换折扣
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['discount'] = rawurldecode($condition['p_d']);
}
if ($brandId === 0) {
$condition['query'] = $domain;
}
if (isset($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
} else {
$condition['gender'] = Helpers::getGenderByCookie();
}
$data = array();
$data['goodListPage'] = true;
... ...