Authored by zhaoqing

商品VIP设置

... ... @@ -15,10 +15,13 @@ module.exports = function (app) {
}
});
//获取商品VIP列表
//修改商品VIP状态
app.post("/vip/changeStatus", "vip_changeStatus");
//修改商品VIP状态
//批量修改商品VIP状态
app.post("/vip/batchChangeStatus", "vip_batchChangeStatus");
//获取商品VIP列表
app.post("/vip/queryProductVipList", "vip_queryProductVipList");
app.get("/vip/ProductVip", "vip.ProductVip", function(response) {
... ...
... ... @@ -26,6 +26,19 @@ module.exports = {
productVipStatus: {type: Number}
}
},
batchChangeStatus: {
title: "修改商品VIP状态",
url: '/vip/batchChangeStatus',
params: {
productSkn: {type: Number},
shopId: {type: Number},
brandId: {type: Number},
productVipStatus: {type: Number},
page: {type: Number},
changeStatus: {type: Number}
}
},
shopVipTrigger: {
title: "开启关闭",
url: "/vip/shopVipTrigger",
... ...
... ... @@ -37,6 +37,12 @@
</div>
</div>
</div>
<div>
<label><input name="all" id="all" type="checkbox" value=""/>选中当前页</label>
<a id="flowShop" href="javascript:;" class="btn btn-info">跟随店铺</a>
<a id="open" href="javascript:;" class="btn btn-info">开启</a>
<a id="close" href="javascript:;" class="btn btn-info">关闭</a>
</div>
<div class="panel panel-primary-head">
<div class="dataTab_wrapper" id="basicTable" ></div>
</div>
... ...
... ... @@ -23,6 +23,14 @@ var g = new common.grid({
};
},
columns: [
// {
// display: "复选框",
// render: function (item) {
// var HtmArr = [];
// HtmArr.push('<label><input name="choose" type="checkbox" value="'+item.productSKN+'"/></label>');
// return HtmArr.join('');
// }
// },
{
display: "SKN",
name: "productSKN"
... ... @@ -65,6 +73,78 @@ var g = new common.grid({
});
g.init('/vip/queryProductVipList');
$("#flowShop").click(function() {
if(!$('#all').is(':checked')) {
alert("请勾选复选框!");
return;
}
var params= {
productSkn: common.util.__input('productSkn'),
shopId: common.util.__input('shop-name'),
brandId: common.util.__input('brandId'),
productVipStatus: common.util.__input('productVipStatus'),
changeStatus: 0
};
common.dialog.confirm("警告",
"确认批量修改商品VIP状态为跟随店铺?",
function () {
common.util.__ajax({
url: '/vip/batchChangeStatus',
data: params
}, function(res) {
g.reload();
});
});
});
$("#open").click(function() {
if(!$('#all').is(':checked')) {
alert("请勾选复选框!");
return;
}
var params= {
productSkn: common.util.__input('productSkn'),
shopId: common.util.__input('shop-name'),
brandId: common.util.__input('brandId'),
productVipStatus: common.util.__input('productVipStatus'),
changeStatus: 1
};
common.dialog.confirm("警告",
"确认批量修改商品VIP状态为开启?",
function () {
common.util.__ajax({
url: '/vip/batchChangeStatus',
data: params
}, function(res) {
g.reload();
});
});
});
$("#close").click(function() {
if(!$('#all').is(':checked')) {
alert("请勾选复选框!");
return;
}
var params= {
productSkn: common.util.__input('productSkn'),
shopId: common.util.__input('shop-name'),
brandId: common.util.__input('brandId'),
productVipStatus: common.util.__input('productVipStatus'),
changeStatus: 2
};
common.dialog.confirm("警告",
"确认批量修改商品VIP状态为关闭?",
function () {
common.util.__ajax({
url: '/vip/batchChangeStatus',
data: params
}, function(res) {
g.reload();
});
});
});
$("#filter-btn").click(function() {
g.reload(1);
});
... ... @@ -86,4 +166,21 @@ function changeStatus(productSkn,status) {
});
};
window.changeStatus = changeStatus;
\ No newline at end of file
// function DoCheck()
// {
// var ch=document.getElementsByName("choose");
// if(document.getElementsByName("all")[0].checked==true)
// {
// for(var i=0;i<ch.length;i++)
// {
// ch[i].checked=true;
// }
// }else{
// for(var i=0;i<ch.length;i++)
// {
// ch[i].checked=false;
// }
// }
// }
// window.DoCheck = DoCheck;
window.changeStatus = changeStatus;
... ...