...
|
...
|
@@ -1947,5 +1947,65 @@ webpackJsonp([152],[ |
|
|
});
|
|
|
}
|
|
|
|
|
|
$(document).on('change', '.model-default-hotproduct', function() {
|
|
|
let _this = $(this);
|
|
|
let sknList = $(this).val().trim();
|
|
|
|
|
|
// 去重
|
|
|
let sknArray = sknList.split(',');
|
|
|
let skns = [];
|
|
|
$.each(sknArray, function(index, item) {
|
|
|
item = item.trim();
|
|
|
// 排除形如 ‘111,222,’ 最后一个逗号
|
|
|
if(item.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 最多只能8个SKN
|
|
|
if(skns.length >= 8) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 不能重复
|
|
|
if($.inArray(item, skns) > -1) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
skns.push(item);
|
|
|
});
|
|
|
|
|
|
sknList = skns.toString();
|
|
|
$(_this).val(sknList);
|
|
|
|
|
|
if(sknList.length === 0) {
|
|
|
if(jsonMain.resources.defaultHotProducts) {
|
|
|
jsonMain.resources.defaultHotProducts.data = '';
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
common.util.__ajax({
|
|
|
url: '/shop/decoration/findProductNotInShop',
|
|
|
data: {
|
|
|
shopId: shopsId,
|
|
|
productSkns: sknList
|
|
|
}
|
|
|
}, function(resp) {
|
|
|
if(resp.code === 200) {
|
|
|
let data = resp.data;
|
|
|
if(data.length > 0) {
|
|
|
common.util.__tip('该店铺不包含以下SKN: ' + data, 'warning');
|
|
|
} else {
|
|
|
let hotProductResource = jsonMain.resources.defaultHotProducts;
|
|
|
if(hotProductResource === undefined) {
|
|
|
hotProductResource = {};
|
|
|
}
|
|
|
hotProductResource.data = sknList;
|
|
|
jsonMain.resources.defaultHotProducts = hotProductResource;
|
|
|
}
|
|
|
}
|
|
|
}, true);
|
|
|
})
|
|
|
|
|
|
/***/ }
|
|
|
]); |
|
|
\ No newline at end of file |
...
|
...
|
|