Authored by zhaoqing

商品VIP设置

@@ -15,10 +15,13 @@ module.exports = function (app) { @@ -15,10 +15,13 @@ module.exports = function (app) {
15 } 15 }
16 }); 16 });
17 17
18 - //获取商品VIP列表 18 + //修改商品VIP状态
19 app.post("/vip/changeStatus", "vip_changeStatus"); 19 app.post("/vip/changeStatus", "vip_changeStatus");
20 20
21 - //修改商品VIP状态 21 + //批量修改商品VIP状态
  22 + app.post("/vip/batchChangeStatus", "vip_batchChangeStatus");
  23 +
  24 + //获取商品VIP列表
22 app.post("/vip/queryProductVipList", "vip_queryProductVipList"); 25 app.post("/vip/queryProductVipList", "vip_queryProductVipList");
23 26
24 app.get("/vip/ProductVip", "vip.ProductVip", function(response) { 27 app.get("/vip/ProductVip", "vip.ProductVip", function(response) {
@@ -26,6 +26,19 @@ module.exports = { @@ -26,6 +26,19 @@ module.exports = {
26 productVipStatus: {type: Number} 26 productVipStatus: {type: Number}
27 } 27 }
28 }, 28 },
  29 + batchChangeStatus: {
  30 + title: "修改商品VIP状态",
  31 + url: '/vip/batchChangeStatus',
  32 + params: {
  33 + productSkn: {type: Number},
  34 + shopId: {type: Number},
  35 + brandId: {type: Number},
  36 + productVipStatus: {type: Number},
  37 + page: {type: Number},
  38 + changeStatus: {type: Number}
  39 +
  40 + }
  41 + },
29 shopVipTrigger: { 42 shopVipTrigger: {
30 title: "开启关闭", 43 title: "开启关闭",
31 url: "/vip/shopVipTrigger", 44 url: "/vip/shopVipTrigger",
@@ -37,6 +37,12 @@ @@ -37,6 +37,12 @@
37 </div> 37 </div>
38 </div> 38 </div>
39 </div> 39 </div>
  40 + <div>
  41 + <label><input name="all" id="all" type="checkbox" value=""/>选中当前页</label>
  42 + <a id="flowShop" href="javascript:;" class="btn btn-info">跟随店铺</a>
  43 + <a id="open" href="javascript:;" class="btn btn-info">开启</a>
  44 + <a id="close" href="javascript:;" class="btn btn-info">关闭</a>
  45 + </div>
40 <div class="panel panel-primary-head"> 46 <div class="panel panel-primary-head">
41 <div class="dataTab_wrapper" id="basicTable" ></div> 47 <div class="dataTab_wrapper" id="basicTable" ></div>
42 </div> 48 </div>
@@ -23,6 +23,14 @@ var g = new common.grid({ @@ -23,6 +23,14 @@ var g = new common.grid({
23 }; 23 };
24 }, 24 },
25 columns: [ 25 columns: [
  26 + // {
  27 + // display: "复选框",
  28 + // render: function (item) {
  29 + // var HtmArr = [];
  30 + // HtmArr.push('<label><input name="choose" type="checkbox" value="'+item.productSKN+'"/></label>');
  31 + // return HtmArr.join('');
  32 + // }
  33 + // },
26 { 34 {
27 display: "SKN", 35 display: "SKN",
28 name: "productSKN" 36 name: "productSKN"
@@ -65,6 +73,78 @@ var g = new common.grid({ @@ -65,6 +73,78 @@ var g = new common.grid({
65 }); 73 });
66 g.init('/vip/queryProductVipList'); 74 g.init('/vip/queryProductVipList');
67 75
  76 +$("#flowShop").click(function() {
  77 + if(!$('#all').is(':checked')) {
  78 + alert("请勾选复选框!");
  79 + return;
  80 + }
  81 + var params= {
  82 + productSkn: common.util.__input('productSkn'),
  83 + shopId: common.util.__input('shop-name'),
  84 + brandId: common.util.__input('brandId'),
  85 + productVipStatus: common.util.__input('productVipStatus'),
  86 + changeStatus: 0
  87 + };
  88 + common.dialog.confirm("警告",
  89 + "确认批量修改商品VIP状态为跟随店铺?",
  90 + function () {
  91 + common.util.__ajax({
  92 + url: '/vip/batchChangeStatus',
  93 + data: params
  94 + }, function(res) {
  95 + g.reload();
  96 + });
  97 + });
  98 +});
  99 +
  100 +$("#open").click(function() {
  101 + if(!$('#all').is(':checked')) {
  102 + alert("请勾选复选框!");
  103 + return;
  104 + }
  105 + var params= {
  106 + productSkn: common.util.__input('productSkn'),
  107 + shopId: common.util.__input('shop-name'),
  108 + brandId: common.util.__input('brandId'),
  109 + productVipStatus: common.util.__input('productVipStatus'),
  110 + changeStatus: 1
  111 + };
  112 + common.dialog.confirm("警告",
  113 + "确认批量修改商品VIP状态为开启?",
  114 + function () {
  115 + common.util.__ajax({
  116 + url: '/vip/batchChangeStatus',
  117 + data: params
  118 + }, function(res) {
  119 + g.reload();
  120 + });
  121 + });
  122 +});
  123 +
  124 +$("#close").click(function() {
  125 + if(!$('#all').is(':checked')) {
  126 + alert("请勾选复选框!");
  127 + return;
  128 + }
  129 + var params= {
  130 + productSkn: common.util.__input('productSkn'),
  131 + shopId: common.util.__input('shop-name'),
  132 + brandId: common.util.__input('brandId'),
  133 + productVipStatus: common.util.__input('productVipStatus'),
  134 + changeStatus: 2
  135 + };
  136 + common.dialog.confirm("警告",
  137 + "确认批量修改商品VIP状态为关闭?",
  138 + function () {
  139 + common.util.__ajax({
  140 + url: '/vip/batchChangeStatus',
  141 + data: params
  142 + }, function(res) {
  143 + g.reload();
  144 + });
  145 + });
  146 +});
  147 +
68 $("#filter-btn").click(function() { 148 $("#filter-btn").click(function() {
69 g.reload(1); 149 g.reload(1);
70 }); 150 });
@@ -86,4 +166,21 @@ function changeStatus(productSkn,status) { @@ -86,4 +166,21 @@ function changeStatus(productSkn,status) {
86 }); 166 });
87 }; 167 };
88 168
89 -window.changeStatus = changeStatus;  
  169 +// function DoCheck()
  170 +// {
  171 +// var ch=document.getElementsByName("choose");
  172 +// if(document.getElementsByName("all")[0].checked==true)
  173 +// {
  174 +// for(var i=0;i<ch.length;i++)
  175 +// {
  176 +// ch[i].checked=true;
  177 +// }
  178 +// }else{
  179 +// for(var i=0;i<ch.length;i++)
  180 +// {
  181 +// ch[i].checked=false;
  182 +// }
  183 +// }
  184 +// }
  185 +// window.DoCheck = DoCheck;
  186 +window.changeStatus = changeStatus;