支付折扣

dev_trainings
caishi 6 years ago
parent 46450f2068
commit 335988a0b1

@ -49,19 +49,23 @@
<%= render :partial => 'upload_img', :locals => {:training => @training} %>
</div>
<div class="infoBar mb10">
<p>费用明细</p>
<p class="break-word justify moneyDetail">大数据培训缴费</p>
<div style="text-align: right">
<p class="inline">
<input type="hidden" name="enlistN" value="<%= @training.training_payinfo.num %>"/>
<span class="fl mr10 font-12"><span id="enlistNum"><%= @training.training_payinfo.num %></span>人</span>
<span class="fl font-16">
<a href="javascript:void(0)" class="minusNum"><i class="iconfont icon-default sky_blue font-18"></i></a>
<span class="red mr5">¥<span id="enlistMoney"><%= @pay_fee * @training.training_payinfo.num %></span></span>
<a href="javascript:void(0)" class="plusNum"><i class="iconfont icon-roundaddfill blue font-18"></i></a>
<p>费用明细<span class="color-orange" id="percentPay">3人及以上8折优惠)</span></p>
<p class="break-word justify moneyDetail">含会议注册费、场地费、培训费、教材资料费、餐费、专家差率费等</p>
<p class="clearfix">
<input type="hidden" name="enlistNum" value="1"/>
<input type="hidden" name="enlistMoney" value="3000"/>
<span class="fl red mr5 font-16">¥<span id="enlistM">3000</span></span>
<span class="lastPrice"></span>
<span class="fr font-16">
<a href="javascript:void(0)" class="minusNum" onclick="minusNum(this)">
<i class="iconfont icon-default sky_blue font-18"></i>
</a>
<span class="mr5 ml5 font-14"><span id="enlistN">1</span>人</span>
<a href="javascript:void(0)" class="plusNum" onclick="plusNum(this)">
<i class="iconfont icon-roundaddfill blue font-18"></i>
</a>
</span>
</p>
</div>
</p>
</div>
<p style="height: 44px;"></p>
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i ==3 ? "" : "none" %>" id="offlinePaySubmitBtn">
@ -227,35 +231,56 @@
//上传头像
InitPhoto();
//加减报名人数
$(".minusNum").click(function(){
var num=parseInt($("#enlistNum").html());
var money=parseFloat($("#enlistMoney").html()).toFixed(2);
if(num>1){
money=parseFloat(parseFloat(money)-parseFloat(money)/parseFloat(num)).toFixed(2);
num=num-1;
$("#enlistNum").html(num);
$("#enlistMoney").html(money);
if(num==1){
$(".icon-default").removeClass("blue").addClass("sky_blue");
}
$("input[name='enlistN']").val(num);
})
//加减报名人数
function minusNum(item){
var num=parseInt($("#enlistN").html());
var money=parseFloat(3000).toFixed(2);
var percent=$("#percentPay");
if(num>1){
num=num-1;
if(num == 1){
$(".icon-default").removeClass("blue").addClass("sky_blue");
}
})
$(".plusNum").click(function(){
var num=parseInt($("#enlistNum").html());
if(num==1){
$(".icon-default").removeClass("sky_blue").addClass("blue");
money=parseFloat(parseFloat(money) *num).toFixed(2);
if($(percent).length>0 && num>2){
$(".lastPrice").html("¥"+ money);
money = parseFloat(parseFloat(money) *0.8);
}else{
$(".lastPrice").html("");
}
var money=parseFloat($("#enlistMoney").html()).toFixed(2);
money=parseFloat(parseFloat(money)+parseFloat(money)/parseFloat(num)).toFixed(2);
num=num+1;
$("#enlistN").html(num);
$("#enlistM").html(money);
$("#enlistNum").val(num);
$("#enlistMoney").val(money);
$("#enlistNum").html(num);
$("#enlistMoney").html(money);
$("input[name='enlistN']").val(num);
})
})
}
}
function plusNum(item){
var num=parseInt($("#enlistN").html());
var money=parseFloat(3000).toFixed(2);
var percent=$("#percentPay");
num=num+1;
if(num > 1){
$(".icon-default").removeClass("sky_blue").addClass("blue");
}
money=parseFloat(parseFloat(money) *num).toFixed(2);
if($(percent).length>0 && num>2){
$(".lastPrice").html("¥"+ money);
money = parseFloat(parseFloat(money) * 0.8).toFixed(2);
}else{
$(".lastPrice").html("");
}
$("#enlistN").html(num);
$("#enlistM").html(money);
$("#enlistNum").val(num);
$("#enlistMoney").val(money);
$("input[name='enlistNum']").val(num);
}
//页面加载时,初始化发票类型
function InitBill(userInfo){
var index=2;

@ -20,12 +20,13 @@ a{text-decoration: none}
.flex1{flex: 1}
li{list-style-type: none;}
.color-orange{color: #FC682D!important;}
.mb5{margin-bottom: 5px}.mb10{margin-bottom: 10px!important;}
.mt5{margin-top: 5px}
.mr5{margin-right: 5px}
.ml10{margin-left: 10px;}
.ml5{margin-left: 5px;}.ml10{margin-left: 10px;}
.mr10{margin-right: 10px;}
.line20{line-height: 20px;}
@ -240,6 +241,7 @@ input[type='text'].right_input{
.billInput.nullVal{border:1px solid #DD1717;}
.meetInfo{color: #4CACFF;}
.enrollNum{margin:10px 15px;font-size: 1.4rem;}
.lastPrice{color: #bfbfbf;font-size: 1.2px;text-decoration: line-through;margin-left: 5px;}
/*上传图片*/
.weui-uploader__bd {position: relative;width: 100px;height: 100px;}
.weui-uploader__files {list-style: none;}

Loading…
Cancel
Save