Authored by xuqi

edit color & size

... ... @@ -411,14 +411,14 @@ Cart = {
filterSet.push({
proId: res.id,
color: color.color,
active: color.cur,
active: color.color === defaultColor ? true : false ,
sizes: color.sizes,
pic: color.thumbs[0],
selectable: color.total > 0,
colorName: color.name,
rgb: color.rgb
});
if (color.color === defaultColor && color.cur) {
if (color.color === defaultColor) {
defaultImg = color.thumbs[0];
}
}
... ... @@ -496,18 +496,18 @@ Cart = {
editTarget.find('.size-item').click(function() {
var $this = $(this);
if ($this.hasClass('current')) {
if ($this.hasClass('active') || $this.hasClass('disabled')) {
return;
}
$(this).addClass('current').siblings('.current').removeClass('current');
$(this).addClass('active').siblings('.active').removeClass('active');
newProductSku = $(this).attr('data-sku');
});
// 初始化size list选中项(其他颜色中第一个尺码)
editTarget.find('.sizes-list.mb10').each(function() {
if ($(this).find('.current').length === 0) {
$(this).find('.size-item').first().addClass('current');
if ($(this).find('.active').length === 0) {
$(this).find('.size-item').first().addClass('active');
}
});
},
... ...
... ... @@ -189,6 +189,15 @@ $hoverColor: #379ed6;
text-align: center;
font-size: 12px;
padding: 4px;
&.disabled {
color: #f0f0f0;
border-color: #f0f0f0;
}
&.current.disabled {
background-color: #999;
}
}
.color-item {
... ...
... ... @@ -36,7 +36,7 @@
border-width: 10px;
}
.current {
.active {
background-color: #444;
color: #fff;
}
... ...
... ... @@ -26,7 +26,7 @@
<div class="sizes-list mb10">
{{#each sizes}}
<span class="size-item mr10 mb10{{#isEqual ../../defaultSize name}} current{{/isEqual}}{{#isEqual num 0}} disabled{{/isEqual}}"
<span class="size-item mr10 mb10{{#isEqual ../../defaultSize name}} current active{{/isEqual}}{{#isEqual num 0}} disabled{{/isEqual}}"
data-sku="{{sku}}">{{name}}</span>
{{/each}}
</div>
... ...