user-signup-verify.blade.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. @extends('auth.master')
  2. @section('content')
  3. <div class="d-flex justify-content-center align-items-center h-100">
  4. <!-- Password recovery form -->
  5. <form class="form-prevent-multiple-submits user-signup-verify-form" action="{{ route('user-signup-verify.store') }}" method="POST">
  6. @csrf
  7. <div class="card mb-0">
  8. <div class="card-body">
  9. <div class="text-center mb-3">
  10. <i class="fas fa-certificate fa-2x text-warning border-warning border-3 rounded-circle p-3 mb-3 mt-1"></i>
  11. <h5 class="mb-0">본인 인증</h5>
  12. {{-- <span class="d-block text-muted">We'll send you instructions in email</span>--}}
  13. </div>
  14. <div class="user-signup-verify mb-4">
  15. <dl class="agree_check tw-border-t tw-bg-gray-500">
  16. <dt>
  17. <input type="checkbox" id="phone-identity-verifiy-ck"> 휴대폰 본인 확인
  18. </dt>
  19. </dl>
  20. </div>
  21. <div class="form-group mb-2 d-flex">
  22. <input type="text" class="form-control certi-txt rounded-right-0" id="mobile-no-txt" maxlength="11" placeholder="휴대폰번호">
  23. <span class="btn_wrap js_btn_wrapper mt-0">
  24. <button type="button" class="btn bg-blue btn-block text-white certi-btn" onclick="send_verify_code(this)">인증번호 발송</button>
  25. </span>
  26. </div>
  27. <div class="form-group mb-0 d-flex">
  28. <input type="text" class="form-control certi-txt rounded-right-0" name="cert_number" placeholder="인증번호" required>
  29. <span class="btn_wrap js_btn_wrapper mt-0">
  30. <button type="submit" class="btn bg-blue btn-block text-white certi-btn button-prevent-multiple-submits">
  31. <i class="spinner fa fa-spinner fa-spin"></i>
  32. 확인
  33. </button>
  34. </span>
  35. </div>
  36. </div>
  37. </div>
  38. </form>
  39. <!-- /password recovery form -->
  40. </div>
  41. @endsection
  42. @push('js')
  43. <script>
  44. async function send_verify_code($this) {
  45. let all_check = true
  46. $('#required-div input').each(function () {
  47. if (! $(this).is(':checked')) {
  48. all_check = false
  49. }
  50. })
  51. if (all_check && $('#phone-identity-verifiy-ck').is(':checked')) {
  52. const response = await call_local_api('{{ route("user-signup-verify.send") }}', {mobile_no: $('#mobile-no-txt').val()})
  53. const error_msg = response.data.original.body
  54. if (error_msg['message'] === 'success') {
  55. $($this).prop('disabled', true)
  56. iziToast.success({ title: 'Success', message: $('#action-completed').text() })
  57. } else {
  58. iziToast.error({ title: 'Error', message: error_msg['message'] })
  59. }
  60. return
  61. }
  62. iziToast.info({ title: 'Info', message: '이용약관에 동의하셔야 합니다' });
  63. }
  64. $('#mobile-no-txt').on('keyup', function () {
  65. $(this).val($(this).val().replace(/[^0-9]/g, ''));
  66. });
  67. $('#all-ck').click(function(){
  68. const checked = $(this).is(':checked');
  69. if (checked) {
  70. $('#required-div input:checkbox').prop('checked', true);
  71. }
  72. });
  73. </script>
  74. @endpush