ach.vue 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class="ach">
  3. <div class="loading">
  4. <img src="../../static/img/icon_refresh.svg" />
  5. </div>
  6. <form ref="formDom" :action="formData.actionUrl" method="post" id="submitForm">
  7. <input type="hidden" name="callbackUrl" :value="formData.callbackUrl">
  8. <input type="hidden" name="currency" :value="formData.currency">
  9. <input type="hidden" name="merType" :value="formData.merType">
  10. <input type="hidden" name="merchantNo" :value="formData.merchantNo">
  11. <input type="hidden" name="merchantOrderNo" :value="formData.merchantOrderNo">
  12. <input type="hidden" name="noticeUrl" :value="formData.noticeUrl">
  13. <input type="hidden" name="orderAmount" :value="formData.orderAmount">
  14. <input type="hidden" name="productDetail" :value="formData.productDetail">
  15. <input type="hidden" name="sign" :value="formData.sign">
  16. <input type="hidden" name="timeStamp" :value="formData.timeStamp">
  17. <input type="hidden" name="version" :value="formData.version">
  18. </form>
  19. </div>
  20. </template>
  21. <script>
  22. import { postRequest } from '../../http/index';
  23. import Api from '../../http/api';
  24. export default {
  25. name: 'ach',
  26. data() {
  27. return {
  28. formData: {}
  29. }
  30. },
  31. mounted() {
  32. this.getPayInfo()
  33. },
  34. methods: {
  35. getPayInfo() {
  36. let amountValue = this.$route.params.amount;
  37. if (amountValue) {
  38. postRequest(Api.usdRechargeRequestByAchpay, {
  39. params: {
  40. amountValue: amountValue
  41. }
  42. }).then(res => {
  43. if(res.code == 0) {
  44. this.formData = res.data;
  45. this.$nextTick(() => {
  46. this.$refs.formDom.submit();
  47. setTimeout(() => {
  48. location.go(-1);
  49. }, 500)
  50. })
  51. }
  52. })
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. html,
  60. body,
  61. #__nuxt,
  62. #__layout {
  63. width: 100%;
  64. height: 100%;
  65. padding: 0;
  66. margin: 0;
  67. overflow: hidden;
  68. }
  69. .ach {
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. width: 100%;
  74. height: 100%;
  75. }
  76. .loading {
  77. width: 50px;
  78. height: 50px;
  79. img {
  80. width: 100%;
  81. height: 100%;
  82. animation: rotate 1s infinite linear;
  83. }
  84. }
  85. @keyframes rotate {
  86. 0% {
  87. transform: rotate(0);
  88. }
  89. 100% {
  90. transform: rotate(360deg);
  91. }
  92. }
  93. </style>