Authored by shuaiguo

feat(促销管理):每满减

... ... @@ -16,7 +16,8 @@
<option value="Needpaygift">加价购</option>
<option value="Degressdiscount">分件折扣</option>
<option value="Cheapestfree">满X免1</option>
<option value="SpecifiedAmount">X件X元</option>
<option value="SpecifiedAmount">X件X元</option>
<option value="LoopCashReduce">每满减</option>
</select>
</div>
</div>
... ...
... ... @@ -39,10 +39,26 @@ var operationEdit={
}
]
},
EveryCashreduce:{
enName:'EveryCashreduce',
LoopCashReduce:{
enName:'LoopCashReduce',
cnName : '每满减',
param_list : []
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',
... ... @@ -193,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":
... ... @@ -216,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);
... ... @@ -263,13 +286,14 @@ var operationEdit={
break;
case this.config.SpecifiedAmount.enName:
_selectObj=this.config.SpecifiedAmount;
case this.config.EveryCashreduce.enName:
this.everyCashreduce()
break;
case this.config.LoopCashReduce.enName:
_selectObj=this.config.LoopCashReduce
break;
}
this.template(firstGroup,_selectObj);
},
everyCashreduce: function() {},
LoopCashReduce: function() {},
bindEvent:function(){
var _g=this;
$('#save_operation').off();
... ...