index.blade.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <form class="modal-form form-prevent-multiple-submits" action="{{ route('address.store') }}" method="POST">
  2. @csrf
  3. @if((new \Jenssegers\Agent\Agent())->isDesktop())
  4. <div class="form-title">
  5. <h3>결제 QR 코드 스캔</h3>
  6. </div>
  7. <div class="form-group text-center">
  8. <img src="{{ $prepare['url'] }}" alt="qrcode">
  9. </div>
  10. <div class="mb-2 text-center text-danger">
  11. <em>MSQUARE MARKET 어플을 이용해서 QR 코드 스캔을 하세요</em>
  12. </div>
  13. @else
  14. <div class="form-title">
  15. <h3>모바일 지갑으로 QR 코드 전달</h3>
  16. </div>
  17. <div class="mb-2 text-center text-danger">
  18. <a href="{{ $prepare['deep_link'] }}"><em>결제 화면으로 이동</em></a>
  19. </div>
  20. @endif
  21. </form>
  22. @once
  23. <script>
  24. // TODO: medium-modal 각각 분리해서 hidden 이벤트 체크해야함
  25. $('#medium-modal').on('hidden.bs.modal', function () {
  26. clearInterval(send_timer)
  27. });
  28. $(document).ready(async function() {
  29. send_timer = setInterval(async function() {
  30. const response = await call_local_api('{{ route("wallet-send.result") }}', { request_key: @json($prepare['request_key']) })
  31. const d = response.data
  32. // console.log(d)
  33. if (d['status'] === 'completed') {
  34. completed_wallet_send(d)
  35. $('#medium-modal.show').modal('hide')
  36. iziToast.success({ title: 'Success', message: $('#action-completed').text() })
  37. clearInterval(send_timer)
  38. }
  39. }, 1000);
  40. });
  41. var send_timer = null
  42. </script>
  43. @endonce