Authored by zhaoqing

VIP返币

... ... @@ -45,6 +45,12 @@ module.exports = function (app) {
//批量修改商品VIP状态
app.post("/vip/batchChangeStatus", "vip_batchChangeStatus");
//修改商品VIP反币状态
app.post("/vip/changeReturnCoinStatus", "vip_changeReturnCoinStatus");
//批量修改商品VIP反币状态
app.post("/vip/batchChangeReturnCoinStatus", "vip_batchChangeReturnCoinStatus");
//获取商品VIP列表
app.post("/vip/queryProductVipList", "vip_queryProductVipList");
... ...
... ... @@ -15,6 +15,7 @@ module.exports = {
shopId: {type: Number},
brandId: {type: Number},
vipDiscountType: {type: Number},
vipReturnCoinStatus: {type: Number},
page: {type: Number}
}
},
... ... @@ -41,6 +42,22 @@ module.exports = {
{ name: 'shopsIds', type: 'String'},
{ name: 'vipStatus', type: 'Number'}
]
},
changeReturnCoinStatus: {
title: "修改商品VIP状态",
url: '/vip/changeReturnCoinStatus',
params: {
productSkn: {type: Number},
vipReturnCoinStatus: {type: Number}
}
},
batchChangeReturnCoinStatus: {
title: "修改商品VIP状态",
url: '/vip/batchChangeReturnCoinStatus',
params: {
sknList: {type: String},
vipReturnCoinStatus: {type: Number}
}
}
}
};
... ...
... ... @@ -6,7 +6,7 @@
<div class="panel-body">
<table class="table table-bordered">
<tr>
<td rowspan="2">商品VIP设置</td>
<td rowspan="2" style="width:250px">商品VIP设置</td>
<td>上传EXCEL:</td>
<td style="position: relative;">
<input id="importProductBatch" name="file" data-type="" type="file" style="border:1px solid red; cursor: pointer; height: 37px; top: 8px;">
... ... @@ -26,6 +26,28 @@
</table>
</div>
<div class="panel-body">
<table class="table table-bordered">
<tr>
<td rowspan="2" style="width:250px">商品VIP返币设置</td>
<td>上传EXCEL:</td>
<td style="position: relative;">
<input id="importReturnCoinBatch" name="file" data-type="" type="file" style="border:1px solid red; cursor: pointer; height: 37px; top: 8px;">
<a class="btn btn-default" href="/vip/index">返回</a>
</td>
</tr>
<tr>
<td>说明:</td>
<td colspan="2">
1、上传文件必须是 .xlsx 文件<br>
2、第一行标题栏:SKN、商品VIP返币状态<br>
<span style="color: red;">3、商品VIP返币状态:1表示开启,0表示关闭;</span><br>
4、请上传自己权限内的商品SKN,一次上传数量不可超过1W条<br/>
5、<a href="/ajax/link/vipProduct">下载样例</a>
</td>
</tr>
</table>
</div>
<div class="panel-body">
<div class="col-md-12">
<div id="message"></div>
</div>
... ...
... ... @@ -47,6 +47,14 @@
</select>
</div>
<div class="panel-col2" style="width: 100px;">
<select id="vipReturnCoinStatus" class="form-control">
<option value="-1">返币状态</option>
<option value="1">开启</option>
<option value="0">关闭</option>
</select>
</div>
<div class="panel-col">
<a id="searchFilter" href="javascript:;" class="btn btn-info">筛选</a>
</div>
... ... @@ -58,8 +66,10 @@
</div>
<div style="margin-left:10px;margin-bottom: 10px">
<label><input name="all" id="all" type="checkbox" onclick="DoCheck()" value=""/>选中当前页</label>
<a onclick="batchChangeStatus(1)" href="javascript:;" class="btn btn-info">开启</a>
<a onclick="batchChangeStatus(2)" href="javascript:;" class="btn btn-danger">关闭</a>
<a onclick="batchChangeStatus(1)" href="javascript:;" class="btn btn-info">开启VIP价</a>
<a onclick="batchChangeStatus(2)" href="javascript:;" class="btn btn-danger">关闭VIP价</a>
<a onclick="batchChangeReturnCoinStatus(1)" href="javascript:;" class="btn btn-info">开启VIP返币</a>
<a onclick="batchChangeReturnCoinStatus(0)" href="javascript:;" class="btn btn-danger">关闭VIP返币</a>
<div style="float:right;margin-right:10px;margin-top:20px;">
<label style="color:#FF0000">*只有正价商品才能开启VIP价格 VIP折扣固定为白金:88折 金卡:9折 银卡:95折</label>
</div>
... ...
... ... @@ -2,6 +2,7 @@
var $ = require('jquery'), common = require('../../common/common');
var importConfig = { "bizType" : "vipBatch" };
var importConfig1 = { "bizType" : "vipReturnCoinBatch" };
$('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>');
var loadModal = null;
... ... @@ -37,3 +38,5 @@ function batchImport(el, type) {
common.edit.ajaxfileupload('#importProductBatch', batchImport('#sort-file', importConfig.bizType));
common.edit.ajaxfileupload('#importReturnCoinBatch', batchImport('#sort-file', importConfig1.bizType));
... ...
... ... @@ -17,7 +17,8 @@ var g = new common.grid({
productSkn: common.util.__input('productSkn'),
shopId: common.util.__input('shopId'),
brandId: common.util.__input('brandId'),
vipDiscountType: common.util.__input('vipDiscountType')
vipDiscountType: common.util.__input('vipDiscountType'),
vipReturnCoinStatus: common.util.__input('vipReturnCoinStatus')
};
},
columns: [
... ... @@ -57,13 +58,29 @@ var g = new common.grid({
return HtmArr.join('');
}
}, {
display: "VIP返币状态",
render: function (item) {
var HtmArr = [];
if(item.vipReturnCoinStatus == 0){
HtmArr.push('<label>关闭</label>');
}else{
HtmArr.push('<label>开启</label>');
}
return HtmArr.join('');
}
}, {
display: '操作',
render: function (item) {
var HtmArr = [];
if(item.vipDiscountType == 3){
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启</a>');
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启VIP价</a>');
}else{
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',2)" href="javascript:;" class="btn btn-danger">关闭VIP价</a>');
}
if(item.vipReturnCoinStatus == 0){
HtmArr.push('<a onclick="changeReturnCoinStatus('+item.productSKN+',1)" href="javascript:;" class="btn btn-info">开启VIP返币</a>');
}else{
HtmArr.push('<a onclick="changeStatus('+item.productSKN+',2)" href="javascript:;" class="btn btn-danger">关闭</a>');
HtmArr.push('<a onclick="changeReturnCoinStatus('+item.productSKN+',0)" href="javascript:;" class="btn btn-danger">关闭VIP返币</a>');
}
return HtmArr.join('');
}
... ... @@ -101,6 +118,37 @@ function batchChangeStatus(status) {
}
/**
* 批量修改商品VIP返币状态
* @param status
*/
function batchChangeReturnCoinStatus(status) {
console.log(status);
var chk_value =[];
$('input[name="choose"]:checked').each(function(){
chk_value.push($(this).val());
});
if(chk_value.length==0) {
alert("你还没有选择任何SKN!");
return;
}
var params= {
sknList: chk_value.toString(),
vipReturnCoinStatus: status
};
common.dialog.confirm("警告",
"确认批量修改商品VIP返币状态?",
function () {
common.util.__ajax({
url: '/vip/batchChangeReturnCoinStatus',
data: params
}, function(res) {
g.reload();
$("[name='all']").removeAttr("checked");
});
});
}
/**
* 搜索商品VIP
*/
$("#searchFilter").click(function() {
... ... @@ -132,6 +180,31 @@ function changeStatus(productSkn,status) {
};
/**
* 单个修改商品VIP返币状态
* @param productSkn
* @param status
*/
function changeReturnCoinStatus(productSkn,status) {
console.log(status);
var param = {
productSkn: productSkn,
vipReturnCoinStatus: status
};
console.log(param);
common.dialog.confirm("警告",
"确认修改商品VIP返币状态?",
function () {
common.util.__ajax({
url: '/vip/changeReturnCoinStatus',
data: param
}, function(res) {
g.reload();
$("[name='all']").removeAttr("checked");
});
});
};
/**
* 全选、反选
* @constructor
*/
... ... @@ -168,3 +241,5 @@ function changeTab(tab) {
}
window.changeTab = changeTab;
window.batchChangeStatus = batchChangeStatus;
window.changeReturnCoinStatus = changeReturnCoinStatus;
window.batchChangeReturnCoinStatus = batchChangeReturnCoinStatus;
... ...