rails_trade 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (792) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +20 -165
  3. data/README.md +8 -1
  4. data/app/apis/trade/apple_pay_api.rb +33 -0
  5. data/app/controllers/trade/admin/advances_controller.rb +58 -0
  6. data/app/controllers/trade/admin/base_controller.rb +3 -4
  7. data/app/controllers/trade/admin/card_advances_controller.rb +60 -0
  8. data/app/controllers/trade/admin/card_logs_controller.rb +44 -0
  9. data/app/controllers/trade/admin/card_payments_controller.rb +60 -0
  10. data/app/controllers/trade/admin/card_prepayments_controller.rb +58 -0
  11. data/app/controllers/trade/admin/card_promotes_controller.rb +63 -0
  12. data/app/controllers/trade/admin/card_templates_controller.rb +69 -0
  13. data/app/controllers/trade/admin/cards_controller.rb +66 -0
  14. data/app/controllers/trade/admin/carts_controller.rb +74 -0
  15. data/app/controllers/trade/admin/cash_givens_controller.rb +55 -0
  16. data/app/controllers/trade/admin/cash_logs_controller.rb +45 -0
  17. data/app/controllers/trade/admin/cashes_controller.rb +41 -0
  18. data/app/controllers/trade/admin/order_payments_controller.rb +42 -40
  19. data/app/controllers/trade/admin/orders_controller.rb +73 -83
  20. data/app/controllers/trade/admin/payment_methods_controller.rb +71 -84
  21. data/app/controllers/trade/admin/payment_orders_controller.rb +45 -42
  22. data/app/controllers/trade/admin/payment_references_controller.rb +45 -39
  23. data/app/controllers/trade/admin/payment_strategies_controller.rb +43 -40
  24. data/app/controllers/trade/admin/payments_controller.rb +68 -74
  25. data/app/controllers/trade/admin/payouts_controller.rb +67 -0
  26. data/app/controllers/trade/admin/promote_carts_controller.rb +54 -0
  27. data/app/controllers/trade/admin/promote_charges_controller.rb +55 -53
  28. data/app/controllers/trade/admin/promote_goods_controller.rb +51 -46
  29. data/app/controllers/trade/admin/promotes_controller.rb +3 -67
  30. data/app/controllers/trade/admin/refunds_controller.rb +51 -40
  31. data/app/controllers/trade/admin/trade_items_controller.rb +103 -98
  32. data/app/controllers/trade/admin/trade_promotes_controller.rb +36 -54
  33. data/app/controllers/trade/admin/users_controller.rb +30 -0
  34. data/app/controllers/trade/advances_controller.rb +50 -0
  35. data/app/controllers/trade/base_controller.rb +4 -0
  36. data/app/controllers/trade/card_templates_controller.rb +61 -0
  37. data/app/controllers/trade/controller/application.rb +35 -0
  38. data/app/controllers/trade/controller/promote.rb +68 -0
  39. data/app/controllers/trade/my/advances_controller.rb +66 -0
  40. data/app/controllers/trade/my/base_controller.rb +3 -3
  41. data/app/controllers/trade/my/card_logs_controller.rb +15 -0
  42. data/app/controllers/trade/my/cards_controller.rb +78 -0
  43. data/app/controllers/trade/my/carts_controller.rb +50 -29
  44. data/app/controllers/trade/my/cash_logs_controller.rb +10 -0
  45. data/app/controllers/trade/my/orders_controller.rb +145 -81
  46. data/app/controllers/trade/my/payment_methods_controller.rb +40 -57
  47. data/app/controllers/trade/my/payments_controller.rb +56 -0
  48. data/app/controllers/trade/my/payouts_controller.rb +33 -0
  49. data/app/controllers/trade/my/trade_items_controller.rb +54 -44
  50. data/app/controllers/trade/panel/base_controller.rb +4 -0
  51. data/app/controllers/trade/panel/exchange_rates_controller.rb +53 -0
  52. data/app/controllers/trade/payments_controller.rb +53 -51
  53. data/app/models/payment/trade/alipay_payment.rb +5 -0
  54. data/app/models/payment/trade/apple_payment.rb +5 -0
  55. data/app/models/payment/trade/bank_payment.rb +5 -0
  56. data/app/models/payment/trade/card_payment.rb +5 -0
  57. data/app/models/payment/trade/hand_payment.rb +5 -0
  58. data/app/models/payment/trade/paypal_payment.rb +5 -0
  59. data/app/models/payment/trade/stripe_payment.rb +5 -0
  60. data/app/models/payment/trade/wxpay_payment.rb +5 -0
  61. data/app/models/payment_method/trade/alipay_method.rb +4 -0
  62. data/app/models/payment_method/trade/bank_method.rb +4 -0
  63. data/app/models/payment_method/trade/stripe_method.rb +5 -0
  64. data/app/models/payout/trade/wxpay_payout.rb +5 -0
  65. data/app/models/promote_charge/trade/discount_promote_charge.rb +5 -0
  66. data/app/models/promote_charge/trade/final_promote_charge.rb +5 -0
  67. data/app/models/promote_charge/trade/minus_promote_charge.rb +5 -0
  68. data/app/models/promote_charge/trade/plus_promote_charge.rb +5 -0
  69. data/app/models/refund/trade/alipay_refund.rb +5 -0
  70. data/app/models/refund/trade/bank_refund.rb +5 -0
  71. data/app/models/refund/trade/card_refund.rb +5 -0
  72. data/app/models/refund/trade/hand_refund.rb +5 -0
  73. data/app/models/refund/trade/paypal_refund.rb +5 -0
  74. data/app/models/refund/trade/stripe_refund.rb +5 -0
  75. data/app/models/refund/trade/wxpay_refund.rb +5 -0
  76. data/app/models/trade/advance.rb +6 -0
  77. data/app/models/trade/application_record.rb +5 -0
  78. data/app/models/trade/card.rb +6 -0
  79. data/app/models/trade/card_advance.rb +5 -0
  80. data/app/models/trade/card_log.rb +5 -0
  81. data/app/models/trade/card_prepayment.rb +5 -0
  82. data/app/models/trade/card_promote.rb +5 -0
  83. data/app/models/trade/card_template.rb +5 -0
  84. data/app/models/trade/cart.rb +7 -0
  85. data/app/models/trade/cash.rb +6 -0
  86. data/app/models/trade/cash_given.rb +5 -0
  87. data/app/models/trade/cash_log.rb +5 -0
  88. data/app/models/trade/exchange_rate.rb +5 -0
  89. data/app/models/trade/ext/payable.rb +50 -0
  90. data/app/models/trade/ext/user.rb +38 -0
  91. data/app/models/trade/model/advance.rb +43 -0
  92. data/app/models/trade/model/agency.rb +10 -0
  93. data/app/models/trade/model/amount.rb +41 -0
  94. data/app/models/trade/model/card.rb +64 -0
  95. data/app/models/trade/model/card_advance.rb +52 -0
  96. data/app/models/trade/model/card_log.rb +17 -0
  97. data/app/models/trade/model/card_prepayment.rb +31 -0
  98. data/app/models/trade/model/card_promote.rb +14 -0
  99. data/app/models/trade/model/card_template.rb +31 -0
  100. data/app/models/trade/model/cart.rb +60 -0
  101. data/app/models/trade/model/cash.rb +32 -0
  102. data/app/models/trade/model/cash_given.rb +40 -0
  103. data/app/models/trade/model/cash_log.rb +26 -0
  104. data/app/models/trade/model/compute.rb +33 -0
  105. data/app/models/trade/model/exchange_rate.rb +44 -0
  106. data/app/models/trade/model/good.rb +66 -0
  107. data/app/models/trade/model/member.rb +25 -0
  108. data/app/models/trade/model/order.rb +127 -0
  109. data/app/models/trade/model/payment/alipay_payment.rb +17 -0
  110. data/app/models/trade/model/payment/apple_payment.rb +9 -0
  111. data/app/models/trade/model/payment/bank_payment.rb +19 -0
  112. data/app/models/trade/model/payment/card_payment.rb +72 -0
  113. data/app/models/trade/model/payment/hand_payment.rb +10 -0
  114. data/app/models/trade/model/payment/paypal_payment.rb +10 -0
  115. data/app/models/trade/model/payment/stripe_payment.rb +11 -0
  116. data/app/models/trade/model/payment/wxpay_payment.rb +15 -0
  117. data/app/models/trade/model/payment.rb +131 -0
  118. data/app/models/trade/model/payment_method/stripe_method.rb +59 -0
  119. data/app/models/trade/model/payment_method.rb +67 -0
  120. data/app/models/trade/model/payment_order.rb +108 -0
  121. data/app/models/trade/model/payment_reference.rb +21 -0
  122. data/app/models/trade/model/payment_strategy.rb +22 -0
  123. data/app/models/trade/model/payout/wxpay_payout.rb +31 -0
  124. data/app/models/trade/model/payout.rb +71 -0
  125. data/app/models/trade/model/plan_attender.rb +33 -0
  126. data/app/models/trade/model/profile.rb +10 -0
  127. data/app/models/trade/model/promote.rb +59 -0
  128. data/app/models/trade/model/promote_cart.rb +30 -0
  129. data/app/models/trade/model/promote_charge/discount_promote_charge.rb +19 -0
  130. data/app/models/trade/model/promote_charge/final_promote_charge.rb +11 -0
  131. data/app/models/trade/model/promote_charge/minus_promote_charge.rb +20 -0
  132. data/app/models/trade/model/promote_charge/plus_promote_charge.rb +9 -0
  133. data/app/models/trade/model/promote_charge.rb +86 -0
  134. data/app/models/trade/model/promote_extra.rb +16 -0
  135. data/app/models/trade/model/promote_good.rb +28 -0
  136. data/app/models/trade/model/refund/alipay_refund.rb +29 -0
  137. data/app/models/trade/model/refund/bank_refund.rb +4 -0
  138. data/app/models/trade/model/refund/card_refund.rb +45 -0
  139. data/app/models/trade/model/refund/hand_refund.rb +9 -0
  140. data/app/models/trade/model/refund/paypal_refund.rb +27 -0
  141. data/app/models/trade/model/refund/stripe_refund.rb +20 -0
  142. data/app/models/trade/model/refund/wxpay_refund.rb +74 -0
  143. data/app/models/trade/model/refund.rb +70 -0
  144. data/app/models/trade/model/sell.rb +24 -0
  145. data/app/models/trade/model/trade_item.rb +214 -0
  146. data/app/models/trade/model/trade_promote.rb +69 -0
  147. data/app/models/trade/order.rb +8 -0
  148. data/app/models/trade/ordering/payment.rb +112 -0
  149. data/app/models/trade/ordering/refund.rb +36 -0
  150. data/app/models/trade/payment.rb +6 -0
  151. data/app/models/trade/payment_method.rb +5 -0
  152. data/app/models/trade/payment_order.rb +5 -0
  153. data/app/models/trade/payment_reference.rb +5 -0
  154. data/app/models/trade/payment_strategy.rb +5 -0
  155. data/app/models/trade/payment_type/alipay.rb +35 -0
  156. data/app/models/trade/payment_type/apple_pay.rb +20 -0
  157. data/app/models/trade/payment_type/paypal.rb +84 -0
  158. data/app/models/trade/payment_type/stripe.rb +57 -0
  159. data/app/models/trade/payment_type/svf_card.rb +24 -0
  160. data/app/models/trade/payment_type/wxpay.rb +104 -0
  161. data/app/models/trade/payout.rb +5 -0
  162. data/app/models/trade/promote.rb +6 -0
  163. data/app/models/trade/promote_cart.rb +5 -0
  164. data/app/models/trade/promote_charge.rb +5 -0
  165. data/app/models/trade/promote_extra.rb +5 -0
  166. data/app/models/trade/promote_good.rb +5 -0
  167. data/app/models/trade/refund.rb +5 -0
  168. data/app/models/trade/trade_item.rb +5 -0
  169. data/app/models/trade/trade_promote.rb +5 -0
  170. data/app/models/trade.rb +11 -0
  171. data/app/views/admin/_trade_nav.html.erb +35 -0
  172. data/app/views/my/_trade_nav.html.erb +4 -9
  173. data/app/views/panel/_trade_nav.html.erb +10 -0
  174. data/app/views/trade/admin/advances/_breadcrumb.html.erb +7 -0
  175. data/app/views/trade/admin/advances/_edit_form.html.erb +4 -0
  176. data/app/views/trade/admin/advances/_form.html.erb +4 -0
  177. data/app/views/trade/admin/advances/_index_tbody.html.erb +3 -0
  178. data/app/views/trade/admin/advances/_index_thead.html.erb +4 -0
  179. data/app/views/trade/admin/advances/_new_form.html.erb +4 -0
  180. data/app/views/trade/admin/advances/index.html.erb +5 -0
  181. data/app/views/trade/admin/advances/show.html.erb +30 -0
  182. data/app/views/trade/admin/base/_nav.html.erb +4 -0
  183. data/app/views/trade/admin/card_advances/_breadcrumb.html.erb +7 -0
  184. data/app/views/trade/admin/card_advances/_edit_form.html.erb +4 -0
  185. data/app/views/trade/admin/card_advances/_form.html.erb +3 -0
  186. data/app/views/trade/admin/card_advances/_index_tbody.html.erb +5 -0
  187. data/app/views/trade/admin/card_advances/_index_thead.html.erb +6 -0
  188. data/app/views/trade/admin/card_advances/_new_form.html.erb +4 -0
  189. data/app/views/trade/admin/card_advances/_show_table.html.erb +20 -0
  190. data/app/views/trade/admin/card_advances/index.html.erb +5 -0
  191. data/app/views/trade/admin/card_logs/_breadcrumb.html.erb +7 -0
  192. data/app/views/trade/admin/card_logs/_card_log.json.jbuilder +11 -0
  193. data/app/views/trade/admin/card_logs/_edit_form.html.erb +4 -0
  194. data/app/views/trade/admin/card_logs/_filter_form.html.erb +8 -0
  195. data/app/views/trade/admin/card_logs/_form.html.erb +3 -0
  196. data/app/views/trade/admin/card_logs/_index_tbody.html.erb +8 -0
  197. data/app/views/trade/admin/card_logs/_index_thead.html.erb +9 -0
  198. data/app/views/trade/admin/card_logs/_index_tr.html.erb +10 -0
  199. data/app/views/trade/admin/card_logs/_new_form.html.erb +4 -0
  200. data/app/views/trade/admin/card_logs/_show.json.jbuilder +1 -0
  201. data/app/views/trade/admin/card_logs/_show_table.html.erb +24 -0
  202. data/app/views/trade/admin/card_logs/index.html.erb +5 -0
  203. data/app/views/trade/admin/card_logs/index.json.jbuilder +1 -0
  204. data/app/views/trade/admin/card_payments/_breadcrumb.html.erb +7 -0
  205. data/app/views/trade/admin/{orders/_search_form.html.erb → card_payments/_button.html.erb} +0 -0
  206. data/app/views/trade/admin/card_payments/_edit_form.html.erb +4 -0
  207. data/app/views/trade/admin/card_payments/_filter_form.html.erb +9 -0
  208. data/app/views/trade/admin/card_payments/_form.html.erb +2 -0
  209. data/app/views/trade/admin/card_payments/_index_tbody.html.erb +3 -0
  210. data/app/views/trade/admin/card_payments/_index_thead.html.erb +4 -0
  211. data/app/views/trade/admin/card_payments/_new_form.html.erb +4 -0
  212. data/app/views/trade/admin/card_payments/_show_table.html.erb +12 -0
  213. data/app/views/trade/admin/card_payments/index.html.erb +5 -0
  214. data/app/views/trade/admin/card_prepayments/_breadcrumb.html.erb +6 -0
  215. data/app/views/trade/admin/card_prepayments/_edit_form.html.erb +4 -0
  216. data/app/views/trade/admin/card_prepayments/_filter_form.html.erb +9 -0
  217. data/app/views/trade/admin/card_prepayments/_form.html.erb +3 -0
  218. data/app/views/trade/admin/card_prepayments/_index_tbody.html.erb +3 -0
  219. data/app/views/trade/admin/card_prepayments/_index_thead.html.erb +4 -0
  220. data/app/views/trade/admin/card_prepayments/_new_form.html.erb +4 -0
  221. data/app/views/trade/admin/card_prepayments/_show_table.html.erb +16 -0
  222. data/app/views/trade/admin/card_prepayments/index.html.erb +5 -0
  223. data/app/views/trade/admin/card_promotes/_breadcrumb.html.erb +6 -0
  224. data/app/views/trade/admin/card_promotes/_edit_form.html.erb +4 -0
  225. data/app/views/trade/admin/card_promotes/_filter_form.html.erb +9 -0
  226. data/app/views/trade/admin/card_promotes/_form.html.erb +4 -0
  227. data/app/views/trade/admin/card_promotes/_index_tbody.html.erb +5 -0
  228. data/app/views/trade/admin/card_promotes/_index_thead.html.erb +6 -0
  229. data/app/views/trade/admin/card_promotes/_new_form.html.erb +4 -0
  230. data/app/views/trade/admin/card_promotes/_show_table.html.erb +12 -0
  231. data/app/views/trade/admin/card_promotes/index.html.erb +5 -0
  232. data/app/views/trade/admin/card_templates/_advance_options.html.erb +1 -0
  233. data/app/views/trade/admin/card_templates/_card_template.json.jbuilder +7 -0
  234. data/app/views/trade/admin/card_templates/_edit_form.html.erb +4 -0
  235. data/app/views/trade/admin/card_templates/_filter_form.html.erb +9 -0
  236. data/app/views/trade/admin/card_templates/_form.html.erb +11 -0
  237. data/app/views/trade/admin/card_templates/_index_tbody.html.erb +14 -0
  238. data/app/views/trade/admin/card_templates/_index_thead.html.erb +10 -0
  239. data/app/views/trade/admin/card_templates/_index_tr.html.erb +25 -0
  240. data/app/views/trade/admin/card_templates/_item_form.html.erb +15 -0
  241. data/app/views/trade/admin/card_templates/_new_form.html.erb +4 -0
  242. data/app/views/trade/admin/card_templates/_show.json.jbuilder +1 -0
  243. data/app/views/trade/admin/card_templates/_show_table.html.erb +12 -0
  244. data/app/views/trade/admin/card_templates/advance_options.js.erb +3 -0
  245. data/app/views/trade/admin/card_templates/index.html.erb +5 -0
  246. data/app/views/trade/admin/card_templates/index.json.jbuilder +1 -0
  247. data/app/views/trade/admin/cards/_breadcrumb.html.erb +6 -0
  248. data/app/views/trade/admin/cards/_button.html.erb +3 -0
  249. data/app/views/trade/admin/cards/_card.json.jbuilder +10 -0
  250. data/app/views/trade/admin/cards/_edit_form.html.erb +4 -0
  251. data/app/views/trade/admin/cards/_filter_form.html.erb +10 -0
  252. data/app/views/trade/admin/cards/_filter_table.html.erb +11 -0
  253. data/app/views/trade/admin/cards/_form.html.erb +4 -0
  254. data/app/views/trade/admin/cards/_index_tbody.html.erb +25 -0
  255. data/app/views/trade/admin/cards/_index_thead.html.erb +14 -0
  256. data/app/views/trade/admin/cards/_index_tr.html.erb +19 -0
  257. data/app/views/trade/admin/cards/_new_form.html.erb +5 -0
  258. data/app/views/trade/admin/cards/_show.json.jbuilder +1 -0
  259. data/app/views/trade/admin/cards/_show_table.html.erb +20 -0
  260. data/app/views/trade/admin/cards/index.html.erb +5 -0
  261. data/app/views/trade/admin/cards/index.json.jbuilder +1 -0
  262. data/app/views/trade/admin/{promote_buyers/show.html.erb → carts/_button.html.erb} +0 -0
  263. data/app/views/trade/admin/{cart_item_serves → carts}/_check.html.erb +0 -0
  264. data/app/views/trade/admin/{cart_item_serves → carts}/_index.html.erb +1 -3
  265. data/app/views/trade/admin/carts/_index_tbody.html.erb +6 -0
  266. data/app/views/trade/admin/carts/_index_thead.html.erb +7 -0
  267. data/app/views/trade/admin/{cart_item_serves → carts}/_new.html.erb +1 -1
  268. data/app/views/trade/admin/{cart_item_serves → carts}/_serve.html.erb +2 -2
  269. data/app/views/trade/admin/{cart_item_serves → carts}/_single.html.erb +0 -0
  270. data/app/views/trade/admin/{cart_item_serves → carts}/_single_table.html.erb +0 -0
  271. data/app/views/trade/admin/{cart_item_serves → carts}/_total.html.erb +0 -0
  272. data/app/views/trade/admin/{cart_item_serves → carts}/_total_table.html.erb +0 -0
  273. data/app/views/trade/admin/carts/index.html.erb +5 -0
  274. data/app/views/trade/admin/cash_givens/_edit_form.html.erb +4 -0
  275. data/app/views/trade/admin/cash_givens/_filter_form.html.erb +5 -0
  276. data/app/views/trade/admin/cash_givens/_form.html.erb +4 -0
  277. data/app/views/trade/admin/cash_givens/_index_tbody.html.erb +17 -0
  278. data/app/views/trade/admin/cash_givens/_index_thead.html.erb +4 -0
  279. data/app/views/trade/admin/cash_givens/_new_form.html.erb +4 -0
  280. data/app/views/trade/admin/cash_givens/_show_table.html.erb +12 -0
  281. data/app/views/trade/admin/cash_givens/index.html.erb +5 -0
  282. data/app/views/trade/admin/cash_logs/_edit_form.html.erb +4 -0
  283. data/app/views/trade/admin/cash_logs/_filter_form.html.erb +8 -0
  284. data/app/views/trade/admin/cash_logs/_form.html.erb +2 -0
  285. data/app/views/trade/admin/cash_logs/_index_tbody.html.erb +25 -0
  286. data/app/views/trade/admin/cash_logs/_index_thead.html.erb +11 -0
  287. data/app/views/trade/admin/cash_logs/_new_form.html.erb +4 -0
  288. data/app/views/trade/admin/cash_logs/_show_table.html.erb +20 -0
  289. data/app/views/trade/admin/cash_logs/index.html.erb +5 -0
  290. data/app/views/trade/admin/cashes/_button.html.erb +0 -0
  291. data/app/views/trade/admin/cashes/_edit_form.html.erb +4 -0
  292. data/app/views/trade/admin/cashes/_filter_form.html.erb +5 -0
  293. data/app/views/trade/admin/cashes/_form.html.erb +3 -0
  294. data/app/views/trade/admin/cashes/_index_tbody.html.erb +18 -0
  295. data/app/views/trade/admin/cashes/_index_thead.html.erb +12 -0
  296. data/app/views/trade/admin/cashes/_new_form.html.erb +4 -0
  297. data/app/views/trade/admin/cashes/_show_tbody.html.erb +20 -0
  298. data/app/views/trade/admin/cashes/index.html.erb +5 -0
  299. data/app/views/trade/admin/goods/_form.html.erb +1 -1
  300. data/app/views/trade/admin/goods/_item.html.erb +1 -1
  301. data/app/views/trade/admin/goods/_new.html.erb +1 -1
  302. data/app/views/trade/admin/order_payments/_index_tbody.html.erb +6 -0
  303. data/app/views/trade/admin/order_payments/_index_thead.html.erb +6 -0
  304. data/app/views/trade/admin/order_payments/_index_tr.html.erb +4 -0
  305. data/app/views/trade/admin/order_payments/_new_form.html.erb +30 -0
  306. data/app/views/trade/admin/order_payments/_payment_orders.html.erb +2 -2
  307. data/app/views/trade/admin/order_payments/index.html.erb +12 -0
  308. data/app/views/trade/admin/orders/_addresses.html.erb +3 -3
  309. data/app/views/trade/admin/orders/_breadcrumb.html.erb +5 -0
  310. data/app/views/trade/admin/orders/_button.html.erb +0 -0
  311. data/app/views/trade/admin/orders/_edit_form.html.erb +3 -0
  312. data/app/views/trade/admin/orders/_filter_form.html.erb +9 -0
  313. data/app/views/trade/admin/orders/_filter_table.html.erb +20 -0
  314. data/app/views/trade/admin/orders/_index_tbody.html.erb +16 -0
  315. data/app/views/trade/admin/orders/_index_thead.html.erb +8 -0
  316. data/app/views/trade/admin/orders/_index_tr.html.erb +10 -0
  317. data/app/views/trade/admin/orders/_invoice_addresses.html.erb +3 -3
  318. data/app/views/trade/admin/orders/_show/_breadcrumb.html.erb +6 -0
  319. data/app/views/trade/admin/orders/index.html.erb +2 -49
  320. data/app/views/trade/admin/orders/new.html.erb +1 -1
  321. data/app/{assets/javascripts/controllers → views}/trade/admin/orders/new.js +0 -0
  322. data/app/views/trade/admin/orders/payments.html.erb +6 -6
  323. data/app/views/trade/admin/orders/refund.turbo_stream.erb +3 -0
  324. data/app/views/trade/admin/orders/show.html.erb +12 -20
  325. data/app/views/trade/admin/payment_methods/_breadcrumb.html.erb +10 -0
  326. data/app/views/trade/admin/payment_methods/_edit_form.html.erb +4 -0
  327. data/app/views/trade/admin/payment_methods/_filter_form.html.erb +12 -0
  328. data/app/views/trade/admin/payment_methods/_filter_table.html.erb +9 -0
  329. data/app/views/trade/admin/payment_methods/_form.html.erb +1 -2
  330. data/app/views/trade/admin/payment_methods/_index_tbody.html.erb +17 -0
  331. data/app/views/trade/admin/payment_methods/_index_thead.html.erb +7 -0
  332. data/app/views/trade/admin/payment_methods/_index_tr.html.erb +10 -0
  333. data/app/views/trade/admin/payment_methods/_new_form.html.erb +4 -0
  334. data/app/views/trade/admin/payment_methods/_unverified/_index_tbody.html.erb +37 -0
  335. data/app/views/trade/admin/payment_methods/index.html.erb +4 -25
  336. data/app/views/trade/admin/payment_methods/mine.html.erb +3 -3
  337. data/app/views/trade/admin/payment_methods/unverified.html.erb +4 -57
  338. data/app/views/trade/admin/payment_orders/_index.html.erb +5 -7
  339. data/app/views/trade/admin/payment_orders/_new.html.erb +5 -8
  340. data/app/views/trade/admin/payment_orders/_orders.html.erb +1 -3
  341. data/app/views/trade/admin/payment_orders/cancel.js.erb +2 -2
  342. data/app/views/trade/admin/payment_orders/create.js.erb +2 -2
  343. data/app/views/trade/admin/payment_orders/new.turbo_stream.erb +2 -0
  344. data/app/views/trade/admin/payment_orders/update.js.erb +2 -2
  345. data/app/views/trade/admin/payment_orders/update_fail.js.erb +2 -2
  346. data/app/views/trade/admin/payment_strategies/_edit_form.html.erb +4 -0
  347. data/app/views/trade/admin/payment_strategies/_form.html.erb +2 -5
  348. data/app/views/trade/admin/payment_strategies/_index_tbody.html.erb +12 -0
  349. data/app/views/trade/admin/payment_strategies/_index_thead.html.erb +3 -0
  350. data/app/views/trade/admin/payment_strategies/_new_form.html.erb +4 -0
  351. data/app/views/trade/admin/payment_strategies/index.html.erb +4 -36
  352. data/app/views/trade/admin/payments/_breadcrumb.html.erb +5 -0
  353. data/app/views/trade/admin/payments/_button.html.erb +2 -0
  354. data/app/views/trade/admin/payments/_edit_form.html.erb +4 -0
  355. data/app/views/trade/admin/payments/_filter_form.html.erb +13 -0
  356. data/app/views/trade/admin/payments/_filter_table.html.erb +29 -0
  357. data/app/views/trade/admin/payments/_form.html.erb +2 -3
  358. data/app/views/trade/admin/payments/_index_tbody.html.erb +24 -0
  359. data/app/views/trade/admin/payments/_index_thead.html.erb +15 -0
  360. data/app/views/trade/admin/payments/_index_tr.html.erb +17 -0
  361. data/app/views/trade/admin/payments/_new_form.html.erb +4 -0
  362. data/app/views/trade/admin/payments/dashboard.html.erb +0 -3
  363. data/app/views/trade/admin/payments/index.html.erb +2 -37
  364. data/app/views/trade/admin/payouts/_edit_form.html.erb +4 -0
  365. data/app/views/trade/admin/payouts/_filter_form.html.erb +10 -0
  366. data/app/views/trade/admin/payouts/_form.html.erb +4 -0
  367. data/app/views/trade/admin/payouts/_index_tbody.html.erb +12 -0
  368. data/app/views/trade/admin/payouts/_index_thead.html.erb +11 -0
  369. data/app/views/trade/admin/payouts/_index_tr.html.erb +9 -0
  370. data/app/views/trade/admin/payouts/_new_form.html.erb +4 -0
  371. data/app/views/trade/admin/payouts/_show_table.html.erb +32 -0
  372. data/app/views/trade/admin/payouts/index.html.erb +5 -0
  373. data/app/views/trade/admin/promote_carts/_breadcrumb.html.erb +10 -0
  374. data/app/views/trade/admin/promote_carts/_edit_form.html.erb +4 -0
  375. data/app/views/trade/admin/promote_carts/_filter_form.html.erb +9 -0
  376. data/app/views/trade/admin/promote_carts/_form.html.erb +9 -0
  377. data/app/views/trade/admin/promote_carts/_index_tbody.html.erb +3 -0
  378. data/app/views/trade/admin/promote_carts/_index_thead.html.erb +4 -0
  379. data/app/views/trade/admin/promote_carts/_index_tr.html.erb +10 -0
  380. data/app/views/trade/admin/promote_carts/_new_form.html.erb +4 -0
  381. data/app/views/trade/admin/{promote_buyers → promote_carts}/_promote_buyer.json.jbuilder +0 -0
  382. data/app/{assets/javascripts/controllers/trade/admin/promote_buyers → views/trade/admin/promote_carts}/edit.js +0 -0
  383. data/app/views/trade/admin/promote_carts/index.html.erb +5 -0
  384. data/app/views/trade/admin/{promote_buyers → promote_carts}/index.json.jbuilder +0 -0
  385. data/app/{assets/javascripts/controllers/trade/admin/promote_buyers → views/trade/admin/promote_carts}/new.js +0 -0
  386. data/app/views/trade/admin/promote_carts/show.json.jbuilder +1 -0
  387. data/app/views/trade/admin/promote_charges/_base_price_form.html.erb +1 -1
  388. data/app/views/trade/admin/promote_charges/_breadcrumb.html.erb +7 -0
  389. data/app/views/trade/admin/promote_charges/_edit_form.html.erb +4 -0
  390. data/app/views/trade/admin/promote_charges/_filter_form.html.erb +13 -0
  391. data/app/views/trade/admin/promote_charges/_form.html.erb +5 -7
  392. data/app/views/trade/admin/promote_charges/_index_tbody.html.erb +17 -0
  393. data/app/views/trade/admin/promote_charges/_index_thead.html.erb +12 -0
  394. data/app/views/trade/admin/promote_charges/_index_tr.html.erb +13 -0
  395. data/app/views/trade/admin/promote_charges/_new_form.html.erb +4 -0
  396. data/app/views/trade/admin/promote_charges/index.html.erb +2 -62
  397. data/app/views/trade/admin/promote_goods/_breadcrumb.html.erb +9 -0
  398. data/app/views/trade/admin/promote_goods/_button.html.erb +3 -0
  399. data/app/views/trade/admin/promote_goods/_filter_form.html.erb +10 -0
  400. data/app/views/trade/admin/promote_goods/_form.html.erb +7 -8
  401. data/app/views/trade/admin/promote_goods/_index_tbody.html.erb +10 -0
  402. data/app/views/trade/admin/promote_goods/_index_thead.html.erb +5 -0
  403. data/app/views/trade/admin/promote_goods/_index_tr.html.erb +16 -0
  404. data/app/views/trade/admin/promote_goods/_new_form.html.erb +4 -0
  405. data/app/views/trade/admin/promote_goods/goods.js.erb +1 -1
  406. data/app/views/trade/admin/promote_goods/index.html.erb +2 -58
  407. data/app/views/trade/admin/promotes/_edit_form.html.erb +4 -0
  408. data/app/views/trade/admin/promotes/_filter_table.html.erb +11 -0
  409. data/app/views/trade/admin/promotes/_form.html.erb +3 -8
  410. data/app/views/trade/admin/promotes/_index_tbody.html.erb +18 -0
  411. data/app/views/trade/admin/promotes/_index_thead.html.erb +12 -0
  412. data/app/views/trade/admin/promotes/_index_tr.html.erb +22 -0
  413. data/app/views/trade/admin/promotes/_new_form.html.erb +4 -0
  414. data/app/views/trade/admin/promotes/_new_promote_charge.html.erb +1 -1
  415. data/app/views/trade/admin/promotes/_show_table.html.erb +4 -0
  416. data/app/views/trade/admin/promotes/index.html.erb +4 -78
  417. data/app/views/trade/admin/refunds/_breadcrumb.html.erb +6 -0
  418. data/app/views/trade/admin/refunds/_filter_form.html.erb +13 -0
  419. data/app/views/trade/admin/refunds/_index_tbody.html.erb +25 -0
  420. data/app/views/trade/admin/refunds/_index_thead.html.erb +12 -0
  421. data/app/views/trade/admin/refunds/_index_tr.html.erb +3 -0
  422. data/app/views/trade/admin/refunds/_logs_form.html.erb +33 -0
  423. data/app/views/trade/admin/refunds/_new.html.erb +8 -18
  424. data/app/views/trade/admin/refunds/confirm.turbo_stream.erb +3 -0
  425. data/app/views/trade/admin/refunds/deny.turbo_stream.erb +3 -0
  426. data/app/views/trade/admin/refunds/index.html.erb +4 -52
  427. data/app/views/trade/admin/refunds/logs.turbo_stream.erb +1 -0
  428. data/app/views/trade/admin/trade_items/_filter.html.erb +5 -5
  429. data/app/views/trade/admin/trade_items/_good_price.html.erb +5 -5
  430. data/app/views/trade/admin/trade_items/_order_price.html.erb +8 -8
  431. data/app/views/trade/admin/trade_items/_retail_price.html.erb +3 -3
  432. data/app/views/trade/admin/trade_items/_show/_breadcrumb.html.erb +7 -0
  433. data/app/views/trade/admin/trade_items/_single_price.html.erb +10 -10
  434. data/app/{assets/javascripts/controllers/trade/admin/cart_items → views/trade/admin/trade_items}/create.js +0 -0
  435. data/app/views/trade/admin/trade_items/index.html.erb +31 -42
  436. data/app/{assets/javascripts/controllers/trade/admin/cart_items → views/trade/admin/trade_items}/index.js +0 -0
  437. data/app/views/trade/admin/trade_items/only.html.erb +2 -2
  438. data/app/{assets/javascripts/controllers/trade/admin/cart_items → views/trade/admin/trade_items}/only.js +0 -0
  439. data/app/views/trade/admin/trade_items/show.html.erb +0 -0
  440. data/app/views/trade/admin/trade_promotes/_edit_form.html.erb +4 -0
  441. data/app/views/trade/admin/trade_promotes/{_filter.html.erb → _filter_form.html.erb} +2 -2
  442. data/app/views/trade/admin/trade_promotes/_form.html.erb +3 -6
  443. data/app/views/trade/admin/trade_promotes/_index_tbody.html.erb +2 -0
  444. data/app/views/trade/admin/trade_promotes/_index_thead.html.erb +3 -0
  445. data/app/views/trade/admin/trade_promotes/_new_form.html.erb +4 -0
  446. data/app/views/trade/admin/trade_promotes/_show_table.html.erb +8 -20
  447. data/app/views/trade/admin/trade_promotes/index.html.erb +3 -36
  448. data/app/views/trade/admin/{buyers → users}/index.html.erb +4 -4
  449. data/app/views/trade/admin/{buyers → users}/orders.html.erb +6 -6
  450. data/app/views/trade/admin/{buyers → users}/overdue.html.erb +2 -2
  451. data/app/views/trade/advances/index.html.erb +15 -0
  452. data/app/views/trade/card_templates/_card_template.json.jbuilder +9 -0
  453. data/app/views/trade/card_templates/_filter_form.html.erb +8 -0
  454. data/app/views/trade/card_templates/_show_table.html.erb +16 -0
  455. data/app/views/trade/card_templates/index.html.erb +16 -0
  456. data/app/views/trade/card_templates/index.json.jbuilder +1 -0
  457. data/app/views/trade/card_templates/show.json.jbuilder +1 -0
  458. data/app/views/trade/goods/_search.html.erb +3 -3
  459. data/app/views/trade/goods/taxon/_breadcrumb.html.erb +2 -2
  460. data/app/views/trade/my/advances/index.json.jbuilder +11 -0
  461. data/app/views/trade/my/advances/order.json.jbuilder +14 -0
  462. data/app/views/trade/my/card_logs/_wallet_log.json.jbuilder +1 -0
  463. data/app/views/trade/my/card_logs/index.html.erb +15 -0
  464. data/app/views/trade/my/card_logs/index.json.jbuilder +5 -0
  465. data/app/views/trade/my/cards/index.html.erb +45 -0
  466. data/app/views/trade/my/cards/new.html.erb +0 -0
  467. data/app/views/trade/my/cards/token.html.erb +11 -0
  468. data/app/views/trade/my/{trade_items → carts}/_additions.html.erb +0 -2
  469. data/app/views/trade/my/carts/_addresses/_index_table.html.erb +14 -0
  470. data/app/views/trade/my/carts/_addresses/_index_tbody.html.erb +5 -0
  471. data/app/views/trade/my/carts/_addresses/_index_tr.html.erb +13 -0
  472. data/app/views/trade/my/carts/_filter_form.html.erb +9 -0
  473. data/app/views/trade/my/carts/_form.html.erb +1 -1
  474. data/app/views/trade/my/carts/_show/_address.html.erb +18 -0
  475. data/app/views/trade/my/carts/_show/_tab_bar.html.erb +22 -0
  476. data/app/views/trade/my/carts/_show_table.html.erb +16 -28
  477. data/app/views/trade/my/carts/_show_thead.html.erb +6 -0
  478. data/app/views/trade/my/carts/_total_price.html.erb +44 -0
  479. data/app/views/trade/my/carts/_trade_item.html.erb +52 -0
  480. data/app/views/trade/my/carts/add.html.erb +23 -0
  481. data/app/views/trade/my/carts/add.turbo_stream.erb +3 -0
  482. data/app/views/trade/my/carts/addresses.html.erb +5 -0
  483. data/app/views/trade/my/carts/destroy.turbo_stream.erb +3 -0
  484. data/app/views/trade/my/carts/show.html+phone.erb +45 -25
  485. data/app/views/trade/my/carts/show.html.erb +25 -0
  486. data/app/views/trade/my/carts/update.turbo_stream.erb +9 -0
  487. data/app/views/trade/my/cash_logs/_cash_log.json.jbuilder +1 -0
  488. data/app/views/trade/my/cash_logs/index.json.jbuilder +4 -0
  489. data/app/views/trade/my/orders/_date_form.html.erb +2 -2
  490. data/app/views/trade/my/orders/_edit_form.html.erb +4 -0
  491. data/app/views/trade/my/orders/_edit_payment_type.html.erb +3 -12
  492. data/app/views/trade/my/orders/_form.html.erb +1 -4
  493. data/app/views/trade/my/orders/_payment_types/_show_table.html.erb +35 -0
  494. data/app/views/trade/my/orders/_show/_breadcrumb.html.erb +6 -0
  495. data/app/views/trade/my/orders/_success.html.erb +9 -0
  496. data/app/views/trade/my/orders/alipay_pay.json.jbuilder +1 -0
  497. data/app/views/trade/my/orders/create.turbo_stream.erb +3 -0
  498. data/app/views/trade/my/orders/edit_payment_type.html.erb +3 -0
  499. data/app/views/trade/my/orders/index.html+phone.erb +14 -11
  500. data/app/views/trade/my/orders/index.html.erb +15 -15
  501. data/app/views/trade/my/orders/new.html.erb +25 -36
  502. data/app/views/trade/my/orders/payment_types.html+phone.erb +51 -0
  503. data/app/views/trade/my/orders/payment_types.html.erb +5 -0
  504. data/app/views/trade/my/orders/refresh.turbo_stream.erb +3 -0
  505. data/app/views/trade/my/orders/show.html+phone.erb +2 -2
  506. data/app/views/trade/my/orders/show.html.erb +54 -97
  507. data/app/views/trade/my/orders/success.html.erb +2 -9
  508. data/app/views/trade/my/orders/wxpay_pay.html.erb +13 -0
  509. data/app/views/trade/my/orders/wxpay_pay_err.html.erb +5 -0
  510. data/app/views/trade/my/orders/wxpay_pc_pay.html.erb +24 -0
  511. data/app/views/trade/my/payment_methods/_button.html.erb +3 -0
  512. data/app/views/trade/my/payment_methods/_edit_form.html.erb +4 -0
  513. data/app/views/trade/my/payment_methods/{_item.html.erb → _index_tbody.html.erb} +3 -4
  514. data/app/views/trade/my/payment_methods/_index_thead.html.erb +4 -0
  515. data/app/views/trade/my/payment_methods/_new_form.html.erb +4 -0
  516. data/app/views/trade/my/payment_methods/index.html.erb +5 -1
  517. data/app/views/trade/my/payments/_edit_form.html.erb +4 -0
  518. data/app/views/trade/my/payments/_filter_form.html.erb +9 -0
  519. data/app/views/trade/my/payments/_form.html.erb +2 -0
  520. data/app/views/trade/my/payments/_index_tbody.html.erb +1 -0
  521. data/app/views/trade/my/payments/_index_thead.html.erb +2 -0
  522. data/app/views/trade/my/payments/_new_form.html.erb +4 -0
  523. data/app/views/trade/my/payments/_show_table.html.erb +4 -0
  524. data/app/views/trade/my/payments/create.turbo_stream.erb +3 -0
  525. data/app/views/trade/my/payments/destroy.turbo_stream.erb +3 -0
  526. data/app/views/trade/my/payments/index.html.erb +5 -0
  527. data/app/views/trade/my/payouts/_payout.json.jbuilder +11 -0
  528. data/app/views/trade/my/payouts/index.json.jbuilder +3 -0
  529. data/app/views/trade/my/payouts/list.json.jbuilder +2 -0
  530. data/app/views/trade/my/payouts/show.json.jbuilder +1 -0
  531. data/app/views/trade/my/shared/_cash.json.jbuilder +6 -0
  532. data/app/views/trade/my/trade_items/_show/_breadcrumb.html.erb +7 -0
  533. data/app/views/trade/my/trade_items/promote.html.erb +12 -0
  534. data/app/views/trade/my/trade_items/show.html.erb +0 -0
  535. data/app/views/trade/my/trade_items/toggle.turbo_stream.erb +3 -0
  536. data/app/views/trade/panel/exchange_rates/_edit_form.html.erb +4 -0
  537. data/app/views/trade/panel/exchange_rates/_filter_form.html.erb +9 -0
  538. data/app/views/trade/panel/exchange_rates/_form.html.erb +4 -0
  539. data/app/views/trade/panel/exchange_rates/_index_tbody.html.erb +3 -0
  540. data/app/views/trade/panel/exchange_rates/_index_thead.html.erb +4 -0
  541. data/app/views/trade/panel/exchange_rates/_new_form.html.erb +4 -0
  542. data/app/views/trade/panel/exchange_rates/_show_table.html.erb +12 -0
  543. data/app/views/trade/panel/exchange_rates/index.html.erb +5 -0
  544. data/config/locales/en.attributes.yml +35 -0
  545. data/config/locales/en.controller.yml +73 -0
  546. data/config/locales/en.yml +28 -44
  547. data/config/locales/zh.attributes.yml +78 -16
  548. data/config/locales/zh.controller.yml +53 -1
  549. data/config/locales/zh.enum.yml +44 -18
  550. data/config/locales/zh.help.yml +7 -7
  551. data/config/locales/zh.yml +24 -0
  552. data/config/routes.rb +164 -89
  553. data/lib/rails_trade/config.rb +0 -2
  554. data/lib/rails_trade/engine.rb +2 -1
  555. data/lib/rails_trade.rb +2 -10
  556. metadata +465 -322
  557. data/app/assets/javascripts/controllers/trade/admin/payment_methods/edit.js +0 -1
  558. data/app/assets/javascripts/controllers/trade/admin/payment_methods/new.js +0 -1
  559. data/app/assets/javascripts/controllers/trade/admin/payments/edit.js +0 -1
  560. data/app/assets/javascripts/controllers/trade/admin/payments/new.js +0 -1
  561. data/app/assets/javascripts/controllers/trade/admin/promote_charges/edit.js +0 -1
  562. data/app/assets/javascripts/controllers/trade/admin/promote_charges/new.js +0 -7
  563. data/app/assets/javascripts/controllers/trade/admin/promote_goods/edit.js +0 -1
  564. data/app/assets/javascripts/controllers/trade/admin/promote_goods/new.js +0 -17
  565. data/app/assets/javascripts/controllers/trade/admin/promotes/edit.js +0 -2
  566. data/app/assets/javascripts/controllers/trade/admin/promotes/new.js +0 -5
  567. data/app/assets/javascripts/controllers/trade/admin/refunds/index.js +0 -1
  568. data/app/assets/javascripts/controllers/trade/admin/refunds/new.js +0 -1
  569. data/app/assets/javascripts/controllers/trade/my/carts/show-phone-ready.js +0 -1
  570. data/app/assets/javascripts/controllers/trade/my/carts/show-ready.js +0 -28
  571. data/app/assets/javascripts/controllers/trade/my/orders/wait-phone.js +0 -8
  572. data/app/assets/javascripts/controllers/trade/my/trade_items/create.js +0 -2
  573. data/app/assets/stylesheets/controllers/trade/admin/promote_charges/index.css +0 -4
  574. data/app/assets/stylesheets/controllers/trade/admin/promotes/index.css +0 -4
  575. data/app/assets/stylesheets/controllers/trade/my/carts/show-phone.css +0 -1
  576. data/app/assets/stylesheets/controllers/trade/payments/wxpay_result.css +0 -57
  577. data/app/channels/paid_channel.rb +0 -7
  578. data/app/controllers/concerns/controller_order_types.rb +0 -89
  579. data/app/controllers/rails_trade/my_cart.rb +0 -16
  580. data/app/controllers/trade/admin/buyers_controller.rb +0 -37
  581. data/app/controllers/trade/admin/cart_serves_controller.rb +0 -66
  582. data/app/controllers/trade/admin/goods_controller.rb +0 -96
  583. data/app/controllers/trade/admin/produces_controller.rb +0 -66
  584. data/app/controllers/trade/admin/promote_buyers_controller.rb +0 -57
  585. data/app/controllers/trade/buyers_controller.rb +0 -8
  586. data/app/controllers/trade/my/order_items_controller.rb +0 -49
  587. data/app/models/cart.rb +0 -4
  588. data/app/models/order.rb +0 -4
  589. data/app/models/payment/alipay_payment.rb +0 -3
  590. data/app/models/payment/apple_payment.rb +0 -3
  591. data/app/models/payment/bank_payment.rb +0 -3
  592. data/app/models/payment/hand_payment.rb +0 -3
  593. data/app/models/payment/paypal_payment.rb +0 -3
  594. data/app/models/payment/stripe_payment.rb +0 -3
  595. data/app/models/payment/wxpay_payment.rb +0 -3
  596. data/app/models/payment.rb +0 -4
  597. data/app/models/payment_method/alipay_method.rb +0 -7
  598. data/app/models/payment_method/bank_method.rb +0 -7
  599. data/app/models/payment_method/stripe_method.rb +0 -3
  600. data/app/models/payment_method.rb +0 -3
  601. data/app/models/payment_order.rb +0 -3
  602. data/app/models/payment_reference.rb +0 -3
  603. data/app/models/payment_strategy.rb +0 -3
  604. data/app/models/payment_type.rb +0 -3
  605. data/app/models/promote.rb +0 -3
  606. data/app/models/promote_buyer.rb +0 -3
  607. data/app/models/promote_charge/cash_promote_charge.rb +0 -3
  608. data/app/models/promote_charge/discount_promote_charge.rb +0 -3
  609. data/app/models/promote_charge/final_promote_charge.rb +0 -3
  610. data/app/models/promote_charge/minus_promote_charge.rb +0 -3
  611. data/app/models/promote_charge/plus_promote_charge.rb +0 -3
  612. data/app/models/promote_charge.rb +0 -3
  613. data/app/models/promote_extra.rb +0 -3
  614. data/app/models/promote_good.rb +0 -3
  615. data/app/models/rails_trade/amount.rb +0 -44
  616. data/app/models/rails_trade/buyer.rb +0 -35
  617. data/app/models/rails_trade/cart.rb +0 -64
  618. data/app/models/rails_trade/good.rb +0 -71
  619. data/app/models/rails_trade/order.rb +0 -98
  620. data/app/models/rails_trade/ordering/payment.rb +0 -113
  621. data/app/models/rails_trade/ordering/refund.rb +0 -34
  622. data/app/models/rails_trade/payment/alipay_payment.rb +0 -15
  623. data/app/models/rails_trade/payment/apple_payment.rb +0 -7
  624. data/app/models/rails_trade/payment/bank_payment.rb +0 -13
  625. data/app/models/rails_trade/payment/hand_payment.rb +0 -8
  626. data/app/models/rails_trade/payment/paypal_payment.rb +0 -8
  627. data/app/models/rails_trade/payment/stripe_payment.rb +0 -9
  628. data/app/models/rails_trade/payment/wxpay_payment.rb +0 -13
  629. data/app/models/rails_trade/payment.rb +0 -134
  630. data/app/models/rails_trade/payment_method/stripe_method.rb +0 -60
  631. data/app/models/rails_trade/payment_method.rb +0 -67
  632. data/app/models/rails_trade/payment_order.rb +0 -108
  633. data/app/models/rails_trade/payment_reference.rb +0 -18
  634. data/app/models/rails_trade/payment_strategy.rb +0 -19
  635. data/app/models/rails_trade/payment_type/alipay.rb +0 -28
  636. data/app/models/rails_trade/payment_type/apple_pay.rb +0 -18
  637. data/app/models/rails_trade/payment_type/paypal.rb +0 -82
  638. data/app/models/rails_trade/payment_type/stripe.rb +0 -55
  639. data/app/models/rails_trade/payment_type/wxpay.rb +0 -55
  640. data/app/models/rails_trade/promote.rb +0 -78
  641. data/app/models/rails_trade/promote_buyer.rb +0 -27
  642. data/app/models/rails_trade/promote_charge/cash_promote_charge.rb +0 -12
  643. data/app/models/rails_trade/promote_charge/discount_promote_charge.rb +0 -17
  644. data/app/models/rails_trade/promote_charge/final_promote_charge.rb +0 -12
  645. data/app/models/rails_trade/promote_charge/minus_promote_charge.rb +0 -11
  646. data/app/models/rails_trade/promote_charge/plus_promote_charge.rb +0 -7
  647. data/app/models/rails_trade/promote_charge.rb +0 -84
  648. data/app/models/rails_trade/promote_extra.rb +0 -13
  649. data/app/models/rails_trade/promote_good.rb +0 -22
  650. data/app/models/rails_trade/refund/alipay_refund.rb +0 -33
  651. data/app/models/rails_trade/refund/bank_refund.rb +0 -5
  652. data/app/models/rails_trade/refund/hand_refund.rb +0 -5
  653. data/app/models/rails_trade/refund/paypal_refund.rb +0 -32
  654. data/app/models/rails_trade/refund/stripe_refund.rb +0 -26
  655. data/app/models/rails_trade/refund/wxpay_refund.rb +0 -48
  656. data/app/models/rails_trade/refund.rb +0 -74
  657. data/app/models/rails_trade/sell.rb +0 -24
  658. data/app/models/rails_trade/trade_item.rb +0 -153
  659. data/app/models/rails_trade/trade_promote.rb +0 -92
  660. data/app/models/rails_trade/user.rb +0 -9
  661. data/app/models/refund/alipay_refund.rb +0 -3
  662. data/app/models/refund/bank_refund.rb +0 -3
  663. data/app/models/refund/hand_refund.rb +0 -3
  664. data/app/models/refund/paypal_refund.rb +0 -3
  665. data/app/models/refund/stripe_refund.rb +0 -3
  666. data/app/models/refund/wxpay_refund.rb +0 -3
  667. data/app/models/refund.rb +0 -3
  668. data/app/models/trade_item.rb +0 -3
  669. data/app/models/trade_promote.rb +0 -3
  670. data/app/views/application/_trade_nav.html.erb +0 -16
  671. data/app/views/trade/admin/buyers/_form.html.erb +0 -17
  672. data/app/views/trade/admin/buyers/_menu.html.erb +0 -5
  673. data/app/views/trade/admin/buyers/_search_form.html.erb +0 -11
  674. data/app/views/trade/admin/buyers/edit.html.erb +0 -6
  675. data/app/views/trade/admin/buyers/new.html.erb +0 -5
  676. data/app/views/trade/admin/buyers/show.html.erb +0 -4
  677. data/app/views/trade/admin/cart_item_serves/add.js.erb +0 -47
  678. data/app/views/trade/admin/cart_item_serves/create.js.erb +0 -3
  679. data/app/views/trade/admin/cart_item_serves/destroy.js.erb +0 -50
  680. data/app/views/trade/admin/cart_item_serves/index.js.erb +0 -50
  681. data/app/views/trade/admin/cart_item_serves/new.js.erb +0 -5
  682. data/app/views/trade/admin/cart_item_serves/single.js.erb +0 -55
  683. data/app/views/trade/admin/cart_item_serves/total.js.erb +0 -55
  684. data/app/views/trade/admin/order_payments/_index.html.erb +0 -44
  685. data/app/views/trade/admin/order_payments/_new.html.erb +0 -44
  686. data/app/views/trade/admin/order_payments/create.js.erb +0 -2
  687. data/app/views/trade/admin/order_payments/destroy.js.erb +0 -2
  688. data/app/views/trade/admin/order_payments/index.js.erb +0 -8
  689. data/app/views/trade/admin/order_payments/new.js.erb +0 -8
  690. data/app/views/trade/admin/orders/_filter.html.erb +0 -26
  691. data/app/views/trade/admin/orders/_form.html.erb +0 -4
  692. data/app/views/trade/admin/orders/refresh.js.erb +0 -7
  693. data/app/views/trade/admin/payment_methods/_edit.html.erb +0 -6
  694. data/app/views/trade/admin/payment_methods/_filter.html.erb +0 -18
  695. data/app/views/trade/admin/payment_methods/_index_layout.html.erb +0 -12
  696. data/app/views/trade/admin/payment_methods/_new.html.erb +0 -13
  697. data/app/views/trade/admin/payment_methods/_payment_method.html.erb +0 -24
  698. data/app/views/trade/admin/payment_methods/create.js.erb +0 -2
  699. data/app/views/trade/admin/payment_methods/destroy.js.erb +0 -1
  700. data/app/views/trade/admin/payment_methods/edit.html.erb +0 -15
  701. data/app/views/trade/admin/payment_methods/edit.js.erb +0 -8
  702. data/app/views/trade/admin/payment_methods/new.html.erb +0 -15
  703. data/app/views/trade/admin/payment_methods/new.js.erb +0 -7
  704. data/app/views/trade/admin/payment_methods/update.js.erb +0 -2
  705. data/app/views/trade/admin/payment_orders/new.js.erb +0 -6
  706. data/app/views/trade/admin/payment_strategies/edit.html.erb +0 -13
  707. data/app/views/trade/admin/payment_strategies/new.html.erb +0 -13
  708. data/app/views/trade/admin/payments/_edit.html.erb +0 -12
  709. data/app/views/trade/admin/payments/_filter.html.erb +0 -40
  710. data/app/views/trade/admin/payments/_item.html.erb +0 -41
  711. data/app/views/trade/admin/payments/_new.html.erb +0 -12
  712. data/app/views/trade/admin/payments/edit.html.erb +0 -13
  713. data/app/views/trade/admin/payments/edit.js.erb +0 -3
  714. data/app/views/trade/admin/payments/new.html.erb +0 -13
  715. data/app/views/trade/admin/payments/new.js.erb +0 -3
  716. data/app/views/trade/admin/payments/show.html.erb +0 -4
  717. data/app/views/trade/admin/promote_buyers/_filter.html.erb +0 -7
  718. data/app/views/trade/admin/promote_buyers/_form.html.erb +0 -17
  719. data/app/views/trade/admin/promote_buyers/edit.html.erb +0 -14
  720. data/app/views/trade/admin/promote_buyers/edit.js.erb +0 -3
  721. data/app/views/trade/admin/promote_buyers/index.html.erb +0 -52
  722. data/app/views/trade/admin/promote_buyers/new.html.erb +0 -13
  723. data/app/views/trade/admin/promote_buyers/new.js.erb +0 -3
  724. data/app/views/trade/admin/promote_buyers/show.json.jbuilder +0 -1
  725. data/app/views/trade/admin/promote_charges/_edit.html.erb +0 -13
  726. data/app/views/trade/admin/promote_charges/_filter.html.erb +0 -11
  727. data/app/views/trade/admin/promote_charges/_new.html.erb +0 -13
  728. data/app/views/trade/admin/promote_goods/_filter.html.erb +0 -8
  729. data/app/views/trade/admin/promotes/_edit.html.erb +0 -12
  730. data/app/views/trade/admin/promotes/_filter.html.erb +0 -9
  731. data/app/views/trade/admin/promotes/_new.html.erb +0 -12
  732. data/app/views/trade/admin/promotes/create.js.erb +0 -2
  733. data/app/views/trade/admin/refunds/_filter.html.erb +0 -11
  734. data/app/views/trade/admin/refunds/_form.html.erb +0 -17
  735. data/app/views/trade/admin/refunds/_logs_table.html.erb +0 -33
  736. data/app/views/trade/admin/refunds/edit.html.erb +0 -6
  737. data/app/views/trade/admin/refunds/logs.js.erb +0 -8
  738. data/app/views/trade/admin/refunds/new.html.erb +0 -5
  739. data/app/views/trade/admin/refunds/new.js.erb +0 -8
  740. data/app/views/trade/admin/refunds/show.html.erb +0 -4
  741. data/app/views/trade/admin/trade_items/destroy.js.erb +0 -1
  742. data/app/views/trade/admin/trade_items/update.js.erb +0 -11
  743. data/app/views/trade/admin/trade_promotes/edit.html.erb +0 -9
  744. data/app/views/trade/admin/trade_promotes/edit.js.erb +0 -3
  745. data/app/views/trade/admin/trade_promotes/new.html.erb +0 -9
  746. data/app/views/trade/admin/trade_promotes/new.js.erb +0 -3
  747. data/app/views/trade/admin/trade_promotes/show.html.erb +0 -7
  748. data/app/views/trade/admin/trade_promotes/show.js.erb +0 -3
  749. data/app/views/trade/admin/trade_promotes/update.js.erb +0 -1
  750. data/app/views/trade/buyers/_show.html.erb +0 -7
  751. data/app/views/trade/buyers/show.js.erb +0 -1
  752. data/app/views/trade/my/carts/_filter.html.erb +0 -7
  753. data/app/views/trade/my/carts/edit.html.erb +0 -9
  754. data/app/views/trade/my/carts/edit.js.erb +0 -3
  755. data/app/views/trade/my/carts/index.html.erb +0 -47
  756. data/app/views/trade/my/carts/new.html.erb +0 -9
  757. data/app/views/trade/my/carts/new.js.erb +0 -3
  758. data/app/views/trade/my/order_items/_form.html.erb +0 -17
  759. data/app/views/trade/my/order_items/edit.html.erb +0 -6
  760. data/app/views/trade/my/order_items/index.html.erb +0 -25
  761. data/app/views/trade/my/order_items/new.html.erb +0 -5
  762. data/app/views/trade/my/order_items/show.html.erb +0 -8
  763. data/app/views/trade/my/orders/_edit.html.erb +0 -10
  764. data/app/views/trade/my/orders/destroy.js.erb +0 -1
  765. data/app/views/trade/my/orders/edit.js.erb +0 -4
  766. data/app/views/trade/my/orders/edit_payment_type.js.erb +0 -4
  767. data/app/views/trade/my/orders/refresh.js.erb +0 -7
  768. data/app/views/trade/my/orders/update.js.erb +0 -3
  769. data/app/views/trade/my/orders/wxpay_pay.js.erb +0 -16
  770. data/app/views/trade/my/orders/wxpay_pay_err.js.erb +0 -5
  771. data/app/views/trade/my/payment_methods/_edit.html.erb +0 -13
  772. data/app/views/trade/my/payment_methods/_index.html.erb +0 -25
  773. data/app/views/trade/my/payment_methods/_new.html.erb +0 -13
  774. data/app/views/trade/my/payment_methods/create.js.erb +0 -3
  775. data/app/views/trade/my/payment_methods/destroy.js.erb +0 -1
  776. data/app/views/trade/my/payment_methods/edit.js.erb +0 -8
  777. data/app/views/trade/my/payment_methods/index.js.erb +0 -1
  778. data/app/views/trade/my/payment_methods/new.js.erb +0 -8
  779. data/app/views/trade/my/payment_methods/show.html.erb +0 -4
  780. data/app/views/trade/my/payment_methods/update.js.erb +0 -2
  781. data/app/views/trade/my/trade_items/_cart_item.js.erb +0 -2
  782. data/app/views/trade/my/trade_items/_single_price.html.erb +0 -6
  783. data/app/views/trade/my/trade_items/_total_price.html.erb +0 -8
  784. data/app/views/trade/my/trade_items/_trade_items.html.erb +0 -68
  785. data/app/views/trade/my/trade_items/create.html.erb +0 -1
  786. data/app/views/trade/my/trade_items/destroy.js.erb +0 -1
  787. data/app/views/trade/my/trade_items/update.js.erb +0 -1
  788. data/app/views/trade/my/users/_form.html.erb +0 -17
  789. data/app/views/trade/my/users/edit.html.erb +0 -44
  790. data/app/views/trade/my/users/show.html.erb +0 -18
  791. data/lib/rails_trade/apple_pay.rb +0 -32
  792. data/lib/rails_trade/version.rb +0 -3
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.append 'body' do %>
2
+ <div data-controller="visit"></div>
3
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.append 'body' do %>
2
+ <div data-controller="visit"></div>
3
+ <% end %>
@@ -1,53 +1,5 @@
1
- <div class="ui top attached segment">
2
- <%= render 'filter' %>
3
- </div>
4
-
5
- <table class="ui bottom attached selectable table">
6
- <thead>
7
- <tr>
8
- <th><%= Refund.human_attribute_name(:refund_uuid) %></th>
9
- <th>Order</th>
10
- <th><%= Refund.human_attribute_name(:total_amount) %></th>
11
- <th><%= Refund.human_attribute_name(:type) %></th>
12
- <th><%= Refund.human_attribute_name(:created_at) %></th>
13
- <th><%= Refund.human_attribute_name(:state) %></th>
14
- <th><%= Refund.human_attribute_name(:comment) %></th>
15
- <th><%= Refund.human_attribute_name(:refunded_at) %>/th>
16
- <th>Operator</th>
17
- </tr>
18
- </thead>
19
- <tbody>
20
- <% @refunds.each do |refund| %>
21
- <tr>
22
- <td><%= refund.refund_uuid %></td>
23
- <td>
24
- <p><%= link_to refund.order.uuid, admin_order_path(refund.order_id) %></p>
25
- <p><%= link_to refund.payment.payment_uuid, admin_payments_path(id: refund.payment_id) %></p>
26
- </td>
27
- <td><%= refund.total_amount.to_money(refund.currency).format %></td>
28
- <td><%= refund.type %></td>
29
- <td><time><%= refund.created_at.to_s(:rfc822) %></time></td>
30
- <td><%= refund.state %></td>
31
- <td><%= refund.comment %></td>
32
- <td>
33
- <% if refund.refunded_at %>
34
- <time><%= refund.refunded_at.to_s(:rfc822) %></time>
35
- <% else %>
36
- <div class="ui buttons">
37
- <%= link_to 'Approve', confirm_admin_refund_path(refund), method: :patch, data: { confirm: 'Confirm Do Refund!' }, class: 'ui positive button' %>
38
- <div class="or"></div>
39
- <%= link_to 'Deny', deny_admin_refund_path(refund), method: :patch, data: { confirm: 'Deny Refund!' }, class: 'ui negative button' %>
40
- </div>
41
- <% end %>
42
- <% if refund.reason %>
43
- <p><%= refund.reason.truncate(27) %></p>
44
- <% end %>
45
- </td>
46
- <td><%= refund.operator&.name %></td>
47
- </tr>
48
- <% end %>
49
- </tbody>
50
- </table>
51
-
52
-
1
+ <%= render layout: 'index_table', locals: { cache_key: Trade::Refund.column_names.hash } do %>
2
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @refunds, as: :model %>
3
+ <% end %>
53
4
 
