...
|
...
|
@@ -1947,19 +1947,13 @@ $(document).on('change', '.model-default-hotproduct', function() { |
|
|
let _this = $(this);
|
|
|
let sknList = $(this).val().trim();
|
|
|
|
|
|
if(sknList.length === 0) {
|
|
|
if(jsonMain.resources.defaultHotProducts) {
|
|
|
jsonMain.resources.defaultHotProducts.data = ''; // 默认值,在发布的时候,如果是默认值,移除该模块
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 去重
|
|
|
let sknArray = sknList.split(',');
|
|
|
let skns = [];
|
|
|
$.each(sknArray, function(index, item) {
|
|
|
item = item.trim();
|
|
|
// 排除形如 ‘111,222,’ 最后一个逗号
|
|
|
if(item.trim().length === 0) {
|
|
|
if(item.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1977,6 +1971,14 @@ $(document).on('change', '.model-default-hotproduct', function() { |
|
|
});
|
|
|
|
|
|
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',
|
...
|
...
|
@@ -1990,7 +1992,6 @@ $(document).on('change', '.model-default-hotproduct', function() { |
|
|
if(data.length > 0) {
|
|
|
common.util.__tip('该店铺不包含以下SKN: ' + data, 'warning');
|
|
|
} else {
|
|
|
$(_this).val(sknList);
|
|
|
let hotProductResource = jsonMain.resources.defaultHotProducts;
|
|
|
if(hotProductResource === undefined) {
|
|
|
hotProductResource = {};
|
...
|
...
|
|