|
|
@ -2,16 +2,21 @@
|
|
|
|
<div style="padding-top: 10px">
|
|
|
|
<div style="padding-top: 10px">
|
|
|
|
<%= hidden_field_tag(:friendly_id, @friendly_id) %>
|
|
|
|
<%= hidden_field_tag(:friendly_id, @friendly_id) %>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <div class="showPanel" id="payTypeLine" NavShow>-->
|
|
|
|
<% if @test_wxpay %>
|
|
|
|
|
|
|
|
<div class="showPanel" id="payTypeLine" NavShow>
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
<div class="showPanel" id="payTypeLine">
|
|
|
|
<div class="showPanel" id="payTypeLine">
|
|
|
|
<!-- <p class="clearfix pr">-->
|
|
|
|
<% end %>
|
|
|
|
<!-- <label>支付方式</label>-->
|
|
|
|
<p class="clearfix pr">
|
|
|
|
<!-- <span class="mr5" style="margin-right: 24px;" id="payTypeName"><%#= @training.training_payinfo.pay_type.to_i == 3 ? "线下支付" : "微信支付" %></span>-->
|
|
|
|
<label>支付方式</label>
|
|
|
|
<!-- <span class="mr5" style="margin-right: 24px;">线下支付</span>-->
|
|
|
|
<% if @test_wxpay %>
|
|
|
|
<!-- <i class="iconfont icon-gengduo1 rightArrow" style="color: #323232;right: 4px"></i>-->
|
|
|
|
<span class="mr5" style="margin-right: 24px;" id="payTypeName"><%= @training.training_payinfo.pay_type.to_i == 3 ? "线下支付" : "微信支付" %></span>
|
|
|
|
<!-- </p>-->
|
|
|
|
<% else %>
|
|
|
|
<!-- <div class="<%#= @training.training_payinfo.pay_type.to_i == 3 ? "" : "none" %> mt5" id="payInfos">-->
|
|
|
|
<span class="mr5" style="margin-right: 24px;">线下支付</span>
|
|
|
|
<div class="mt5" id="payInfos">
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<i class="iconfont icon-gengduo1 rightArrow" style="color: #323232;right: 4px"></i>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div class="<%= @training.training_payinfo.pay_type.to_i == 3 ? "" : "none" %> mt5" id="payInfos">
|
|
|
|
<div class="payInfo df">
|
|
|
|
<div class="payInfo df">
|
|
|
|
<span class="fl accountIcon">
|
|
|
|
<span class="fl accountIcon">
|
|
|
|
<i class="iconfont icon-yinhangqia blue"></i>
|
|
|
|
<i class="iconfont icon-yinhangqia blue"></i>
|
|
|
@ -60,10 +65,13 @@
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
<p>备注</p>
|
|
|
|
<p>备注</p>
|
|
|
|
<textarea class="remarkAccount" name="info" id="info" placeholder="请您在此输入您的留言"><%= @training.training_payinfo.info %></textarea>
|
|
|
|
<textarea class="remarkAccount" name="info" id="info" placeholder="请您在此输入您的留言"><%= @training.training_payinfo.info %></textarea>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="infoBar mb10 pay-image <%= @training.training_payinfo.pay_type.to_i == 3 ? "" : "none" %>">
|
|
|
|
<p>上传转账凭证</p>
|
|
|
|
<p>上传转账凭证</p>
|
|
|
|
<!--图片上传-->
|
|
|
|
<!--图片上传-->
|
|
|
|
<%= render :partial => 'upload_img', :locals => {:training => @training} %>
|
|
|
|
<%= render :partial => 'upload_img', :locals => {:training => @training} %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
<p>费用明细
|
|
|
|
<p>费用明细
|
|
|
|
<% if @training.training_type == 3 %>
|
|
|
|
<% if @training.training_type == 3 %>
|
|
|
@ -196,7 +204,7 @@
|
|
|
|
})
|
|
|
|
})
|
|
|
|
//立即支付
|
|
|
|
//立即支付
|
|
|
|
$('#payBtn').on('click', function () {
|
|
|
|
$('#payBtn').on('click', function () {
|
|
|
|
if(!checkBillInfo()){ return }
|
|
|
|
if(!checkBillInfo()){ return }
|
|
|
|
|
|
|
|
|
|
|
|
var postData = $('form').serialize();
|
|
|
|
var postData = $('form').serialize();
|
|
|
|
postData += '&js=true'
|
|
|
|
postData += '&js=true'
|
|
|
@ -228,7 +236,7 @@
|
|
|
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
|
setTimeout(function () {
|
|
|
|
setTimeout(function () {
|
|
|
|
window.location.href = "/trainings/<%= @tag_id %>/result";
|
|
|
|
window.location.href = "/trainings/<%= @friendly_id %>/result";
|
|
|
|
}, 500);
|
|
|
|
}, 500);
|
|
|
|
} else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
|
|
|
|
} else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
|
|
|
|
|
|
|
|
|
|
|
@ -358,14 +366,14 @@
|
|
|
|
$("#payTypeName").html($(this).html().trim());
|
|
|
|
$("#payTypeName").html($(this).html().trim());
|
|
|
|
console.log($(this).index());
|
|
|
|
console.log($(this).index());
|
|
|
|
if ($(this).index() == 0) { //微信支付
|
|
|
|
if ($(this).index() == 0) { //微信支付
|
|
|
|
$("#payInfos,#sendPhoto").addClass("none");
|
|
|
|
$("#payInfos,.pay-image").addClass("none");
|
|
|
|
//切换显示按钮
|
|
|
|
//切换显示按钮
|
|
|
|
$("#offlinePaySubmitBtn").addClass("none");
|
|
|
|
$("#offlinePaySubmitBtn").addClass("none");
|
|
|
|
$("#paySubmitBtn").removeClass("none");
|
|
|
|
$("#paySubmitBtn").removeClass("none");
|
|
|
|
|
|
|
|
|
|
|
|
$('#pay_type').val("1");
|
|
|
|
$('#pay_type').val("1");
|
|
|
|
} else { //线下支付
|
|
|
|
} else { //线下支付
|
|
|
|
$("#payInfos,#sendPhoto").removeClass("none");
|
|
|
|
$("#payInfos,.pay-image").removeClass("none");
|
|
|
|
//切换显示按钮
|
|
|
|
//切换显示按钮
|
|
|
|
$("#offlinePaySubmitBtn").removeClass("none");
|
|
|
|
$("#offlinePaySubmitBtn").removeClass("none");
|
|
|
|
$("#paySubmitBtn").addClass("none");
|
|
|
|
$("#paySubmitBtn").addClass("none");
|
|
|
|