Merge branch 'dev_trainings' into develop

dev_trainings
p31729568 6 years ago
commit f84cfd45f0

@ -173,6 +173,9 @@ class TrainingsController < ApplicationController
if training_info.pay_type.to_i == TrainingPayinfo::PayType_Wechat
training_info.status = TrainingPayinfo::Status_None
elsif params[:offline_later_pay].to_s == 'true'
# 线下支付-稍后支付
training_info.status = TrainingPayinfo::Status_None
else
training_info.status = TrainingPayinfo::Status_Wait
end
@ -197,6 +200,7 @@ class TrainingsController < ApplicationController
attachment = Attachment.create!(file: params[:image], author: User.first)
training_payinfo = @training.training_payinfo
training_payinfo.attachment = attachment
training_payinfo.status = TrainingPayinfo::Status_Wait if training_payinfo.status == TrainingPayinfo::Status_None
training_payinfo.save!
render json: {status: 0}
end

@ -1,6 +1,8 @@
<form action="/trainings/update_payinfo" method="post" accept-charset="UTF-8" enctype="multipart/form-data">
<div style="padding-top: 10px">
<%= hidden_field_tag(:tag_id, params[:id]) %>
<%= hidden_field_tag(:offline_later_pay, 'false') %>
<!-- <div class="showPanel" id="payTypeLine" NavShow>-->
<div class="showPanel" id="payTypeLine">
<p class="clearfix pr">
@ -77,7 +79,7 @@
</div>
<p style="height: 44px;"></p>
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i == 1 ? "none" : "" %>" id="offlinePaySubmitBtn">
<a href="<%= enroll_training_path(id: @tag_id) %>" class="leftbtn">稍后支付</a>
<a href="javascript:void(0)" class="leftbtn" id="laterSubmitFormBtn">稍后支付</a>
<a href="javascript:void(0)" class="rightbtn" id="submitFormBtn">立即支付</a>
</div>
@ -235,6 +237,14 @@
}
$('form').submit();
});
$('#laterSubmitFormBtn').on('click', function () {
if($("#billDemand").attr("status")==2){
$(".billInput").val('');
}
$('#offline_later_pay').val('true');
$('form').submit();
});
//上传头像
InitPhoto();

Loading…
Cancel
Save