AddFundsPayment.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!--
  2. Copyright 2019 Hackware SpA <human@hackware.cl>
  3. This file is part of "Hackware Userland" and licensed under the terms
  4. of the GNU Affero General Public License version 3, or (at your option)
  5. a later version. You should have received a copy of this license along
  6. with the software. If not, see <https://www.gnu.org/licenses/>.
  7. -->
  8. <template>
  9. <div class="add-funds-payment">
  10. <h2>Seleccione medio de pago</h2>
  11. <div class="payment-methods">
  12. <template v-for="(paymentMethod, index) in paymentMethods">
  13. <router-link
  14. :key="index"
  15. :to="linkTo(paymentMethod)"
  16. class="payment-method"
  17. >
  18. <img
  19. :src="image(paymentMethod)"
  20. :alt="paymentMethod.title"
  21. class="img"
  22. >
  23. <div class="description">
  24. {{ paymentMethod.description }}
  25. </div>
  26. </router-link>
  27. </template>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. name: 'AddFundsPayment',
  34. data() {
  35. return {
  36. paymentMethods: [],
  37. };
  38. },
  39. beforeCreate() {
  40. this.$fetcher.haweseGet('/gateways/payment-methods/purchase')
  41. .then((body) => { this.paymentMethods = body; });
  42. },
  43. methods: {
  44. linkTo(paymentMethod) {
  45. return `/add-funds/${paymentMethod.gateway}?${paymentMethod.property}=${paymentMethod.const}`;
  46. },
  47. image(paymentMethod) {
  48. return `/img/payment_methods/${paymentMethod.gateway}.${paymentMethod.const}.svg`;
  49. },
  50. },
  51. };
  52. </script>
  53. <style lang="scss">
  54. @import "../assets/bootstrap/custom";
  55. .add-funds-payment {
  56. > h2 {
  57. @extend .text-center;
  58. }
  59. > .payment-methods {
  60. @extend .row;
  61. @extend .text-center;
  62. @extend .mx-1;
  63. > a.payment-method {
  64. @extend .col-lg-6;
  65. @extend .mx-auto;
  66. @extend .d-flex;
  67. @extend .flex-column;
  68. @extend .justify-content-center;
  69. transition: all 1s ease;
  70. height: 9rem;
  71. color: var(--dark);
  72. > .description {
  73. @extend .mx-auto;
  74. width: 80%;
  75. }
  76. > img {
  77. @extend .mx-auto;
  78. width: 80%;
  79. transition: all 300ms ease;
  80. }
  81. &:hover {
  82. background-color: $gray-200;
  83. text-decoration: none;
  84. > img {
  85. width: 84%;
  86. }
  87. }
  88. }
  89. }
  90. }
  91. </style>