...
|
...
|
@@ -39,6 +39,27 @@ var operationEdit={ |
|
|
}
|
|
|
]
|
|
|
},
|
|
|
LoopCashReduce:{
|
|
|
enName:'LoopCashReduce',
|
|
|
cnName : '每满减',
|
|
|
param_list : [
|
|
|
{
|
|
|
name:'maxLoopNumber' ,
|
|
|
display_name : '循环上限',
|
|
|
type : 'text',
|
|
|
default_value : '10000',
|
|
|
post_label: '倍',
|
|
|
required: true
|
|
|
},
|
|
|
{
|
|
|
name:'reduce' ,
|
|
|
display_name : '满减',
|
|
|
type : 'text',
|
|
|
default_value : '',
|
|
|
required: true
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
Gift:{
|
|
|
enName:'Gift',
|
|
|
cnName:'赠品',
|
...
|
...
|
@@ -188,7 +209,10 @@ var operationEdit={ |
|
|
for(var _index in _data.param_list){
|
|
|
_param=_data.param_list[_index];
|
|
|
var _html=_htmlObj.clone();
|
|
|
_html.children("label").html(_param.display_name);
|
|
|
var $label = _html.children("label").html(_param.display_name);
|
|
|
if(_param.required) {
|
|
|
$label.append($("<span class=\" red \" style=\"padding-left: 5px\">*</span>"));
|
|
|
}
|
|
|
var _input;
|
|
|
switch(_param.type){
|
|
|
case "text":
|
...
|
...
|
@@ -211,7 +235,11 @@ var operationEdit={ |
|
|
}
|
|
|
_input.attr("id",_param.name);
|
|
|
_input.attr("name",_param.name);
|
|
|
_html.children("div").html(_input);
|
|
|
var $inputParent = _html.children("div").html(_input);
|
|
|
if(_param.post_label) {
|
|
|
$inputParent.css({'display': 'flex', 'align-items': 'center'});
|
|
|
$inputParent.append($('<span>倍</span>').css('padding-left', '10px'))
|
|
|
}
|
|
|
if(_param.remark){
|
|
|
var _remark=$("<label class=\"control-label red\"></label>");
|
|
|
_remark.html(_param.remark);
|
...
|
...
|
@@ -258,10 +286,14 @@ var operationEdit={ |
|
|
break;
|
|
|
case this.config.SpecifiedAmount.enName:
|
|
|
_selectObj=this.config.SpecifiedAmount;
|
|
|
break;
|
|
|
case this.config.LoopCashReduce.enName:
|
|
|
_selectObj=this.config.LoopCashReduce
|
|
|
break;
|
|
|
}
|
|
|
this.template(firstGroup,_selectObj);
|
|
|
},
|
|
|
LoopCashReduce: function() {},
|
|
|
bindEvent:function(){
|
|
|
var _g=this;
|
|
|
$('#save_operation').off();
|
...
|
...
|
@@ -310,6 +342,18 @@ var operationEdit={ |
|
|
common.util.__tip("数据格式不对,请根据提示输入", "warning");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if(reqData["promotionType"] === 'LoopCashReduce') {
|
|
|
if(!(/^[1-9]\d*(\.\d{1})?$/.test(_temp.reduce))) {
|
|
|
common.util.__tip("满减金额为大于0且最多精确到小数点后1位", "warning");
|
|
|
return false;
|
|
|
}
|
|
|
if(!(/^[1-9]\d*(\.{0})$/.test(_temp.maxLoopNumber))) {
|
|
|
common.util.__tip("循环上限填写倍数为大于1的整数", "warning");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
_actionParam = JSON.stringify(_temp);
|
|
|
reqData["actionParam"]=_actionParam;
|
...
|
...
|
|