Skip to content

Commit

Permalink
payment pendings
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Jan 27, 2025
1 parent 6df0076 commit e2a8e09
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<%= form_with theme: nil, scope: 'batch', url: { action: 'payment_confirm' }, skip_default_ids: true do |f| %>
<% @order.payments.select(&->(i){ i.is_a?(Trade::WalletPayment) }).each do |payment| %>
<%= f.fields '', model: payment, skip_default_ids: true do |df| %>
<%= df.hidden_field :wallet_id %>
<%= df.hidden_field :type %>
<%= df.fields :payment_orders do |ef| %>
<%= ef.hidden_field :payment_amount %>
<%= ef.hidden_field :order_amount %>
<%= ef.hidden_field :state, value: 'confirmed' %>
<% end %>
<% end %>
<% end %>
<%= f.submit '确认', class: 'button is-fullwidth is-success' %>
<% end %>
17 changes: 3 additions & 14 deletions app/views/trade/my/orders/_payment_pending/_pending_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
<%= form_with theme: nil, scope: 'batch', url: { action: 'payment_confirm' }, skip_default_ids: true do |f| %>
<% @order.payments.select(&->(i){ i.is_a?(Trade::WalletPayment) }).each do |payment| %>
<%= f.fields '', model: payment, skip_default_ids: true do |df| %>
<%= df.hidden_field :wallet_id %>
<%= df.hidden_field :type %>
<%= df.fields :payment_orders do |ef| %>
<%= ef.hidden_field :payment_amount %>
<%= ef.hidden_field :order_amount %>
<%= ef.hidden_field :state, value: 'confirmed' %>
<% end %>
<% end %>
<% end %>
<%= f.submit '确认', class: 'button is-fullwidth is-success' %>
<% end %>
<%= form_with theme: 'modal_line', model: @order, url: { action: 'payment_confirm' }, method: :post, skip_default_ids: true do |f| %>
<%= render partial: 'payment_types_form', locals: { f: f } %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= turbo_stream.update 'weui-tab__panel', partial: 'payment_pending' %>
2 changes: 1 addition & 1 deletion app/views/trade/my/orders/payment_pending.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= turbo_stream.update 'weui-tab__panel', partial: 'payment_pending' %>
<%= turbo_stream.append 'body', partial: 'pending_form', layout: 'modal_form' %>

0 comments on commit e2a8e09

Please sign in to comment.