rails_trade 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +165 -0
- data/README.md +47 -0
- data/Rakefile +37 -0
- data/app/assets/config/rails_trade_manifest.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/index.js +15 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/overdue.js +15 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/create.js +3 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/index.js +80 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/cart_items/only.js +45 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/orders/new.js +29 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/edit.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/new.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/unverified.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payments/index.js +0 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/payments/new.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_buyers/edit.js +31 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_buyers/new.js +31 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_goods/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/edit.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/new.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/edit.js +2 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/index.js +1 -0
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/new.js +4 -0
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/create.js +3 -0
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/index.js +65 -0
- data/app/controllers/areas_controller.rb +18 -0
- data/app/controllers/buyers_controller.rb +8 -0
- data/app/controllers/concerns/controller_order_types.rb +92 -0
- data/app/controllers/goods_controller.rb +90 -0
- data/app/controllers/payments_controller.rb +50 -0
- data/app/controllers/providers_controller.rb +8 -0
- data/app/controllers/the_trade_admin/addresses_controller.rb +75 -0
- data/app/controllers/the_trade_admin/areas_controller.rb +50 -0
- data/app/controllers/the_trade_admin/base_controller.rb +5 -0
- data/app/controllers/the_trade_admin/buyers_controller.rb +37 -0
- data/app/controllers/the_trade_admin/cart_item_serves_controller.rb +63 -0
- data/app/controllers/the_trade_admin/cart_items_controller.rb +123 -0
- data/app/controllers/the_trade_admin/order_payments_controller.rb +52 -0
- data/app/controllers/the_trade_admin/orders_controller.rb +103 -0
- data/app/controllers/the_trade_admin/payment_methods_controller.rb +111 -0
- data/app/controllers/the_trade_admin/payment_orders_controller.rb +56 -0
- data/app/controllers/the_trade_admin/payment_references_controller.rb +54 -0
- data/app/controllers/the_trade_admin/payment_strategies_controller.rb +50 -0
- data/app/controllers/the_trade_admin/payments_controller.rb +89 -0
- data/app/controllers/the_trade_admin/produces_controller.rb +66 -0
- data/app/controllers/the_trade_admin/promote_buyers_controller.rb +39 -0
- data/app/controllers/the_trade_admin/promote_charges_controller.rb +62 -0
- data/app/controllers/the_trade_admin/promote_goods_controller.rb +50 -0
- data/app/controllers/the_trade_admin/promotes_controller.rb +105 -0
- data/app/controllers/the_trade_admin/providers_controller.rb +121 -0
- data/app/controllers/the_trade_admin/refunds_controller.rb +60 -0
- data/app/controllers/the_trade_admin/serve_charges_controller.rb +67 -0
- data/app/controllers/the_trade_admin/serves_controller.rb +107 -0
- data/app/controllers/the_trade_my/addresses_controller.rb +50 -0
- data/app/controllers/the_trade_my/base_controller.rb +13 -0
- data/app/controllers/the_trade_my/buyers_controller.rb +35 -0
- data/app/controllers/the_trade_my/cart_items_controller.rb +71 -0
- data/app/controllers/the_trade_my/order_items_controller.rb +49 -0
- data/app/controllers/the_trade_my/orders_controller.rb +161 -0
- data/app/controllers/the_trade_my/payment_methods_controller.rb +76 -0
- data/app/controllers/the_trade_my/providers_controller.rb +44 -0
- data/app/models/rails_trade/address.rb +14 -0
- data/app/models/rails_trade/area.rb +65 -0
- data/app/models/rails_trade/cart_item.rb +185 -0
- data/app/models/rails_trade/cart_item_serve.rb +16 -0
- data/app/models/rails_trade/concerns/good_able.rb +63 -0
- data/app/models/rails_trade/concerns/order_able.rb +48 -0
- data/app/models/rails_trade/concerns/promote_fee.rb +54 -0
- data/app/models/rails_trade/concerns/serve_fee.rb +41 -0
- data/app/models/rails_trade/concerns/summary_service.rb +67 -0
- data/app/models/rails_trade/concerns/the_payment.rb +88 -0
- data/app/models/rails_trade/concerns/the_refund.rb +36 -0
- data/app/models/rails_trade/concerns/the_trade_buyer.rb +50 -0
- data/app/models/rails_trade/concerns/the_trade_user.rb +23 -0
- data/app/models/rails_trade/good_partner.rb +8 -0
- data/app/models/rails_trade/good_produce.rb +14 -0
- data/app/models/rails_trade/order.rb +111 -0
- data/app/models/rails_trade/order_item.rb +88 -0
- data/app/models/rails_trade/order_promote.rb +23 -0
- data/app/models/rails_trade/order_serve.rb +23 -0
- data/app/models/rails_trade/order_shipment.rb +10 -0
- data/app/models/rails_trade/payment.rb +135 -0
- data/app/models/rails_trade/payment_interface/payment_interface_base.rb +8 -0
- data/app/models/rails_trade/payment_interface/the_alipay.rb +49 -0
- data/app/models/rails_trade/payment_interface/the_paypal.rb +103 -0
- data/app/models/rails_trade/payment_interface/the_stripe.rb +73 -0
- data/app/models/rails_trade/payment_interface/the_wxpay.rb +56 -0
- data/app/models/rails_trade/payment_method.rb +57 -0
- data/app/models/rails_trade/payment_methods/alipay_method.rb +7 -0
- data/app/models/rails_trade/payment_methods/bank_method.rb +7 -0
- data/app/models/rails_trade/payment_methods/stripe_method.rb +57 -0
- data/app/models/rails_trade/payment_order.rb +75 -0
- data/app/models/rails_trade/payment_reference.rb +15 -0
- data/app/models/rails_trade/payment_strategy.rb +16 -0
- data/app/models/rails_trade/payments/alipay_payment.rb +12 -0
- data/app/models/rails_trade/payments/bank_payment.rb +15 -0
- data/app/models/rails_trade/payments/hand_payment.rb +13 -0
- data/app/models/rails_trade/payments/paypal_payment.rb +8 -0
- data/app/models/rails_trade/payments/stripe_payment.rb +7 -0
- data/app/models/rails_trade/payments/wxpay_payment.rb +14 -0
- data/app/models/rails_trade/produce.rb +18 -0
- data/app/models/rails_trade/promote.rb +40 -0
- data/app/models/rails_trade/promote_buyer.rb +9 -0
- data/app/models/rails_trade/promote_charge.rb +17 -0
- data/app/models/rails_trade/promote_charges/single_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_charges/total_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_good.rb +9 -0
- data/app/models/rails_trade/promotes/amount_promote.rb +4 -0
- data/app/models/rails_trade/promotes/number_promote.rb +4 -0
- data/app/models/rails_trade/provider.rb +25 -0
- data/app/models/rails_trade/refund.rb +63 -0
- data/app/models/rails_trade/refunds/alipay_refund.rb +33 -0
- data/app/models/rails_trade/refunds/bank_refund.rb +5 -0
- data/app/models/rails_trade/refunds/hand_refund.rb +5 -0
- data/app/models/rails_trade/refunds/paypal_refund.rb +32 -0
- data/app/models/rails_trade/refunds/stripe_refund.rb +26 -0
- data/app/models/rails_trade/refunds/wxpay_refund.rb +40 -0
- data/app/models/rails_trade/serve.rb +44 -0
- data/app/models/rails_trade/serve_charge.rb +37 -0
- data/app/models/rails_trade/serve_charges/single_serve_charge.rb +7 -0
- data/app/models/rails_trade/serve_charges/total_serve_charge.rb +7 -0
- data/app/models/rails_trade/serve_good.rb +9 -0
- data/app/models/rails_trade/serves/number_serve.rb +4 -0
- data/app/models/rails_trade/serves/quantity_serve.rb +4 -0
- data/app/models/rails_trade/shipment.rb +8 -0
- data/app/views/buyers/_show.html.erb +7 -0
- data/app/views/buyers/show.js.erb +1 -0
- data/app/views/goods/_choose.html.erb +36 -0
- data/app/views/goods/_good.html.erb +17 -0
- data/app/views/goods/_good_item.html.erb +17 -0
- data/app/views/goods/_nav.html.erb +18 -0
- data/app/views/goods/_search.html.erb +6 -0
- data/app/views/goods/index.html.erb +34 -0
- data/app/views/goods/index/_product.html.erb +14 -0
- data/app/views/goods/item.html.erb +47 -0
- data/app/views/goods/produce.html.erb +48 -0
- data/app/views/goods/show.html.erb +2 -0
- data/app/views/goods/show/_basic.html.erb +23 -0
- data/app/views/goods/show/_carousel.html.erb +35 -0
- data/app/views/goods/show/_items.html.erb +32 -0
- data/app/views/goods/show/_sales.html.erb +17 -0
- data/app/views/goods/show/_side.html.erb +19 -0
- data/app/views/goods/taxon/_breadcrumb.html.erb +8 -0
- data/app/views/goods/taxon/_nav.html.erb +19 -0
- data/app/views/goods/taxon/_nav_.html.erb +18 -0
- data/app/views/goods/taxon/_nav_last.html.erb +19 -0
- data/app/views/layouts/rails_trade_admin/base.html.erb +25 -0
- data/app/views/layouts/rails_trade_my/base.html.erb +28 -0
- data/app/views/rails_trade_admin/addresses/_address.html.erb +24 -0
- data/app/views/rails_trade_admin/addresses/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/addresses/_form.html.erb +23 -0
- data/app/views/rails_trade_admin/addresses/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/addresses/create.js.erb +2 -0
- data/app/views/rails_trade_admin/addresses/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/addresses/edit.js.erb +39 -0
- data/app/views/rails_trade_admin/addresses/index.html.erb +41 -0
- data/app/views/rails_trade_admin/addresses/new.js.erb +52 -0
- data/app/views/rails_trade_admin/addresses/show.html.erb +4 -0
- data/app/views/rails_trade_admin/addresses/update.js.erb +2 -0
- data/app/views/rails_trade_admin/areas/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/areas/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/areas/index.html.erb +43 -0
- data/app/views/rails_trade_admin/areas/new.html.erb +11 -0
- data/app/views/rails_trade_admin/areas/show.html.erb +1 -0
- data/app/views/rails_trade_admin/base/_nav.html.erb +24 -0
- data/app/views/rails_trade_admin/base/_nav_bar.html.erb +23 -0
- data/app/views/rails_trade_admin/base/_nav_payment.html.erb +25 -0
- data/app/views/rails_trade_admin/buyers/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/buyers/_menu.html.erb +5 -0
- data/app/views/rails_trade_admin/buyers/_search_form.html.erb +11 -0
- data/app/views/rails_trade_admin/buyers/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/buyers/index.html.erb +46 -0
- data/app/views/rails_trade_admin/buyers/new.html.erb +5 -0
- data/app/views/rails_trade_admin/buyers/orders.html.erb +134 -0
- data/app/views/rails_trade_admin/buyers/overdue.html.erb +49 -0
- data/app/views/rails_trade_admin/buyers/show.html.erb +4 -0
- data/app/views/rails_trade_admin/cart_item_serves/_check.html.erb +12 -0
- data/app/views/rails_trade_admin/cart_item_serves/_index.html.erb +37 -0
- data/app/views/rails_trade_admin/cart_item_serves/_new.html.erb +14 -0
- data/app/views/rails_trade_admin/cart_item_serves/_serve.html.erb +16 -0
- data/app/views/rails_trade_admin/cart_item_serves/_single.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_item_serves/_single_table.html.erb +29 -0
- data/app/views/rails_trade_admin/cart_item_serves/_total.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_item_serves/_total_table.html.erb +26 -0
- data/app/views/rails_trade_admin/cart_item_serves/add.js.erb +47 -0
- data/app/views/rails_trade_admin/cart_item_serves/create.js.erb +3 -0
- data/app/views/rails_trade_admin/cart_item_serves/destroy.js.erb +50 -0
- data/app/views/rails_trade_admin/cart_item_serves/index.js.erb +50 -0
- data/app/views/rails_trade_admin/cart_item_serves/new.js.erb +5 -0
- data/app/views/rails_trade_admin/cart_item_serves/single.js.erb +55 -0
- data/app/views/rails_trade_admin/cart_item_serves/total.js.erb +55 -0
- data/app/views/rails_trade_admin/cart_items/_additions.html.erb +20 -0
- data/app/views/rails_trade_admin/cart_items/_filter.html.erb +15 -0
- data/app/views/rails_trade_admin/cart_items/_good_price.html.erb +10 -0
- data/app/views/rails_trade_admin/cart_items/_order_price.html.erb +27 -0
- data/app/views/rails_trade_admin/cart_items/_retail_price.html.erb +4 -0
- data/app/views/rails_trade_admin/cart_items/_single_price.html.erb +28 -0
- data/app/views/rails_trade_admin/cart_items/_total_price.html.erb +9 -0
- data/app/views/rails_trade_admin/cart_items/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/cart_items/error.html.erb +3 -0
- data/app/views/rails_trade_admin/cart_items/index.html.erb +104 -0
- data/app/views/rails_trade_admin/cart_items/only.html.erb +72 -0
- data/app/views/rails_trade_admin/cart_items/total.js.erb +11 -0
- data/app/views/rails_trade_admin/cart_items/update.js.erb +11 -0
- data/app/views/rails_trade_admin/goods/_form.html.erb +7 -0
- data/app/views/rails_trade_admin/goods/_item.html.erb +6 -0
- data/app/views/rails_trade_admin/goods/_new.html.erb +11 -0
- data/app/views/rails_trade_admin/goods/_show.html.erb +24 -0
- data/app/views/rails_trade_admin/goods/_show_tr.html.erb +24 -0
- data/app/views/rails_trade_admin/goods/create.js.erb +2 -0
- data/app/views/rails_trade_admin/goods/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/goods/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/goods/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/goods/edit_items.html.erb +43 -0
- data/app/views/rails_trade_admin/goods/edit_pic.html.erb +32 -0
- data/app/views/rails_trade_admin/goods/edit_promote.html.erb +64 -0
- data/app/views/rails_trade_admin/goods/index.html.erb +32 -0
- data/app/views/rails_trade_admin/goods/new.html.erb +14 -0
- data/app/views/rails_trade_admin/goods/new.js.erb +8 -0
- data/app/views/rails_trade_admin/goods/show.js.erb +5 -0
- data/app/views/rails_trade_admin/goods/update.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/_index.html.erb +44 -0
- data/app/views/rails_trade_admin/order_payments/_new.html.erb +44 -0
- data/app/views/rails_trade_admin/order_payments/_payment_orders.html.erb +17 -0
- data/app/views/rails_trade_admin/order_payments/_payments.html.erb +19 -0
- data/app/views/rails_trade_admin/order_payments/create.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/create_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/order_payments/destroy.js.erb +2 -0
- data/app/views/rails_trade_admin/order_payments/index.js.erb +8 -0
- data/app/views/rails_trade_admin/order_payments/new.js.erb +8 -0
- data/app/views/rails_trade_admin/orders/_addresses.html.erb +36 -0
- data/app/views/rails_trade_admin/orders/_filter.html.erb +20 -0
- data/app/views/rails_trade_admin/orders/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/orders/_invoice_addresses.html.erb +36 -0
- data/app/views/rails_trade_admin/orders/_item.html.erb +10 -0
- data/app/views/rails_trade_admin/orders/_new_items.html.erb +70 -0
- data/app/views/rails_trade_admin/orders/_search_form.html.erb +7 -0
- data/app/views/rails_trade_admin/orders/edit.html.erb +1 -0
- data/app/views/rails_trade_admin/orders/index.html.erb +61 -0
- data/app/views/rails_trade_admin/orders/new.html.erb +23 -0
- data/app/views/rails_trade_admin/orders/payments.html.erb +50 -0
- data/app/views/rails_trade_admin/orders/refresh.js.erb +7 -0
- data/app/views/rails_trade_admin/orders/show.html.erb +89 -0
- data/app/views/rails_trade_admin/payment_methods/_edit.html.erb +6 -0
- data/app/views/rails_trade_admin/payment_methods/_form.html.erb +5 -0
- data/app/views/rails_trade_admin/payment_methods/_index_layout.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/payment_methods/_payment_method.html.erb +25 -0
- data/app/views/rails_trade_admin/payment_methods/_search_form.html.erb +22 -0
- data/app/views/rails_trade_admin/payment_methods/create.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_methods/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_methods/edit.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/payment_methods/index.html.erb +23 -0
- data/app/views/rails_trade_admin/payment_methods/mine.html.erb +23 -0
- data/app/views/rails_trade_admin/payment_methods/new.html.erb +15 -0
- data/app/views/rails_trade_admin/payment_methods/new.js.erb +7 -0
- data/app/views/rails_trade_admin/payment_methods/unverified.html.erb +60 -0
- data/app/views/rails_trade_admin/payment_methods/update.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/_index.html.erb +31 -0
- data/app/views/rails_trade_admin/payment_orders/_new.html.erb +24 -0
- data/app/views/rails_trade_admin/payment_orders/_orders.html.erb +27 -0
- data/app/views/rails_trade_admin/payment_orders/cancel.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/create.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/create_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_orders/new.js.erb +6 -0
- data/app/views/rails_trade_admin/payment_orders/raise_fail.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_orders/update.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_orders/update_fail.js.erb +2 -0
- data/app/views/rails_trade_admin/payment_references/_form.html.erb +20 -0
- data/app/views/rails_trade_admin/payment_references/_new.html.erb +11 -0
- data/app/views/rails_trade_admin/payment_references/destroy.js.erb +1 -0
- data/app/views/rails_trade_admin/payment_references/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/payment_references/index.html.erb +25 -0
- data/app/views/rails_trade_admin/payment_references/new.js.erb +8 -0
- data/app/views/rails_trade_admin/payment_references/show.html.erb +4 -0
- data/app/views/rails_trade_admin/payment_strategies/_form.html.erb +5 -0
- data/app/views/rails_trade_admin/payment_strategies/edit.html.erb +13 -0
- data/app/views/rails_trade_admin/payment_strategies/index.html.erb +37 -0
- data/app/views/rails_trade_admin/payment_strategies/new.html.erb +13 -0
- data/app/views/rails_trade_admin/payments/_form.html.erb +12 -0
- data/app/views/rails_trade_admin/payments/_item.html.erb +49 -0
- data/app/views/rails_trade_admin/payments/_search_form.html.erb +15 -0
- data/app/views/rails_trade_admin/payments/analyze.js.erb +12 -0
- data/app/views/rails_trade_admin/payments/dashboard.html.erb +4 -0
- data/app/views/rails_trade_admin/payments/edit.html.erb +15 -0
- data/app/views/rails_trade_admin/payments/index.html.erb +60 -0
- data/app/views/rails_trade_admin/payments/new.html.erb +17 -0
- data/app/views/rails_trade_admin/payments/show.html.erb +4 -0
- data/app/views/rails_trade_admin/promote_buyers/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/promote_buyers/_promote_buyer.json.jbuilder +2 -0
- data/app/views/rails_trade_admin/promote_buyers/edit.html.erb +14 -0
- data/app/views/rails_trade_admin/promote_buyers/index.html.erb +42 -0
- data/app/views/rails_trade_admin/promote_buyers/index.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_buyers/new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_buyers/show.html.erb +0 -0
- data/app/views/rails_trade_admin/promote_buyers/show.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_charges/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_charges/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/promote_charges/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_charges/_search_form.html.erb +9 -0
- data/app/views/rails_trade_admin/promote_charges/edit.js.erb +8 -0
- data/app/views/rails_trade_admin/promote_charges/index.html.erb +49 -0
- data/app/views/rails_trade_admin/promote_charges/new.js.erb +8 -0
- data/app/views/rails_trade_admin/promote_goods/_form.html.erb +4 -0
- data/app/views/rails_trade_admin/promote_goods/_promote_good.json.jbuilder +2 -0
- data/app/views/rails_trade_admin/promote_goods/edit.html.erb +14 -0
- data/app/views/rails_trade_admin/promote_goods/index.html.erb +37 -0
- data/app/views/rails_trade_admin/promote_goods/index.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promote_goods/new.html.erb +13 -0
- data/app/views/rails_trade_admin/promote_goods/show.html.erb +0 -0
- data/app/views/rails_trade_admin/promote_goods/show.json.jbuilder +1 -0
- data/app/views/rails_trade_admin/promotes/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/edit.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/index.html.erb +65 -0
- data/app/views/rails_trade_admin/promotes/new.html.erb +9 -0
- data/app/views/rails_trade_admin/promotes/show.html.erb +4 -0
- data/app/views/rails_trade_admin/providers/_form.html.erb +6 -0
- data/app/views/rails_trade_admin/providers/_product.html.erb +12 -0
- data/app/views/rails_trade_admin/providers/_side.html.erb +8 -0
- data/app/views/rails_trade_admin/providers/area.html.erb +1 -0
- data/app/views/rails_trade_admin/providers/channel.html.erb +46 -0
- data/app/views/rails_trade_admin/providers/edit.html.erb +16 -0
- data/app/views/rails_trade_admin/providers/index.html.erb +27 -0
- data/app/views/rails_trade_admin/providers/new.html.erb +21 -0
- data/app/views/rails_trade_admin/providers/posts.html.erb +41 -0
- data/app/views/rails_trade_admin/providers/products.html.erb +23 -0
- data/app/views/rails_trade_admin/providers/show.html.erb +60 -0
- data/app/views/rails_trade_admin/refunds/_form.html.erb +17 -0
- data/app/views/rails_trade_admin/refunds/_logs_table.html.erb +33 -0
- data/app/views/rails_trade_admin/refunds/_new.html.erb +18 -0
- data/app/views/rails_trade_admin/refunds/_search_form.html.erb +13 -0
- data/app/views/rails_trade_admin/refunds/edit.html.erb +6 -0
- data/app/views/rails_trade_admin/refunds/index.html.erb +57 -0
- data/app/views/rails_trade_admin/refunds/logs.js.erb +8 -0
- data/app/views/rails_trade_admin/refunds/new.html.erb +5 -0
- data/app/views/rails_trade_admin/refunds/new.js.erb +8 -0
- data/app/views/rails_trade_admin/refunds/show.html.erb +4 -0
- data/app/views/rails_trade_admin/serve_charges/_edit.html.erb +13 -0
- data/app/views/rails_trade_admin/serve_charges/_form.html.erb +10 -0
- data/app/views/rails_trade_admin/serve_charges/_new.html.erb +13 -0
- data/app/views/rails_trade_admin/serve_charges/_search_form.html.erb +10 -0
- data/app/views/rails_trade_admin/serve_charges/edit.js.erb +7 -0
- data/app/views/rails_trade_admin/serve_charges/index.html.erb +56 -0
- data/app/views/rails_trade_admin/serve_charges/new.js.erb +8 -0
- data/app/views/rails_trade_admin/serves/_form.html.erb +9 -0
- data/app/views/rails_trade_admin/serves/edit.html.erb +9 -0
- data/app/views/rails_trade_admin/serves/index.html.erb +80 -0
- data/app/views/rails_trade_admin/serves/new.html.erb +9 -0
- data/app/views/rails_trade_my/addresses/_edit.html.erb +31 -0
- data/app/views/rails_trade_my/addresses/_form.html.erb +23 -0
- data/app/views/rails_trade_my/addresses/_new.html.erb +11 -0
- data/app/views/rails_trade_my/addresses/create.js.erb +2 -0
- data/app/views/rails_trade_my/addresses/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/addresses/edit.js.erb +39 -0
- data/app/views/rails_trade_my/addresses/index.html.erb +44 -0
- data/app/views/rails_trade_my/addresses/new.js.erb +39 -0
- data/app/views/rails_trade_my/addresses/show.html.erb +4 -0
- data/app/views/rails_trade_my/addresses/update.js.erb +2 -0
- data/app/views/rails_trade_my/base/_nav.html.erb +22 -0
- data/app/views/rails_trade_my/buyers/_form.html.erb +5 -0
- data/app/views/rails_trade_my/buyers/edit.html.erb +2 -0
- data/app/views/rails_trade_my/buyers/show.html.erb +21 -0
- data/app/views/rails_trade_my/cart_items/_additions.html.erb +22 -0
- data/app/views/rails_trade_my/cart_items/_single_price.html.erb +6 -0
- data/app/views/rails_trade_my/cart_items/_total_price.html.erb +8 -0
- data/app/views/rails_trade_my/cart_items/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/cart_items/index.html.erb +69 -0
- data/app/views/rails_trade_my/cart_items/total.js.erb +11 -0
- data/app/views/rails_trade_my/cart_items/update.js.erb +8 -0
- data/app/views/rails_trade_my/my/index.html.erb +17 -0
- data/app/views/rails_trade_my/order_items/_form.html.erb +17 -0
- data/app/views/rails_trade_my/order_items/edit.html.erb +6 -0
- data/app/views/rails_trade_my/order_items/index.html.erb +25 -0
- data/app/views/rails_trade_my/order_items/new.html.erb +5 -0
- data/app/views/rails_trade_my/order_items/show.html.erb +8 -0
- data/app/views/rails_trade_my/orders/_date_form.html.erb +23 -0
- data/app/views/rails_trade_my/orders/_edit.html.erb +10 -0
- data/app/views/rails_trade_my/orders/_edit_payment_type.html.erb +13 -0
- data/app/views/rails_trade_my/orders/_form.html.erb +4 -0
- data/app/views/rails_trade_my/orders/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/orders/edit.js.erb +4 -0
- data/app/views/rails_trade_my/orders/edit_payment_type.js.erb +6 -0
- data/app/views/rails_trade_my/orders/fail.html.erb +11 -0
- data/app/views/rails_trade_my/orders/index.html.erb +55 -0
- data/app/views/rails_trade_my/orders/index.json.jbuilder +9 -0
- data/app/views/rails_trade_my/orders/new.html.erb +41 -0
- data/app/views/rails_trade_my/orders/refresh.js.erb +7 -0
- data/app/views/rails_trade_my/orders/show.html.erb +103 -0
- data/app/views/rails_trade_my/orders/success.html.erb +12 -0
- data/app/views/rails_trade_my/orders/update.js.erb +3 -0
- data/app/views/rails_trade_my/orders/update_payment_type.js.erb +3 -0
- data/app/views/rails_trade_my/orders/wxpay_pay.js.erb +16 -0
- data/app/views/rails_trade_my/orders/wxpay_pay_err.js.erb +5 -0
- data/app/views/rails_trade_my/payment_methods/_edit.html.erb +13 -0
- data/app/views/rails_trade_my/payment_methods/_form.html.erb +5 -0
- data/app/views/rails_trade_my/payment_methods/_index.html.erb +25 -0
- data/app/views/rails_trade_my/payment_methods/_item.html.erb +10 -0
- data/app/views/rails_trade_my/payment_methods/_new.html.erb +13 -0
- data/app/views/rails_trade_my/payment_methods/create.js.erb +3 -0
- data/app/views/rails_trade_my/payment_methods/destroy.js.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/edit.js.erb +8 -0
- data/app/views/rails_trade_my/payment_methods/index.html.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/index.js.erb +1 -0
- data/app/views/rails_trade_my/payment_methods/new.js.erb +8 -0
- data/app/views/rails_trade_my/payment_methods/show.html.erb +4 -0
- data/app/views/rails_trade_my/payment_methods/update.js.erb +2 -0
- data/app/views/rails_trade_my/providers/_form.html.erb +5 -0
- data/app/views/rails_trade_my/providers/_provider.html.erb +20 -0
- data/app/views/rails_trade_my/providers/edit.html.erb +2 -0
- data/app/views/rails_trade_my/providers/index.html.erb +12 -0
- data/app/views/rails_trade_my/providers/new.html.erb +10 -0
- data/app/views/rails_trade_my/providers/show.html.erb +13 -0
- data/app/views/rails_trade_my/users/_form.html.erb +17 -0
- data/app/views/rails_trade_my/users/edit.html.erb +44 -0
- data/app/views/rails_trade_my/users/show.html.erb +18 -0
- data/config/locales/en.yml +85 -0
- data/config/locales/zh.yml +75 -0
- data/config/routes.rb +118 -0
- data/db/migrate/20150514135720_create_providers.rb +59 -0
- data/db/migrate/20170601014520_create_payments.rb +52 -0
- data/db/migrate/20170602061859_create_payment_references.rb +12 -0
- data/db/migrate/20170702234123_create_orders.rb +56 -0
- data/db/migrate/20170714080032_create_payment_strategies.rb +77 -0
- data/db/migrate/20171115063702_create_promote_buyers.rb +31 -0
- data/db/schema.rb +94 -0
- data/lib/rails_trade.rb +22 -0
- data/lib/rails_trade/config.rb +12 -0
- data/lib/rails_trade/engine.rb +30 -0
- data/lib/rails_trade/version.rb +3 -0
- data/lib/tasks/the_trade_tasks.rake +4 -0
- metadata +491 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
<div class="">
|
2
|
+
|
3
|
+
<div class="ui top attached menu borderless">
|
4
|
+
<div class="item"><strong>商品列表</strong></div>
|
5
|
+
<div class="right menu">
|
6
|
+
<div class="item"><%= link_to '新建', new_admin_good_path, class: 'ui teal button' %></div>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<table class="ui table">
|
11
|
+
<thead>
|
12
|
+
<tr>
|
13
|
+
<th>ID</th>
|
14
|
+
<th>Name</th>
|
15
|
+
<th>Sku</th>
|
16
|
+
<th>Price</th>
|
17
|
+
<th></th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
|
21
|
+
<% @goods.each do |good| %>
|
22
|
+
<tr>
|
23
|
+
<td><%= good.id %></td>
|
24
|
+
<td><%= good.name %></td>
|
25
|
+
<td><%= good.sku %></td>
|
26
|
+
<td><%= good.price %></td>
|
27
|
+
<td><%= link_to '编辑', edit_admin_good_path(good) %></td>
|
28
|
+
<td><%= link_to '删除', admin_good_path(good), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</table>
|
32
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="three wide column">
|
2
|
+
<%= render 'admin/base/nav' %>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div class="thirteen wide column">
|
6
|
+
<div class="ui breadcrumb">
|
7
|
+
<%= link_to '商品列表', admin_goods_path, class: 'section' %>
|
8
|
+
<div class="divider"> / </div>
|
9
|
+
<div class="active section">新增商品</div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<%= render 'form' %>
|
13
|
+
|
14
|
+
</div>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<div class="ui modal" id="payment_logs">
|
2
|
+
<i class="close icon"></i>
|
3
|
+
<div class="header">
|
4
|
+
<span style="color: #0d71bb">Payment Logs</span>
|
5
|
+
</div>
|
6
|
+
<div class="content">
|
7
|
+
<table class="ui basic red table">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Payment ID</th>
|
11
|
+
<th><%= Payment.human_attribute_name(:type) %></th>
|
12
|
+
<th><%= PaymentOrder.human_attribute_name(:order_amount) %></th>
|
13
|
+
<th><%= PaymentOrder.human_attribute_name(:check_amount) %></th>
|
14
|
+
<th><%= PaymentOrder.human_attribute_name(:created_at) %></th>
|
15
|
+
<th>操作</th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<% @order.payment_orders.each do |payment_order| %>
|
20
|
+
<tr id="checked_<%= payment_order.id %>">
|
21
|
+
<td style="color: #999;"><%= payment_order.payment_id %></td>
|
22
|
+
<td><%= payment_order.payment.type %></td>
|
23
|
+
<td><%= payment_order.order_amount %></td>
|
24
|
+
<td><%= payment_order.check_amount.to_money(payment_order.payment.currency).format %></td>
|
25
|
+
<td><%= payment_order.created_at.to_s %></td>
|
26
|
+
<td>
|
27
|
+
<%= link_to '退款', new_admin_payment_refund_path(payment_order.payment_id, order_id: payment_order.order_id), remote: true %>
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
<% end %>
|
31
|
+
</tbody>
|
32
|
+
<tfoot>
|
33
|
+
<tr>
|
34
|
+
<th colspan="5"></th>
|
35
|
+
<th class="center aligned">
|
36
|
+
预核销合计:<span id="checked_amount"><%= @order.payment_orders.sum(:check_amount) %></span>
|
37
|
+
</th>
|
38
|
+
<th colspan="2"></th>
|
39
|
+
</tr>
|
40
|
+
</tfoot>
|
41
|
+
</table>
|
42
|
+
|
43
|
+
</div>
|
44
|
+
</div>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<div class="ui modal" id="payment_logs">
|
2
|
+
<i class="close icon"></i>
|
3
|
+
<div class="header">
|
4
|
+
<span style="color: #0d71bb">Payment Logs</span>
|
5
|
+
</div>
|
6
|
+
<div class="content">
|
7
|
+
<table class="ui basic red table">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Payment ID</th>
|
11
|
+
<th><%= Payment.human_attribute_name(:type) %></th>
|
12
|
+
<th><%= Payment.human_attribute_name(:total_amount) %></th>
|
13
|
+
<th>可核销</th>
|
14
|
+
<th><%= Payment.human_attribute_name(:created_at) %></th>
|
15
|
+
<th>预核销</th>
|
16
|
+
<th>核销时间</th>
|
17
|
+
<th>操作</th>
|
18
|
+
</tr>
|
19
|
+
</thead>
|
20
|
+
<tbody>
|
21
|
+
<% unless @order.all_paid? %>
|
22
|
+
<%= render partial: 'payments', collection: @payments, as: :payment %>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<%= render partial: 'payment_orders', collection: @order.payment_orders, as: :payment_order %>
|
26
|
+
</tbody>
|
27
|
+
<tfoot>
|
28
|
+
<tr>
|
29
|
+
<th colspan="5"></th>
|
30
|
+
<th class="center aligned">
|
31
|
+
预核销合计:<span id="checked_amount"><%= @order.payment_orders.sum(:check_amount) %></span>
|
32
|
+
</th>
|
33
|
+
<th colspan="2"></th>
|
34
|
+
</tr>
|
35
|
+
</tfoot>
|
36
|
+
</table>
|
37
|
+
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<tr id="checked_<%= payment_order.payment_id %>">
|
2
|
+
<td style="color: #999;"><%= payment_order.payment.payment_uuid %></td>
|
3
|
+
<td class="center aligned"><%= payment_order.payment.type %></td>
|
4
|
+
<td><%= payment_order.payment.total_amount %></td>
|
5
|
+
<td><%= payment_order.payment.unchecked_amount %></td>
|
6
|
+
<td class="center aligned"><%= payment_order.payment.created_at.to_s %></td>
|
7
|
+
<td class="center aligned">
|
8
|
+
<%= payment_order.check_amount.to_money(payment_order.payment.currency).format %>
|
9
|
+
<span style="color: #999;"><%= payment_order.state_i18n %></span>
|
10
|
+
</td>
|
11
|
+
<td class="center aligned"><%= payment_order.created_at.to_s %></td>
|
12
|
+
<td>
|
13
|
+
<% if payment_order.init? %>
|
14
|
+
<%= link_to '撤销', admin_order_order_payment_path(@order, payment_order), method: :delete, remote: true %>
|
15
|
+
<% end %>
|
16
|
+
</td>
|
17
|
+
</tr>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<tr id="unchecked_<%= payment.id %>">
|
2
|
+
<td style="color: #999;">
|
3
|
+
<%= payment.payment_uuid %>
|
4
|
+
<%= form_with url: admin_order_order_payments_path(@order), id: "new_payment_#{payment.id}" do |f| %>
|
5
|
+
<% end %>
|
6
|
+
</td>
|
7
|
+
<td><%= payment.type %></td>
|
8
|
+
<td><%= payment.total_amount %></td>
|
9
|
+
<td><%= payment.unchecked_amount %></td>
|
10
|
+
<td><%= payment.created_at %></td>
|
11
|
+
<td>
|
12
|
+
<%= hidden_field_tag 'payment_order[payment_id]', payment.id, form: "new_payment_#{payment.id}" %>
|
13
|
+
<%= number_field_tag 'payment_order[check_amount]', @order.unreceived_amount <= (payment.unchecked_amount + 1) ? @order.unreceived_amount : payment.unchecked_amount, placeholder: 'Result:', class: 'three wide field', step: '0.01', form: "new_payment_#{payment.id}" %>
|
14
|
+
</td>
|
15
|
+
<td></td>
|
16
|
+
<td>
|
17
|
+
<%= submit_tag '预核销', form: "new_payment_#{payment.id}" %>
|
18
|
+
</td>
|
19
|
+
</tr>
|
@@ -0,0 +1 @@
|
|
1
|
+
alert('<%= @payment_order.errors.full_messages.join(', ') %>')
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<table class="ui table">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th colspan="3">Transport Address</th>
|
5
|
+
<th colspan="3">
|
6
|
+
<%= link_to 'New Address', new_admin_address_path(user_id: @order.user_id), remote: true, class: 'ui mini button' %>
|
7
|
+
</th>
|
8
|
+
</tr>
|
9
|
+
</thead>
|
10
|
+
<tbody id="transport_addresses_tbody">
|
11
|
+
<% addresses.each do |address| %>
|
12
|
+
<tr id="address_<%= address.id %>">
|
13
|
+
<td>
|
14
|
+
<div class="ui radio checkbox">
|
15
|
+
<%= radio_button_tag :'order[address_id]', address.id, @order.address_id == address.id, form: 'new_order' %><label></label>
|
16
|
+
</div>
|
17
|
+
</td>
|
18
|
+
<td><%= address.contact_person %></td>
|
19
|
+
<td><%= address.tel %></td>
|
20
|
+
<td>
|
21
|
+
<%= address.area.nation %>
|
22
|
+
<%= address.area.province %>
|
23
|
+
<%= address.area.city %>
|
24
|
+
</td>
|
25
|
+
<td><%= address.address %></td>
|
26
|
+
<td>
|
27
|
+
<%= link_to 'Show', address_path(address) %>
|
28
|
+
<%= link_to 'Edit', edit_admin_address_path(address), remote: true %>
|
29
|
+
<%= link_to 'Destroy', admin_address_path(address), method: :delete, remote: true, data: { confirm: 'Are you sure?' } %>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
<% end %>
|
33
|
+
</tbody>
|
34
|
+
</table>
|
35
|
+
|
36
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<dl>
|
2
|
+
<dt>Payment State:</dt>
|
3
|
+
<dd>
|
4
|
+
<%= link_to 'All', filter_params(except: [:payment_status]), class: active_params(payment_status: '', active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
|
5
|
+
<% Order.payment_statuses.each do |payment_status, _| %>
|
6
|
+
<%= link_to payment_status, filter_params(payment_status: payment_status, except: [:id]), class: active_params(payment_status: payment_status, active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
|
7
|
+
<% end %>
|
8
|
+
</dd>
|
9
|
+
</dl>
|
10
|
+
<dl>
|
11
|
+
<dt>Payment Type:</dt>
|
12
|
+
<dd>
|
13
|
+
<%= link_to 'All', filter_params(except: [:payment_type]), class: active_params(payment_type: '', active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
|
14
|
+
<% Order.options_i18n(:payment_type).each do |key, value| %>
|
15
|
+
<%= link_to key, filter_params(payment_type: value), class: active_params(payment_type: value, active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
|
16
|
+
<% end %>
|
17
|
+
</dd>
|
18
|
+
</dl>
|
19
|
+
|
20
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_with(model: order, local: true) do |form| %>
|
2
|
+
<% if order.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(order.errors.count, "error") %> prohibited this order from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% order.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="actions">
|
15
|
+
<%= form.submit %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<table class="ui table">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th colspan="3">Invoice Addresses</th>
|
5
|
+
<th colspan="3">
|
6
|
+
<%= link_to 'New Address', new_admin_address_path(user_id: @order.user_id), remote: true, class: 'ui mini button' %>
|
7
|
+
</th>
|
8
|
+
</tr>
|
9
|
+
</thead>
|
10
|
+
<tbody id="invoice_addresses_tbody">
|
11
|
+
<% addresses.each do |address| %>
|
12
|
+
<tr id="address_<%= address.id %>">
|
13
|
+
<td>
|
14
|
+
<div class="ui radio checkbox">
|
15
|
+
<%= radio_button_tag :'order[invoice_address_id]', address.id, @order.address_id == address.id, form: 'new_order' %><label></label>
|
16
|
+
</div>
|
17
|
+
</td>
|
18
|
+
<td><%= address.contact_person %></td>
|
19
|
+
<td><%= address.tel %></td>
|
20
|
+
<td>
|
21
|
+
<%= address.area.nation %>
|
22
|
+
<%= address.area.province %>
|
23
|
+
<%= address.area.city %>
|
24
|
+
</td>
|
25
|
+
<td><%= address.address %></td>
|
26
|
+
<td>
|
27
|
+
<%= link_to 'Show', address_path(address) %>
|
28
|
+
<%= link_to 'Edit', edit_admin_address_path(address), remote: true %>
|
29
|
+
<%= link_to 'Destroy', admin_address_path(address), method: :delete, remote: true, data: { confirm: 'Are you sure?' } %>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
<% end %>
|
33
|
+
</tbody>
|
34
|
+
</table>
|
35
|
+
|
36
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<tr>
|
2
|
+
<td><%= order.id %></td>
|
3
|
+
<td><%= order.received_amount %></td>
|
4
|
+
<td class="error"><%= order.unreceived_amount %></td>
|
5
|
+
<td><%= order.amount %></td>
|
6
|
+
<td><%= order.subtotal %></td>
|
7
|
+
<td><%= order.shipping_fee %></td>
|
8
|
+
<td><%= order.handling_fee %></td>
|
9
|
+
</tr>
|
10
|
+
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<table class="ui table">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th>
|
5
|
+
<%= form_with model: order, url: admin_orders_path, multipart: true, local: true, id: 'new_order' do |f| %>
|
6
|
+
<% @order_form = f %>
|
7
|
+
<%= f.hidden_field :user_id %>
|
8
|
+
<%= f.hidden_field :amount %>
|
9
|
+
<% end %>
|
10
|
+
</th>
|
11
|
+
<th>Name</th>
|
12
|
+
<th></th>
|
13
|
+
<th></th>
|
14
|
+
<th></th>
|
15
|
+
<th></th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<% order.order_items.each do |order_item| %>
|
19
|
+
<%= @order_form.fields_for :order_items, order_item do |oi| %>
|
20
|
+
<tr>
|
21
|
+
<td>
|
22
|
+
<%= order_item.good&.name %>
|
23
|
+
<%= oi.hidden_field :cart_item_id, form: 'new_order' %>
|
24
|
+
</td>
|
25
|
+
<td><%= oi.date_field :deliver_on, form: 'new_order' %></td>
|
26
|
+
<td><%= oi.number_field :advance_payment, form: 'new_order' %></td>
|
27
|
+
<td><%= oi.text_field :comment, form: 'new_order' %></td>
|
28
|
+
<td><%= order_item.amount %></td>
|
29
|
+
<td></td>
|
30
|
+
</tr>
|
31
|
+
<% end %>
|
32
|
+
<% end %>
|
33
|
+
<% order.order_serves.each do |order_serve| %>
|
34
|
+
<%= @order_form.fields_for :order_serves, order_serve do |os| %>
|
35
|
+
<tr>
|
36
|
+
<td>
|
37
|
+
<%= order_serve.serve&.name %>
|
38
|
+
<%= os.hidden_field :serve_id, form: 'new_order' %>
|
39
|
+
<%= os.hidden_field :serve_charge_id, form: 'new_order' %>
|
40
|
+
</td>
|
41
|
+
<td colspan="3"></td>
|
42
|
+
<td><%= os.number_field :amount, step: '0.01', form: 'new_order' %></td>
|
43
|
+
<td></td>
|
44
|
+
</tr>
|
45
|
+
<% end %>
|
46
|
+
<% end %>
|
47
|
+
<% order.order_promotes.each do |order_promote| %>
|
48
|
+
<%= @order_form.fields_for :order_promotes, order_promote do |op| %>
|
49
|
+
<tr>
|
50
|
+
<td>
|
51
|
+
<%= order_promote.promote&.name %>
|
52
|
+
<%= op.hidden_field :promote_id, form: 'new_order' %>
|
53
|
+
<%= op.hidden_field :promote_charge_id, form: 'new_order' %>
|
54
|
+
</td>
|
55
|
+
<td colspan="3"></td>
|
56
|
+
<td><%= op.number_field :amount, step: '0.01', form: 'new_order' %></td>
|
57
|
+
<td></td>
|
58
|
+
</tr>
|
59
|
+
<% end %>
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
<tfoot>
|
63
|
+
<tr>
|
64
|
+
<th colspan="6">
|
65
|
+
<div class="">
|
66
|
+
</div>
|
67
|
+
</th>
|
68
|
+
</tr>
|
69
|
+
</tfoot>
|
70
|
+
</table>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%= search_form_with css: { wrapper_all: 'inline field', wrapper_input: 'field', wrapper_submit: 'field', submit: 'ui green button'} do |f| %>
|
2
|
+
<div class="fields">
|
3
|
+
<%= f.text_field :uuid, placeholder: 'UUID', css: { wrapper_input: 'two wide field' } %>
|
4
|
+
<%= f.submit class: 'ui green small button' %>
|
5
|
+
<%= link_to 'Clear All Filters', filter_params(only: []), class: 'ui white button' %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<div class="ui top attached segment">
|
2
|
+
<h1>订单列表</h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div class="ui attached segment">
|
6
|
+
<%= render 'search_form' %>
|
7
|
+
<%= render 'filter' %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<table class="ui bottom attached table">
|
11
|
+
<thead>
|
12
|
+
<tr>
|
13
|
+
<th>ID</th>
|
14
|
+
<th><%= Order.human_attribute_name(:id) %></th>
|
15
|
+
<th><%= Order.human_attribute_name(:buyer) %></th>
|
16
|
+
<th><%= Order.human_attribute_name(:payment_type) %></th>
|
17
|
+
<th><%= Order.human_attribute_name(:amount) %></th>
|
18
|
+
<th><%= Order.human_attribute_name(:received_amount) %></th>
|
19
|
+
<th><%= Order.human_attribute_name(:currency) %></th>
|
20
|
+
<th><%= Order.human_attribute_name(:payment_status) %></th>
|
21
|
+
<th><%= Order.human_attribute_name(:created_at) %></th>
|
22
|
+
<th>Actions</th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
|
26
|
+
<% @orders.each do |order| %>
|
27
|
+
<tr id="order_<%= order.id %>">
|
28
|
+
<td><%= order.id %></td>
|
29
|
+
<td><%= link_to order.uuid, admin_order_path(order) %></td>
|
30
|
+
<td>
|
31
|
+
<% if order.user_id %>
|
32
|
+
<p><%= link_to order.user&.name, admin_user_path(order.user_id) %></p>
|
33
|
+
<% end %>
|
34
|
+
<% if order.buyer_id %>
|
35
|
+
<p><%= link_to order.buyer&.name, orders_admin_buyer_path(order.buyer_id) %></p>
|
36
|
+
<% end %>
|
37
|
+
</td>
|
38
|
+
<td><span class="ui label"><%= order.payment_type %></span></td>
|
39
|
+
<td><%= order.amount %></td>
|
40
|
+
<td><%= order.received_amount %></td>
|
41
|
+
<td><%= t "currency.#{ order.currency&.upcase }" %></td>
|
42
|
+
<td>
|
43
|
+
<%= order.payment_status_i18n %>
|
44
|
+
<% if ['part_paid', 'all_paid'].include?(order.payment_status) %>
|
45
|
+
<%= link_to 'Refund', refund_admin_order_path(order.id), method: :patch, class: 'ui mini gray button' %>
|
46
|
+
<% elsif ['refunding', 'refunded', 'denied'].include?(order.payment_status) %>
|
47
|
+
<%= link_to 'Refund List', admin_refunds_path(order_id: order.id), class: 'ui mini green button' %>
|
48
|
+
<% elsif ['unpaid'].include?(order.payment_status) %>
|
49
|
+
<%= link_to 'Add Payment', new_admin_payment_path(order_id: order.id), class: 'ui mini green button' %>
|
50
|
+
<% end %>
|
51
|
+
</td>
|
52
|
+
<td><time><%= order.created_at.to_s(:rfc822) %></time></td>
|
53
|
+
<td class="ui labels">
|
54
|
+
<%= link_to 'Show', admin_order_path(order), class: 'ui blue label' %>
|
55
|
+
<%= link_to 'Edit', edit_admin_order_path(order), class: 'ui red label' %>
|
56
|
+
</td>
|
57
|
+
</tr>
|
58
|
+
<% end %>
|
59
|
+
</table>
|
60
|
+
|
61
|
+
<%= paginate @orders %>
|