Authored by xuhongyun

build

... ... @@ -3,8 +3,10 @@ webpackJsonp([88],{
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
var $ = __webpack_require__(1),
common = __webpack_require__(2);
var $ = __webpack_require__(1);
var common = __webpack_require__(2);
var edit = __webpack_require__(6);
var ZeroClipboard = __webpack_require__(32);
ZeroClipboard.config({swfPath: "http://cdn.yoho.cn/yohobuy-portal/assets/images/ZeroClipboard.swf"});
... ... @@ -21,12 +23,22 @@ webpackJsonp([88],{
columns: [
{display: "商品池编号", name: "id"},
{display: "商品池名称", name: "poolName"},
{display: "头部banner", name: "bannerUrl",
render: function (item) {
if (item.bannerUrl) {
return '<a class="list-img" target="_blank" href="' + item.bannerUrl + '">' +
'<img src="' + item.bannerUrl + '"></a>';
} else {
return '';
}
}},
{display: "说明", name: "comment"},
{display: "SKN个数", name: "total"},
{display: "操作", name: "", render: function (item) {
return '<a id="detailPool" class="btn btn-xs btn-info" data-index="'+item.__index+'">详情</a>' +
'<a id="editPool" class="btn btn-xs btn-primary" data-index="'+item.__index+'">编辑</a>' +
'<a id="emptyPool" class="btn btn-xs btn-warning" data-index="'+item.__index+'">清空</a>' +
'<a id="emptyPoolImg" class="btn btn-xs btn-warning" data-index="'+item.__index+'">清空banner</a>' +
'<a id="deletePool" class="btn btn-xs btn-danger" data-index="'+item.__index+'">删除</a>'+
'<a id="viewUrl" class="btn btn-xs btn-danger" data-index="'+item.__index+'">查看链接</a>';
}}
... ... @@ -96,14 +108,16 @@ webpackJsonp([88],{
poolName: $("#poolName").val(),
comment: $("#comment").val(),
producttype: $("#producttype").val(),
productSkns: $("#sknVal").val().replace("[", "").replace("]", "")
productSkns: $("#sknVal").val().replace("[", "").replace("]", ""),
bannerUrl: document.getElementById("bannerUrl").defaultValue
}
}, function () {//局部刷新商品池名称,说明
if(type == 0){
g.reload(1);
}else{
$('#product-pool .grid tbody tr').eq(index).find('td').eq(1).text($("#poolName").val()); //商品池名称
$('#product-pool .grid tbody tr').eq(index).find('td').eq(2).text($("#comment").val()); //说明
//$('#product-pool .grid tbody tr').eq(index).find('td').eq(1).text($("#poolName").val()); //商品池名称
//$('#product-pool .grid tbody tr').eq(index).find('td').eq(2).text($("#comment").val()); //说明
g.reload(1);
}
});
}else{
... ... @@ -113,6 +127,10 @@ webpackJsonp([88],{
);
if(type != 0) $("#producttype").val(obj.producttype);
var e = new edit('#productEdit',{
"bucket" : "brandBanner"
});
e.init();
//上传文件
common.edit.ajaxfileupload("#productSkn", {
params: {
... ... @@ -181,7 +199,17 @@ webpackJsonp([88],{
});
});
},
//清空banner
emptyPoolImg: function (obj,index) {
common.dialog.confirm("清空商品池banner确认", "确认清空商品池banner:<font color='red'>【"+obj.poolName+"】</font>么?", function () {
common.util.__ajax({
url: '/market/productPool/clearProductPoolBanner',
data: {id: obj.id}
}, function () {
g.init('/market/productPool/queryProductPoolPage');
});
});
},
//删除商品池
deletePool: function (obj,index) {
common.dialog.confirm("删除商品池确认", "确认删除商品池:<font color='red'>【"+obj.poolName+"】</font>么?", function () {
... ... @@ -249,6 +277,12 @@ webpackJsonp([88],{
var item = g.rows[index];
Bll.emptyPool(item,index);
});
//清空banner
$(document).on("click", "#emptyPoolImg", function () {
var index = $(this).data("index");
var item = g.rows[index];
Bll.emptyPoolImg(item,index);
});
//删除商品池
$(document).on("click", "#deletePool", function () {
... ...
... ... @@ -30,6 +30,9 @@ module.exports = function (app) {
//清空
app.post("/market/productPool/clearProductPool", "ProductPool_clearProductPool");
//清空banner
app.post("/market/productPool/clearProductPoolBanner", "ProductPool_clearProductPoolBanner");
//删除
app.post("/market/productPool/deleteProductPool", "ProductPool_deleteProductPool");
... ...
... ... @@ -25,7 +25,8 @@ module.exports = {
comment: {type: String},
producttype: {type: String},
diffType: {type: Number},
productSkns: {type: String}
productSkns: {type: String},
bannerUrl: {type: String}
}
},
updateProductPool: {
... ... @@ -36,7 +37,8 @@ module.exports = {
poolName: {type: String},
comment: {type: String},
producttype: {type: String},
productSkns: {type: String}
productSkns: {type: String},
bannerUrl: {type: String}
}
},
clearProductPool: {
... ... @@ -46,6 +48,13 @@ module.exports = {
id: {type: Number}
}
},
clearProductPoolBanner: {
title: "清空商品池banner",
url: '/pool/clearProductPoolBanner',
params: {
id: {type: Number}
}
},
deleteProductPool: {
title: "删除商品池",
url: '/pool/deleteProductPool',
... ...
... ... @@ -83,6 +83,14 @@
</div>
</div>
</div>
<div class="form-group">
<label for="bannerUrl" class="col-sm-3 control-label">头部banner</label>
<div class="col-sm-9">
<input type="file" id="bannerUrl" name="bannerUrl" value="[[bannerUrl]]" required extend="gif,png,jpg,jpeg,pdf" placeholder="头部banner" bucket="brandBanner" />
</div>
</div>
</div>
</script>
... ...