5
+ <%= paginate @refunds %>
@@ -0,0 +1 @@
1
+ <%= turbo_stream.update 'modal', partial: 'modal_form', locals: { action: 'logs' } %>
@@ -1,15 +1,15 @@
1
1
  <p>
2
2
  <span>Good Type:</span>
3
- <%= link_to 'All', filter_params(except: [:good_type]), class: active_params(type: '', active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
3
+ <%= link_to t('.all'), filter_params(except: [:good_type]), class: active_params(type: '', active: 'button is-info', item: 'button is-light') %>
4
4
  <% CartItem.good_types.each do |good_type| %>
5
- <%= link_to good_type, filter_params(good_type: good_type), class: active_params(type: good_type, active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
5
+ <%= link_to good_type, filter_params(good_type: good_type), class: active_params(type: good_type, active: 'button is-info', item: 'button is-light') %>
6
6
  <% end %>
7
7
  </p>
8
8
  <p>
9
9
  <span>Assistant:</span>
10
- <%= link_to 'All', filter_params(except: [:myself]), class: active_params(myself: '', active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
11
- <%= link_to 'Assistant', filter_params(myself: 0), class: active_params(myself: 0, active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
12
- <%= link_to 'Self', filter_params(myself: 1), class: active_params(myself: 1, active_class: 'ui basic blue button', item_class: 'ui basic white button') %>
10
+ <%= link_to t('.all'), filter_params(except: [:myself]), class: active_params(myself: '', active: 'button is-info', item: 'button is-light') %>
11
+ <%= link_to 'Assistant', filter_params(myself: 0), class: active_params(myself: 0, active: 'button is-info', item: 'button is-light') %>
12
+ <%= link_to 'Self', filter_params(myself: 1), class: active_params(myself: 1, active: 'button is-info', item: 'button is-light') %>
13
13
  </p>
14
14
 
15
15
 
@@ -1,10 +1,10 @@
1
1
  <div>
2
- <%= cart_item.good.final_price %><i class="info circle icon xx_popup" style="color: grey;"></i>
2
+ <%= trade_item.good.price %><i class="info circle icon xx_popup" style="color: grey;"></i>
3
3
  <div class="ui popup">
4
- <p>Export price: <%= cart_item.good.price %></p>
5
- <% cart_item.good.serve.charges.each do |charge| %>
6
- <p><%= charge.item.name %>: <%= charge.subtotal %></p>
4
+ <p>Export price: <%= trade_item.good.price %></p>
5
+ <% trade_item.trade_promotes.each do |trade_promote| %>
6
+ <p><%= trade_promote.promote.name %>: <%= trade_promote.amount %></p>
7
7
  <% end %>
8
8
  </div>
9
9
  </div>
10
- <p><%= cart_item.good&.quantity %><%= cart_item.good&.unit %></p>
10
+ <p><%= trade_item.good&.quantity %><%= trade_item.good&.unit %></p>
@@ -1,27 +1,27 @@
1
1
  <div>
2
2
  <span style="color: grey;">Item Price: </span>
3
- <%= cart_item.final_price %>
3
+ <%= trade_item.final_price %>
4
4
  </div>
5
5
  <div>
6
6
  <span style="color: grey;">Total Serve Price: </span>
7
- <%= cart_item.total_serve_price %><i class="info circle icon xx_popup" style="color: grey;"></i>
7
+ <%= trade_item.total_serve_price %><i class="info circle icon xx_popup" style="color: grey;"></i>
8
8
  <div class="ui popup">
9
- <% cart_item.total_serve_charges.each do |charge| %>
9
+ <% trade_item.total_serve_charges.each do |charge| %>
10
10
  <p><%= charge.item.name %>: <%= charge.subtotal %></p>
11
11
  <% end %>
12
12
  </div>
13
- <%= link_to 'edit', total_admin_cart_item_cart_item_serves_path(cart_item), remote: true, class: 'ui mini label' %>
13
+ <%= link_to 'edit', total_admin_trade_item_trade_item_serves_path(trade_item), class: 'ui mini label' %>
14
14
  </div>
15
15
  <div>
16
16
  <span style="color: grey;">Promote Price: </span>
17
- <%= cart_item.total_promote_price %><i class="info circle icon xx_popup" style="color: grey;"></i>
17
+ <%= trade_item.total_promote_price %><i class="info circle icon xx_popup" style="color: grey;"></i>
18
18
  <div class="ui popup">
19
- <% cart_item.total.promote_charges.each do |charge| %>
19
+ <% trade_item.total.promote_charges.each do |charge| %>
20
20
  <p><%= charge.item.name %>: <%= charge.subtotal %></p>
21
21
  <% end %>
22
22
  </div>
23
23
  </div>
24
24
  <div>
25
25
  <span style="color: grey;">Final Price: </span>
26
- <%= cart_item.estimate_price %>
27
- </div>
26
+ <%= trade_item.estimate_price %>
27
+ </div>
@@ -1,4 +1,4 @@
1
1
  <div>
2
- <%= cart_item.retail_price %>
3
- <span style="color: red;">(<%= cart_item.discount_price %>)</span>
4
- </div>
2
+ <%= trade_item.retail_price %>
3
+ <span style="color: red;">(<%= trade_item.reduced_amount %>)</span>
4
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="breadcrumb has-succeeds-separator">
2
+ <ul>
3
+ <li><%= link_to t('trade.my.orders.index.title'), { controller: 'orders', action: 'index' } %></li>
4
+ <li><%= link_to @trade_item.order.uuid, { controller: 'orders', action: 'show', id: @trade_item.order_id } %></li>
5
+ <li class="is-active"><%= @trade_item.id %></li>
6
+ </ul>
7
+ </div>
@@ -1,28 +1,28 @@
1
1
  <div>
2
2
  <span style="color: grey;">Good price: </span>
3
- <%= cart_item.pure_price %>
3
+ <%= trade_item.single_price %>
4
4
  </div>
5
5
  <div>
6
6
  <span style="color: grey;">Serve Price: </span>
7
- <%= cart_item.serve_price %><i class="info circle icon xx_popup" style="color: grey;"></i>
7
+ <%= trade_item.additional_amount %><i class="info circle icon xx_popup" style="color: grey;"></i>
8
8
  <div class="ui popup">
9
- <% cart_item.serve_charges.each do |charge| %>
10
- <p><%= charge.item.name %>: <%= charge.subtotal %></p>
9
+ <% trade_item.trade_promotes.each do |trade_promote| %>
10
+ <p><%= trade_promote.promote.name %>: <%= trade_promote.amount %></p>
11
11
  <% end %>
12
12
  </div>
13
- <%= link_to 'edit', single_admin_cart_item_cart_item_serves_path(cart_item), remote: true, class: 'ui mini label' %>
13
+ <%= link_to 'edit', admin_trade_promotes_path(trade_item_id: trade_item.id), class: 'ui mini label' %>
14
14
  </div>
15
15
  <div>
16
16
  <span style="color: grey;">Promote Price: </span>
17
- <span style="color: red;"><%= cart_item.reduced_price %></span>
17
+ <span style="color: red;"><%= trade_item.reduced_amount %></span>
18
18
  <i class="info circle icon xx_popup" style="color: grey;"></i>
19
19
  <div class="ui popup">
20
- <% cart_item.promote.charges.each do |charge| %>
21
- <p><%= charge.item.name %>: <%= charge.subtotal %></p>
20
+ <% trade_item.trade_promotes.each do |trade_promote| %>
21
+ <p><%= trade_promote.promote.name %>: <%= trade_promote.amount %></p>
22
22
  <% end %>
23
23
  </div>
24
24
  </div>
25
25
  <div>
26
26
  <span style="color: grey;">Final Price: </span>
27
- <span><%= cart_item.final_price %></span>
28
- </div>
27
+ <span><%= trade_item.amount %></span>
28
+ </div>
@@ -19,74 +19,63 @@
19
19
  <div class="ui segment top attached">
20
20
  <% if @user %>
21
21
  <%= link_to '生成订单', new_admin_order_path(user_id: @user.id), class: 'ui red button', id: 'new_order_top' %>
22
- <%= link_to '生成文档', doc_admin_cart_items_path(user_id: @user.id), class: 'ui orange button', id: 'cart_items_doc' %>
22
+ <%= link_to '生成文档', doc_admin_trade_items_path(user_id: @user.id), class: 'ui orange button', id: 'trade_items_doc' %>
23
23
  <% end %>
24
24
  </div>
25
- <table class="ui bottom attached selectable table">
25
+ <table class="table is-hoverable is-fullwidth">
26
26
  <thead>
27
- <tr class="">
28
- <th><%= check_box_tag :all %></th>
29
- <th>Name</th>
30
- <th>报价</th>
31
- <th>数量</th>
32
- <th>原价</th>
33
- <th>最终价格</th>
34
- <th>预成单报价</th>
35
- <th>Actions</th>
36
- </tr>
27
+ <tr>
28
+ <th><%= check_box_tag :all %></th>
29
+ <th><%= Trade::TradeItem.human_attribute_name('good/name') %></th>
30
+ <th><%= Trade::TradeItem.human_attribute_name(:amount) %></th>
31
+ <th><%= Trade::TradeItem.human_attribute_name(:number) %></th>
32
+ <th><%= Trade::TradeItem.human_attribute_name(:original_amount) %></th>
33
+ <th><%= Trade::TradeItem.human_attribute_name(:retail_price) %></th>
34
+ <th><%= Trade::TradeItem.human_attribute_name(:wholesale_price) %></th>
35
+ <th></th>
36
+ </tr>
37
37
  </thead>
38
38
  <tbody>
39
- <% @cart_items.each do |cart_item| %>
40
- <tr class="<%= active_asserts join: false, active: cart_item.checked, positive: cart_item.good_id.to_s == params[:good_id] %>" id="cart_item_<%= cart_item.id %>">
41
- <td><%= check_box_tag(:cart_item_id, cart_item.id, cart_item.checked) %></td>
39
+ <% @trade_items.each do |trade_item| %>
40
+ <tr class="<%= active_asserts join: false, active: trade_item.checked?, positive: trade_item.good_id.to_s == params[:good_id] %>" id="trade_item_<%= trade_item.id %>">
41
+ <td><%= check_box_tag(:trade_item_id, trade_item.id, trade_item.checked?) %></td>
42
42
  <td>
43
- <i class="child icon<%= active_assert(cart_item.myself, expected: ' green', unexpected: '') %>"></i>
44
- <%= cart_item.good&.name %>
45
- <%= link_to only_admin_cart_items_path(good_type: cart_item.good_type, good_id: cart_item.good_id) do %>
46
- <i class="legal icon"></i>
47
- <% end %>
43
+ <i class="child icon<%= trade_item.myself ? ' green' : '' %>"></i>
44
+ <%= trade_item.good&.name %>
48
45
  </td>
49
46
  <td>
50
- <% cache [cart_item, 'good_price'] do %>
51
- <%= render partial: 'good_price', locals: { cart_item: cart_item } %>
52
- <% end %>
47
+ <%= render partial: 'good_price', locals: { trade_item: trade_item } %>
53
48
  </td>
54
49
  <td>
55
50
  <div class="ui left right action input">
56
- <div class="ui button" onclick="decrease_quantity(<%= cart_item.id %>)"><i class="minus icon"></i></div>
57
- <%= text_field_tag :quantity, cart_item.quantity, id: "quantity_#{cart_item.id}", onkeyup: "update_quantity(#{cart_item.id})", disabled: true %>
58
- <div class="ui button" onclick="increase_quantity(<%= cart_item.id %>)"><i class="fas fa-plus"></i></div>
51
+ <div class="ui button" onclick="decrease_quantity(<%= trade_item.id %>)"><i class="minus icon"></i></div>
52
+ <%= text_field_tag :number, trade_item.number, id: "quantity_#{trade_item.id}", onkeyup: "update_quantity(#{trade_item.id})", disabled: true %>
53
+ <div class="ui button" onclick="increase_quantity(<%= trade_item.id %>)"><i class="fas fa-plus"></i></div>
59
54
  </div>
60
55
  </td>
61
- <td id="retail_price_<%= cart_item.id %>">
62
- <% cache [cart_item, 'retail_price'] do %>
63
- <%= render partial: 'retail_price', locals: { cart_item: cart_item } %>
64
- <% end %>
56
+ <td id="retail_price_<%= trade_item.id %>">
57
+ <%= render partial: 'retail_price', locals: { trade_item: trade_item } %>
65
58
  </td>
66
- <td id="single_price_<%= cart_item.id %>">
67
- <% cache [cart_item, 'single_price'] do %>
68
- <%= render partial: 'single_price', locals: { cart_item: cart_item } %>
69
- <% end %>
59
+ <td id="single_price_<%= trade_item.id %>">
60
+ <%= render partial: 'single_price', locals: { trade_item: trade_item } %>
70
61
  </td>
71
- <td id="order_price_<%= cart_item.id %>">
72
- <% cache [cart_item, 'order_price'] do %>
73
- <%= render partial: 'order_price', locals: { cart_item: cart_item } %>
74
- <% end %>
62
+ <td id="order_price_<%= trade_item.id %>">
63
+ <%# render partial: 'order_price', locals: { trade_item: trade_item } %>
75
64
  </td>
76
65
  <td>
77
- <%= link_to 'delete', admin_cart_item_path(cart_item), method: :delete, remote: true, class: 'ui mini label' %>
66
+ <%= link_to 'delete', admin_trade_item_path(trade_item), method: :delete, class: 'ui mini label' %>
78
67
  </td>
79
68
  </tr>
80
69
  <% end %>
81
70
  </tbody>
82
71
  <tbody id="additions_body">
83
- <%= render 'additions' %>
72
+ <%# render 'additions' %>
84
73
  </tbody>
85
74
  <tfoot>
86
75
  <tr>
87
76
  <th colspan="5"></th>
88
77
  <th id="total_price">
89
- <%= render 'total_price' %>
78
+ <%# render 'total_price' %>
90
79
  </th>
91
80
  <th colspan="3"></th>
92
81
  </tr>
@@ -101,4 +90,4 @@
101
90
  </tfoot>
102
91
  </table>
103
92
 
104
- <%= paginate @cart_items %>
93
+ <%= paginate @trade_items %>
@@ -17,7 +17,7 @@
17
17
  <%= link_to '生成订单', new_admin_order_path(cart_item_id: @cart_item.id), class: 'ui red button', id: 'new_order_top' %>
18
18
  <%= link_to '生成文档', doc_admin_cart_items_path(cart_item_id: @cart_item.id), class: 'ui orange button', id: 'cart_items_doc' %>
19
19
  </div>
20
- <table class="ui bottom attached selectable table">
20
+ <table class="table is-hoverable is-fullwidth">
21
21
  <thead>
22
22
  <tr class="">
23
23
  <th>Name</th>
@@ -55,7 +55,7 @@
55
55
  <td id="single_price_<%= @cart_item.id %>"><%= render partial: 'single_price', locals: { cart_item: @cart_item }, cached: true %></td>
56
56
  <td id="order_price_<%= @cart_item.id %>"><%= render partial: 'order_price', locals: { cart_item: @cart_item }, cached: true %></td>
57
57
  <td>
58
- <%= link_to 'delete', admin_cart_item_path(@cart_item), method: :delete, remote: true, class: 'ui mini label' %>
58
+ <%= link_to 'delete', admin_cart_item_path(@cart_item), method: :delete, class: 'ui mini label' %>
59
59
  </td>
60
60
  </tr>
61
61
  </tbody>
File without changes
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @trade_promote, url: { action: 'update' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -1,7 +1,7 @@
1
- <%= form_with theme: 'search', model: TradePromote.new do |f| %>
1
+ <%= form_with theme: 'search', model: Trade::TradePromote.new do |f| %>
2
2
  <div class="fields">
3
3
  <%= f.text_field :name %>
4
4
  <%= f.submit %>
5
- <%= link_to t('.clear'), filter_params(except: [:name]), class: 'ui button' %>
5
+ <%= link_to t('.clear'), filter_params(except: [:name]), class: 'button is-light' %>
6
6
  </div>
7
7
  <% end %>
@@ -1,6 +1,3 @@
1
- <%= form_with model: [:admin, @trade_promote] do |f| %>
2
- <%= render 'shared/error_messages', target: @trade_promote %>
3
- <%= f.number_field :amount %>
4
- <%= f.text_area :note %>
5
- <%= f.submit %>
6
- <% end %>
1
+ <%= render 'error_messages', target: f.object %>
2
+ <%= f.number_field :amount %>
3
+ <%= f.text_area :note %>
@@ -0,0 +1,2 @@
1
+ <td><%= model.amount %></td>
2
+ <td><%= model.note %></td>
@@ -0,0 +1,3 @@
1
+ <th><%= Trade::TradePromote.human_attribute_name(:amount) %></th>
2
+ <th><%= Trade::TradePromote.human_attribute_name(:note) %></th>
3
+ <th></th>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @trade_promote, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -1,20 +1,8 @@
1
- <table class="ui very basic large table">
2
- <thead>
3
- <tr>
4
- <th class="six wide">
5
- <%= link_to t('.edit'), edit_admin_trade_promote_path(@trade_promote), class: 'ui mini blue right floated button', remote: true %>
6
- </th>
7
- <th class="ten wide"></th>
8
- </tr>
9
- </thead>
10
- <tbody>
11
- <tr>
12
- <td class="right aligned"><%= TradePromote.human_attribute_name(:amount) %></td>
13
- <td><%= @trade_promote.amount %></td>
14
- </tr>
15
- <tr>
16
- <td class="right aligned"><%= TradePromote.human_attribute_name(:note) %></td>
17
- <td><%= @trade_promote.note %></td>
18
- </tr>
19
- </tbody>
20
- </table>
1
+ <tr>
2
+ <td class="has-text-right"><%= Trade::TradePromote.human_attribute_name(:amount) %></td>
3
+ <td><%= @trade_promote.amount %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= Trade::TradePromote.human_attribute_name(:note) %></td>
7
+ <td><%= @trade_promote.note %></td>
8
+ </tr>
@@ -1,38 +1,5 @@
1
- <div class="ui top attached segment">
2
- <%= render 'filter' %>
3
- </div>
4
-
5
- <table class="ui bottom attached selectable table">
6
- <thead>
7
- <tr>
8
- <th><%= TradePromote.human_attribute_name(:amount) %></th>
9
- <th><%= TradePromote.human_attribute_name(:note) %></th>
10
- <th>
11
- <%= link_to new_admin_trade_promote_path, remote: true, class: 'ui mini green button' do %>
12
- <i class="fas fa-plus"></i><%= t('.new') %>
13
- <% end %>
14
- </th>
15
- </tr>
16
- </thead>
17
- <tbody>
18
- <% @trade_promotes.each do |trade_promote| %>
19
- <tr>
20
- <td><%= trade_promote.amount %></td>
21
- <td><%= trade_promote.note %></td>
22
- <td>
23
- <%= link_to admin_trade_promote_path(trade_promote), data: { tooltip: t('.show') }, remote: true, class: 'ui mini circular icon button' do %>
24
- <i class="fas fa-eye"></i>
25
- <% end %>
26
- <%= link_to edit_admin_trade_promote_path(trade_promote), data: { tooltip: t('.edit') }, remote: true, class: 'ui mini circular icon button' do %>
27
- <i class="fas fa-pencil-alt"></i>
28
- <% end %>
29
- <%= link_to admin_trade_promote_path(trade_promote), method: :delete, data: { tooltip: t('.destroy'), confirm: t('.confirm') }, class: 'ui mini circular icon button' do %>
30
- <i class="fas fa-trash-alt"></i>
31
- <% end %>
32
- </td>
33
- </tr>
34
- <% end %>
35
- </tbody>
36
- </table>
1
+ <%= render layout: 'index_table', locals: { cache_key: Trade::TradePromote.column_names.hash } do %>
2
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @trade_promotes, as: :model %>
3
+ <% end %>
37
4
 
38
5
  <%= paginate @trade_promotes %>