Authored by 毕凯

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

... ... @@ -941,6 +941,7 @@ class HelperSearch
if ($data) {
$result['conditions'] = $data;
}
$result['clearUrl'] = self::current();
return $result;
}
... ... @@ -1369,8 +1370,6 @@ class HelperSearch
public static function filter()
{
$result = array();
//清除选中
$result['checkedConditions']['clearUrl'] = self::current();
//频道
$result['channel'] = array();
//性别
... ...
... ... @@ -242,10 +242,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
// 颜色块切换勾选样式
$this.siblings('.chosed').removeClass('chosed');
// 特殊处理
// 特殊处理: 老的选中尺码在新选中的颜色对应尺码中不存在, 需要将颜色的第一行对应的颜色块加上勾选样式.
if (-1 === curGoodNum) {
$curColorBlock = $($colorRowList.eq(0).children().get(index));
$curColorBlock.addClass('chosed');
// 当前选择的颜色块,加上勾选样式
} else {
$this.toggleClass('chosed');
}
... ...
... ... @@ -40,13 +40,16 @@ $('.employ span').each(function(index) {
});
});
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
function scrollHandler() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) {
page++;
couponAJAX(statu, page);
return;
}
}
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
couponAJAX(statu, page);
\ No newline at end of file
... ...
... ... @@ -16,12 +16,16 @@ function ajaxCurrencyDetail(page) {
});
}
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
function scrollHandler() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) {
page++;
ajaxCurrencyDetail(page);
return;
}
}
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
ajaxCurrencyDetail(page);
... ...
... ... @@ -51,7 +51,7 @@ var $listNav = $('#list-nav'),
end: false
},
discount: {
order: 0,
order: 1,
reload: true,
page: 0,
end: false
... ...
... ... @@ -70,8 +70,8 @@
<a href="javascript:void(0);">
<span class="nav-txt">折扣</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
... ...
... ... @@ -98,7 +98,7 @@
<li class="hide" key="2">
<form class="feed-back-form" action="#">
<div>您对新版还有哪些意见或建议?</div>
<textarea name="answer" id="feedback-answer"></textarea>
<textarea name="answer" id="feedback-answer" class="feedback-answer"></textarea>
<div>
<span class="feed-back-btn button">提交</span>
</div>
... ...
... ... @@ -208,6 +208,7 @@
<div class="senior-sub-wrap">
{{#each seniorChose}}
<div class="senior-sub hide" data-attr="{{attr}}">
<div class="senior-content">
{{#if showMulti}}
<span class="multi-select">多选 +</span>
{{/if}}
... ... @@ -226,6 +227,7 @@
<button class="multi-select-cancel">取消</button>
</div>
</div>
</div>
{{/each}}
</div>
</div>
... ...
... ... @@ -8,8 +8,6 @@ var $ = require('yoho.jquery');
var $returnTop = $('.return-top');
var apiDomain;
/**
* 订阅
* @return {[type]} [description]
... ... @@ -19,42 +17,37 @@ function actionSubscription() {
$subscriberBtn = $('#subscriber-btn'),
emailReg = /^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/;
var subscribeParam = {
method: 'open.subscriber.subscriber',
v: 1,
return_type: 'jsonp',
open_key: '12345'
};
var iconCode = {
mail: '&#xe61b;',
tick: '&#xe61a'
};
var email = $.trim($subscriberBox.val());
var params = {};
$subscriberBox.focus(function() {
$(this).val('').css('color', '');
$subscriberBtn.removeClass('done').html(iconCode.mail);
});
$subscriberBtn.click(function() {
var email = $.trim($subscriberBox.val());
if (email !== '' && emailReg.test(email)) {
$.extend(params, subscribeParam, {
try {
$.ajax({
url: 'http://www.yohobuy.com/common/emailsubscriber',
dataType: 'jsonp',
data: {
email: email,
tmp: Math.random(),
uid: $.uid('_UID')
});
try {
$.getJSON('http://test.open.yohobuy.com' + '/?callback=?', params, function(data) {
uid: window.getUid()
},
success: function(data) {
if (data.data.result === 1) {
$subscriberBox.val('已订阅到:' + email);
$subscriberBtn.addClass('done').html(iconCode.tick);
} else {
$subscriberBox.css('color', 'red');
}
}
});
} catch (e) {
console.log(e.message);
... ... @@ -90,7 +83,6 @@ function actionhomeFootChange() {
var $this = $(this),
$li = $this.closest('li'),
index = $li.index(),
params = {},
_solution = [];
var _answer = $li.find('.feedback-answer').val(),
... ... @@ -101,18 +93,19 @@ function actionhomeFootChange() {
_solution.push($(this).val());
});
params = {
method: 'open.feedback.submit',
feedback: _feedback || 0,
question: _question || 0,
$.ajax({
url: 'http://www.yohobuy.com/common/suggestfeedback',
dataType: 'jsonp',
data: {
feedback_id: _feedback || 0,
question_id: _question || 0,
answer: _answer || '',
solution: _solution.join(',')
};
$.getData(apiDomain, params, function(data) {
},
success: function(data) {
var next = index + 1;
if (data.result === 1) {
if (~~data.data.result === 1) {
if (index === count - 1) {
alert('感谢您的参与!');
return;
... ... @@ -120,9 +113,10 @@ function actionhomeFootChange() {
$li.addClass('hide');
$vote.eq(index + 1).removeClass('hide');
$vote.children(':eq(' + (index + 1) + ')').removeClass('hide');
$feedBackPage.children('.cur').removeClass('cur');
$feedBackPage.eq(next).addClass('cur');
$feedBackPage.children(':eq(' + next + ')').addClass('cur');
}
}
});
});
... ...
... ... @@ -293,7 +293,6 @@
.senior {
padding-bottom: 6px;
padding-right: 0;
.attr-content {
position: relative;
... ... @@ -306,6 +305,8 @@
.senior-attr-wrap > .attr:hover,
.senior-attr-wrap > .attr.hover {
font-weight: bold;
> .iconfont {
visibility: hidden;
}
... ... @@ -318,13 +319,13 @@
.senior-sub {
box-sizing: border-box;
position: absolute;
padding: 15px 0 15px 91px;
padding: 0 15px 15px 91px;
left: -91px;
right: -1px;
right: -16px;
top: 39px;
background: #fff;
border: 1px solid #dfdfdf;
border-top-color: #eaeceb;
border-top: 0;
z-index: 2;
ul {
... ... @@ -342,6 +343,11 @@
}
}
.senior-content {
padding-top: 15px;
border-top: 1px solid #eaeceb;
}
.senior-up-icon {
position: relative;
width: 100%;
... ...
... ... @@ -217,7 +217,7 @@ class SearchModel
$result = SearchData::getSuggest($query);
if (isset($result['code']) && $result['code'] == 200 && isset($result['suggest']['items']) && !empty($result['suggest']['items'])) {
foreach ($result['suggest']['items'] as $v) {
$data .= '<li><a style="display: block;" href="http://search.yohobuy.com/?query='.$v['item'].'" class="clearfix clear search-item" title="'.$v['item'].'" act="http://search.yohobuy.com/?query='.$v['item'].'"><span class="searchvalue" >'.$v['item'].'</span><span class="valuenum">约'.$v['frequency'].'个商品</span></a></li>';
$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>';
}
}
return $data;
... ...
... ... @@ -21,13 +21,21 @@ class SearchController extends WebAction
*/
public function suggestAction()
{
$suggest = '';
$callback = $this->get('callback');
$query = rawurldecode($this->get('query'));
$size = rawurldecode($this->get('size',10));
if (empty($query)) {
$this->helpJsonCallbackResult($callback, 412, '搜索词为空');
}
if ($size > 50) {
$size = 10;
}
if ($query) {
$param['query'] = $query;
$param['size'] = $size;
$suggest = SearchModel::getSuggest($param);
}
echo $suggest;
$this->helpJsonCallbackResult($callback, 200, 'suggest', $suggest);
}
/**
... ...