Authored by whb

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

... ... @@ -1157,7 +1157,6 @@ class HelperSearch
'activities_id_desc' => 'activities.activity_id:desc',
'activities_id_asc' => 'activities.activity_id:asc',
);
$param = array();
$param['status'] = 1; // 是否上架,1表示在架,2表示不在
$param['sales'] = 'Y'; // 只搜索销售的产品
... ... @@ -1182,7 +1181,6 @@ class HelperSearch
if (!empty($condition)) {
$param += $condition;
}
return Yohobuy::httpBuildQuery(self::getUrl(), $param);
}
... ... @@ -1218,8 +1216,8 @@ class HelperSearch
}
/**
* 并行调接口url获取(获取品牌数据)
*/
* 并行调接口url获取(获取品牌数据)
*/
public static function getBrandUrl($customOptions = array())
{
// 构建必传参数
... ... @@ -1312,8 +1310,8 @@ class HelperSearch
elseif ($type == 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
}
return 'http://101.200.31.165/yohosearch/search.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';
}
}
... ...
... ... @@ -28,9 +28,6 @@ var $chosePanel = $('#chose-panel'),
$sizeRowList,
$curColorBlock,
$colorRowList,
$curSizeRow,
$curColorRow,
rowIndex,
cbFn,
$allChoseItems,
queryString,
... ... @@ -48,9 +45,6 @@ function init() {
$sizeRowList = $('.size-list ul');
$colorRowList = $('.color-list ul');
$leftNum = $('#left-num');
$curSizeRow = $sizeRowList.eq(0);
$curColorRow = $colorRowList.eq(0);
rowIndex = 0;
curColorIndex = 0;
curSizeIndex = 0;
}
... ... @@ -138,6 +132,28 @@ function displayGoodNum(curGoodNum) {
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
function changeSizeChosed(oldSizeIndex) {
if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
$curSizeBlock = $($sizeRowList.eq(oldSizeIndex).children().get(curColorIndex - 1));
$curSizeBlock.addClass('chosed');
return $curSizeBlock.data('num');
}
return 0;
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
function changeColorChosed(oldColorIndex) {
if (curSizeIndex && $curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
$curColorBlock = $($colorRowList.eq(oldColorIndex).children().get(curSizeIndex - 1));
$curColorBlock.addClass('chosed');
return $curColorBlock.data('num');
}
return 0;
}
init();
$yohoPage.on('touchstart', '.chose-panel', function(e) {
... ... @@ -153,13 +169,9 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
$yohoPage.on('touchstart', '.color-list .block', function() {
var $this = $(this),
index,
curSizeBlock,
index = $this.index(),
curGoodNum;
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
// 当前颜色已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
... ... @@ -176,38 +188,15 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
curSizeIndex = 0;
//如果尺码已经是选择状态
if (curColorIndex) {
// 之前选中的尺码去掉勾选样式,新尺码块勾选
if ($curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
curSizeBlock = $sizeRowList.eq(0).children().get(curColorIndex - 1);
$curSizeBlock = $(curSizeBlock);
curGoodNum = $curSizeBlock.data('num');
$curSizeBlock.addClass('chosed');
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
changeSizeChosed(0);
// 当前颜色不是选中状态,选中时
} else {
hasChooseColor = true;
//如果尺码已经是选择状态
if (curColorIndex) {
// 之前选中的尺码去掉勾选样式,新尺码块勾选
if ($curSizeBlock && $curSizeBlock.length > 0) {
$curSizeBlock.removeClass('chosed');
//curSizeBlock = $sizeRowList.eq(curSizeIndex + 1).children().get(curColorIndex - 1);
curSizeBlock = $sizeRowList.eq(index + 1).children().get(curColorIndex - 1);
$curSizeBlock = $(curSizeBlock);
curGoodNum = $curSizeBlock.data('num');
$curSizeBlock.addClass('chosed');
}
}
//老的选中尺码去掉勾选,新的选中尺码加上勾选
curGoodNum = changeSizeChosed(index + 1);
// 显示剩余数量
displayGoodNum(curGoodNum);
... ... @@ -225,7 +214,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
}
// 当前颜色块 切换勾选样式
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
$('#good-num').val(1);
... ... @@ -233,13 +223,9 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
updateConformButtonClassAndText();
}).on('touchstart', '.size-list .block', function() {
var $this = $(this),
index,
curColorBlock,
index = $this.index(),
curGoodNum;
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
// 当前尺码已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
... ... @@ -256,35 +242,15 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
curColorIndex = 0;
//如果颜色已经是选择状态
if (curSizeIndex) {
// 之前选中的颜色去掉勾选样式,新颜色块勾选
if ($curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
curColorBlock = $colorRowList.eq(0).children().get(curSizeIndex - 1);
$curColorBlock = $(curColorBlock);
curGoodNum = $curColorBlock.data('num');
$curColorBlock.addClass('chosed');
}
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
changeColorChosed(0);
// 当前尺码不是选中状态,选中时
} else {
hasChooseSize = true;
//如果颜色已经是选择状态
if (curSizeIndex) {
// 之前选中的颜色去掉勾选样式,新颜色块勾选
if ($curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1);
$curColorBlock = $(curColorBlock);
curGoodNum = $curColorBlock.data('num');
$curColorBlock.addClass('chosed');
}
}
//老的选中颜色去掉勾选,新的选中颜色加上勾选
curGoodNum = changeColorChosed(index + 1);
// 显示剩余数量
displayGoodNum(curGoodNum);
... ... @@ -299,6 +265,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
$curSizeBlock = $this;
}
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
$this.toggleClass('chosed');
$('#good-num').val(1);
... ...
... ... @@ -110,7 +110,7 @@ class SearchModel
);
//接收高级选项
foreach ($_GET as $key =>$val) {
if (strpos('parameter_',$key) !== false) {
if (strpos($key, 'parameter_') !== false) {
$condition[$key] = (int) $val;
}
}
... ... @@ -129,7 +129,6 @@ class SearchModel
$data['condition'] = $condition;
$data['sortCondition'] = $sortCondition;
$data['options'] = $options;
return $data;
}
... ... @@ -221,7 +220,7 @@ class SearchModel
$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;
return $data;
}
/**
... ...
... ... @@ -49,10 +49,7 @@ class ListController extends WebAction
*/
public function saleAction()
{
//排序
$condition['order'] = 's_n_desc';
//打折
$condition['p_d'] = '0,0.9';
$condition = array();
$list = SearchModel::getListData($condition);
$data = array(
//初始化js
... ...
... ... @@ -21,11 +21,13 @@ class SearchController extends WebAction
*/
public function suggestAction()
{
$suggest = '';
$query = rawurldecode($this->get('query'));
if ($query) {
$param['query'] = $query;
SearchModel::getSuggest($param);
$suggest = SearchModel::getSuggest($param);
}
echo $suggest;
}
/**
... ... @@ -35,7 +37,6 @@ class SearchController extends WebAction
{
$condition['msort'] = $this->get('msort');
$size = SearchModel::getSortSize($condition);
print_r($size); exit;
$this->echoJson($size);
}
}
\ No newline at end of file
... ...