|
|
var $ = require('jquery'),
|
|
|
common = require('../../../common/common');
|
|
|
var $ = require('jquery');
|
|
|
var common = require('../../../common/common');
|
|
|
var edit = require('../../../common/edit');
|
|
|
|
|
|
|
|
|
var ZeroClipboard = require("../../../common/util/ZeroClipboard.min");
|
|
|
ZeroClipboard.config({swfPath: "http://cdn.yoho.cn/yohobuy-portal/assets/images/ZeroClipboard.swf"});
|
...
|
...
|
@@ -16,12 +18,22 @@ var g = new common.grid({ |
|
|
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>';
|
|
|
}}
|
...
|
...
|
@@ -91,14 +103,16 @@ var Bll = { |
|
|
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{
|
...
|
...
|
@@ -108,6 +122,10 @@ var Bll = { |
|
|
);
|
|
|
if(type != 0) $("#producttype").val(obj.producttype);
|
|
|
|
|
|
var e = new edit('#productEdit',{
|
|
|
"bucket" : "brandBanner"
|
|
|
});
|
|
|
e.init();
|
|
|
//上传文件
|
|
|
common.edit.ajaxfileupload("#productSkn", {
|
|
|
params: {
|
...
|
...
|
@@ -176,7 +194,17 @@ var Bll = { |
|
|
});
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//清空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 () {
|
...
|
...
|
@@ -244,6 +272,12 @@ $(document).on("click", "#emptyPool", function () { |
|
|
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 () {
|
...
|
...
|
|