Authored by xuhongyun

build

... ... @@ -116,8 +116,11 @@ webpackJsonp([29],{
if(items.isDel==="N"){
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs del-promotion">删除</a>');
}
if(items.status===0){
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-info btn-xs open-promotion">开启</a>');
}
if(items.noticeStatus===0){
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-info btn-xs open-promotion">开启预告</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-info btn-xs open-promotion-notice">开启预告</a>');
}
return HtmArr.join('');
}
... ... @@ -152,7 +155,7 @@ webpackJsonp([29],{
});
//开启预告
$('tbody').on('click', '.open-promotion', function() {
$('tbody').on('click', '.open-promotion-notice', function() {
var item = g.rows[$(this).data("index")];
common.dialog.confirm("温馨提示", "你确定要开启预告吗?", function () {
... ... @@ -172,7 +175,57 @@ webpackJsonp([29],{
}, true);
});
});
// 开启促销
$('tbody').on('click', '.open-promotion', function() {
var item = g.rows[$(this).data("index")];
common.dialog.confirm("温馨提示", "你确定要开启促销吗?", function () {
common.util.__ajax({
url: '/promotionInfo/updatePromotionStatus',
data: {
id: item.id,
status: 1
}
}, function(res) {
if (res.code == 200) {
common.util.__tip('开启成功', 'success');
g.reload();
} else {
common.util.__tip(res.message);
}
}, true);
});
});
/***********************批量导出***********************/
$("#batchExportPromotion").click(function(){
var count = 0,
data = g.options.parms();
var filter=$(".wqt_all").prop("checked");
$.each(data, function(key, value) {
if (value && value != '') {
count++;
}
});
if (count > 0) {
var getResult=function(){
var result={};
for(var name in data){
if(data.hasOwnProperty(name)&&data[name]){
result[name]=data[name];
}
}
return result
}
window.open("/ajax/down?queryConf=" + JSON.stringify(getResult()) + "&type=promotionExport");
}else{
common.util.__tip('请选择导出促销的条件', 'warning');
return;
}
});
/***/ },
... ...
... ... @@ -16,6 +16,7 @@ webpackJsonp([75],{
var endTimeObj;
var customType = [];
var showScope = [];
var shopPriceLimits = [];
var isNew;
var publicCouponType;
... ... @@ -135,6 +136,7 @@ webpackJsonp([75],{
if (type == 'update') {
if (couponBean.customType) {
customType = couponBean.customType.split(',');
for (var i = 0; i < customType.length; i++) {
... ... @@ -142,7 +144,17 @@ webpackJsonp([75],{
$("input ." + custom).attr("checked", "checked");
}
}
console.log("showScope detail:" + couponBean.showScope);
/*$("input.showScope-1").prop("checked",false);
$("input.showScope-2").prop("checked",false);
$("input.showScope-3").prop("checked",false);*/
if (couponBean.showScope) {
showScope = couponBean.showScope.split(',');
for(var i = 0; i <showScope.length; i++) {
var checkBoxName = "showScope-" + showScope[i];
$("input ." + checkBoxName).attr("checked", "checked");
}
}
if (couponBean.shopPriceLimits) {
shopPriceLimits = couponBean.shopPriceLimits.split(',');
for (var i = 0; i < shopPriceLimits.length; i++) {
... ... @@ -337,6 +349,15 @@ webpackJsonp([75],{
} else if (couponTypeVal == 6) {
couponBean.feeSharingType = 2;
}
if (couponTypeVal == 1){
couponBean.showScope = "1,2";
} else if (couponTypeVal == 6) {
couponBean.showScope = "1,2,3";
} else {
couponBean.showScope = "2";
}
$.extend(window.ViewModel, couponBean);
Bll.__render(couponBean, type);
});
... ... @@ -356,6 +377,7 @@ webpackJsonp([75],{
couponBean.customType = customType.join(",");
});
$(document).on("click", "input[name='publicCouponType']", function () {
publicCouponType = $(this).val();
console.log("publicCouponType", publicCouponType);
... ... @@ -535,6 +557,15 @@ webpackJsonp([75],{
}
}
});
showScope = [];
$('input:checkbox[name="showScope"]:checked').each(function () {
showScope.push($(this).val());
});
couponBean.showScope = showScope.join(",");
console.log("showScope: " + couponBean.showScope);
if (jsonDataChannel.length === 0) {
common.util.__tip('渠道限制不能为空!', 'warning');
return false;
... ... @@ -543,7 +574,7 @@ webpackJsonp([75],{
* 该属性值给校验未通过回显用 校验通过重新赋值
* @type {Array}
*/
couponBean.channel = jsonDataChannel
couponBean.channel = jsonDataChannel;
//新增时如果,如果没有选定,赋予1(我司承担)
... ... @@ -1124,7 +1155,8 @@ webpackJsonp([75],{
cusPublicCouponName: "",
publicCouponType: "",
couponAvailableChannels: "", // 可用渠道
channel: "" // 可用渠道勾选状态
channel: "", // 可用渠道勾选状态
showScope: ""//展示范围
};
module.exports = couponBean;
... ...
... ... @@ -24,8 +24,8 @@ webpackJsonp([77],[
var couponTypes = ["活动券", "B券", "券码", "生日券", "免邮券", "店铺券", "分享券", "会员营销券"];
var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"];
// var customTypes = ["新客户", "银卡会员", "金卡会员", "白金卡会员", "普通用户(不含新客)"];
var customTypes = {1: "新客户", 2: "银卡会员", 3: "金卡会员", 4: "白金卡会员", 5: "普通用户(不含新客)", 9: "学生"};
var showScopes = {1: "购物车展示", 2: "详情页展示", 3:"店铺展示"}
var shopPriceLimitsTable = {1: "成交价低于吊牌价三折", 2: "限量商品"};
var thirdTypeEnum = {1: "微信", 2: "支付宝", 3: "微薄"};
... ... @@ -383,6 +383,20 @@ webpackJsonp([77],[
item1.customType = "无";
}
//优惠券展示范围
if (item1.showScope) {
console.info("showScope:" + item1.showScope);
item1.showScope = item1.showScope.split(",");
var scopeLen = item1.showScope.length;
var scopes = [];
for(var i = 0; i < scopeLen; i++){
scopes.push(showScopes[item1.showScope[i]]);
}
item1.showScope = scopes.join(",")
}else {
item1.showScope = "无"
}
// shopPriceLimitsTable
if (item1.shopPriceLimits) {
item1.shopPriceLimits = item1.shopPriceLimits.split(",");
... ...
... ... @@ -36,6 +36,8 @@ module.exports = function (app){
app.post("/promotionInfo/delete","promotion_deletePromotionInfo");
//开启促销预告
app.post("/promotionInfo/updatePromotionNoticeStatus","promotion_updatePromotionNoticeStatus");
//开启促销
app.post("/promotionInfo/updatePromotionStatus","promotion_updatePromotionStatus");
//参数-促销条件
app.post("/promotion/setCondition","promotion_setCondition");
... ...
... ... @@ -60,6 +60,14 @@ module.exports={
{name: 'noticeStatus', type: 'Number'}
]
},
updatePromotionStatus:{
title:"开启促销",
url:"/promotion/updatePromotionStatus",
params:[
{name: 'id', type: 'Number'},
{name: 'status', type: 'Number'}
]
},
getPromotionInfoList:{
title:"查询列表",
url:"/promotion/getPromotionInfoList",
... ...
... ... @@ -63,7 +63,8 @@ module.exports = {
prdPoolLimit: {type: String},
cusPublicCouponName: {type: String},
publicCouponType: {type: Number},
channel: {type: String}
channel: {type: String},
showScope : {type: String}
}
},
reject: {
... ...
... ... @@ -350,6 +350,8 @@ function __sendRequest(options, success, fail, wlen, i, args) {
}
Request(options, function (error, response, body) {
//console.error("request-options=> ",options, "body=>" ,body);
//console.error("request-error =>", error, 'status=>', response.statusCode )
if (!wlen.len) {
return;
}
... ...
... ... @@ -44,9 +44,10 @@
<div class="panel-col">
<input name="description" id="description" placeholder="输入描述的关键信息" class="form-control" />
</div>
<div class="panel-col">
<div style="float: left; height: 40px; margin: 0 10px 10px;">
<a id="filter-btn" href="javascript:void(0);" class="btn btn-info">筛选</a>
<a id="filter-all" href="/promotionInfo/index" class="btn btn-info">全部</a>
<a id="batchExportPromotion" href="javascript:void(0);" class="btn btn-info">导出</a>
</div>
</div>
</div>
... ...
... ... @@ -412,6 +412,27 @@
<div>
<div class="panel-heading">
<h4 class="panel-title">展示范围</h4>
</div>
<div class="panel-body">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<label class="checkbox-inline">
<input type="checkbox" value="1" name="showScope" class="showScope-1" [[if couponType==3||couponType==4||couponType==5||couponType==7||couponType==8]]disabled[[/if]]> 购物车展
</label>
<label class="checkbox-inline">
<input type="checkbox" value="2" name="showScope" class="showScope-2" [[if couponType==-1]]disabled[[/if]]> 详情页展
</label>
<label class="checkbox-inline">
<input type="checkbox" value="3" name="showScope" class="showScope-3" [[if couponType==1||couponType==3||couponType==4||couponType==5||couponType==7||couponType==8]]disabled[[/if]] > 店铺展
</label>
</div>
<input type="hidden" value="[[showScope]]" id="showScope" for="checkbox" placeholder="展示范围">
</div>
</div>
</div>
<div class="panel-heading">
<h4 class="panel-title">费用承担</h4>
... ...
... ... @@ -383,7 +383,22 @@
</div>
</div>
</div>
</div>
<div class="panel-heading">
<h4 class="panel-title">展示范围</h4>
</div>
<div class="panel-body">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">展示范围</label>
<div class="col-sm-8">
<p>[[showScope]]</p>
</div>
</div>
</div>
</div>
</div>
</script>
... ...