Authored by xuhongyun

build

This diff could not be displayed because it is too large.
... ... @@ -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
... ...
... ... @@ -70,4 +70,5 @@ module.exports = function (app) {
//获取店铺下的BLK商品
app.post("/shop/decoration/findBlkProductByShopsId","shopDecoration_findBlkProductByShopsId");
app.post("/shop/decoration/findProductNotInShop", "shopDecoration_findProductNotInShop");
}
... ...
... ... @@ -132,6 +132,15 @@
{name: 'productSkn', type: 'Number'},
{name: 'size', type: 'number'}
]
},
findProductNotInShop: {
title: "检查商品是否属于店铺",
url: "/ShopsDecoratorRest/findProductNotInShop",
params: [
{name: 'shopId', type: 'Number'},
{name: 'productSkns', type: 'String'}
]
}
}
}
... ...
... ... @@ -80,7 +80,16 @@
</div>
</div>
<!--右侧main-->
<div class="model-main-right model-main-right-default"></div>
<div class="model-main-right">
<div class="form-group">
<label class="col-sm-2">推荐商品(以英文逗号分隔,最多8): </label>
<div class="col-sm-10">
<input type="text" class="form-control model-default-hotproduct" placeholder="请输入推荐商品,以英文逗号分隔,最多8个SKN"
value="[[resources.defaultHotProducts ? resources.defaultHotProducts.data : '']]" maxlength="90">
</div>
</div>
<div class="model-main-right-default"></div>
</div>
<div class="clear"></div>
</div>
</div>
... ...