Authored by Lynnic

购物车面板代码修改 --code reviewed by LZF

... ... @@ -1245,10 +1245,9 @@
'notForSale':'非卖品',
thumb: [
thumbs: [
{
id:1,
url : ''
img : ''
},
...
],
... ... @@ -1256,28 +1255,29 @@
price: '',
salePrice: '',
colors: [
{
id: 1,
chosed: true,
name: '黄色',
colorNum:10,
sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割
},
...
],
{
id: 1,
skcId:,
chosed: true,
name: '黄色',
colorNum:10,
sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割
},
...
],
sizes: [
{
id: 2,
skuId:,
goodId:,
chosed: true,
name: 'X',
sizeNum: 2,
colorNumStr:'10/20/30' //对应的商品颜色数目用斜杠分割
},
...
],
totalNum: 20
]
},
'introUrl' : '',
'id' : '',
... ...
... ... @@ -78,7 +78,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
//根据颜色切换图片
if ($this.closest('.block-list').hasClass('color-list')) {
$('.chose-panel .basic-info').find('.thumb').addClass('hide').eq(index).removeClass('hide');
$('.chose-panel').find('.thumb').addClass('hide').eq(index).removeClass('hide');
}
if ($chosed.length === 0) {
... ... @@ -120,6 +120,10 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
}
numArray = $siblingBlock.find('.chosed').data('numstr').split('/');
$that.find('.num .left-num').html('剩余' + numArray[index] + '件');
if (2 === $chosed.closest('.zero-stock').length) {
$('#chose-btn-sure').css('background-color', '#c0c0c0');
$('#chose-btn-sure').html('已售罄');
}
}
}).on('touchstart', '.btn-minus', function() {
... ...
... ... @@ -113,7 +113,7 @@
border-color: #e0e0e0;
background: none;
color: #e0e0e0;
background-color: #f0f0f0;
background-color: #c0c0c0;
}
}
... ...
... ... @@ -25,7 +25,7 @@
<span>颜色</span>
<ul class="clearfix" data-type="color">
{{# colors}}
<li class="block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}" data-num="{{colorNum}}" data-numstr="{{sizeNumStr}}">
<li class="block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}zero-stock{{/unless}}" data-num="{{colorNum}}" data-numstr="{{sizeNumStr}}" data-skcid="{{skcId}}">
{{name}}
</li>
{{/ colors}}
... ... @@ -35,7 +35,7 @@
<span>尺码</span>
<ul class="clearfix" data-type="size" >
{{# sizes}}
<li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id={{id}} data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}">
<li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id={{id}} data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodId}}">
{{name}}
</li>
{{/ sizes}}
... ...