Authored by wangwei

Merge branch 'dev_link' into test6.5

... ... @@ -59,7 +59,9 @@ module.exports = {
productLimit:{type:String},
isNew : {type:Number},
isUseLimitRule:{type:String},
prdPoolLimit : {type:String}
prdPoolLimit : {type:String},
cusPublicCouponName:{type:String},
publicCouponType:{type:Number}
}
},
reject: {
... ...
... ... @@ -61,22 +61,38 @@
<input type="hidden" value="[[isNew]]" id="isNew" for="checkbox"
placeholder="前台展示">
[[/if]]
[[if couponType=='3']]
&nbsp;&nbsp;&nbsp;&nbsp;<label class="checkbox-inline"><input type="checkbox" value="1" name="isUseLimitRule" class="custom-1" [[if isUseLimitRule=='N']]checked[[/if]]> 市场通用</label>
[[/if]]
</div>
</div>
</div>
[[if couponType==3]]
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="form-group" >
<label class="col-sm-2 control-label">生成方式 <span class="red">*</span></label>
<div class="col-sm-8" >
<div class="col-sm-8" class="radio-inline">
<input type="radio" name="publicCouponType" value="0" [[if publicCouponType==0]]checked[[/if]]>系统生成</label>
<input type="checkbox" value="1" name="isUseLimitRule" class="custom-1" [[if isUseLimitRule=='N']]checked[[/if]]> 市场通
<input type="radio" name="publicCouponType" value="1" [[if publicCouponType==1]]checked[[/if]]>手动配置</label>
</div>
</div>
</div>
[[if publicCouponType==1]]
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">码值 <span class="red">*</span></label>
<div class="col-sm-8" >
<input type="text" name="cusPublicCouponName" placeholder='以"#"开头,支持数字,字母(不区分大小写),汉字,20字符内' class="form-control observe"
data-field="cusPublicCouponName" required maxlength="20" value="[[cusPublicCouponName]]">
</div>
</div>
</div>
[[/if]]
[[/if]]
</div>
<div class="panel-heading">
<h4 class="panel-title">基本信息</h4>
</div>
... ... @@ -95,7 +111,7 @@
<label class="col-sm-2 control-label">数量<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" placeholder="数量" prompt="数量" class="form-control observe number"
<input type="text" name="couponNum" placeholder="数量" prompt="数量" class="form-control observe number"
data-field="couponNum"
required value="[[couponNum]]" >
</div>
... ...
... ... @@ -96,6 +96,18 @@
</div>
</div>
</div>
[[if publicCouponType=='1']]
<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> [[cusPublicCouponName]]</p>
</div>
</div>
</div>
</div>
[[/if]]
[[/if]]
<div class="panel-heading">
<h4 class="panel-title">基本信息</h4>
... ...
... ... @@ -25,8 +25,8 @@
<td>url类型</td>
<td>
<label>url类型<span style="color:red">*</span></label>&emsp;&emsp;
<label class="radio-inline"><input type="radio" name="urlType" value="1" checked>http</label>
<label class="radio-inline"><input type="radio" name="urlType" value="2">https</label>
<label class="radio-inline"><input type="radio" name="urlType" value="1" >http</label>
<label class="radio-inline"><input type="radio" name="urlType" value="2" checked>https</label>
</td>
</tr>
</table>
... ...
... ... @@ -64,7 +64,7 @@
<div class="form-group">
<label>url类型<span style="color:red">*</span></label></label>&emsp;&emsp;
<label class="radio-inline"><input type="radio" name="urlType" value="1">http</label>
<label class="radio-inline"><input type="radio" name="urlType" value="2">https</label>
<label class="radio-inline"><input type="radio" name="urlType" value="2" checked>https</label>
<input type="hidden" value="[[urlType]]" id="urlType" for="radio" required>
</div>
<div class="form-group">
... ...
... ... @@ -49,7 +49,7 @@ var Iaccount = {
var apiCofig = {
//root:__dirname,
EnvConst:{
domain:"http://192.168.102.48:8088/platform",
domain:"http://127.0.0.1:8088/platform",
//domain:"http://127.0.0.1:8088/platform",
// domain:"http://172.16.6.200:8088/platform",
//domain:"http://192.168.102.202:8088/platform",
... ...
... ... @@ -13,6 +13,7 @@ var endTimeObj;
var customType = [];
var shopPriceLimits=[];
var isNew ;
var publicCouponType;
/**
* 监听输入值的变化
*/
... ... @@ -172,7 +173,14 @@ var Bll = {
if(couponBean.isNew){
isNew = couponBean.isNew;
}
if(couponBean.couponType=='3'){
$("input[name='publicCouponType']").attr("disabled",true);
if(couponBean.publicCouponType=='1'){
$("input[name='cusPublicCouponName']").attr("disabled",true);
$("input[name='couponNum']").attr("disabled",true);
$("#filter-couponType").attr("disabled",true);
}
}
}
},
... ... @@ -326,6 +334,21 @@ $(document).on("click", "input[name='customType']", function () {
}
couponBean.customType = customType.join(",");
});
$(document).on("click", "input[name='publicCouponType']", function () {
publicCouponType = $(this).val();
console.log("publicCouponType",publicCouponType);
if(publicCouponType=='1'){
couponBean.couponNum = 1;
$("input[name='couponNum']").attr("disabled",true);
}
couponBean.publicCouponType = publicCouponType
Bll.__render(couponBean, type);;
if(publicCouponType=='1'){
$("input[name='couponNum']").attr("disabled",true);
}
});
/**
* 免邮券开关
*/
... ... @@ -377,6 +400,27 @@ $(document).on("click", "#save_brand", function () {
return false;
}
}
if(couponBean.couponType=='3'){
if(couponBean.publicCouponType=='0'){
couponBean.cusPublicCouponName = '';
}
if(couponBean.publicCouponType=='1'){
var cusPublicCouponName = couponBean.cusPublicCouponName;
if(cusPublicCouponName==''){
common.util.__tip('码值不能为空!', 'warning');
return false;
}
//名称不能包含特殊字符
if(!cusPublicCouponName.startsWith("#")||/[~^$@%&!*]/gi.test(cusPublicCouponName)){
common.util.__tip('码值格式输入错误', 'warning');
return false;
}
if(cusPublicCouponName.length>20){
common.util.__tip('码值不可超出20个汉字', 'warning');
return false;
}
}
}
var productLimit = $("textarea[name=\"productLimit\"]").val();
if(productLimit){
couponBean.productLimit = productLimit;
... ...
... ... @@ -27,7 +27,10 @@ var couponBean = {
shopIds:"",
feeSharingType:"0",
feeSharingRatio:"",
isUseLimitRule:""
isUseLimitRule:"",
cusPublicCouponName:"",
publicCouponType:""
};
module.exports = couponBean;
\ No newline at end of file
... ...
... ... @@ -9,12 +9,12 @@ common = require('../../../common/common');
var module = {
channelId: 2,
linkType: "app",
urlType:1
urlType:2
},
singleModule = {
action: "go.brand",
linkType: "app",
urlType:1
urlType:2
};
var edit = new common.edit2("#generate-content");
var role = $("#wrap-content").attr("role"),
... ...