index.blade.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <form class="modal-form form-prevent-multiple-submits" action="{{ route('address.store') }}" method="POST">
  2. @csrf
  3. <input type="hidden" name="seq_no" value="{{ request('seq_no') }}">
  4. <div class="form-title">
  5. <h3>주소 추가</h3>
  6. </div>
  7. <div class="form-group">
  8. <label class="form-label">종류</label>
  9. <div class="d-flex align-items-center">
  10. @forelse ($codeTitle['sort']['company-destina-bd'] ?? [] as $key => $sort)
  11. @if ($sort['Code'] !== '')
  12. <div class="sort-div">
  13. <input type="radio" value="{{ $sort['Code'] }}" name="sort" id="sort-radio-{{ $key }}" {{ $key === 0 ? 'checked' : '' }}>
  14. <label for="sort-radio-{{ $key }}" class="form-label">{{ $sort['Title'] }}</label>
  15. </div>
  16. @endif
  17. @empty
  18. @endforelse
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <label class="form-label">우편번호</label>
  23. <div class="d-flex">
  24. <input class="form-control radius-r0" type="text" name="zip_code" id="zip-code-txt"
  25. placeholder="우편번호를 입력하세요." required>
  26. <button type="button" onclick="get_zip_code(this)" tabindex="-1"
  27. class="btn-dark rounded border-0 radius-l0 col-4">
  28. <i class="fas fa-map-marker-alt fa-lg" style="line-height: 24px;"></i>
  29. </button>
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label class="form-label">주소</label>
  34. <input class="form-control" type="text" name="addr1" id="addr1-txt" placeholder="주소를 입력하세요." required>
  35. </div>
  36. <div class="form-group">
  37. <label class="form-label">주소상세</label>
  38. <textarea style="height: 100px" class="form-control" name="addr2" id="addr2-txt" placeholder="상세주소를 입력하세요."></textarea>
  39. </div>
  40. <button class="form-btn button-prevent-multiple-submits save-prev-scroll-submits" type="submit">
  41. <i class="spinner fa fa-spinner fa-spin"></i>
  42. 저장
  43. </button>
  44. </form>
  45. @once
  46. <script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>
  47. <script>
  48. function get_zip_code($this){
  49. new daum.Postcode({
  50. oncomplete: function(data) {
  51. $($this).closest('form').find('#zip-code-txt').val(data.zonecode)
  52. $($this).closest('form').find('#addr1-txt').val(data.roadAddress)
  53. }
  54. }).open();
  55. }
  56. </script>
  57. @endonce