contactus-custom.blade.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. @extends('views.layouts.master')
  2. @section('content')
  3. <form class="sub inquiry form-prevent-multiple-submits" id="contact-us-form" method="POST" action="{{ route('contact-us-custom.store') }}">
  4. @csrf
  5. <div class="container">
  6. <div class="navi">
  7. <a href="/"><i class="fa-solid fa-house"></i> 홈</a> > 매매상담 > 상담문의
  8. </div>
  9. <div class="title">
  10. <h2>상담문의</h2>
  11. </div>
  12. </div>
  13. <div class="personal">
  14. <div class="container">
  15. <div class="stit">
  16. <h3>개인정보 입력</h3>
  17. </div>
  18. <div class="input_form">
  19. <div>
  20. <input type="hidden" name="Pc7" value="상담접수">
  21. </div>
  22. <div>
  23. <label class="need">신청자 이름</label>
  24. <input type="text" name="Pc1" value="{{ old('Pc1') }}" placeholder="이름을 입력해주세요." required>
  25. </div>
  26. <div>
  27. <label class="need">연락처</label>
  28. <input type="tel" name="Pc2" value="{{ old('Pc2') }}" placeholder="연락처를 입력해주세요." required>
  29. </div>
  30. <div>
  31. <label class="need">거래 구분</label>
  32. <label for="sell" class="radio_box">
  33. <input id="sell" type="radio" name="Pc3" value="매도" {{ old('Pc3') == null || old('Pc3') === '매도' ? 'checked' : '' }}>
  34. <span></span> 매도
  35. </label>
  36. <label for="buy" class="radio_box">
  37. <input id="buy" type="radio" name="Pc3" value="매수" {{ old('Pc3') === '매수' ? 'checked' : '' }}>
  38. <span></span> 매수
  39. </label>
  40. </div>
  41. <div>
  42. <label class="need">회원권 구분</label>
  43. <select name="Pc4" required>
  44. <option value="골프회원권" {{ $siseType === 'golf' || is_null($siseType) ? 'selected' : '' }}>골프회원권</option>
  45. <option value="콘도회원권" {{ $siseType === 'condo' ? 'selected' : '' }}>콘도회원권</option>
  46. <option value="휘트니스회원권" {{ $siseType === 'fitness' ? 'selected' : '' }}>휘트니스회원권</option>
  47. </select>
  48. </div>
  49. <div>
  50. <label class="need">회원권명</label>
  51. <input type="text" name="Pc5" value="{{ old('Pc5', $postTitle ?? '') }}" placeholder="회원권명을 입력해주세요." required>
  52. </div>
  53. <div class="price">
  54. <label class="need">희망 가격</label>
  55. <input type="tel" name="Pc6" value="{{ old('Pc6') }}" placeholder="희망 가격을 입력해주세요." required> 만원
  56. </div>
  57. <div class="request">
  58. <label>요청 사항</label>
  59. <textarea name="Pt1" placeholder="요청사항을 입력해주세요.">{{ old('Pt1') }}</textarea>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="agree">
  65. <div class="container">
  66. <div class="stit">
  67. <h3>개인정보 취급방침</h3>
  68. </div>
  69. <div class="term_wrap">
  70. <pre>
  71. {!! $policy['PostContents'] ?? '' !!}
  72. </pre>
  73. </div>
  74. <div class="agree_check">
  75. <label for="agree" class="check_box">
  76. <input id="agree" type="checkbox" required>
  77. <span></span>
  78. [필수] 상기 약관을 확인했으며, 개인정보 취급방침에 동의합니다.
  79. </label>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="container">
  84. <div class="guide">※ 모든 항목을 올바르게 입력하셔야 문의하기 버튼이 활성화 됩니다.</div>
  85. <div class="captcha_wrap d-flex flex-column">
  86. <div id="captcha" class="g-recaptcha mb-3 mb-md-0" data-sitekey="6LdEDgcqAAAAAFB0ti6Jwq1jH8nltyjBIcnqHJ5M"></div>
  87. <div class="captch_box">
  88. <div class="d-flex modal-body px-0 m-auto py-5">
  89. <div class="form-group mb-1">
  90. <div class="captcha text-center">
  91. <span>{!! captcha_img() !!}</span>
  92. </div>
  93. </div>
  94. <div class="form-group d-flex mb-0">
  95. <input id="captcha" type="text"
  96. class="form-control" required placeholder="문자열 입력" name="captcha">
  97. <button type="button" class="btn reload" id="reload">
  98. 새로고침
  99. </button>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="btn_wrap">
  104. <button type="submit" disabled
  105. class="contact-us-btn btn btn_primary submitForm button-prevent-multiple-submits">
  106. <i class="spinner fa fa-spinner fa-spin"></i>
  107. 문의하기
  108. </button>
  109. </div>
  110. </div>
  111. </div>
  112. </form>
  113. @endsection
  114. @push('js')
  115. {{-- <script src="https://www.google.com/recaptcha/api.js?hl={{ getLocale() }}" async defer></script>--}}
  116. <script src="https://www.google.com/recaptcha/api.js?hl={{ app()->getLocale() }}" async defer></script>
  117. <script>
  118. $('#contact-us-form').on('submit', function(event) {
  119. event.preventDefault()
  120. event.stopPropagation()
  121. var v = grecaptcha.getResponse()
  122. if (v.length == 0) {
  123. return iziToast.error({ title: 'Error', message: "자동입력방지 기능 - '로봇이 아닙니다.'를 체크해주세요" })
  124. }
  125. click_submit_btn(this)
  126. this.submit()
  127. });
  128. $('#contact-us-form input').on('input', function() {
  129. input_check()
  130. });
  131. function input_check() {
  132. let check = true
  133. $('#contact-us-form input').each(function () {
  134. if ($(this).val() == '') {
  135. check = false
  136. return false
  137. }
  138. })
  139. $('.contact-us-btn').prop('disabled', ! check)
  140. return check
  141. }
  142. $('input[name=Pc2]').on('input', function() {
  143. let phoneNumber = $(this).val();
  144. // Remove any non-numeric characters
  145. phoneNumber = phoneNumber.replace(/\D/g, '');
  146. // Limit input to 11 digits
  147. phoneNumber = phoneNumber.substring(0, 11);
  148. // Update the input value
  149. $(this).val(phoneNumber);
  150. });
  151. $('#reload').click(function () {
  152. $.ajax({
  153. type: 'GET',
  154. url: '{{ url('reload-captcha') }}',
  155. success: function (data) {
  156. $('#captcha').val('')
  157. $(".captcha span").html(data.captcha);
  158. }
  159. });
  160. });
  161. </script>
  162. @endpush