DelvAddrChangePopWeb.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!-- 배송지변경 팝업 -->
  2. <form name="delvAddrChangeForm" id="delvAddrChangeForm">
  3. <div class="modal-header">
  4. <h5 class="modal-title" id="adrsChangeLabel">배송지 선택</h5>
  5. </div>
  6. <div class="modal-body">
  7. <div class="pop_cont">
  8. <ul>
  9. <!-- 배송지목록 -->
  10. <th:block th:each="deliveryAddr, index : ${deliveryAddrList}">
  11. <li>
  12. <div class="adrs_box">
  13. <dl>
  14. <div>
  15. <dt><span class="sr-only">배송지명</span></dt>
  16. <dd>
  17. <th:block th:text="${deliveryAddr.recipNm}"></th:block>
  18. <span class="icon_tag">
  19. <th:block th:if="${deliveryAddr.defaultYn} == 'Y'">
  20. <em class="tag">기본 배송지</em>
  21. </th:block>
  22. <th:block th:if="${deliveryAddr.shotDelvUseYn} == 'Y'">
  23. <em class="tag primary_line">총알배송</em>
  24. </th:block>
  25. </span>
  26. </dd>
  27. </div>
  28. <div>
  29. <dt><span class="sr-only">휴대폰 번호</span></dt>
  30. <dd th:text="${deliveryAddr.recipPhnno}"></dd>
  31. </div>
  32. <div>
  33. <dt><span class="sr-only">배송주소</span></dt>
  34. <dd th:text="${deliveryAddr.recipBaseAddr} + ' ' + ${deliveryAddr.recipDtlAddr}"></dd>
  35. </div>
  36. <div>
  37. <dt>배송요청 사항&nbsp;:&nbsp;</dt>
  38. <dd th:text="${deliveryAddr.delvMemo}"></dd>
  39. </div>
  40. </dl>
  41. <button type="button" class="btn btn_default btn_sm btn_addrModify_pop" th:value="${deliveryAddr.custDelvAddrSq}"><span>수정</span></button>
  42. <button type="button" class="btn btn_dark btn_sm btn_sel_delvAddr" th:value="${deliveryAddr.custDelvAddrSq}"><span>선택</span></button>
  43. <input type="hidden" name="recipNm" th:value="${deliveryAddr.recipNm}"/>
  44. <input type="hidden" name="recipPhnno" th:value="${deliveryAddr.recipPhnno}"/>
  45. <input type="hidden" name="recipZipcode" th:value="${deliveryAddr.recipZipcode}"/>
  46. <input type="hidden" name="recipBaseAddr" th:value="${deliveryAddr.recipBaseAddr}"/>
  47. <input type="hidden" name="recipDtlAddr" th:value="${deliveryAddr.recipDtlAddr}"/>
  48. <input type="hidden" name="delvMemo" th:value="${deliveryAddr.delvMemo}"/>
  49. </div>
  50. </li>
  51. </th:block>
  52. </ul>
  53. </div>
  54. </div>
  55. <div class="modal-footer">
  56. <button type="button" class="btn btn_dark" id="btn_adrsAdd_pop"><span>배송지 추가</span></button>
  57. </div>
  58. </form>
  59. <script th:inline="javascript">
  60. //컨텐츠 호출
  61. $(document).ready( function() {
  62. });
  63. // 2. 버튼기능구현
  64. // 2.1 배송지선택버튼
  65. $(".btn_sel_delvAddr").on("click", function(){
  66. // custDelvAddrSq 부모창으로 전달
  67. var delvObj = {
  68. "custDelvAddrSq" : $(this).attr("value")
  69. , "dispYn" : "Y"
  70. , "recipNm" : $(this).parent().find("input[name=recipNm]").val()
  71. , "recipPhnno" : $(this).parent().find("input[name=recipPhnno]").val()
  72. , "recipZipcode" : $(this).parent().find("input[name=recipZipcode]").val()
  73. , "recipBaseAddr" : $(this).parent().find("input[name=recipBaseAddr]").val()
  74. , "recipDtlAddr" : $(this).parent().find("input[name=recipDtlAddr]").val()
  75. , "delvMemo" : $(this).parent().find("input[name=delvMemo]").val()
  76. }
  77. // 부모장으로 값 전닫
  78. delvAddrSet(delvObj);
  79. // 팝업닫기
  80. $(".close-modal").trigger("click");
  81. });
  82. // 2.2 배송지수정버튼
  83. $(".btn_addrModify_pop").on("click", function(){
  84. var obj = {
  85. "custDelvAddrSq" : $(this).attr("value")
  86. }
  87. $.ajax( {
  88. type : "POST",
  89. url : '/common/delvAddrModifyPop',
  90. data : JSON.stringify(obj),
  91. dataType : 'html',
  92. beforeSend : function(xhr, settings) {
  93. xhr.setRequestHeader("AJAX" , "true");
  94. xhr.setRequestHeader('Accept' , 'application/json');
  95. xhr.setRequestHeader('Content-Type' , 'application/json');
  96. gagajf.showProgressbar(true);
  97. },
  98. success : function(result) {
  99. $("#adrsModifyPop .modal-dialog .modal-content").html(result);
  100. $("#adrsModifyPop").modal("show");
  101. }
  102. });
  103. });
  104. // 2.3 배송지추가 팝업열기
  105. $('#btn_adrsAdd_pop').on("click", function(){
  106. $.ajax( {
  107. type : "POST",
  108. url : '/common/delvAddrAddPop',
  109. data : JSON.stringify(jsonObj),
  110. dataType : 'html',
  111. beforeSend : function(xhr, settings) {
  112. xhr.setRequestHeader("AJAX" , "true");
  113. xhr.setRequestHeader('Accept' , 'application/json');
  114. xhr.setRequestHeader('Content-Type' , 'application/json');
  115. gagajf.showProgressbar(true);
  116. },
  117. success : function(result) {
  118. $("#adrsAddPop .modal-dialog .modal-content").html(result);
  119. $("#adrsAddPop").modal("show");
  120. }
  121. });
  122. });
  123. </script>