Authored by pangjie

优惠券功能修改

... ... @@ -44,7 +44,10 @@ module.exports = {
couponAmount: {type: Number},
brandLimit: {type: String},
sortLimit: {type: String},
customType: {type: String}
customType: {type: String},
multipleNum: {type: Number},
shopPriceLimits: {type: String},
sknExclude: {type: String}
}
},
reject: {
... ...
... ... @@ -313,7 +313,7 @@
<input type="checkbox" value="4" name="customType" class="custom-4"> 白金会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="9" name="customType" class="custom-4"> 学生
<input type="checkbox" value="9" name="customType" class="custom-9"> 学生
</label>
</div>
... ... @@ -322,6 +322,28 @@
</div>
</div>
</div>
<div class="panel-heading">
<h4 class="panel-title">互斥配置</h4>
</div>
<div class="panel-body">
<div class="row">
<div class="form-group">
<div class="col-sm-10">
<label class="checkbox-inline">
<input type="checkbox" value="1" name="shopPriceLimits" class="pricelimit-1"> 成交价低于吊牌价三折
</label>
<label class="checkbox-inline">
<input type="checkbox" value="2" name="shopPriceLimits" class="pricelimit-2"> 限量商品
</label>
</div>
<input type="hidden" value="[[shopPriceLimits]]" id="shopPriceLimits" for="checkbox"
placeholder="券限制条件">
</div>
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
... ...
... ... @@ -12,6 +12,7 @@ var type = $("#basicForm").attr("role"),//类型 新增或修改
var startTimeObj;
var endTimeObj;
var customType = [];
var shopPriceLimits=[];
/**
* 监听输入值的变化
... ... @@ -93,6 +94,16 @@ var Bll = {
}
}
}
if (type == 'update') {
if (couponBean.shopPriceLimits) {
shopPriceLimits = couponBean.shopPriceLimits.split(',');
for (var i = 0; i < shopPriceLimits.length; i++) {
var custom = "pricelimit-" + shopPriceLimits[i];
$("input ." + custom).attr("checked", "checked");
}
}
}
},
//modified by jie.pang@yoho.cn:20160812 去掉隐藏的功能
checkSortNum: function () {
... ... @@ -205,6 +216,22 @@ $(document).on("click", "input[name='customType']", function () {
couponBean.customType = customType.join(",");
});
/**
* 用券限制
*/
$(document).on("click", "input[name='shopPriceLimits']", function () {
if ($(this).is(':checked')) {
shopPriceLimits.push($(this).val());
} else {
for (var i = 0; i < shopPriceLimits.length; i++) {
if ($(this).val() == shopPriceLimits[i]) {
shopPriceLimits.splice(i, 1)
}
}
}
couponBean.shopPriceLimits = shopPriceLimits.join(",");
});
//输入限制
$(document).on("keyup", ".number", function () {
$(this).val($(this).val().replace(/\D/g, ''));
... ...
... ... @@ -19,6 +19,9 @@ var couponBean = {
sortList:"",
sortLimit:"",
customType:"",
multipleNum:1,
shopPriceLimits:"",
sknExclude:"",
useRange:0
};
... ...