Authored by ccbikai

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

... ... @@ -85,7 +85,9 @@ likeHammer.on('tap', function(e) {
success: function(data) {
if (data.code === 200) {
$this.toggleClass('like');
} else if (data.code === 400) {
} else if (data.code === 400 || data.code === 412) {
//code:412 用户ID不正确,即未登录
tip.show('未登录');
} else {
tip.show(data.message);
... ...
... ... @@ -17,13 +17,6 @@ var missStatus; //是否忽略选中状态
//隐藏筛选界面
function hideFilter() {
$filter.addClass('hide');
if (missStatus) {
//重置一级筛选项选中状态
$filter.find('.classify-item.active').removeClass('active');
$filter.find('.classify-item:first-child').addClass('active');
}
}
//显示筛选界面
... ... @@ -31,6 +24,7 @@ function showFilter() {
$filter.removeClass('hide');
}
//主筛选项Tap事件句柄
function classifyTapEvt($this) {
if ($this.hasClass('active')) {
return;
... ... @@ -41,9 +35,8 @@ function classifyTapEvt($this) {
$this.addClass('active');
}
function subClassifyTapEvt($this) {
var id = $this.data('id');
//子筛选项选中处理
function setSubClassify($this) {
var $sub = $this.closest('.sub-classify');
var $shower = $sub.siblings('.shower');
... ... @@ -72,6 +65,17 @@ function subClassifyTapEvt($this) {
$shower.removeClass('default');
}
return $sub;
}
//子筛选项Tap句柄
function subClassifyTapEvt($this) {
var id = $this.data('id');
var $sub;
$sub = setSubClassify($this);
if (fCbFn) {
fCbFn({
type: $sub.data('type'),
... ... @@ -80,12 +84,6 @@ function subClassifyTapEvt($this) {
}
hideFilter();
//重置选中状态
if (missStatus) {
$this.removeClass('chosed');
$sub.children(':first-child').addClass('chosed');
}
}
//初始化筛选
... ... @@ -133,8 +131,25 @@ function initFilter(opt) {
});
}
//重置筛选面板
function resetFilter() {
if (typeof $filter === 'undefined') {
return;
}
//重置子筛选项
$('.sub-classify').each(function() {
setSubClassify($(this).children(':first-child'));
});
//重置主筛选项
classifyTapEvt($('.classify > :first-child'));
}
exports.initFilter = initFilter;
exports.showFilter = showFilter;
exports.hideFilter = hideFilter;
\ No newline at end of file
exports.hideFilter = hideFilter;
exports.resetFilter = resetFilter;
\ No newline at end of file
... ...
... ... @@ -41,6 +41,8 @@ var defaultOpt = {
dayLimit: 1
};
var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置
var now = new Date(),
month = now.getMonth() + 1,
date = now.getDate();
... ... @@ -267,8 +269,7 @@ $.ajax({
//切换active状态到$pre上
$pre.addClass('active');
$pre.siblings('.filter').removeClass('active');
},
missStatus: true
}
});
}
});
... ... @@ -343,6 +344,10 @@ navHammer.on('tap', function(e) {
$dgc.removeClass('hide');
break;
}
//重置筛选项
filter.resetFilter();
defaultOpt = $.extend({}, storeOpt);
}
$active.removeClass('active');
... ...
.good-info {
float: left;
width: 46.4%;
width: 276rem / $pxConvertRem;
height: 486rem / $pxConvertRem;
margin: 28rem / $pxConvertRem 0 0 2.4%;
margin: 0 (15rem / $pxConvertRem) (28rem / $pxConvertRem);
.tag-container {
height: 28rem / $pxConvertRem;
width: 100%;
overflow: hidden;
.good-tag {
display: block;
... ... @@ -15,23 +15,27 @@
height: 28rem / $pxConvertRem;
font-size: 18rem / $pxConvertRem;
text-align: center;
line-height: 32rem / $pxConvertRem;
line-height: 28rem / $pxConvertRem;
box-sizing: border-box;
margin-right: 4rem / $pxConvertRem;
&:last-child {
margin-right: 0;
}
}
.new-tag {
width: 60rem / $pxConvertRem;
background-color: #78dc7e;
color: #fff;
}
.renew-tag {
width: 90rem / $pxConvertRem;
background-color: #78dc7e;
color: #fff;
}
.sale-tag {
width: 60rem / $pxConvertRem;
background-color: #ff575c;
... ... @@ -43,21 +47,35 @@
color: #fff;
}
.limit-tag {
box-sizing: border-box;
width: 90rem / $pxConvertRem;
border: 1px solid #000;
color: #000;
line-height: 24rem / $pxConvertRem;
}
}
}
.good-detail-img {
position: relative;
.good-islike {
position: absolute;
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
top: 0rem / $pxConvertRem;
right: 0rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
font-size: 30rem / $pxConvertRem;
text-align: center;
color: #b0b0b0;
text-decoration: none;
}
.good-like {
color: #d72928;
}
img {
display: block;
width: 100%;
// height: 366rem / $pxConvertRem;
height: 366rem / $pxConvertRem;
}
.few-tag {
... ...
... ... @@ -17,7 +17,6 @@
height: 192rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
border-right: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
&:nth-child(-n+3) {
border-bottom: none;
}
... ...