rails_trade 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +37 -15
- data/Rakefile +9 -27
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/create.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/index.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/only.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/orders/new.js +0 -0
- data/app/assets/javascripts/controllers/trade/admin/payment_methods/edit.js +1 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/payment_methods/new.js +0 -0
- data/app/assets/javascripts/controllers/trade/admin/payments/edit.js +1 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/payments/new.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/promote_buyers/edit.js +0 -0
- data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/promote_buyers/new.js +3 -1
- data/app/assets/javascripts/controllers/trade/admin/promote_charges/edit.js +1 -0
- data/app/assets/javascripts/controllers/trade/admin/promote_charges/new.js +7 -0
- data/app/assets/javascripts/controllers/trade/admin/promote_goods/edit.js +1 -0
- data/app/assets/javascripts/controllers/trade/admin/promote_goods/new.js +17 -0
- data/app/assets/javascripts/controllers/trade/admin/promotes/edit.js +2 -0
- data/app/assets/javascripts/controllers/trade/admin/promotes/new.js +5 -0
- data/app/assets/javascripts/controllers/trade/admin/refunds/index.js +1 -0
- data/app/assets/javascripts/controllers/trade/admin/refunds/new.js +1 -0
- data/app/assets/javascripts/controllers/trade/my/carts/show-phone-ready.js +1 -0
- data/app/assets/javascripts/controllers/trade/my/carts/show-ready.js +28 -0
- data/app/assets/javascripts/controllers/trade/my/orders/wait-phone.js +8 -0
- data/app/{views/goods/show.html.erb → assets/javascripts/controllers/trade/my/trade_items/create.js} +0 -0
- data/app/assets/stylesheets/controllers/trade/admin/promote_charges/index.css +4 -0
- data/app/assets/stylesheets/controllers/trade/admin/promotes/index.css +4 -0
- data/app/{views/rails_trade_admin/orders/edit.html.erb → assets/stylesheets/controllers/trade/my/carts/show-phone.css} +0 -0
- data/app/assets/stylesheets/controllers/trade/payments/wxpay_result.css +57 -0
- data/app/channels/paid_channel.rb +7 -0
- data/app/controllers/concerns/controller_order_types.rb +3 -6
- data/app/controllers/rails_trade/my_cart.rb +16 -0
- data/app/controllers/trade/admin/base_controller.rb +5 -0
- data/app/controllers/{the_trade_admin → trade/admin}/buyers_controller.rb +3 -3
- data/app/controllers/{the_trade_admin/cart_item_serves_controller.rb → trade/admin/cart_serves_controller.rb} +8 -5
- data/app/controllers/{goods_controller.rb → trade/admin/goods_controller.rb} +7 -1
- data/app/controllers/{the_trade_admin → trade/admin}/order_payments_controller.rb +6 -3
- data/app/controllers/{the_trade_admin → trade/admin}/orders_controller.rb +23 -16
- data/app/controllers/{the_trade_admin → trade/admin}/payment_methods_controller.rb +8 -5
- data/app/controllers/{the_trade_admin → trade/admin}/payment_orders_controller.rb +10 -12
- data/app/controllers/{the_trade_admin → trade/admin}/payment_references_controller.rb +3 -3
- data/app/controllers/{the_trade_admin → trade/admin}/payment_strategies_controller.rb +9 -5
- data/app/controllers/trade/admin/payments_controller.rb +97 -0
- data/app/controllers/{the_trade_admin → trade/admin}/produces_controller.rb +4 -4
- data/app/controllers/trade/admin/promote_buyers_controller.rb +57 -0
- data/app/controllers/trade/admin/promote_charges_controller.rb +67 -0
- data/app/controllers/trade/admin/promote_goods_controller.rb +63 -0
- data/app/controllers/trade/admin/promotes_controller.rb +69 -0
- data/app/controllers/{the_trade_admin → trade/admin}/refunds_controller.rb +9 -12
- data/app/controllers/{the_trade_admin/cart_items_controller.rb → trade/admin/trade_items_controller.rb} +26 -28
- data/app/controllers/trade/admin/trade_promotes_controller.rb +71 -0
- data/app/controllers/trade/buyers_controller.rb +8 -0
- data/app/controllers/trade/my/base_controller.rb +4 -0
- data/app/controllers/trade/my/carts_controller.rb +32 -0
- data/app/controllers/{the_trade_my → trade/my}/order_items_controller.rb +4 -4
- data/app/controllers/trade/my/orders_controller.rb +106 -0
- data/app/controllers/{the_trade_my → trade/my}/payment_methods_controller.rb +1 -1
- data/app/controllers/trade/my/trade_items_controller.rb +47 -0
- data/app/controllers/trade/payments_controller.rb +71 -0
- data/app/models/cart.rb +4 -0
- data/app/models/order.rb +4 -0
- data/app/models/payment.rb +4 -0
- data/app/models/payment/alipay_payment.rb +3 -0
- data/app/models/payment/apple_payment.rb +3 -0
- data/app/models/payment/bank_payment.rb +3 -0
- data/app/models/payment/hand_payment.rb +3 -0
- data/app/models/payment/paypal_payment.rb +3 -0
- data/app/models/payment/stripe_payment.rb +3 -0
- data/app/models/payment/wxpay_payment.rb +3 -0
- data/app/models/payment_method.rb +3 -0
- data/app/models/{rails_trade/payment_methods → payment_method}/alipay_method.rb +1 -1
- data/app/models/{rails_trade/payment_methods → payment_method}/bank_method.rb +1 -1
- data/app/models/payment_method/stripe_method.rb +3 -0
- data/app/models/payment_order.rb +3 -0
- data/app/models/payment_reference.rb +3 -0
- data/app/models/payment_strategy.rb +3 -0
- data/app/models/payment_type.rb +3 -0
- data/app/models/promote.rb +3 -0
- data/app/models/promote_buyer.rb +3 -0
- data/app/models/promote_charge.rb +3 -0
- data/app/models/promote_charge/cash_promote_charge.rb +3 -0
- data/app/models/promote_charge/discount_promote_charge.rb +3 -0
- data/app/models/promote_charge/final_promote_charge.rb +3 -0
- data/app/models/promote_charge/minus_promote_charge.rb +3 -0
- data/app/models/promote_charge/plus_promote_charge.rb +3 -0
- data/app/models/promote_extra.rb +3 -0
- data/app/models/promote_good.rb +3 -0
- data/app/models/rails_trade/amount.rb +44 -0
- data/app/models/rails_trade/buyer.rb +35 -0
- data/app/models/rails_trade/cart.rb +64 -0
- data/app/models/rails_trade/good.rb +71 -0
- data/app/models/rails_trade/order.rb +78 -91
- data/app/models/rails_trade/ordering/payment.rb +113 -0
- data/app/models/rails_trade/{concerns/the_refund.rb → ordering/refund.rb} +3 -5
- data/app/models/rails_trade/payment.rb +72 -73
- data/app/models/rails_trade/payment/alipay_payment.rb +15 -0
- data/app/models/rails_trade/payment/apple_payment.rb +7 -0
- data/app/models/rails_trade/{payments → payment}/bank_payment.rb +2 -4
- data/app/models/rails_trade/payment/hand_payment.rb +8 -0
- data/app/models/rails_trade/payment/paypal_payment.rb +8 -0
- data/app/models/rails_trade/payment/stripe_payment.rb +9 -0
- data/app/models/rails_trade/{payments → payment}/wxpay_payment.rb +1 -2
- data/app/models/rails_trade/payment_method.rb +22 -12
- data/app/models/rails_trade/{payment_methods → payment_method}/stripe_method.rb +7 -4
- data/app/models/rails_trade/payment_order.rb +84 -51
- data/app/models/rails_trade/payment_reference.rb +12 -9
- data/app/models/rails_trade/payment_strategy.rb +15 -12
- data/app/models/rails_trade/payment_type/alipay.rb +28 -0
- data/app/models/rails_trade/payment_type/apple_pay.rb +18 -0
- data/app/models/rails_trade/{payment_interface/the_paypal.rb → payment_type/paypal.rb} +8 -29
- data/app/models/rails_trade/{payment_interface/the_stripe.rb → payment_type/stripe.rb} +8 -26
- data/app/models/rails_trade/payment_type/wxpay.rb +55 -0
- data/app/models/rails_trade/promote.rb +65 -27
- data/app/models/rails_trade/promote_buyer.rb +25 -7
- data/app/models/rails_trade/promote_charge.rb +78 -11
- data/app/models/rails_trade/promote_charge/cash_promote_charge.rb +12 -0
- data/app/models/rails_trade/promote_charge/discount_promote_charge.rb +17 -0
- data/app/models/rails_trade/promote_charge/final_promote_charge.rb +12 -0
- data/app/models/rails_trade/promote_charge/minus_promote_charge.rb +11 -0
- data/app/models/rails_trade/promote_charge/plus_promote_charge.rb +7 -0
- data/app/models/rails_trade/promote_extra.rb +13 -0
- data/app/models/rails_trade/promote_good.rb +20 -7
- data/app/models/rails_trade/refund.rb +30 -19
- data/app/models/rails_trade/{refunds → refund}/alipay_refund.rb +1 -1
- data/app/models/rails_trade/refund/bank_refund.rb +5 -0
- data/app/models/rails_trade/refund/hand_refund.rb +5 -0
- data/app/models/rails_trade/{refunds → refund}/paypal_refund.rb +1 -1
- data/app/models/rails_trade/{refunds → refund}/stripe_refund.rb +1 -1
- data/app/models/rails_trade/{refunds → refund}/wxpay_refund.rb +17 -9
- data/app/models/rails_trade/sell.rb +24 -0
- data/app/models/rails_trade/trade_item.rb +153 -0
- data/app/models/rails_trade/trade_promote.rb +92 -0
- data/app/models/rails_trade/user.rb +9 -0
- data/app/models/refund.rb +3 -0
- data/app/models/refund/alipay_refund.rb +3 -0
- data/app/models/refund/bank_refund.rb +3 -0
- data/app/models/refund/hand_refund.rb +3 -0
- data/app/models/refund/paypal_refund.rb +3 -0
- data/app/models/refund/stripe_refund.rb +3 -0
- data/app/models/refund/wxpay_refund.rb +3 -0
- data/app/models/trade_item.rb +3 -0
- data/app/models/trade_promote.rb +3 -0
- data/app/views/application/_trade_nav.html.erb +16 -0
- data/app/views/my/_trade_nav.html.erb +10 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/_menu.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/_search_form.html.erb +3 -3
- data/app/views/{rails_trade_admin → trade/admin}/buyers/edit.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/buyers/new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/buyers/orders.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/buyers/overdue.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/buyers/show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_check.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_serve.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_single.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_single_table.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_total.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/_total_table.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/add.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/index.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/single.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/cart_item_serves/total.js.erb +0 -0
- data/app/views/trade/admin/goods/_form.html.erb +7 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/_item.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/_new.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/_show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/_show_tr.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit_items.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit_pic.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/edit_promote.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/goods/index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/goods/new.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/goods/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/show.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/goods/update.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_index.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_payment_orders.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/_payments.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/create_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/index.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/order_payments/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/_addresses.html.erb +1 -1
- data/app/views/trade/admin/orders/_filter.html.erb +26 -0
- data/app/views/trade/admin/orders/_form.html.erb +4 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/_invoice_addresses.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/orders/_item.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/_new_items.html.erb +1 -1
- data/app/{assets/javascripts/controllers/rails_trade_admin/payments/index.js → views/trade/admin/orders/_search_form.html.erb} +0 -0
- data/app/views/trade/admin/orders/index.html.erb +52 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/orders/payments.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/orders/refresh.js.erb +0 -0
- data/app/views/trade/admin/orders/show.html.erb +75 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_edit.html.erb +0 -0
- data/app/views/{rails_trade_admin/payment_methods/_search_form.html.erb → trade/admin/payment_methods/_filter.html.erb} +5 -9
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_index_layout.html.erb +2 -5
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_new.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/_payment_method.html.erb +2 -3
- data/app/views/trade/admin/payment_methods/create.js.erb +2 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/edit.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/edit.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/index.html.erb +7 -4
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/mine.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/new.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/unverified.html.erb +4 -6
- data/app/views/{rails_trade_admin → trade/admin}/payment_methods/update.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/_index.html.erb +2 -6
- data/app/views/trade/admin/payment_orders/_new.html.erb +23 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/_orders.html.erb +2 -9
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/cancel.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/create.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/create_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/raise_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/update.js.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_orders/update_fail.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/_form.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/_new.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/edit.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/index.html.erb +1 -1
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_references/show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/edit.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/index.html.erb +2 -2
- data/app/views/{rails_trade_admin → trade/admin}/payment_strategies/new.html.erb +1 -1
- data/app/views/trade/admin/payments/_checked_amount.html.erb +6 -0
- data/app/views/trade/admin/payments/_edit.html.erb +12 -0
- data/app/views/trade/admin/payments/_filter.html.erb +40 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/_form.html.erb +6 -2
- data/app/views/trade/admin/payments/_item.html.erb +41 -0
- data/app/views/trade/admin/payments/_new.html.erb +12 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/analyze.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/dashboard.html.erb +0 -0
- data/app/views/trade/admin/payments/edit.html.erb +13 -0
- data/app/views/trade/admin/payments/edit.js.erb +3 -0
- data/app/views/trade/admin/payments/index.html.erb +40 -0
- data/app/views/trade/admin/payments/new.html.erb +13 -0
- data/app/views/trade/admin/payments/new.js.erb +3 -0
- data/app/views/{rails_trade_admin → trade/admin}/payments/show.html.erb +0 -0
- data/app/views/trade/admin/promote_buyers/_filter.html.erb +7 -0
- data/app/views/trade/admin/promote_buyers/_form.html.erb +17 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/_promote_buyer.json.jbuilder +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/edit.html.erb +1 -1
- data/app/views/trade/admin/promote_buyers/edit.js.erb +3 -0
- data/app/views/trade/admin/promote_buyers/index.html.erb +52 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/index.json.jbuilder +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/new.html.erb +1 -1
- data/app/views/trade/admin/promote_buyers/new.js.erb +3 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/show.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/promote_buyers/show.json.jbuilder +0 -0
- data/app/views/trade/admin/promote_charges/_base_price_form.html.erb +1 -0
- data/app/views/trade/admin/promote_charges/_edit.html.erb +13 -0
- data/app/views/trade/admin/promote_charges/_filter.html.erb +11 -0
- data/app/views/trade/admin/promote_charges/_form.html.erb +11 -0
- data/app/views/trade/admin/promote_charges/_new.html.erb +13 -0
- data/app/views/trade/admin/promote_charges/index.html.erb +65 -0
- data/app/views/trade/admin/promote_charges/options.js.erb +4 -0
- data/app/views/trade/admin/promote_goods/_filter.html.erb +8 -0
- data/app/views/trade/admin/promote_goods/_form.html.erb +8 -0
- data/app/views/trade/admin/promote_goods/_goods_options.html.erb +1 -0
- data/app/views/trade/admin/promote_goods/goods.js.erb +2 -0
- data/app/views/trade/admin/promote_goods/index.html.erb +61 -0
- data/app/views/trade/admin/promotes/_edit.html.erb +12 -0
- data/app/views/trade/admin/promotes/_filter.html.erb +9 -0
- data/app/views/trade/admin/promotes/_form.html.erb +12 -0
- data/app/views/trade/admin/promotes/_new.html.erb +12 -0
- data/app/views/trade/admin/promotes/_new_promote_charge.html.erb +10 -0
- data/app/views/trade/admin/promotes/create.js.erb +2 -0
- data/app/views/trade/admin/promotes/index.html.erb +79 -0
- data/app/views/trade/admin/refunds/_filter.html.erb +11 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/_form.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/_logs_table.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/_new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/edit.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/index.html.erb +13 -17
- data/app/views/{rails_trade_admin → trade/admin}/refunds/logs.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/new.html.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/new.js.erb +0 -0
- data/app/views/{rails_trade_admin → trade/admin}/refunds/show.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_additions.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_filter.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_good_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_order_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_retail_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_single_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/_total_price.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/destroy.js.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/error.html.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/index.html.erb +3 -3
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/only.html.erb +2 -2
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/total.js.erb +0 -0
- data/app/views/{rails_trade_admin/cart_items → trade/admin/trade_items}/update.js.erb +0 -0
- data/app/views/trade/admin/trade_promotes/_filter.html.erb +7 -0
- data/app/views/trade/admin/trade_promotes/_form.html.erb +6 -0
- data/app/views/trade/admin/trade_promotes/_show_table.html.erb +20 -0
- data/app/views/trade/admin/trade_promotes/edit.html.erb +9 -0
- data/app/views/trade/admin/trade_promotes/edit.js.erb +3 -0
- data/app/views/trade/admin/trade_promotes/index.html.erb +38 -0
- data/app/views/trade/admin/trade_promotes/new.html.erb +9 -0
- data/app/views/trade/admin/trade_promotes/new.js.erb +3 -0
- data/app/views/trade/admin/trade_promotes/show.html.erb +7 -0
- data/app/views/trade/admin/trade_promotes/show.js.erb +3 -0
- data/app/views/trade/admin/trade_promotes/update.js.erb +1 -0
- data/app/views/{buyers → trade/buyers}/_show.html.erb +0 -0
- data/app/views/{buyers → trade/buyers}/show.js.erb +0 -0
- data/app/views/{goods → trade/goods}/_choose.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_good.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_good_item.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_nav.html.erb +0 -0
- data/app/views/{goods → trade/goods}/_search.html.erb +0 -0
- data/app/views/{goods → trade/goods}/index.html.erb +0 -0
- data/app/views/{goods → trade/goods}/index/_product.html.erb +0 -0
- data/app/views/{goods → trade/goods}/item.html.erb +0 -0
- data/app/views/{goods → trade/goods}/produce.html.erb +0 -0
- data/app/views/trade/goods/show.html.erb +2 -0
- data/app/views/{goods → trade/goods}/show/_basic.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_carousel.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_items.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_sales.html.erb +0 -0
- data/app/views/{goods → trade/goods}/show/_side.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_breadcrumb.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_nav.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_nav_.html.erb +0 -0
- data/app/views/{goods → trade/goods}/taxon/_nav_last.html.erb +0 -0
- data/app/views/trade/my/carts/_filter.html.erb +7 -0
- data/app/views/trade/my/carts/_form.html.erb +8 -0
- data/app/views/trade/my/carts/_show_table.html.erb +28 -0
- data/app/views/trade/my/carts/edit.html.erb +9 -0
- data/app/views/trade/my/carts/edit.js.erb +3 -0
- data/app/views/trade/my/carts/index.html.erb +47 -0
- data/app/views/trade/my/carts/new.html.erb +9 -0
- data/app/views/trade/my/carts/new.js.erb +3 -0
- data/app/views/trade/my/carts/show.html+phone.erb +46 -0
- data/app/views/{rails_trade_admin/promote_goods → trade/my/carts}/show.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/edit.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/index.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/order_items/new.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/order_items/show.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/_date_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/_edit.html.erb +2 -2
- data/app/views/trade/my/orders/_edit_payment_type.html.erb +12 -0
- data/app/views/{rails_trade_my → trade/my}/orders/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/destroy.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/edit.js.erb +0 -0
- data/app/views/trade/my/orders/edit_payment_type.js.erb +4 -0
- data/app/views/{rails_trade_my → trade/my}/orders/fail.html.erb +0 -0
- data/app/views/trade/my/orders/index.html+phone.erb +37 -0
- data/app/views/trade/my/orders/index.html.erb +36 -0
- data/app/views/{rails_trade_my → trade/my}/orders/index.json.jbuilder +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/new.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/orders/refresh.js.erb +0 -0
- data/app/views/trade/my/orders/refund.json.jbuilder +12 -0
- data/app/views/trade/my/orders/show.html+phone.erb +3 -0
- data/app/views/{rails_trade_my → trade/my}/orders/show.html.erb +3 -3
- data/app/views/{rails_trade_my → trade/my}/orders/success.html.erb +0 -2
- data/app/views/{rails_trade_my → trade/my}/orders/update.js.erb +1 -1
- data/app/views/trade/my/orders/wait.html+wechat.erb +4 -0
- data/app/views/trade/my/orders/wxpay_pay.js.erb +16 -0
- data/app/views/trade/my/orders/wxpay_pay_err.js.erb +5 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_edit.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_index.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_item.html.erb +1 -1
- data/app/views/{rails_trade_my → trade/my}/payment_methods/_new.html.erb +3 -3
- data/app/views/{rails_trade_my → trade/my}/payment_methods/create.js.erb +0 -0
- data/app/views/{rails_trade_my/addresses → trade/my/payment_methods}/destroy.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/edit.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/index.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/index.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/new.js.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/payment_methods/show.html.erb +0 -0
- data/app/views/{rails_trade_my/addresses → trade/my/payment_methods}/update.js.erb +0 -0
- data/app/views/trade/my/trade_items/_additions.html.erb +12 -0
- data/app/views/trade/my/trade_items/_cart_item.js.erb +2 -0
- data/app/views/trade/my/trade_items/_single_price.html.erb +6 -0
- data/app/views/trade/my/trade_items/_total_price.html.erb +8 -0
- data/app/views/trade/my/trade_items/_trade_items.html.erb +68 -0
- data/app/views/trade/my/trade_items/create.html.erb +1 -0
- data/app/views/{rails_trade_my/cart_items → trade/my/trade_items}/destroy.js.erb +0 -0
- data/app/views/trade/my/trade_items/index.json.jbuilder +0 -0
- data/app/views/trade/my/trade_items/update.js.erb +1 -0
- data/app/views/{rails_trade_my → trade/my}/users/_form.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/users/edit.html.erb +0 -0
- data/app/views/{rails_trade_my → trade/my}/users/show.html.erb +0 -0
- data/app/views/trade/payments/_wxpay_result.html.erb +3 -0
- data/app/views/trade/payments/wxpay_result.js.erb +1 -0
- data/config/locales/en.enum.yml +47 -0
- data/config/locales/en.yml +22 -60
- data/config/locales/zh.attributes.yml +75 -0
- data/config/locales/zh.controller.yml +51 -0
- data/config/locales/zh.enum.yml +58 -0
- data/config/locales/zh.help.yml +7 -0
- data/config/routes.rb +45 -59
- data/lib/rails_trade.rb +9 -19
- data/lib/rails_trade/apple_pay.rb +32 -0
- data/lib/rails_trade/config.rb +6 -3
- data/lib/rails_trade/engine.rb +15 -19
- data/lib/rails_trade/version.rb +1 -1
- metadata +475 -422
- data/app/assets/config/rails_trade_manifest.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/index.js +0 -15
- data/app/assets/javascripts/controllers/rails_trade_admin/buyers/overdue.js +0 -15
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/edit.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/payment_methods/unverified.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/promote_goods/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/edit.js +0 -2
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/promotes/new.js +0 -2
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/edit.js +0 -2
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/index.js +0 -1
- data/app/assets/javascripts/controllers/rails_trade_admin/serves/new.js +0 -4
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/create.js +0 -3
- data/app/assets/javascripts/controllers/rails_trade_my/cart_items/index.js +0 -65
- data/app/controllers/areas_controller.rb +0 -18
- data/app/controllers/buyers_controller.rb +0 -8
- data/app/controllers/payments_controller.rb +0 -50
- data/app/controllers/providers_controller.rb +0 -8
- data/app/controllers/the_trade_admin/addresses_controller.rb +0 -75
- data/app/controllers/the_trade_admin/areas_controller.rb +0 -50
- data/app/controllers/the_trade_admin/base_controller.rb +0 -5
- data/app/controllers/the_trade_admin/payments_controller.rb +0 -89
- data/app/controllers/the_trade_admin/promote_buyers_controller.rb +0 -39
- data/app/controllers/the_trade_admin/promote_charges_controller.rb +0 -62
- data/app/controllers/the_trade_admin/promote_goods_controller.rb +0 -50
- data/app/controllers/the_trade_admin/promotes_controller.rb +0 -105
- data/app/controllers/the_trade_admin/providers_controller.rb +0 -121
- data/app/controllers/the_trade_admin/serve_charges_controller.rb +0 -67
- data/app/controllers/the_trade_admin/serves_controller.rb +0 -107
- data/app/controllers/the_trade_my/addresses_controller.rb +0 -50
- data/app/controllers/the_trade_my/base_controller.rb +0 -13
- data/app/controllers/the_trade_my/buyers_controller.rb +0 -35
- data/app/controllers/the_trade_my/cart_items_controller.rb +0 -71
- data/app/controllers/the_trade_my/orders_controller.rb +0 -161
- data/app/controllers/the_trade_my/providers_controller.rb +0 -44
- data/app/models/rails_trade/address.rb +0 -14
- data/app/models/rails_trade/area.rb +0 -65
- data/app/models/rails_trade/cart_item.rb +0 -185
- data/app/models/rails_trade/cart_item_serve.rb +0 -16
- data/app/models/rails_trade/concerns/good_able.rb +0 -63
- data/app/models/rails_trade/concerns/order_able.rb +0 -48
- data/app/models/rails_trade/concerns/promote_fee.rb +0 -54
- data/app/models/rails_trade/concerns/serve_fee.rb +0 -41
- data/app/models/rails_trade/concerns/summary_service.rb +0 -67
- data/app/models/rails_trade/concerns/the_payment.rb +0 -88
- data/app/models/rails_trade/concerns/the_trade_buyer.rb +0 -50
- data/app/models/rails_trade/concerns/the_trade_user.rb +0 -23
- data/app/models/rails_trade/good_partner.rb +0 -8
- data/app/models/rails_trade/good_produce.rb +0 -14
- data/app/models/rails_trade/order_item.rb +0 -88
- data/app/models/rails_trade/order_promote.rb +0 -23
- data/app/models/rails_trade/order_serve.rb +0 -23
- data/app/models/rails_trade/order_shipment.rb +0 -10
- data/app/models/rails_trade/payment_interface/payment_interface_base.rb +0 -8
- data/app/models/rails_trade/payment_interface/the_alipay.rb +0 -49
- data/app/models/rails_trade/payment_interface/the_wxpay.rb +0 -56
- data/app/models/rails_trade/payments/alipay_payment.rb +0 -12
- data/app/models/rails_trade/payments/hand_payment.rb +0 -13
- data/app/models/rails_trade/payments/paypal_payment.rb +0 -8
- data/app/models/rails_trade/payments/stripe_payment.rb +0 -7
- data/app/models/rails_trade/produce.rb +0 -18
- data/app/models/rails_trade/promote_charges/single_promote_charge.rb +0 -7
- data/app/models/rails_trade/promote_charges/total_promote_charge.rb +0 -7
- data/app/models/rails_trade/promotes/amount_promote.rb +0 -4
- data/app/models/rails_trade/promotes/number_promote.rb +0 -4
- data/app/models/rails_trade/provider.rb +0 -25
- data/app/models/rails_trade/refunds/bank_refund.rb +0 -5
- data/app/models/rails_trade/refunds/hand_refund.rb +0 -5
- data/app/models/rails_trade/serve.rb +0 -44
- data/app/models/rails_trade/serve_charge.rb +0 -37
- data/app/models/rails_trade/serve_charges/single_serve_charge.rb +0 -7
- data/app/models/rails_trade/serve_charges/total_serve_charge.rb +0 -7
- data/app/models/rails_trade/serve_good.rb +0 -9
- data/app/models/rails_trade/serves/number_serve.rb +0 -4
- data/app/models/rails_trade/serves/quantity_serve.rb +0 -4
- data/app/models/rails_trade/shipment.rb +0 -8
- data/app/views/layouts/rails_trade_admin/base.html.erb +0 -25
- data/app/views/layouts/rails_trade_my/base.html.erb +0 -28
- data/app/views/rails_trade_admin/addresses/_address.html.erb +0 -24
- data/app/views/rails_trade_admin/addresses/_edit.html.erb +0 -13
- data/app/views/rails_trade_admin/addresses/_form.html.erb +0 -23
- data/app/views/rails_trade_admin/addresses/_new.html.erb +0 -13
- data/app/views/rails_trade_admin/addresses/create.js.erb +0 -2
- data/app/views/rails_trade_admin/addresses/destroy.js.erb +0 -1
- data/app/views/rails_trade_admin/addresses/edit.js.erb +0 -39
- data/app/views/rails_trade_admin/addresses/index.html.erb +0 -41
- data/app/views/rails_trade_admin/addresses/new.js.erb +0 -52
- data/app/views/rails_trade_admin/addresses/show.html.erb +0 -4
- data/app/views/rails_trade_admin/addresses/update.js.erb +0 -2
- data/app/views/rails_trade_admin/areas/_form.html.erb +0 -9
- data/app/views/rails_trade_admin/areas/edit.html.erb +0 -16
- data/app/views/rails_trade_admin/areas/index.html.erb +0 -43
- data/app/views/rails_trade_admin/areas/new.html.erb +0 -11
- data/app/views/rails_trade_admin/areas/show.html.erb +0 -1
- data/app/views/rails_trade_admin/base/_nav.html.erb +0 -24
- data/app/views/rails_trade_admin/base/_nav_bar.html.erb +0 -23
- data/app/views/rails_trade_admin/base/_nav_payment.html.erb +0 -25
- data/app/views/rails_trade_admin/goods/_form.html.erb +0 -7
- data/app/views/rails_trade_admin/orders/_filter.html.erb +0 -20
- data/app/views/rails_trade_admin/orders/_form.html.erb +0 -17
- data/app/views/rails_trade_admin/orders/_search_form.html.erb +0 -7
- data/app/views/rails_trade_admin/orders/index.html.erb +0 -61
- data/app/views/rails_trade_admin/orders/show.html.erb +0 -89
- data/app/views/rails_trade_admin/payment_methods/create.js.erb +0 -2
- data/app/views/rails_trade_admin/payment_orders/_new.html.erb +0 -24
- data/app/views/rails_trade_admin/payments/_item.html.erb +0 -49
- data/app/views/rails_trade_admin/payments/_search_form.html.erb +0 -15
- data/app/views/rails_trade_admin/payments/edit.html.erb +0 -15
- data/app/views/rails_trade_admin/payments/index.html.erb +0 -60
- data/app/views/rails_trade_admin/payments/new.html.erb +0 -17
- data/app/views/rails_trade_admin/promote_buyers/_form.html.erb +0 -6
- data/app/views/rails_trade_admin/promote_buyers/index.html.erb +0 -42
- data/app/views/rails_trade_admin/promote_charges/_edit.html.erb +0 -13
- data/app/views/rails_trade_admin/promote_charges/_form.html.erb +0 -6
- data/app/views/rails_trade_admin/promote_charges/_new.html.erb +0 -13
- data/app/views/rails_trade_admin/promote_charges/_search_form.html.erb +0 -9
- data/app/views/rails_trade_admin/promote_charges/edit.js.erb +0 -8
- data/app/views/rails_trade_admin/promote_charges/index.html.erb +0 -49
- data/app/views/rails_trade_admin/promote_charges/new.js.erb +0 -8
- data/app/views/rails_trade_admin/promote_goods/_form.html.erb +0 -4
- data/app/views/rails_trade_admin/promote_goods/_promote_good.json.jbuilder +0 -2
- data/app/views/rails_trade_admin/promote_goods/edit.html.erb +0 -14
- data/app/views/rails_trade_admin/promote_goods/index.html.erb +0 -37
- data/app/views/rails_trade_admin/promote_goods/index.json.jbuilder +0 -1
- data/app/views/rails_trade_admin/promote_goods/new.html.erb +0 -13
- data/app/views/rails_trade_admin/promote_goods/show.json.jbuilder +0 -1
- data/app/views/rails_trade_admin/promotes/_form.html.erb +0 -9
- data/app/views/rails_trade_admin/promotes/edit.html.erb +0 -9
- data/app/views/rails_trade_admin/promotes/index.html.erb +0 -65
- data/app/views/rails_trade_admin/promotes/new.html.erb +0 -9
- data/app/views/rails_trade_admin/promotes/show.html.erb +0 -4
- data/app/views/rails_trade_admin/providers/_form.html.erb +0 -6
- data/app/views/rails_trade_admin/providers/_product.html.erb +0 -12
- data/app/views/rails_trade_admin/providers/_side.html.erb +0 -8
- data/app/views/rails_trade_admin/providers/area.html.erb +0 -1
- data/app/views/rails_trade_admin/providers/channel.html.erb +0 -46
- data/app/views/rails_trade_admin/providers/edit.html.erb +0 -16
- data/app/views/rails_trade_admin/providers/index.html.erb +0 -27
- data/app/views/rails_trade_admin/providers/new.html.erb +0 -21
- data/app/views/rails_trade_admin/providers/posts.html.erb +0 -41
- data/app/views/rails_trade_admin/providers/products.html.erb +0 -23
- data/app/views/rails_trade_admin/providers/show.html.erb +0 -60
- data/app/views/rails_trade_admin/refunds/_search_form.html.erb +0 -13
- data/app/views/rails_trade_admin/serve_charges/_edit.html.erb +0 -13
- data/app/views/rails_trade_admin/serve_charges/_form.html.erb +0 -10
- data/app/views/rails_trade_admin/serve_charges/_new.html.erb +0 -13
- data/app/views/rails_trade_admin/serve_charges/_search_form.html.erb +0 -10
- data/app/views/rails_trade_admin/serve_charges/edit.js.erb +0 -7
- data/app/views/rails_trade_admin/serve_charges/index.html.erb +0 -56
- data/app/views/rails_trade_admin/serve_charges/new.js.erb +0 -8
- data/app/views/rails_trade_admin/serves/_form.html.erb +0 -9
- data/app/views/rails_trade_admin/serves/edit.html.erb +0 -9
- data/app/views/rails_trade_admin/serves/index.html.erb +0 -80
- data/app/views/rails_trade_admin/serves/new.html.erb +0 -9
- data/app/views/rails_trade_my/addresses/_edit.html.erb +0 -31
- data/app/views/rails_trade_my/addresses/_form.html.erb +0 -23
- data/app/views/rails_trade_my/addresses/_new.html.erb +0 -11
- data/app/views/rails_trade_my/addresses/create.js.erb +0 -2
- data/app/views/rails_trade_my/addresses/edit.js.erb +0 -39
- data/app/views/rails_trade_my/addresses/index.html.erb +0 -44
- data/app/views/rails_trade_my/addresses/new.js.erb +0 -39
- data/app/views/rails_trade_my/addresses/show.html.erb +0 -4
- data/app/views/rails_trade_my/base/_nav.html.erb +0 -22
- data/app/views/rails_trade_my/buyers/_form.html.erb +0 -5
- data/app/views/rails_trade_my/buyers/edit.html.erb +0 -2
- data/app/views/rails_trade_my/buyers/show.html.erb +0 -21
- data/app/views/rails_trade_my/cart_items/_additions.html.erb +0 -22
- data/app/views/rails_trade_my/cart_items/_single_price.html.erb +0 -6
- data/app/views/rails_trade_my/cart_items/_total_price.html.erb +0 -8
- data/app/views/rails_trade_my/cart_items/index.html.erb +0 -69
- data/app/views/rails_trade_my/cart_items/total.js.erb +0 -11
- data/app/views/rails_trade_my/cart_items/update.js.erb +0 -8
- data/app/views/rails_trade_my/my/index.html.erb +0 -17
- data/app/views/rails_trade_my/orders/_edit_payment_type.html.erb +0 -13
- data/app/views/rails_trade_my/orders/edit_payment_type.js.erb +0 -6
- data/app/views/rails_trade_my/orders/index.html.erb +0 -55
- data/app/views/rails_trade_my/orders/update_payment_type.js.erb +0 -3
- data/app/views/rails_trade_my/orders/wxpay_pay.js.erb +0 -16
- data/app/views/rails_trade_my/orders/wxpay_pay_err.js.erb +0 -5
- data/app/views/rails_trade_my/payment_methods/destroy.js.erb +0 -1
- data/app/views/rails_trade_my/payment_methods/update.js.erb +0 -2
- data/app/views/rails_trade_my/providers/_form.html.erb +0 -5
- data/app/views/rails_trade_my/providers/_provider.html.erb +0 -20
- data/app/views/rails_trade_my/providers/edit.html.erb +0 -2
- data/app/views/rails_trade_my/providers/index.html.erb +0 -12
- data/app/views/rails_trade_my/providers/new.html.erb +0 -10
- data/app/views/rails_trade_my/providers/show.html.erb +0 -13
- data/config/locales/zh.yml +0 -75
- data/db/migrate/20150514135720_create_providers.rb +0 -59
- data/db/migrate/20170601014520_create_payments.rb +0 -52
- data/db/migrate/20170602061859_create_payment_references.rb +0 -12
- data/db/migrate/20170702234123_create_orders.rb +0 -56
- data/db/migrate/20170714080032_create_payment_strategies.rb +0 -77
- data/db/migrate/20171115063702_create_promote_buyers.rb +0 -31
- data/db/schema.rb +0 -94
- data/lib/tasks/the_trade_tasks.rake +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d112e55ad01337c027a723850cf6cbd103a552480cabc2922075aa28d10e069
|
4
|
+
data.tar.gz: aeb19d3f5c728963ea5e5b6760174e4723eb46565d230c43fded491fa0816804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54e3f0ce194c840eebb880898bc8593f8c0835319f64fab543be25168198ef0bfb2e55c8252cdbcf5bbd27085c6f4ccef6bbba693cfcfb6fa60a367ed8f8c85c
|
7
|
+
data.tar.gz: d5564ac56c8bff784949b48deac9c7d59707adbbc4bb23732a13d6e8d956aeeb7c9a0d47a0d3cd676ce0e6e8aa80dcda14ca1b4ea9d67bbb38d1707271c3d5a6
|
data/LICENSE
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
GNU LESSER GENERAL PUBLIC LICENSE
|
2
2
|
Version 3, 29 June 2007
|
3
3
|
|
4
|
-
Copyright (C)
|
4
|
+
Copyright (C) 2019 Mingyuan Qin.
|
5
5
|
Everyone is permitted to copy and distribute verbatim copies
|
6
6
|
of this license document, but changing it is not allowed.
|
7
7
|
|
data/README.md
CHANGED
@@ -1,26 +1,37 @@
|
|
1
1
|
# RailsTrade
|
2
2
|
|
3
|
+
处理订单、支付(退款)、促销策略、附加服务策略;
|
3
4
|
|
4
|
-
|
5
|
+
## 特性
|
6
|
+
* 在购物车环节就可以查看完整的优惠券策略,不必首先生成订单才能知晓全部优惠,能进一步提升转化率,降低系统取消订单数。
|
7
|
+
* 经典的优惠券策略叠加计算实现,性能佳,实现简单,易于理解;
|
8
|
+
* 接入了常见的支付方式
|
9
|
+
* 微信支付
|
10
|
+
* 支付宝
|
11
|
+
* PayPal
|
12
|
+
* Stripe
|
13
|
+
* ApplePay
|
14
|
+
|
5
15
|
## 核心模型
|
6
16
|
|
7
17
|
* good_type / good_id
|
8
18
|
|
9
|
-
可进行售卖,出租的实体,将其关联 good
|
19
|
+
可进行售卖,出租的实体,将其关联 good 即可处理。
|
10
20
|
|
11
|
-
|
21
|
+
`Good`模型会处理涉及由可交易产生的信息,比如价格、促销方式等。
|
12
22
|
|
13
|
-
|
14
|
-
CartItem -> Order(OrderItem) <=> Payment
|
23
|
+
* User/Buyer
|
15
24
|
|
25
|
+
## 生成订单的两种方式
|
16
26
|
|
17
|
-
|
18
|
-
|
27
|
+
* 基于购物车生成订单;
|
19
28
|
```
|
20
|
-
|
29
|
+
Good -> [CartItem] -> Order(OrderItem) <=> Payment
|
30
|
+
└ Promote(Serve)
|
21
31
|
```
|
32
|
+
* 直接生成订单;
|
22
33
|
|
23
|
-
|
34
|
+
## 集成商品编辑信息
|
24
35
|
```erb
|
25
36
|
|
26
37
|
```
|
@@ -31,10 +42,16 @@ OrderItem <=> Shipment
|
|
31
42
|
|
32
43
|
* Provider
|
33
44
|
|
34
|
-
|
35
|
-
|
45
|
+
## 购物车中价格字段说明
|
46
|
+
|
47
|
+
cart/cart_item 中价格字段说明
|
36
48
|
|
37
|
-
|
49
|
+
* single_price: 商品单价
|
50
|
+
* original_amount: 商品原价
|
51
|
+
* retail_price: 零售价()
|
52
|
+
* final_price: 最终价格
|
53
|
+
|
54
|
+
## 注意
|
38
55
|
* Order: amount, received_amount
|
39
56
|
* Payment: total_amount, checked_amount
|
40
57
|
* PaymentOrder: check_amount
|
@@ -42,6 +59,11 @@ OrderItem <=> Shipment
|
|
42
59
|
### 依赖
|
43
60
|
* [default_form](https://github.com/qinmingyuan/default_form)
|
44
61
|
* [default_where](https://github.com/qinmingyuan/default_where)
|
45
|
-
* [
|
46
|
-
* [
|
47
|
-
* admin/payments
|
62
|
+
* [rails_audit](https://github.com/work-design/rails_audit)
|
63
|
+
* [rails_data](https://github.com/work-design/rails_data)
|
64
|
+
* admin/payments
|
65
|
+
* [rails_role](https://github.com/work-design/rails_role)
|
66
|
+
* admin/payments_controller
|
67
|
+
|
68
|
+
## License
|
69
|
+
License 采用 [LGPL-3.0](https://opensource.org/licenses/LGPL-3.0).
|
data/Rakefile
CHANGED
@@ -1,37 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
rescue LoadError
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
end
|
6
|
-
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'sdoc'
|
7
3
|
require 'rdoc/task'
|
8
4
|
|
9
|
-
RDoc::Task.new(:
|
10
|
-
rdoc.rdoc_dir = '
|
11
|
-
rdoc.title
|
12
|
-
rdoc.options << '--
|
13
|
-
rdoc.
|
5
|
+
RDoc::Task.new(:sdoc) do |rdoc|
|
6
|
+
rdoc.rdoc_dir = 'docs'
|
7
|
+
rdoc.title = 'RailsTrade'
|
8
|
+
rdoc.options << '--format=sdoc'
|
9
|
+
rdoc.template = 'rails'
|
10
|
+
rdoc.rdoc_files.include('README.md')
|
14
11
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
12
|
end
|
16
13
|
|
17
|
-
APP_RAKEFILE = File.expand_path(
|
14
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
18
15
|
load 'rails/tasks/engine.rake'
|
19
|
-
|
20
|
-
|
21
16
|
load 'rails/tasks/statistics.rake'
|
22
17
|
|
23
|
-
|
24
|
-
|
25
18
|
Bundler::GemHelper.install_tasks
|
26
19
|
|
27
|
-
require 'rake/testtask'
|
28
|
-
|
29
|
-
Rake::TestTask.new(:test) do |t|
|
30
|
-
t.libs << 'lib'
|
31
|
-
t.libs << 'test'
|
32
|
-
t.pattern = 'test/**/*_test.rb'
|
33
|
-
t.verbose = false
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
task default: :test
|
data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/create.js
RENAMED
File without changes
|
data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/index.js
RENAMED
File without changes
|
data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/cart_items/only.js
RENAMED
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
import './new'
|
data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/payment_methods/new.js
RENAMED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
import './new'
|
File without changes
|
data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/promote_buyers/edit.js
RENAMED
File without changes
|
data/app/assets/javascripts/controllers/{rails_trade_admin → trade/admin}/promote_buyers/new.js
RENAMED
@@ -1,3 +1,4 @@
|
|
1
|
+
$('#promote_buyer_buyer_type').dropdown();
|
1
2
|
$('#promote_buyer_buyer_id').dropdown({
|
2
3
|
apiSettings: {
|
3
4
|
url: '/buyers/search?q={query}',
|
@@ -28,4 +29,5 @@ $('#promote_buyer_promote_id').dropdown({
|
|
28
29
|
filterRemoteData: false,
|
29
30
|
saveRemoteData: true,
|
30
31
|
minCharacters: 2
|
31
|
-
});
|
32
|
+
});
|
33
|
+
$('#promote_buyer_status').dropdown();
|
@@ -0,0 +1 @@
|
|
1
|
+
import './new'
|
@@ -0,0 +1,7 @@
|
|
1
|
+
$('#promote_charge_type').dropdown({
|
2
|
+
onChange: function(value, text, $selectedItem){
|
3
|
+
var search_url = new URL('admin/promote_charges/options', location.origin);
|
4
|
+
search_url.searchParams.set('type', value);
|
5
|
+
Rails.ajax({url: search_url, type: 'GET', dataType: 'script'});
|
6
|
+
}
|
7
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
import './new'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
$('#promote_good_good_type').dropdown({
|
2
|
+
onChange: function (value, text, $selectedItem) {
|
3
|
+
var search_url = new URL(window.location.origin);
|
4
|
+
search_url.pathname = 'admin/promote_goods/goods';
|
5
|
+
search_url.search = $.param({good_type: value});
|
6
|
+
|
7
|
+
Rails.ajax({
|
8
|
+
url: search_url,
|
9
|
+
type: 'GET',
|
10
|
+
dataType: 'script'
|
11
|
+
})
|
12
|
+
}
|
13
|
+
});
|
14
|
+
$('#promote_good_good_id').dropdown({
|
15
|
+
placeholder: false
|
16
|
+
});
|
17
|
+
$('#promote_good_status').dropdown();
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#q_payment_method').dropdown();
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#payment_type').dropdown();
|
@@ -0,0 +1 @@
|
|
1
|
+
import './show-ready'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Controller } from 'stimulus'
|
2
|
+
|
3
|
+
class CartController extends Controller {
|
4
|
+
static targets = [ 'number' ];
|
5
|
+
|
6
|
+
connect() {
|
7
|
+
console.log(this.numberTarget.value)
|
8
|
+
console.log('CartController connected!')
|
9
|
+
}
|
10
|
+
|
11
|
+
update() {
|
12
|
+
var data = new FormData();
|
13
|
+
data.set(this.numberTarget.name, this.numberTarget.value);
|
14
|
+
Rails.ajax({ url: this.numberTarget.dataset.url, type: 'PATCH', dataType: 'script', data: data })
|
15
|
+
}
|
16
|
+
|
17
|
+
increase() {
|
18
|
+
this.numberTarget.value = this.numberTarget.valueAsNumber + 1;
|
19
|
+
this.update()
|
20
|
+
}
|
21
|
+
|
22
|
+
decrease() {
|
23
|
+
this.numberTarget.value = this.numberTarget.valueAsNumber - 1;
|
24
|
+
this.update()
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
application.register('cart', CartController);
|
data/app/{views/goods/show.html.erb → assets/javascripts/controllers/trade/my/trade_items/create.js}
RENAMED
File without changes
|
File without changes
|
@@ -0,0 +1,57 @@
|
|
1
|
+
.loader,
|
2
|
+
.loader:before,
|
3
|
+
.loader:after {
|
4
|
+
border-radius: 50%;
|
5
|
+
width: 2.5em;
|
6
|
+
height: 2.5em;
|
7
|
+
-webkit-animation-fill-mode: both;
|
8
|
+
animation-fill-mode: both;
|
9
|
+
-webkit-animation: load7 1.8s infinite ease-in-out;
|
10
|
+
animation: load7 1.8s infinite ease-in-out;
|
11
|
+
}
|
12
|
+
.loader {
|
13
|
+
color: #ffffff;
|
14
|
+
font-size: 10px;
|
15
|
+
margin: 80px auto;
|
16
|
+
position: relative;
|
17
|
+
text-indent: -9999em;
|
18
|
+
-webkit-transform: translateZ(0);
|
19
|
+
-ms-transform: translateZ(0);
|
20
|
+
transform: translateZ(0);
|
21
|
+
-webkit-animation-delay: -0.16s;
|
22
|
+
animation-delay: -0.16s;
|
23
|
+
}
|
24
|
+
.loader:before,
|
25
|
+
.loader:after {
|
26
|
+
content: '';
|
27
|
+
position: absolute;
|
28
|
+
top: 0;
|
29
|
+
}
|
30
|
+
.loader:before {
|
31
|
+
left: -3.5em;
|
32
|
+
-webkit-animation-delay: -0.32s;
|
33
|
+
animation-delay: -0.32s;
|
34
|
+
}
|
35
|
+
.loader:after {
|
36
|
+
left: 3.5em;
|
37
|
+
}
|
38
|
+
@-webkit-keyframes load7 {
|
39
|
+
0%,
|
40
|
+
80%,
|
41
|
+
100% {
|
42
|
+
box-shadow: 0 2.5em 0 -1.3em;
|
43
|
+
}
|
44
|
+
40% {
|
45
|
+
box-shadow: 0 2.5em 0 0;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
@keyframes load7 {
|
49
|
+
0%,
|
50
|
+
80%,
|
51
|
+
100% {
|
52
|
+
box-shadow: 0 2.5em 0 -1.3em;
|
53
|
+
}
|
54
|
+
40% {
|
55
|
+
box-shadow: 0 2.5em 0 0;
|
56
|
+
}
|
57
|
+
}
|
@@ -9,7 +9,6 @@ module ControllerOrderTypes
|
|
9
9
|
:paypal_execute,
|
10
10
|
:wxpay_pay
|
11
11
|
]
|
12
|
-
wechat_api
|
13
12
|
end
|
14
13
|
|
15
14
|
def stripe_pay
|
@@ -73,11 +72,9 @@ module ControllerOrderTypes
|
|
73
72
|
end
|
74
73
|
|
75
74
|
def wxpay_pay
|
76
|
-
|
77
|
-
@order.spbill_create_ip = request.remote_ip
|
75
|
+
@wxpay_order = @order.wxpay_order(spbill_create_ip: request.remote_ip)
|
78
76
|
|
79
|
-
@wxpay_order
|
80
|
-
if @wxpay_order[:result_code] == 'FAIL' || @wxpay_order.empty?
|
77
|
+
if @wxpay_order['result_code'] == 'FAIL' || @wxpay_order.blank?
|
81
78
|
render 'wxpay_pay_err'
|
82
79
|
else
|
83
80
|
render 'wxpay_pay'
|
@@ -89,4 +86,4 @@ module ControllerOrderTypes
|
|
89
86
|
set_order
|
90
87
|
end
|
91
88
|
|
92
|
-
end
|
89
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module RailsTrade::MyCart
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
included do
|
4
|
+
helper_method :current_cart
|
5
|
+
end
|
6
|
+
|
7
|
+
def current_cart
|
8
|
+
return @current_cart if defined? @current_cart
|
9
|
+
if current_user
|
10
|
+
@current_cart = current_user.carts.default_where(default_params).find_or_create_by(default: true)
|
11
|
+
else
|
12
|
+
@current_cart = Cart.find_or_create_by(default_form_params.merge(session_id: session.id))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::BuyersController < Trade::Admin::BaseController
|
2
2
|
before_action :set_buyer, only: [:orders]
|
3
3
|
|
4
4
|
def index
|
@@ -6,7 +6,7 @@ class RailsTradeAdmin::BuyersController < RailsTradeAdmin::BaseController
|
|
6
6
|
q_params = params.fetch(:q, {}).permit(:payment_strategy_id, :'crm_permits.manager_id', :'name-like').reverse_merge('orders.payment_status': ['unpaid', 'part_paid'], 'orders.state': 'active')
|
7
7
|
@overdue_date = params.fetch(:q, {})['overdue_date-lte'] || Date.today
|
8
8
|
|
9
|
-
@buyers = Buyer.unscoped.includes(:orders, :payment_strategy, :crm_permits).default_where(q_params).permit_with(
|
9
|
+
@buyers = Buyer.unscoped.includes(:orders, :payment_strategy, :crm_permits).default_where(q_params).permit_with(rails_role_user).page(params[:page])
|
10
10
|
end
|
11
11
|
|
12
12
|
def overdue
|
@@ -14,7 +14,7 @@ class RailsTradeAdmin::BuyersController < RailsTradeAdmin::BaseController
|
|
14
14
|
q_params = params.fetch(:q, {}).permit(:payment_strategy_id, :'crm_permits.manager_id', :'name-like').reverse_merge('orders.payment_status': ['unpaid', 'part_paid'], 'orders.state': 'active')
|
15
15
|
@overdue_date = params.fetch(:q, {})['overdue_date-lte'] || Date.today
|
16
16
|
|
17
|
-
@buyers = Buyer.unscoped.includes(:orders, :payment_strategy, :crm_permits).default_where(q_params).permit_with(
|
17
|
+
@buyers = Buyer.unscoped.includes(:orders, :payment_strategy, :crm_permits).default_where(q_params).permit_with(rails_role_user).page(params[:page])
|
18
18
|
end
|
19
19
|
|
20
20
|
def orders
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Trade::Admin::CartServesController < Trade::Admin::BaseController
|
2
2
|
before_action :set_cart_item
|
3
3
|
|
4
4
|
def index
|
@@ -14,8 +14,8 @@ class RailsTradeAdmin::CartItemServesController < RailsTradeAdmin::BaseControlle
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def new
|
17
|
-
@
|
18
|
-
@serve_charge = @cart_item.get_charge(@
|
17
|
+
@cart_serve = @cart_item.cart_serves.find_or_initialize_by(serve_id: params[:serve_id])
|
18
|
+
@serve_charge = @cart_item.get_charge(@cart_serve.serve)
|
19
19
|
end
|
20
20
|
|
21
21
|
def create
|
@@ -29,7 +29,7 @@ class RailsTradeAdmin::CartItemServesController < RailsTradeAdmin::BaseControlle
|
|
29
29
|
if @cart_item_serve.save
|
30
30
|
@cart_item.cart_item_serves.reload
|
31
31
|
format.js
|
32
|
-
format.html { redirect_to @cart_item_serve
|
32
|
+
format.html { redirect_to @cart_item_serve }
|
33
33
|
else
|
34
34
|
format.js
|
35
35
|
format.html { render :new }
|
@@ -57,7 +57,10 @@ class RailsTradeAdmin::CartItemServesController < RailsTradeAdmin::BaseControlle
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def cart_item_serve_params
|
60
|
-
params.fetch(:cart_item_serve, {}).permit(
|
60
|
+
params.fetch(:cart_item_serve, {}).permit(
|
61
|
+
:serve_id,
|
62
|
+
:price
|
63
|
+
)
|
61
64
|
end
|
62
65
|
|
63
66
|
end
|