Authored by xuhongyun

build

@@ -3,8 +3,10 @@ webpackJsonp([88],{ @@ -3,8 +3,10 @@ webpackJsonp([88],{
3 /***/ 0: 3 /***/ 0:
4 /***/ function(module, exports, __webpack_require__) { 4 /***/ function(module, exports, __webpack_require__) {
5 5
6 - var $ = __webpack_require__(1),  
7 - common = __webpack_require__(2); 6 + var $ = __webpack_require__(1);
  7 + var common = __webpack_require__(2);
  8 + var edit = __webpack_require__(6);
  9 +
8 10
9 var ZeroClipboard = __webpack_require__(32); 11 var ZeroClipboard = __webpack_require__(32);
10 ZeroClipboard.config({swfPath: "http://cdn.yoho.cn/yohobuy-portal/assets/images/ZeroClipboard.swf"}); 12 ZeroClipboard.config({swfPath: "http://cdn.yoho.cn/yohobuy-portal/assets/images/ZeroClipboard.swf"});
@@ -21,12 +23,22 @@ webpackJsonp([88],{ @@ -21,12 +23,22 @@ webpackJsonp([88],{
21 columns: [ 23 columns: [
22 {display: "商品池编号", name: "id"}, 24 {display: "商品池编号", name: "id"},
23 {display: "商品池名称", name: "poolName"}, 25 {display: "商品池名称", name: "poolName"},
  26 + {display: "头部banner", name: "bannerUrl",
  27 + render: function (item) {
  28 + if (item.bannerUrl) {
  29 + return '<a class="list-img" target="_blank" href="' + item.bannerUrl + '">' +
  30 + '<img src="' + item.bannerUrl + '"></a>';
  31 + } else {
  32 + return '';
  33 + }
  34 + }},
24 {display: "说明", name: "comment"}, 35 {display: "说明", name: "comment"},
25 {display: "SKN个数", name: "total"}, 36 {display: "SKN个数", name: "total"},
26 {display: "操作", name: "", render: function (item) { 37 {display: "操作", name: "", render: function (item) {
27 return '<a id="detailPool" class="btn btn-xs btn-info" data-index="'+item.__index+'">详情</a>' + 38 return '<a id="detailPool" class="btn btn-xs btn-info" data-index="'+item.__index+'">详情</a>' +
28 '<a id="editPool" class="btn btn-xs btn-primary" data-index="'+item.__index+'">编辑</a>' + 39 '<a id="editPool" class="btn btn-xs btn-primary" data-index="'+item.__index+'">编辑</a>' +
29 '<a id="emptyPool" class="btn btn-xs btn-warning" data-index="'+item.__index+'">清空</a>' + 40 '<a id="emptyPool" class="btn btn-xs btn-warning" data-index="'+item.__index+'">清空</a>' +
  41 + '<a id="emptyPoolImg" class="btn btn-xs btn-warning" data-index="'+item.__index+'">清空banner</a>' +
30 '<a id="deletePool" class="btn btn-xs btn-danger" data-index="'+item.__index+'">删除</a>'+ 42 '<a id="deletePool" class="btn btn-xs btn-danger" data-index="'+item.__index+'">删除</a>'+
31 '<a id="viewUrl" class="btn btn-xs btn-danger" data-index="'+item.__index+'">查看链接</a>'; 43 '<a id="viewUrl" class="btn btn-xs btn-danger" data-index="'+item.__index+'">查看链接</a>';
32 }} 44 }}
@@ -96,14 +108,16 @@ webpackJsonp([88],{ @@ -96,14 +108,16 @@ webpackJsonp([88],{
96 poolName: $("#poolName").val(), 108 poolName: $("#poolName").val(),
97 comment: $("#comment").val(), 109 comment: $("#comment").val(),
98 producttype: $("#producttype").val(), 110 producttype: $("#producttype").val(),
99 - productSkns: $("#sknVal").val().replace("[", "").replace("]", "") 111 + productSkns: $("#sknVal").val().replace("[", "").replace("]", ""),
  112 + bannerUrl: document.getElementById("bannerUrl").defaultValue
100 } 113 }
101 }, function () {//局部刷新商品池名称,说明 114 }, function () {//局部刷新商品池名称,说明
102 if(type == 0){ 115 if(type == 0){
103 g.reload(1); 116 g.reload(1);
104 }else{ 117 }else{
105 - $('#product-pool .grid tbody tr').eq(index).find('td').eq(1).text($("#poolName").val()); //商品池名称  
106 - $('#product-pool .grid tbody tr').eq(index).find('td').eq(2).text($("#comment").val()); //说明 118 + //$('#product-pool .grid tbody tr').eq(index).find('td').eq(1).text($("#poolName").val()); //商品池名称
  119 + //$('#product-pool .grid tbody tr').eq(index).find('td').eq(2).text($("#comment").val()); //说明
  120 + g.reload(1);
107 } 121 }
108 }); 122 });
109 }else{ 123 }else{
@@ -113,6 +127,10 @@ webpackJsonp([88],{ @@ -113,6 +127,10 @@ webpackJsonp([88],{
113 ); 127 );
114 if(type != 0) $("#producttype").val(obj.producttype); 128 if(type != 0) $("#producttype").val(obj.producttype);
115 129
  130 + var e = new edit('#productEdit',{
  131 + "bucket" : "brandBanner"
  132 + });
  133 + e.init();
116 //上传文件 134 //上传文件
117 common.edit.ajaxfileupload("#productSkn", { 135 common.edit.ajaxfileupload("#productSkn", {
118 params: { 136 params: {
@@ -181,7 +199,17 @@ webpackJsonp([88],{ @@ -181,7 +199,17 @@ webpackJsonp([88],{
181 }); 199 });
182 }); 200 });
183 }, 201 },
184 - 202 + //清空banner
  203 + emptyPoolImg: function (obj,index) {
  204 + common.dialog.confirm("清空商品池banner确认", "确认清空商品池banner:<font color='red'>【"+obj.poolName+"】</font>么?", function () {
  205 + common.util.__ajax({
  206 + url: '/market/productPool/clearProductPoolBanner',
  207 + data: {id: obj.id}
  208 + }, function () {
  209 + g.init('/market/productPool/queryProductPoolPage');
  210 + });
  211 + });
  212 + },
185 //删除商品池 213 //删除商品池
186 deletePool: function (obj,index) { 214 deletePool: function (obj,index) {
187 common.dialog.confirm("删除商品池确认", "确认删除商品池:<font color='red'>【"+obj.poolName+"】</font>么?", function () { 215 common.dialog.confirm("删除商品池确认", "确认删除商品池:<font color='red'>【"+obj.poolName+"】</font>么?", function () {
@@ -249,6 +277,12 @@ webpackJsonp([88],{ @@ -249,6 +277,12 @@ webpackJsonp([88],{
249 var item = g.rows[index]; 277 var item = g.rows[index];
250 Bll.emptyPool(item,index); 278 Bll.emptyPool(item,index);
251 }); 279 });
  280 + //清空banner
  281 + $(document).on("click", "#emptyPoolImg", function () {
  282 + var index = $(this).data("index");
  283 + var item = g.rows[index];
  284 + Bll.emptyPoolImg(item,index);
  285 + });
252 286
253 //删除商品池 287 //删除商品池
254 $(document).on("click", "#deletePool", function () { 288 $(document).on("click", "#deletePool", function () {
@@ -30,6 +30,9 @@ module.exports = function (app) { @@ -30,6 +30,9 @@ module.exports = function (app) {
30 30
31 //清空 31 //清空
32 app.post("/market/productPool/clearProductPool", "ProductPool_clearProductPool"); 32 app.post("/market/productPool/clearProductPool", "ProductPool_clearProductPool");
  33 +
  34 + //清空banner
  35 + app.post("/market/productPool/clearProductPoolBanner", "ProductPool_clearProductPoolBanner");
33 36
34 //删除 37 //删除
35 app.post("/market/productPool/deleteProductPool", "ProductPool_deleteProductPool"); 38 app.post("/market/productPool/deleteProductPool", "ProductPool_deleteProductPool");
@@ -25,7 +25,8 @@ module.exports = { @@ -25,7 +25,8 @@ module.exports = {
25 comment: {type: String}, 25 comment: {type: String},
26 producttype: {type: String}, 26 producttype: {type: String},
27 diffType: {type: Number}, 27 diffType: {type: Number},
28 - productSkns: {type: String} 28 + productSkns: {type: String},
  29 + bannerUrl: {type: String}
29 } 30 }
30 }, 31 },
31 updateProductPool: { 32 updateProductPool: {
@@ -36,7 +37,8 @@ module.exports = { @@ -36,7 +37,8 @@ module.exports = {
36 poolName: {type: String}, 37 poolName: {type: String},
37 comment: {type: String}, 38 comment: {type: String},
38 producttype: {type: String}, 39 producttype: {type: String},
39 - productSkns: {type: String} 40 + productSkns: {type: String},
  41 + bannerUrl: {type: String}
40 } 42 }
41 }, 43 },
42 clearProductPool: { 44 clearProductPool: {
@@ -46,6 +48,13 @@ module.exports = { @@ -46,6 +48,13 @@ module.exports = {
46 id: {type: Number} 48 id: {type: Number}
47 } 49 }
48 }, 50 },
  51 + clearProductPoolBanner: {
  52 + title: "清空商品池banner",
  53 + url: '/pool/clearProductPoolBanner',
  54 + params: {
  55 + id: {type: Number}
  56 + }
  57 + },
49 deleteProductPool: { 58 deleteProductPool: {
50 title: "删除商品池", 59 title: "删除商品池",
51 url: '/pool/deleteProductPool', 60 url: '/pool/deleteProductPool',
@@ -83,6 +83,14 @@ @@ -83,6 +83,14 @@
83 </div> 83 </div>
84 </div> 84 </div>
85 </div> 85 </div>
  86 +
  87 + <div class="form-group">
  88 + <label for="bannerUrl" class="col-sm-3 control-label">头部banner</label>
  89 + <div class="col-sm-9">
  90 + <input type="file" id="bannerUrl" name="bannerUrl" value="[[bannerUrl]]" required extend="gif,png,jpg,jpeg,pdf" placeholder="头部banner" bucket="brandBanner" />
  91 + </div>
  92 + </div>
  93 +
86 </div> 94 </div>
87 </script> 95 </script>
88 96