...
|
...
|
@@ -116,8 +116,11 @@ function setBackInput(type) { |
|
|
}
|
|
|
|
|
|
function formatExchangeOption($dom, type) {
|
|
|
var sku = $dom.data('sku');
|
|
|
var $optItem;
|
|
|
var sku = $dom.data('sku'),
|
|
|
skc = $dom.data('skc');
|
|
|
var $optItem,
|
|
|
$colorDom,
|
|
|
$colorItem;
|
|
|
var cd;
|
|
|
|
|
|
if (!$dom || !sku) {
|
...
|
...
|
@@ -130,13 +133,18 @@ function formatExchangeOption($dom, type) { |
|
|
}
|
|
|
});
|
|
|
|
|
|
if (!$optItem) {
|
|
|
return;
|
|
|
$colorDom = $dom.closest('.exchange-choose-wrap').find('.exchange-color');
|
|
|
|
|
|
$colorDom.children().each(function() {
|
|
|
if (+skc === +$(this).attr('value')) {
|
|
|
$colorItem = $(this);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
type = type * 1;
|
|
|
if (!type || type === 4 || type === 6 || type === 8) {
|
|
|
$optItem.removeAttr('disabled');
|
|
|
$optItem && $optItem.removeAttr('disabled');
|
|
|
$colorItem && $colorItem.removeAttr('disabled');
|
|
|
} else {
|
|
|
if (+$dom.val() === +sku) {
|
|
|
$dom.val(0);
|
...
|
...
|
@@ -147,7 +155,16 @@ function formatExchangeOption($dom, type) { |
|
|
}
|
|
|
}).show();
|
|
|
}
|
|
|
$optItem.attr('disabled', 'disabled');
|
|
|
$optItem && $optItem.attr('disabled', 'disabled');
|
|
|
|
|
|
if (colorSize[skc].length === 1 && +colorSize[skc][0].id === +sku) {
|
|
|
if (+$colorDom.val() === +skc) {
|
|
|
$colorDom.val(0).change();
|
|
|
}
|
|
|
$colorItem && $colorItem.attr('disabled', 'disabled');
|
|
|
} else {
|
|
|
$colorItem && $colorItem.removeAttr('disabled');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|