Commit cf555e6c authored by agping's avatar agping

6

parent 3dd47daf
......@@ -38,7 +38,7 @@
<div class="pull-right">
<ul class="bread_btn">
<li>
<!--<a class="btn btn-info add-activity" data-toggle="modal" href="#modal-add">新增活动</a>-->
<a class="btn btn-info add-activity" data-toggle="modal" href="#modal-add">新增活动</a>
</li>
</ul>
</div>
......@@ -109,17 +109,17 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">兑现动作:</label>
<label class="control-label">自己的订单确认分佣</label>
<label class="control-label confirm-commission">自己的订单确认分佣</label>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">活动有效期:</label>
<label class="control-label">创建时间:</label>
<input class="input-width-m input-width" type="text" value="" id="activity_start_date"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d',readOnly:true})"/>
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})"/>
<label class="control-label"></label>
<input class="input-width-m input-width" type="text" value="" id="activity_end_date"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'%y-%M-%d',readOnly:true})"/>
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})"/>
</div>
<div class="form-group">
......@@ -135,12 +135,12 @@
<input type="radio" name="activity-total" value="0"><label class="control-label">最多</label>
<input type="number" value="0" class="input-width-s input-width" id="activity-total-num">
</div>
<!--<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">用户可得红包数:</label>
<input type="radio" name="red-total-bag" value="-1"><label class="control-label">不限</label>
<input type="radio" name="red-total-bag" value="0"><label class="control-label">最多</label>
<input type="number" value="0" class="input-width-s input-width" id="red-bag-num">个
</div>-->
<input type="radio" name="activity-total-bag" value="-1"><label class="control-label">不限</label>
<input type="radio" name="activity-total-bag" value="0"><label class="control-label">最多</label>
<input type="number" value="0" class="input-width-s input-width" id="activity-bag-num">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">活动规则:</label>
<textarea name="" rows="" cols="" style="height: 80px;width: 300px;border-radius: 6px;" id="activity-rule"></textarea>
......
......@@ -19,12 +19,20 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
redEnvelope.isSubmitId=1;//编辑活动的话 提交活动id
redEnvelope.activityId=$(this).attr ("data-id");
redEnvelope.getActivityDetails($(this).attr ("data-id"));
if($('input[name="return_action"]').val() == 0){
$('.confirm-commission').html('自己的订单确认分佣');
}else{
$('.confirm-commission').html('邀请的人的订单确认分佣');
}
});
$(document).on('click', '.add-activity', function(e) {
var _this = $(this);
e.preventDefault();
e.stopPropagation();
redEnvelope.isSubmitId=0;//新增活动的话 不提交活动id
document.getElementById("form_reset").reset();
});
//提交编辑 新增的活动详情
$(document).on('click', '.submit_add', function(e) {
......@@ -32,9 +40,17 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
e.preventDefault();
e.stopPropagation();
redEnvelope.submitAdd();
});
//
$("input[name='return_action']").change(function(){
var _this = $(this);
if(_this.val() == 0){
$('.confirm-commission').html('自己的订单确认分佣');
}else{
$('.confirm-commission').html('邀请的人的订单确认分佣');
}
});
},
......@@ -96,13 +112,13 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
}else{
$("input[name='activity-total'][value='" + 0 + "']").prop("checked", "checked");
}
//
// if(data.data.list[0].available*1 == -1){
// $("input[name='red-total-bag'][value='" + -1 + "']").prop("checked", "checked");
//
// }else{
// $("input[name='red-total-bag'][value='" + 0 + "']").prop("checked", "checked");
// }
//用户可得红包数
if(data.data.list[0].available*1 == -1){
$("input[name='activity-total-bag'][value='" + -1 + "']").prop("checked", "checked");
}else{
$("input[name='activity-total-bag'][value='" + 0 + "']").prop("checked", "checked");
}
}
});
......@@ -113,7 +129,6 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
if(redEnvelope.isSubmitId == 1){
params.id=redEnvelope.activityId;
}
params.title=$('#activity-title').val();
params.return_type=$("input[name='return_type']:checked").val();
params.money= $('#activity-money').val();
......@@ -121,24 +136,27 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
params.activity_start_time= (new Date($('#activity_start_date').val())).getTime()*0.001;
params.activity_end_time= (new Date($('#activity_end_date').val())).getTime()*0.001;
// params.use_period= $('#red-day').val();
//活动发放总次数
if($("input[name='activity-total']:checked").val() == -1){
params.total= -1;
}else{
params.total= $('#activity-total-num').val();
}
//奖励有效期
if($("input[name='award-period']:checked").val() == -1){
params.use_period= -1;
}else{
params.use_period= $('#activity-day').val();
}
// if($("input[name='red-total-bag']:checked").val() == -1){
// params.available= -1;
// }else{
// params.available= $('#red-bag-num').val();
//
// }
//用户可得红包数
if($("input[name='activity-total-bag']:checked").val() == -1){
params.available= -1;
}else{
params.available= $('#activity-bag-num').val();
}
params.activity_rule= $('#activity-rule').val();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment