OrderFormMob.html 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671
  1. <!DOCTYPE html>
  2. <html lang="ko" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="mob/common/layout/SubLayoutMob">
  3. <!--
  4. *******************************************************************************
  5. * @source : OrderFormMob.html
  6. * @desc : 주문/결제 Page
  7. *============================================================================
  8. * STYLE24
  9. * Copyright(C) 2020 TSIT, All rights reserved.
  10. *============================================================================
  11. * VER DATE AUTHOR DESCRIPTION
  12. * === =========== ========== =============================================
  13. * 1.0 2021.04.05 jsh77b 최초 작성
  14. *******************************************************************************
  15. -->
  16. <body onunload="">
  17. <th:block layout:fragment="content">
  18. <link rel="stylesheet" type="text/css" href="/ux/pc/css/swiper.min.css">
  19. <script type="text/javascript" src="/ux/pc/js/swiper.min.js"></script>
  20. <script type="text/javascript" src="/ux/pc/js/slick.min.js"></script>
  21. <script type="text/javascript" src="/ux/pc/js/jquery-ui.js"></script>
  22. <!-- payment.js -->
  23. <script type="text/javascript" th:src="${@environment.getProperty('pg.kcp.js.url')}" src=""></script>
  24. <script type="text/javascript" src="/biz/payment.js"></script>
  25. <script type="text/javascript" src="/ux/plugins/approval_key.js" charset='euc-kr'></script>
  26. <form id="order_info" name="order_info" method="post" action="/order/pay/result/response" ></form>
  27. <!-- 주문금액정보표현 -->
  28. <form id="orderAmtForm" name="orderAmtForm">
  29. <!-- 고객정보 -->
  30. <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="orderInfo" id="orderInfo">
  31. <tbody>
  32. <tr style="height:30px;">
  33. <td class="custNm"></td>
  34. <td class="email"></td>
  35. <td class="cellPhnno"></td>
  36. <td class="recipNm"></td>
  37. <td class="recipPhnno"></td>
  38. <td class="recipZipcode"></td>
  39. <td class="recipBaseAddr"></td>
  40. <td class="recipDtlAddr"></td>
  41. <td class="delvMemo"></td>
  42. <td class="sexGb"></td>
  43. <td class="birthYmd"></td>
  44. <td class="giftPackYn" th:text="${giftPackYn}"></td>
  45. </tr>
  46. </tbody>
  47. </table>
  48. <!-- //고객정보 -->
  49. <!-- 사은품정보 -->
  50. <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="freegiftInfo">
  51. <tr style="height:30px;">
  52. <td class="freegiftValArr"></td>
  53. <td class="freegiftUsePointArr"></td>
  54. <td class="freegiftSqArr"></td>
  55. <td class="freegiftGoodsArr"></td>
  56. </tr>
  57. </table>
  58. <!-- //사은품정보 -->
  59. <!-- 주문상세금액 -->
  60. <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="orderDetailInfo" id="orderDetailInfo">
  61. <th:block th:each="delvAllCart, index : ${delvAllCartList}">
  62. <th:block th:if="${delvAllCart != null and #lists.size(delvAllCart) > 0}">
  63. <th:block th:each="goods, i : ${delvAllCart}">
  64. <tr style="height:30px;">
  65. <td class="cartSq" th:text="${goods.cartSq}"></td>
  66. <td class="goodsNm" th:text="${goods.goodsNm}" style="display:none"></td>
  67. <td class="goodsCd" th:text="${goods.goodsCd}"></td>
  68. <td class="goodsType" th:text="${goods.goodsType}"></td>
  69. <td class="itemCd" th:text="${goods.itemCd}"></td>
  70. <td class="optCd" th:text="${goods.optCd}"></td>
  71. <td class="optCd1" th:text="${goods.optCd1}" style="display:none"></td>
  72. <td class="optCd2" th:text="${goods.optCd2}" style="display:none"></td>
  73. <td class="itemQtyr" th:text="${goods.itemQtyr}" style="display:none"></td>
  74. <td class="orgCurrPrice" th:text="${goods.orgCurrPrice}"></td>
  75. <td class="cpn1CpnSq" th:text="${goods.cpn1CpnSq}"></td>
  76. <td class="cpn1DcAmt" th:text="${goods.orgCurrPrice} - ${goods.currPrice}"></td>
  77. <td class="optAddPrice" th:text="${goods.optAddPrice}"></td>
  78. <td class="goodsQty" th:text="${goods.goodsQty}"></td>
  79. <td class="ordAmt">0</td>
  80. <th:block th:if="${goods.applyQtySectionYn} == 'Y' and ${goods.qtyTmtbSq} > 0">
  81. <td class="tmtb1Sq" th:text="${goods.qtyTmtbSq}"></td>
  82. <td class="tmtb1DcAmt" th:text="${goods.tmtb1DcAmt}"></td>
  83. </th:block>
  84. <th:block th:if="${goods.applyQtySectionYn} != 'Y'">
  85. <td class="tmtb1Sq">0</td>
  86. <td class="tmtb1DcAmt">0</td>
  87. </th:block>
  88. <th:block th:if="${goods.applyAmtSectionYn} == 'Y' and ${goods.amtTmtbSq} > 0">
  89. <td class="tmtb2Sq" th:text="${goods.amtTmtbSq}"></td>
  90. <td class="tmtb2DcAmt" th:text="${goods.tmtb2DcAmt}"></td>
  91. </th:block>
  92. <th:block th:if="${goods.applyAmtSectionYn} != 'Y'">
  93. <td class="tmtb2Sq" >0</td>
  94. <td class="tmtb2DcAmt" >0</td>
  95. </th:block>
  96. <td class="goodsCpnSq">0</td>
  97. <td class="goodsCpnDcAmt">0</td>
  98. <td class="cartCpnSq">0</td>
  99. <td class="cartCpnDcAmt">0</td>
  100. <td class="prePntDcAmt1" th:text="${goods.prePntDcAmt}"></td>
  101. <td class="dcSumAmt">0</td>
  102. <td class="pntDcAmt1">0</td>
  103. <td class="gfcdUseAmt1">0</td>
  104. <td class="realOrdAmt1">0</td>
  105. <td class="savePntAmt1">0</td>
  106. <td class="shotDelvYn" th:text="${goods.shotDelvYn}"></td>
  107. <td class="foreignBuyYn" th:text="${goods.foreignBuyYn}"></td>
  108. <td class="orderMadeYn" th:text="${goods.orderMadeYn}"></td>
  109. <td class="delvFeeCd" th:text="${goods.delvFeeCd}"></td>
  110. <td class="pntPrate" th:text="${goods.pntPrate}"></td>
  111. <td class="pntMrate" th:text="${goods.pntMrate}"></td>
  112. </tr>
  113. </th:block>
  114. </th:block>
  115. </th:block>
  116. </table>
  117. <!-- //주문상세금액 -->
  118. <!-- 배송단위목록 -->
  119. <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="delvFeeCdInfo" id="delvFeeCdInfo">
  120. <th:block th:each="delvFeeCd, index : ${delvFeeCdList}">
  121. <tr style="height:30px;">
  122. <td class="supplyCompCd" th:text="${delvFeeCd.supplyCompCd}"></td>
  123. <td class="delvFeeCd" th:text="${delvFeeCd.delvFeeCd}"></td>
  124. <td class="delvFee" th:text="${delvFeeCd.delvFee}"></td>
  125. <td class="delvCpnSq">0</td>
  126. <td class="delvCpnDcAmt">0</td>
  127. </tr>
  128. </th:block>
  129. </table>
  130. <!-- //배송단위목록 -->
  131. <!-- 주문금액합계 -->
  132. <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="orderSumAmtInfo" id="orderSumAmtInfo">
  133. <tr style="height:30px;">
  134. <td class="orgGoodsSumAmt">0</td>
  135. <td class="delvSumAmt" th:text="${sumDelvFee}"></td>
  136. <td class="freegiftUsePnt">0</td>
  137. <td class="cpn1DcSumAmt">0</td>
  138. <td class="ordSumAmt">0</td>
  139. <td class="tmtb1DcSumAmt">0</td>
  140. <td class="tmtb2DcSumAmt">0</td>
  141. <td class="tmtbDcSumAmt">0</td>
  142. <td class="goodsCpnDcSumAmt">0</td>
  143. <td class="cartCpnDcSumAmt">0</td>
  144. <td class="delvCpnDcSumAmt">0</td>
  145. <td class="cpnDcSumAmt">0</td>
  146. <td class="prePntDcSumAmt">0</td>
  147. <td class="pntDcSumAmt">0</td>
  148. <td class="gfcdUseSumAmt">0</td>
  149. <td class="realOrdSumAmt">0</td>
  150. <td class="savePntSumAmt">0</td>
  151. </tr>
  152. </table>
  153. <!-- //주문금액합계 -->
  154. </form>
  155. <!-- //주문금액정보표현 -->
  156. <!-- 주문고객정보 -->
  157. <form id="orderForm" name="orderForm">
  158. <main role="" id="" class="container od">
  159. <section class="content odPayment od_gift">
  160. <form action="" class="form_wrap">
  161. <!-- 주문내역 -->
  162. <div class="inner wide" id="orderListInfo" style="display:none"></div>
  163. <!-- //주문내역 -->
  164. <!-- 주문고객 -->
  165. <div class="inner wide" id="custemerInfo" style="display:none"></div>
  166. <!-- //주문고객 -->
  167. <!-- 선물받으실분 -->
  168. <div class="inner wide" id="orderGiftInfo" style="display:none"></div>
  169. <!-- //선물받으실분 -->
  170. <!-- 배송지 정보 -->
  171. <div class="inner wide" id="deliveryAddrInfo" style="display:none"></div>
  172. <!-- //배송지 정보 -->
  173. <!-- 개인통관고유부호 -->
  174. <div class="inner wide" id="entryInfo" style="display:none"></div>
  175. <!-- //개인통관고유부호 -->
  176. <!-- 주문제작상품동의 -->
  177. <div class="inner wide" id="madeInfo" style="display:none"></div>
  178. <!-- //주문제작상품동의 -->
  179. <!-- 사은품 -->
  180. <div class="inner wide" id="freegiftInfo" style="display:none"></div>
  181. <!-- //사은품 -->
  182. <!-- 할인/혜택 사용 -->
  183. <div class="inner wide" id="dcAmtInfo" style="display:none"></div>
  184. <!-- //할인/혜택 사용 -->
  185. <!-- 결제수단 선택 -->
  186. <div class="inner wide" id="paymentInfo" style="display:none"></div>
  187. <!-- //결제수단 선택 -->
  188. <!-- 결제 정보 -->
  189. <div class="inner">
  190. <div class="tbl_wrap pay_wrap">
  191. <div class="tbl_tit">
  192. <h3>결제 예정금액</h3>
  193. <strong class="pay"><span class="realOrdAmt"></span>원</strong>
  194. </div>
  195. <div class="tbl type1">
  196. <table>
  197. <colgroup>
  198. <col width="227">
  199. <col width="*">
  200. </colgroup>
  201. <tbody>
  202. <tr>
  203. <td>
  204. <dl>
  205. <div>
  206. <dt>주문금액</dt>
  207. <dd><div><span class="orgGoodsSumAmt" th:text="${#numbers.formatInteger(orgGoodsSumAmt, 1, 'COMMA')}"></span>원</div></dd>
  208. </div>
  209. <div>
  210. <dt>할인금액</dt>
  211. <dd>
  212. <div class="c_primary"> <!-- 210526_ 추가 : [.c_primary] 클래스 추가시 #fd4802 색상 변경. -->
  213. <span class="dcSumAmt"></span>원
  214. </div>
  215. </dd>
  216. </div>
  217. <div>
  218. <dt>배송비</dt>
  219. <dd><div><span class="delvSumAmt" th:text="${#numbers.formatInteger(sumDelvFee, 1, 'COMMA')}"></span>원</div></dd>
  220. </div>
  221. </dl>
  222. </td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. </div>
  227. </div>
  228. <div class="area_paymentinfo">
  229. <!-- @자사만,무통장,실시간있으면 미노출 -->
  230. <!-- @입점이있으면 -->
  231. <div class="paymentinfo">
  232. <div class="payinfo_blk_wrap">
  233. <a href="javascript:void(0);">구매조건 확인 및 결제대행 서비스 약관 동의<span>보기</span></a>
  234. <div class="payinfo_blk_parent">
  235. <div class="payinfo_blk">
  236. <a href="javascript:void(0);">개인정보 제공에 대한 동의<span>보기</span></a>
  237. <div class="infotxt">
  238. STYLE24는 다음과 같이 회원님의 개인정보를 제3자에게 제공합니다.
  239. <table class="paymentinfo agree1">
  240. <colgroup>
  241. <col width="30%">
  242. <col width="*">
  243. </colgroup>
  244. <tbody>
  245. <tr>
  246. <th>제공받는 자</th>
  247. <td>서울보증보험㈜, ㈜유세이프</td>
  248. </tr>
  249. <tr>
  250. <th>제공하는 항목</th>
  251. <td>
  252. 구매자명, 구매자 생년월일,
  253. 구매자 성별, 구매자 연락처
  254. (일반전화 및 핸드폰), 구매자
  255. 이메일, 주문번호,
  256. 배송지 정보, 주문 금액
  257. </td>
  258. </tr>
  259. <tr>
  260. <th>제공 목적</th>
  261. <td>쇼핑몰보증보험 가입 및 보험가입 제반 사항</td>
  262. </tr>
  263. <tr>
  264. <th>보유 및 이용기간</th>
  265. <td>개별서비스 제공기간</td>
  266. </tr>
  267. </tbody>
  268. </table>
  269. <!-- 입점업체가 있을때 노출 -->
  270. <th:block th:if="${delvCnt} > 0">
  271. <table class="paymentinfo agree2">
  272. <colgroup>
  273. <col width="30%">
  274. <col width="*">
  275. </colgroup>
  276. <tbody>
  277. <tr>
  278. <th>제공받는 자</th>
  279. <td>
  280. <th:block th:each="delvFeeCd, i : ${delvFeeCdList}">
  281. <th:block th:unless="${delvFeeCd.delvFeeCd} == 'WMS'">
  282. <th:block th:if="${i.count == #lists.size(delvFeeCdList)}">
  283. <th:block th:text="|${delvFeeCd.supplyCompNm}|"></th:block>
  284. </th:block>
  285. <th:block th:if="${i.count < #lists.size(delvFeeCdList)}">
  286. <th:block th:text="|${delvFeeCd.supplyCompNm},|"></th:block>
  287. </th:block>
  288. </th:block>
  289. </th:block>
  290. </td>
  291. </tr>
  292. <tr>
  293. <th>제공하는 항목</th>
  294. <td>성명, 주소, 연락처</td>
  295. </tr>
  296. <tr>
  297. <th>제공 목적</th>
  298. <td>주문상품의 배송, 고객상담 및 불만처리</td>
  299. </tr>
  300. <tr>
  301. <th>보유 및 이용기간</th>
  302. <td>이용목적 달성 시 까지</td>
  303. </tr>
  304. </tbody>
  305. </table>
  306. </th:block>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. <div class="agree_payment">
  313. 위 주문내역을 확인 하였으며, 회원 본인은 결제에 동의합니다. (전자상거래법 제 8조 제2항)
  314. </div>
  315. </div>
  316. </div>
  317. <!-- //결제 정보 -->
  318. <div class="inner wide">
  319. <div class="area_paybtn">
  320. <div class="btn_group btn_group_flex">
  321. <div>
  322. <button type="button" id="btn_payment" class="btn btn_primary">
  323. 동의 후 <span class="total_price">0</span>원 결제하기
  324. </button>
  325. </div> <!-- 210406_ID추가 -->
  326. </div>
  327. </div>
  328. </div>
  329. </form>
  330. </section>
  331. </main>
  332. <!-- 할인쿠폰 변경 팝업 -->
  333. <div class="modal pop_full couponModify_pop" id="couponModifyPop" tabindex="-1" role="dialog" aria-labelledby="couponModifyLabel" aria-hidden="true"></div>
  334. <!-- //할인쿠폰 변경 팝업 -->
  335. <!-- 배송비 쿠폰선택_팝업 -->
  336. <div id="couponSelectPop02" class="popup_box couponSelectPop couponSelectPop02"></div>
  337. <!-- //배송비 쿠폰선택_팝업 -->
  338. <script th:inline="javascript">
  339. // 배송관련정보 변수선언
  340. var cartGoodsList = [[${cartGoodsList}]] // 배송목록
  341. var shotCnt = [[${shotCnt}]]; // 자사 총알 배송건수
  342. var wmsCnt = [[${wmsCnt}]]; // 자사 일반 배송건수
  343. var shotWmsCnt = [[${shotWmsCnt}]]; // 자사 총알,일반 배송건수
  344. var resCnt = [[${resCnt}]]; // 자사 예약 배송건수
  345. var delvCnt = [[${delvCnt}]]; // 입점 일반 배송건수
  346. var orgSumDelvFee = [[${sumDelvFee}]]; // 최초배송비합계
  347. var prePntDcAmt = [[${prePntDcAmt}]]; // 선포인트사용가능금액
  348. var custNm = [[${order.custNm}]]; // 주문자명
  349. var cellPhnno = [[${order.cellPhnno}]]; // 핸드폰번호
  350. var email = [[${order.email}]]; // 이메일
  351. var recipZipcode = [[${order.recipZipcode}]]; // 우편번호
  352. var recipBaseAddr = [[${order.recipBaseAddr}]]; // 기본주소
  353. var recipDtlAddr = [[${order.recipDtlAddr}]]; // 상세주소
  354. var cartSqArr = [[${order.cartSqArr}]]; // 장바구니시퀀스 목록
  355. var shotDelvUseYn = [[${order.shotDelvUseYn}]]; // 총알배송사용여부(장바구니)
  356. var shotDelvYn = [[${order.shotDelvUseYn}]]; // 총알배송사용여부(장바구니)
  357. var foreignBuyYn = [[${order.foreignBuyYn}]]; // 해외구매대행
  358. var foreignBuyYn = [[${foreignBuyYn}]]; // 해외구매대행여부
  359. var orderMadeYn = [[${orderMadeYn}]]; // 주문제작상품여부
  360. var isLogin = [[${isLogin}]]; // 로그인여부
  361. var giftPackYn = [[${giftPackYn}]]; // 선물받기여부
  362. var custCpnSq = 0;
  363. var cpnIndex = 0;
  364. var cpnApplyTemp = false;
  365. //AJAX 로드를 위한 변수 설정
  366. var jsonObj = {};
  367. // 컨텐츠 호출
  368. $(document).ready( function() {
  369. // 999. 개발화면정보설정
  370. var devTemp = false;
  371. var arr = []
  372. arr[0] = "orderInfo";
  373. arr[1] = "freegiftInfo";
  374. arr[2] = "orderDetailInfo";
  375. arr[3] = "delvFeeCdInfo";
  376. arr[4] = "orderSumAmtInfo";
  377. if (devTemp) {
  378. $("table").each(function(){
  379. var name = $(this).attr("name");
  380. for (i=0 ; i<arr.length ; i++) {
  381. if (name == arr[i]) {
  382. $(this).show();
  383. }
  384. }
  385. });
  386. }
  387. // 1. 타이틀설정
  388. $("#htopTitle").text("주문/결제");
  389. // 2. 장바구니시퀀스 배열 변환
  390. cartSqArr = String(cartSqArr).split(",");
  391. var dispYn = "N";
  392. if (isLogin == false) {
  393. //dispYn = "Y";
  394. }
  395. // AJAX 로드를 위한 변수 설정
  396. jsonObj = {
  397. "custNm" : custNm
  398. , "cellPhnno" : cellPhnno
  399. , "email" : email
  400. , "recipZipcode" : recipZipcode
  401. , "recipBaseAddr" : recipBaseAddr
  402. , "recipDtlAddr" : recipDtlAddr
  403. , "cartSqArr" : cartSqArr
  404. , "dispYn" : dispYn
  405. , "shotDelvYn" : shotDelvUseYn
  406. , "shotDelvUseYn" : shotDelvUseYn
  407. , "foreignBuyYn" : foreignBuyYn
  408. , "orderMadeYn" : orderMadeYn
  409. , "custDelvAddrSq" : 0
  410. , "giftPackYn" : giftPackYn
  411. , "cartGoodsList" : cartGoodsList
  412. }
  413. jsonData = JSON.stringify(jsonObj);
  414. // 1. AJAX 정보(회원정보로드)
  415. custemerInfoSet();
  416. });
  417. window.onpageshow = function(event){
  418. if ( event.persisted || (event.originalEvent && event.originalEvent.persisted) || (window.performance && window.performance.navigation.type == 2) ){
  419. window.history.back();
  420. }
  421. };
  422. // 1. 함수기능 정의
  423. // 1.1 고객정보로드
  424. var custemerInfoSet = function() {
  425. $.ajax( {
  426. type : "POST",
  427. url : '/order/custemerInfo',
  428. data : JSON.stringify(jsonObj),
  429. dataType : 'html',
  430. beforeSend : function(xhr, settings) {
  431. xhr.setRequestHeader("AJAX" , "true");
  432. xhr.setRequestHeader('Accept' , 'application/json');
  433. xhr.setRequestHeader('Content-Type' , 'application/json');
  434. },
  435. success : function(result) {
  436. if (result != null) {
  437. $("#custemerInfo").css("display", "block");
  438. $("#custemerInfo").html(result);
  439. // 고객정보설정
  440. $("#orderAmtForm .custNm").text($("#orderForm input[name='custNm']").val());
  441. $("#orderAmtForm .email").text($("#orderForm input[name='email']").val());
  442. $("#orderAmtForm .cellPhnno").text($("#orderForm input[name='cellPhnno']").val());
  443. $("#orderAmtForm .sexGb").text($("#orderForm input[name='sexGb']").val());
  444. $("#orderAmtForm .birthYmd").text($("#orderForm input[name='birthYmd']").val());
  445. }
  446. // 1.2 개인통관부호 정보
  447. if (foreignBuyYn == "Y") {
  448. entryInfoSet();
  449. }
  450. // 1.3 주문제작상품동의여부
  451. if (orderMadeYn == "Y") {
  452. madeInfoSet();
  453. }
  454. // 1.4 선물하기여부체크
  455. if (giftPackYn == "Y") {
  456. // 1.4.1 선물하기정보로드
  457. orderGiftInfoSet(jsonObj, true);
  458. } else {
  459. // 1.4.2 배송정보로드
  460. deliveryAddrInfoSet(jsonObj, true);
  461. }
  462. }
  463. });
  464. }
  465. // 1.2 개인통관부호 정보
  466. var entryInfoSet = function() {
  467. $.ajax( {
  468. type : "POST",
  469. url : '/order/entryInfo',
  470. data : JSON.stringify(jsonObj),
  471. dataType : 'html',
  472. beforeSend : function(xhr, settings) {
  473. xhr.setRequestHeader("AJAX" , "true");
  474. xhr.setRequestHeader('Accept' , 'application/json');
  475. xhr.setRequestHeader('Content-Type' , 'application/json');
  476. },
  477. success : function(result) {
  478. $("#entryInfo").css("display", "block");
  479. $("#entryInfo").html(result);
  480. }
  481. });
  482. }
  483. // 1.3 주문제작상품동의여부
  484. var madeInfoSet = function() {
  485. $.ajax( {
  486. type : "POST",
  487. url : '/order/madeInfo',
  488. data : JSON.stringify(jsonObj),
  489. dataType : 'html',
  490. beforeSend : function(xhr, settings) {
  491. xhr.setRequestHeader("AJAX" , "true");
  492. xhr.setRequestHeader('Accept' , 'application/json');
  493. xhr.setRequestHeader('Content-Type' , 'application/json');
  494. },
  495. success : function(result) {
  496. $("#madeInfo").css("display", "block");
  497. $("#madeInfo").html(result);
  498. }
  499. });
  500. }
  501. // 1.4.1 선물받기여부정보로드
  502. var orderGiftInfoSet = function() {
  503. $.ajax( {
  504. type : "POST",
  505. url : '/order/orderGiftInfo',
  506. data : JSON.stringify(jsonObj),
  507. dataType : 'html',
  508. beforeSend : function(xhr, settings) {
  509. xhr.setRequestHeader("AJAX" , "true");
  510. xhr.setRequestHeader('Accept' , 'application/json');
  511. xhr.setRequestHeader('Content-Type' , 'application/json');
  512. },
  513. success : function(result) {
  514. $("#orderGiftInfo").css("display", "block");
  515. $("#orderGiftInfo").html(result);
  516. // 직접입력 선택 버튼
  517. $("#orderGiftInfo .gift_tab .fold_cont ul li").on("click", function(){
  518. $(this).parent().find("li").removeClass("active");
  519. $(this).addClass("active");
  520. $(this).parent().parent().find("input[name=recipNm]").val("");
  521. $(this).parent().parent().find("input[name=recipPhnno]").val("");
  522. // 직접입력시 입력창 활성화
  523. if ($(this).find("span").text() == "직접입력") {
  524. $(this).parent().parent().find("input[name=recipNm]").attr("readOnly", false);
  525. $(this).parent().parent().find("input[name=recipPhnno]").attr("readOnly", false);
  526. } else {
  527. $(this).parent().parent().find("input[name=recipNm]").attr("readOnly", true);
  528. $(this).parent().parent().find("input[name=recipPhnno]").attr("readOnly", true);
  529. // 2021.06.03
  530. window.style24.getContact();
  531. }
  532. });
  533. // 주문목록정보로드
  534. orderListInfoSet(JSON.stringify(jsonObj), true);
  535. }
  536. });
  537. }
  538. // 2021.06.03 어플 callback 함수 호출
  539. function contactInfo(jsonString) {
  540. let jsonObj = JSON.parse(jsonString);
  541. var phnno = jsonObj.contact.phnno;
  542. phnno = phnno.replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-");
  543. $("#orderForm #orderGiftInfo input[name=recipNm]").val(jsonObj.contact.name);
  544. $("#orderForm #orderGiftInfo input[name=recipPhnno]").val(phnno);
  545. }
  546. // 1.4.2 배송정보로드
  547. var deliveryAddrInfoSet = function(delvObj, temp) {
  548. // 2021.04.29 AJAX 로드를 위한 변수 설정
  549. delvObj.foreignBuyYn = foreignBuyYn;
  550. delvObj.orderMadeYn = orderMadeYn;
  551. $.ajax( {
  552. type : "POST",
  553. url : '/order/deliveryAddrInfo',
  554. data : JSON.stringify(delvObj),
  555. dataType : 'html',
  556. beforeSend : function(xhr, settings) {
  557. xhr.setRequestHeader("AJAX" , "true");
  558. xhr.setRequestHeader('Accept' , 'application/json');
  559. xhr.setRequestHeader('Content-Type' , 'application/json');
  560. },
  561. success : function(result) {
  562. $("#deliveryAddrInfo").css("display", "block");
  563. $("#deliveryAddrInfo").html(result);
  564. // 2021.05.16 배송정보가 있으면 노출
  565. if ($("#orderForm input[name='recipZipcode']").val() != "00000") {
  566. $("#orderForm .ship_info.exist").show();
  567. $("#orderForm .ship_info.none").hide();
  568. } else {
  569. $("#orderForm .ship_info.exist").hide();
  570. $("#orderForm .ship_info.none").show();
  571. }
  572. // 배송정보설정
  573. $("#orderAmtForm .recipNm").text($("#orderForm input[name='recipNm']").val());
  574. $("#orderAmtForm .recipPhnno").text($("#orderForm input[name='recipPhnno']").val());
  575. $("#orderAmtForm .recipZipcode").text($("#orderForm input[name='recipZipcode']").val());
  576. $("#orderAmtForm .recipBaseAddr").text($("#orderForm input[name='recipBaseAddr']").val());
  577. $("#orderAmtForm .recipDtlAddr").text($("#orderForm input[name='recipDtlAddr']").val());
  578. $("#orderAmtForm .delvMemo").text($("#orderForm input[name='delvMemo']").val());
  579. // 2. 버튼기능구현
  580. // 2.1 회원 배송지변경 팝업열기
  581. $('#orderForm .btn_adrsChange_pop').on("click", function(){
  582. // 회원인경우
  583. if (isLogin == true) {
  584. $.ajax( {
  585. type : "POST",
  586. url : '/common/delvAddrChangePop',
  587. data : JSON.stringify(jsonObj),
  588. dataType : 'html',
  589. beforeSend : function(xhr, settings) {
  590. xhr.setRequestHeader("AJAX" , "true");
  591. xhr.setRequestHeader('Accept' , 'application/json');
  592. xhr.setRequestHeader('Content-Type' , 'application/json');
  593. },
  594. success : function(result) {
  595. $("#adrsChangePop .modal-dialog .modal-content").html(result);
  596. $("#adrsChangePop").modal("show");
  597. }
  598. });
  599. }
  600. // 비회원인경우
  601. else {
  602. $.ajax( {
  603. type : "POST",
  604. url : '/common/delvAddrAddPop',
  605. data : JSON.stringify(jsonObj),
  606. dataType : 'html',
  607. beforeSend : function(xhr, settings) {
  608. xhr.setRequestHeader("AJAX" , "true");
  609. xhr.setRequestHeader('Accept' , 'application/json');
  610. xhr.setRequestHeader('Content-Type' , 'application/json');
  611. },
  612. success : function(result) {
  613. $("#adrsAddPop .modal-dialog .modal-content").html(result);
  614. $("#adrsAddPop").modal("show");
  615. }
  616. });
  617. }
  618. });
  619. // 1.5 총알배송가능 지역, 총알배송 가능 시간 체크(초기로드정보)
  620. fnGetDailyDeliveryCheck(temp);
  621. }
  622. });
  623. }
  624. // 1.5 총알배송가능 지역, 총알배송 가능 시간 체크
  625. var fnGetDailyDeliveryCheck = function (temp) {
  626. jsonData = JSON.stringify(jsonObj);
  627. // 장바구니 총알배송 사용여부 체크 N
  628. if (shotDelvUseYn == "N") {
  629. // 초기에 한번 데이타 로드
  630. if (temp) {
  631. // 1.4 주문상품목록로드
  632. orderListInfoSet(jsonData, temp);
  633. }
  634. } else {
  635. // 배송지 우편번호 체크
  636. var zipcode = $("#orderForm input[name='recipZipcode']").val();
  637. // 총알배송여부 체크 배송지정보 존재여부 체크
  638. if (zipcode == null || zipcode == '') {
  639. //alert("배송지정보가 없습니다. 기본 총알배송 가능지역으로 설정 합니다.");
  640. zipcode = "04320"; // 기본 서울역 우편번호로 설정
  641. }
  642. // TODO
  643. var shotDelvObj = {"recipZipcode" : zipcode};
  644. gagajf.ajaxJsonSubmit(
  645. "/order/getDailyDeliveryCheck"
  646. , JSON.stringify(shotDelvObj)
  647. , function (result) {
  648. // 총알배송여부체크
  649. var tempShotDelvYn = "N";
  650. if (parseInt(result) > 0) {
  651. tempShotDelvYn = "Y";
  652. }
  653. // json 값 설정
  654. var orderListObj = {
  655. "cartSqArr" : cartSqArr
  656. , "shotDelvYn" : tempShotDelvYn
  657. , "giftPackYn" : giftPackYn
  658. , "cartGoodsList" : cartGoodsList
  659. };
  660. var orderListJsonData = JSON.stringify(orderListObj);
  661. if (temp) {
  662. // 1.6 주문상품목록로드
  663. orderListInfoSet(orderListJsonData, temp);
  664. } else {
  665. if (tempShotDelvYn != shotDelvYn) {
  666. orderListInfoSet(orderListJsonData, temp);
  667. }
  668. }
  669. shotDelvYn = tempShotDelvYn;
  670. }
  671. )
  672. }
  673. }
  674. // 1.6 주문상품목록로드
  675. var orderListInfoSet = function(orderListJsonData, temp) {
  676. $.ajax( {
  677. type : "POST",
  678. url : '/order/orderListInfo',
  679. data : orderListJsonData,
  680. dataType : 'html',
  681. beforeSend : function(xhr, settings) {
  682. xhr.setRequestHeader("AJAX" , "true");
  683. xhr.setRequestHeader('Accept' , 'application/json');
  684. xhr.setRequestHeader('Content-Type' , 'application/json');
  685. },
  686. success : function(result) {
  687. if (result != null) {
  688. $("#orderListInfo").css("display", "block");
  689. $("#orderListInfo").html(result);
  690. $("#delvFeeCdCnt").text($("#orderForm input[name=delvFeeCdCnt]").val());
  691. // 총알배송건수가 있으면 총알배송 태그 표시
  692. if (parseInt($("#orderForm input[name=shotCnt]").val()) > 0 ) {
  693. $("#orderForm .shotDelv").show();
  694. } else {
  695. $("#orderForm .shotDelv").hide();
  696. }
  697. }
  698. // 1.7 사은품정보로드
  699. if (temp) {
  700. freegiftInfoSet();
  701. }
  702. }
  703. });
  704. }
  705. // 1.7 사은품정보로드
  706. var freegiftInfoSet = function() {
  707. $.ajax( {
  708. type : "POST",
  709. url : '/order/freegiftInfo',
  710. data : JSON.stringify(jsonObj),
  711. dataType : 'html',
  712. beforeSend : function(xhr, settings) {
  713. xhr.setRequestHeader("AJAX" , "true");
  714. xhr.setRequestHeader('Accept' , 'application/json');
  715. xhr.setRequestHeader('Content-Type' , 'application/json');
  716. },
  717. success : function(result) {
  718. if (result != null) {
  719. $("#freegiftInfo").html(result);
  720. var total_gift = 0;
  721. var total_deduct = 0;
  722. // 2.2 사은품선택 라디오 버튼 기능
  723. $("#orderForm .freegiftRdo").on("click", function() {
  724. total_gift = 0;
  725. total_deduct = 0;
  726. // 2021.04.14 사은품 사용 포인트가 보유포인트보다 작아야 한다.
  727. var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
  728. var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
  729. var usepoint = parseInt($(this).attr("usepoint"));
  730. rmPntAmt = rmPntAmt - freegiftUsePnt - usepoint;
  731. if (rmPntAmt < 0) {
  732. mcxDialog.alert("보유포인트가 부족합니다.");
  733. return false;
  734. }
  735. $("#orderForm .freegiftRdo").each(function(){
  736. // 라디오버튼 사은품 체크
  737. if ($(this).is(":checked")) {
  738. // 수령거부가 아닐때 체크
  739. if ($(this).val() != "noSel") {
  740. total_gift += 1;
  741. total_deduct += parseInt($(this).attr("usepoint"));
  742. }
  743. }
  744. });
  745. $("#orderForm .total_gift").text(total_gift); // 사은품총선택개수
  746. $("#orderForm .total_deduct").text(total_deduct.addComma()); // 사은품총사용포인트
  747. $("#orderAmtForm .freegiftUsePnt").text(total_deduct);
  748. // 2021.04.29 사은품기능 리셋
  749. var pntDcAmt = parseInt($("#orderAmtForm .pntDcSumAmt").text());
  750. if (pntDcAmt > 0) {
  751. mcxDialog.alert("적용된 할인/혜택이 초기화 됩니다.");
  752. pntDcAmtReset();
  753. }
  754. // 2021.05.07 금액계산실행
  755. custCpnSumAmtCal();
  756. });
  757. // 2021.04.29 무료사은품 기본선택
  758. $("#orderForm .freegiftRdo").each(function(){
  759. var usepoint = parseInt($(this).attr("usepoint"));
  760. var count = parseInt($(this).attr("count"));
  761. // 첫번째 무료 선택
  762. if (usepoint == 0 && count == 1) {
  763. $(this).trigger("click");
  764. total_gift = 0;
  765. total_deduct = 0;
  766. // 2021.04.14 사은품 사용 포인트가 보유포인트보다 작아야 한다.
  767. var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
  768. var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
  769. var usepoint = parseInt($(this).attr("usepoint"));
  770. rmPntAmt = rmPntAmt - freegiftUsePnt - usepoint;
  771. if (rmPntAmt < 0) {
  772. mcxDialog.alert("보유포인트가 부족합니다.");
  773. return false;
  774. }
  775. $("#orderForm .freegiftRdo").each(function(){
  776. if ($(this).attr("allYn") == "Y" ) {
  777. total_gift += 1;
  778. }
  779. // 라디오버튼 사은품 체크
  780. if ($(this).is(":checked")) {
  781. // 수령거부가 아닐때 체크
  782. if ($(this).val() != "noSel") {
  783. total_gift += 1;
  784. total_deduct += parseInt($(this).attr("usepoint"));
  785. }
  786. }
  787. });
  788. $("#orderForm .total_gift").text(total_gift); // 사은품총선택개수
  789. $("#orderForm .total_deduct").text(total_deduct.addComma()); // 사은품총사용포인트
  790. $("#orderAmtForm .freegiftUsePnt").text(total_deduct);
  791. // 포인트초기화기능
  792. pntDcAmtReset();
  793. }
  794. });
  795. total_gift = 0;
  796. // 사은품테이블 그리기
  797. $("#orderForm .gift_box").each(function(){
  798. $(this).find(".freegiftRdo").each(function(){
  799. if ($(this).is(":checked")) {
  800. // 수령거부가 아닐때 체크
  801. if ($(this).val() != "noSel") {
  802. total_gift += 1;
  803. total_deduct += parseInt($(this).attr("usepoint"));
  804. }
  805. }
  806. $("#orderForm .total_gift").text(total_gift); // 사은품총선택개수
  807. });
  808. });
  809. // 2021.04.29 사은품동의 체크 기능
  810. /*
  811. $("#orderForm #chk-agree_gift").on("click", function(){
  812. if ($(this).is(":checked") == false) {
  813. mcxDialog.alert("미동의시 사은품 지급이 되지 않습니다.");
  814. }
  815. });
  816. */
  817. }
  818. // 1.8 결제타입로드
  819. paymentInfoSet();
  820. }
  821. });
  822. }
  823. // 1.8 결제타입로드 (결제버튼기능구현)
  824. var paymentInfoSet = function() {
  825. $.ajax( {
  826. type : "POST",
  827. url : '/order/paymentInfo',
  828. data : JSON.stringify(jsonObj),
  829. dataType : 'html',
  830. beforeSend : function(xhr, settings) {
  831. xhr.setRequestHeader("AJAX" , "true");
  832. xhr.setRequestHeader('Accept' , 'application/json');
  833. xhr.setRequestHeader('Content-Type' , 'application/json');
  834. },
  835. success : function(result) {
  836. if (result != null) {
  837. $("#paymentInfo").css("display", "block");
  838. $("#paymentInfo").html(result);
  839. var payType = "";
  840. // 결제타입명칭 설정
  841. $("#orderForm .area_paymethod .paymethod_box ul li").on("click", function(){
  842. payType = $(this).find(".payType").text();
  843. if ($(this).find("input[name=rdi-paynormal]").is(":checked")) {
  844. $(".payTypeNm").text(payType);
  845. }
  846. // 2021.04.29 수정
  847. $("#orderForm input[name=insuranceYn]").attr("checked", false);
  848. $("#orderForm .area_paymentinfo .agree1").hide();
  849. // 2021.04.25 실시간계좌이체, 무통장입금시 보증보험 신청 약관 노출
  850. if (payType == "실시간계좌이체" || payType == "무통장입금" ) {
  851. $("#orderForm .area_paymethod .agree_insurance").show();
  852. } else {
  853. $("#orderForm .area_paymethod .agree_insurance").hide();
  854. }
  855. if (delvCnt > 0) {
  856. $("#orderForm .area_paymentinfo .paymentinfo").show();
  857. } else {
  858. $("#orderForm .area_paymentinfo .paymentinfo").hide();
  859. }
  860. });
  861. // 2021.04.25 실시간계좌이체, 무통장입금시 보증보험 신청 약관 노출
  862. // 2021.05.16 동의박스체크시노출
  863. $("#orderForm input[name=insuranceYn]").on("click", function(){
  864. var displayTemp = true;
  865. if (payType == "실시간계좌이체" || payType == "무통장입금" ) {
  866. if ($(this).is(":checked")) {
  867. $("#orderForm .area_paymethod .agree_insurance").show();
  868. $("#orderForm .area_paymentinfo .paymentinfo").show();
  869. $("#orderForm .area_paymentinfo .agree1").show();
  870. } else {
  871. displayTemp = false;
  872. }
  873. } else {
  874. displayTemp = false;
  875. }
  876. if (displayTemp == false) {
  877. $("#orderForm .area_paymentinfo .agree1").hide();
  878. if (delvCnt > 0) {
  879. $("#orderForm .area_paymentinfo .paymentinfo.agree2").show();
  880. } else {
  881. $("#orderForm .area_paymentinfo .paymentinfo.agree2").hide();
  882. }
  883. }
  884. });
  885. // 2021.05.16 초기값설정
  886. $("#orderForm .area_paymethod .agree_insurance").hide();
  887. $("#orderForm .area_paymentinfo .agree1").hide();
  888. if (delvCnt > 0) {
  889. $("#orderForm .area_paymentinfo .paymentinfo.agree2").show();
  890. } else {
  891. $("#orderForm .area_paymentinfo .paymentinfo.agree2").hide();
  892. }
  893. // 결제하기
  894. $("#btn_payment").on("click", function(){
  895. // 사은품정보
  896. var prePntDcAmtYn = $("#orderForm input[name='rdi-beforpoint']:checked").val();
  897. var paynormal = $("#orderForm input[name='rdi-paynormal']:checked").val();
  898. var orderDetailList = [];
  899. var delvFeeCdList = [];
  900. var ordGoodsQty = 0;
  901. var goodsNm = "";
  902. var orgEntryNo = "";
  903. var entryNo = "";
  904. var giftMsg = "감사합니다.";
  905. var insuranceYn = "N";
  906. // 2021.04.25
  907. if ($("#orderForm input[name=insuranceYn]").is(":checked")) {
  908. insuranceYn = "Y";
  909. }
  910. // 배송주소등록
  911. if ($("#orderAmtForm .recipZipcode").text() == "00000") {
  912. mcxDialog.alert("배송정보를 등록해 주세요.");
  913. // 배송정보화면노출
  914. deliveryAddrInfoDispYn("Y");
  915. return false;
  916. }
  917. // 선물받기일때 배송지주소 받지않음
  918. if (giftPackYn == "N") {
  919. if ($("#orderAmtForm .recipZipcode").text() == "0000" || gagajf.isNull($("#orderAmtForm .recipZipcode").text())) {
  920. mcxDialog.alert("배송정보를 입력해주세요.");
  921. return false;
  922. }
  923. } else {
  924. if (gagajf.isNull($("#orderForm #orderGiftInfo input[name=recipNm]").val())) {
  925. mcxDialog.alert("선물받을분 이름을 입력해주세요.");
  926. $("#orderForm #orderGiftInfo input[name=recipNm]").focus();
  927. orderGiftInfoDispYn("Y");
  928. return false;
  929. }
  930. if (gagajf.isNull($("#orderForm #orderGiftInfo input[name=recipPhnno]").val())) {
  931. mcxDialog.alert("선물받을분 휴대폰번호를 입력해주세요.");
  932. $("#orderForm #orderGiftInfo input[name=recipPhnno]").focus();
  933. orderGiftInfoDispYn("Y");
  934. return false;
  935. }
  936. $("#orderAmtForm .recipNm").text($("#orderForm #orderGiftInfo input[name=recipNm]").val());
  937. $("#orderAmtForm .recipPhnno").text($("#orderForm #orderGiftInfo input[name=recipPhnno]").val());
  938. if (gagajf.isNull($("textarea#giftMsg").val())) {
  939. giftMsg = "감사합니다.";
  940. } else {
  941. giftMsg = $("textarea#giftMsg").val();
  942. }
  943. }
  944. // TODO 개인통관번호 동의 체크시 통관번호 등록
  945. if (foreignBuyYn == "Y") {
  946. if ($("#orderForm input[name=rdi-overseas]:checked").val() == "Y") {
  947. if (gagajf.isNull($("#orderForm input[name=entryNo]").val())) {
  948. mcxDialog.alert("개인통관고유부호를 입력해주세요.");
  949. $('#orderForm input[name=entryNo]').focus();
  950. // 배송정보화면노출
  951. entryInfoDispYn("Y");
  952. return false;
  953. }
  954. orgEntryNo = $("#orderForm input[name=entryNo]").val();
  955. if (orgEntryNo.substr(0,1) != "P") {
  956. mcxDialog.alert("개인통관고유부호가 유효하지 않습니다.");
  957. $('#orderForm input[name=entryNo]').focus();
  958. // 배송정보화면노출
  959. deliveryAddrInfoDispYn("Y");
  960. return false;
  961. }
  962. if (orgEntryNo.length < 13) {
  963. mcxDialog.alert("개인통관고유부호가 유효하지 않습니다.");
  964. $('#orderForm input[name=entryNo]').focus();
  965. // 배송정보화면노출
  966. entryInfoDispYn("Y");
  967. return false;
  968. }
  969. if (!$("#orderForm #chk-overs-agr").is(":checked")) {
  970. mcxDialog.alert("개인통관정보고유부호 정보 동의/저장항목을 체크해주세요.");
  971. // 배송정보화면노출
  972. entryInfoDispYn("Y");
  973. return false;
  974. }
  975. }
  976. }
  977. // 주문제작상품일때 주문제작정보동의
  978. if (orderMadeYn == "Y") {
  979. if (!$("#orderForm #chk-custom-agr1").is(":checked")) {
  980. mcxDialog.alert("주문제작상품에 대한 동의를 하지 않으실 경우 해당 상품을 쇼핑백에서 제외하신 후 다시 결제를 시도해주세요.");
  981. // 배송정보화면노출
  982. madeInfoDispYn("Y");
  983. return false;
  984. }
  985. }
  986. // 사은품지급할 경우 체크
  987. if ($("#orderAmtForm .freegiftValArr").text().length > 0) {
  988. if (!$("#orderForm #chk-agree_gift").is(":checked")) {
  989. mcxDialog.alert("사은품 지급 정보 동의를 체크해주세요.");
  990. // 배송정보화면노출
  991. freegiftInfoDispYn("Y");
  992. return false;
  993. }
  994. }
  995. // 결재수단
  996. if (gagajf.isNull(paynormal)) {
  997. mcxDialog.alert("결제수단을 선택해 주세요.");
  998. // 결제수단정보노출
  999. paymentInfoDispYn("Y");
  1000. return false;
  1001. }
  1002. var paynormalArr = paynormal.split("|");
  1003. var pgGb = paynormalArr[0];
  1004. var payMeans = paynormalArr[1];
  1005. var custPayMeans = "N";
  1006. // 자주쓰는결제타입
  1007. if ($("#orderForm #chk-agree_paymethod").is(":checked") == true) {
  1008. custPayMeans = "Y";
  1009. }
  1010. // 주문상세데이타 생성
  1011. $("#orderDetailInfo .cartSq").each(function(){
  1012. // 주문상세단위 총알배송여부 변경
  1013. var orderDetailShotDelvYn = $(this).parent().find(".shotDelvYn").text();
  1014. if (orderDetailShotDelvYn == "Y") {
  1015. if (shotDelvYn == "N") {
  1016. orderDetailShotDelvYn = "N";
  1017. }
  1018. }
  1019. // 개인통관번호
  1020. if ($(this).parent().find(".foreignBuyYn").text() == "Y") {
  1021. entryNo = orgEntryNo;
  1022. } else {
  1023. entryNo = "";
  1024. }
  1025. var orderDetailData = {
  1026. "cartSq" : $(this).text()
  1027. ,"currPrice" : $(this).parent().find(".orgCurrPrice").text()
  1028. ,"optAddPrice" : $(this).parent().find(".optAddPrice").text()
  1029. ,"ordAmt" : $(this).parent().find(".ordAmt").text()
  1030. ,"cpn1CpnSq" : $(this).parent().find(".cpn1CpnSq").text()
  1031. ,"cpn1DcAmt" : $(this).parent().find(".cpn1DcAmt").text()
  1032. ,"goodsQty" : $(this).parent().find(".goodsQty").text()
  1033. ,"tmtb1Sq" : $(this).parent().find(".tmtb1Sq").text()
  1034. ,"tmtb1DcAmt" : $(this).parent().find(".tmtb1DcAmt").text()
  1035. ,"tmtb2Sq" : $(this).parent().find(".tmtb2Sq").text()
  1036. ,"tmtb2DcAmt" : $(this).parent().find(".tmtb2DcAmt").text()
  1037. ,"goodsCpnSq" : $(this).parent().find(".goodsCpnSq").text()
  1038. ,"goodsCpnDcAmt" : $(this).parent().find(".goodsCpnDcAmt").text()
  1039. ,"cartCpnSq" : $(this).parent().find(".cartCpnSq").text()
  1040. ,"cartCpnDcAmt" : $(this).parent().find(".cartCpnDcAmt").text()
  1041. ,"prePntDcAmt" : $(this).parent().find(".prePntDcAmt1").text()
  1042. ,"pntDcAmt" : $(this).parent().find(".pntDcAmt1").text()
  1043. ,"gfcdUseAmt" : $(this).parent().find(".gfcdUseAmt1").text()
  1044. ,"realOrdAmt" : $(this).parent().find(".realOrdAmt1").text()
  1045. ,"savePntAmt" : $(this).parent().find(".savePntAmt1").text()
  1046. ,"shotDelvYn" : orderDetailShotDelvYn
  1047. ,"foreignBuyYn" : $(this).parent().find(".foreignBuyYn").text()
  1048. ,"makeGoodsYn" : $(this).parent().find(".orderMadeYn").text()
  1049. ,"delvFeeCd" : $(this).parent().find(".delvFeeCd").text()
  1050. ,"goodsCd" : $(this).parent().find(".goodsCd").text()
  1051. ,"itemCdArr" : $(this).parent().find(".itemCd").text().split(",")
  1052. ,"optCdArr" : $(this).parent().find(".optCd").text().split(",")
  1053. ,"itemQtyArr" : $(this).parent().find(".itemQtyr").text().split(",")
  1054. ,"goodsType" : $(this).parent().find(".goodsType").text()
  1055. ,"entryNo" : entryNo
  1056. ,"giftPackYn" : giftPackYn
  1057. }
  1058. // 상품수
  1059. ordGoodsQty++;
  1060. orderDetailList.push(orderDetailData);
  1061. });
  1062. // 주문배송업체정보 생성
  1063. $("#delvFeeCdInfo .delvFeeCd").each(function(){
  1064. var delvFeeCdData = {
  1065. "delvFeeCd" : $(this).text()
  1066. ,"supplyCompCd" : $(this).parent().find(".supplyCompCd").text()
  1067. ,"delvFee" : $(this).parent().find(".delvFee").text()
  1068. ,"delvCpnSq" : $(this).parent().find(".delvCpnSq").text()
  1069. ,"delvCpnDcAmt" : $(this).parent().find(".delvCpnDcAmt").text()
  1070. }
  1071. delvFeeCdList.push(delvFeeCdData);
  1072. });
  1073. // 2021.04.29 상픈품 체크박스 미동의시 사은품 미지급
  1074. var freegiftValArr = $("#orderAmtForm .freegiftValArr").text().split(",");
  1075. var freegiftSqArr = $("#orderAmtForm .freegiftSqArr").text().split(",");
  1076. var freegiftGoodsArr = $("#orderAmtForm .freegiftGoodsArr").text().split(",");
  1077. var freegiftUsePointArr = $("#orderAmtForm .freegiftUsePointArr").text().split(",");
  1078. /*
  1079. if (!$("#orderForm #chk-agree_gift").is(":checked") == false) {
  1080. freegiftValArr = "";
  1081. freegiftSqArr = "";
  1082. freegiftGoodsArr = "";
  1083. freegiftUsePointArr = "";
  1084. }
  1085. */
  1086. // 주문데이타 생성
  1087. var orderData = {
  1088. "custNm" : $("#orderAmtForm .custNm").text()
  1089. ,"email" : $("#orderAmtForm .email").text()
  1090. ,"recipNm" : $("#orderAmtForm .recipNm").text()
  1091. ,"recipPhnno" : $("#orderAmtForm .recipPhnno").text()
  1092. ,"recipZipcode" : $("#orderAmtForm .recipZipcode").text()
  1093. ,"recipBaseAddr" : $("#orderAmtForm .recipBaseAddr").text()
  1094. ,"recipDtlAddr" : $("#orderAmtForm .recipDtlAddr").text()
  1095. ,"delvMemo" : $("#orderAmtForm .delvMemo").text()
  1096. ,"insuranceYn" : insuranceYn
  1097. ,"sexGb" : $("#orderAmtForm .sexGb").text()
  1098. ,"birthYmd" : $("#orderAmtForm .birthYmd").text()
  1099. ,"prePntDcAmtYn" : prePntDcAmtYn
  1100. ,"orderDetailList" : orderDetailList
  1101. ,"delvFeeCdList" : delvFeeCdList
  1102. ,"shotDelvYn" : shotDelvYn
  1103. ,"entryNo" : entryNo
  1104. ,"pgGb" : pgGb
  1105. ,"payMeans" : payMeans // 네이버페이, 카카오페이
  1106. ,"payAmt" : $("#orderAmtForm .realOrdSumAmt").text()
  1107. ,"ordNm" : $("#orderAmtForm .custNm").text()
  1108. ,"ordPhnno" : $("#orderAmtForm .cellPhnno").text()
  1109. ,"goodsNm" : $("#orderAmtForm .goodsNm").eq(0).text()
  1110. ,"ordGoodsQty" : ordGoodsQty
  1111. ,"freegiftValArr" : freegiftValArr
  1112. ,"freegiftSqArr" : freegiftSqArr
  1113. ,"freegiftGoodsArr" : freegiftGoodsArr
  1114. ,"freegiftUsePointArr" : freegiftUsePointArr
  1115. ,"giftMsg" : giftMsg
  1116. ,"custPayMeans" : custPayMeans
  1117. ,"cartSqArr" : cartSqArr
  1118. ,"orgGoodsSumAmt" : $("#orderAmtForm .orgGoodsSumAmt").text()
  1119. ,"cpn1DcSumAmt" : $("#orderAmtForm .cpn1DcSumAmt").text()
  1120. ,"tmtb1DcSumAmt" : $("#orderAmtForm .tmtb1DcSumAmt").text()
  1121. ,"tmtb2DcSumAmt" : $("#orderAmtForm .tmtb2DcSumAmt").text()
  1122. ,"goodsCpnDcSumAmt" : $("#orderAmtForm .goodsCpnDcSumAmt").text()
  1123. ,"cartCpnDcSumAmt" : $("#orderAmtForm .cartCpnDcSumAmt").text()
  1124. ,"prePntDcSumAmt" : $("#orderAmtForm .prePntDcSumAmt").text()
  1125. ,"pntDcSumAmt" : $("#orderAmtForm .pntDcSumAmt").text()
  1126. ,"gfcdUseSumAmt" : $("#orderAmtForm .gfcdUseSumAmt").text()
  1127. ,"realOrdSumAmt" : $("#orderAmtForm .realOrdSumAmt").text()
  1128. ,"delvSumAmt" : $("#orderAmtForm .delvSumAmt").text()
  1129. };
  1130. $.ajax( {
  1131. type : "POST",
  1132. url : '/order/create/preOrder',
  1133. data : JSON.stringify(orderData),
  1134. dataType : 'html',
  1135. beforeSend : function(xhr, settings) {
  1136. xhr.setRequestHeader("AJAX" , "true");
  1137. xhr.setRequestHeader('Accept' , 'application/json');
  1138. xhr.setRequestHeader('Content-Type' , 'application/json');
  1139. },
  1140. success : function(result) {
  1141. // 결재정보로드
  1142. $("#order_info").html(result);
  1143. var pgGb = $("#order_info input[name=pgGb]").val();
  1144. if (pgGb == "NAVER") {
  1145. fnNaverPaymentReady();
  1146. } else if (pgGb == "KAKAO") {
  1147. fnKakaoPaymentReady();
  1148. } else if (pgGb == "KCP" || pgGb == "PAYCO") {
  1149. // 2021.06.02 태팔요청
  1150. var protocol = location.protocol;
  1151. $("#order_info input[name=Ret_URL]").val(protocol + _frontUrl + "/order/pay/result/response");
  1152. kcp_AJAX();
  1153. }
  1154. }
  1155. });
  1156. });
  1157. // 1.9 할인영역 설정 (로그인여부일때 동작)
  1158. if (isLogin == true) {
  1159. dcAmtInfoSet();
  1160. } else {
  1161. // 금액계산초기화
  1162. custCpnSumAmtCal();
  1163. }
  1164. }
  1165. }
  1166. });
  1167. }
  1168. // 1.9.0 프로모션 쿠폰 적용 함수
  1169. var serialCpnApply = function(){
  1170. if (gagajf.isNull($("#serialCpnNm").val())) {
  1171. mcxDialog.alert("할인코드를 입력해주세요.");
  1172. $('#serialCpnNm').focus();
  1173. return false;
  1174. }
  1175. let data = {
  1176. rdCpnNm : $("#serialCpnNm").val()
  1177. }
  1178. $.ajax( {
  1179. type : "POST",
  1180. url : '/cart/list/serialCpnApply',
  1181. contentType : 'application/json',
  1182. dataType : 'json',
  1183. data : JSON.stringify(data),
  1184. success : function(result) {
  1185. // 프로모션쿠폰적용 후 할인영역 노출
  1186. jsonObj.dispYn = "Y";
  1187. // 성공일때는 쿠폰정보 및 포인트 정보 reset
  1188. if (result.serialCpnInfo.result == "SUCCESS") {
  1189. mcxDialog.alert("쿠폰 등록이 되었습니다.");
  1190. // 1.8 할인영역 재로드
  1191. dcAmtInfoSet(jsonData);
  1192. } else {
  1193. mcxDialog.alert(result.serialCpnInfo.result);
  1194. $("#serialCpnNm").val("");
  1195. }
  1196. }
  1197. });
  1198. }
  1199. // 1.9 할인영역 설정 (쿠폰, 선포인트, 포인트, 상품권)
  1200. var dcAmtInfoSet = function() {
  1201. // 1.8.1 할인정보로드
  1202. $.ajax( {
  1203. type : "POST",
  1204. url : '/order/dcAmtInfo',
  1205. data : JSON.stringify(jsonObj),
  1206. dataType : 'html',
  1207. beforeSend : function(xhr, settings) {
  1208. xhr.setRequestHeader("AJAX" , "true");
  1209. xhr.setRequestHeader('Accept' , 'application/json');
  1210. xhr.setRequestHeader('Content-Type' , 'application/json');
  1211. },
  1212. success : function(result) {
  1213. if (result != null) {
  1214. $("#dcAmtInfo").css("display", "block");
  1215. $("#dcAmtInfo").html(result);
  1216. // 상품쿠폰 팝업정보로드
  1217. $.ajax( {
  1218. type : "POST",
  1219. url : '/order/couponApplyPop',
  1220. data : JSON.stringify(jsonObj),
  1221. dataType : 'html',
  1222. beforeSend : function(xhr, settings) {
  1223. xhr.setRequestHeader("AJAX" , "true");
  1224. xhr.setRequestHeader('Accept' , 'application/json');
  1225. xhr.setRequestHeader('Content-Type' , 'application/json');
  1226. },
  1227. success : function(result) {
  1228. $("#couponModifyPop").html(result);
  1229. // 1.8.1 선포인트기능초기화
  1230. prePntDcAmtReset();
  1231. // 1.8.2 쿠폰적용초기화(할인율최고)(상품,장바구니)
  1232. custGoodsCpnInit();
  1233. // 상품쿠폰, 장바구니쿠폰 팝업 열기
  1234. $("#btn_couponModify_pop").on("click", function(){
  1235. // 2021.04.23 보유쿠폰이 없을때 적용
  1236. var custCpnCnt = parseInt($("#orderForm input[name=custCpnCnt]").val());
  1237. if (custCpnCnt < 1) {
  1238. mcxDialog.alert("적용 가능한 쿠폰이 없습니다.");
  1239. return false;
  1240. }
  1241. $("#couponModifyPop").modal("show");
  1242. // 쿠폰적용초기화(할인율최고)(상품,장바구니)
  1243. custGoodsCpnInit();
  1244. return false;
  1245. });
  1246. // 1.8.3 상품상세쿠폰 팝업 열기
  1247. $("#couponModifyPop .area_item_coupon .form_field .select_custom").on("click", function() {
  1248. var index = parseInt($(this).attr("value"));
  1249. var obj = $(".couponSelectPop").eq(index);
  1250. obj.show().addClass("active");
  1251. $("body").css({"overflow":"hidden"});
  1252. });
  1253. // 1.8.4 쿠폰적용버튼
  1254. $("#btn_coupon_apply").on("click", function(){
  1255. // 상품쿠폰적용
  1256. $('#couponApplyForm .couponSelectPop ul li.selected').each(function(index){
  1257. custCpnApply($(this), index, "goodsCpn");
  1258. });
  1259. // 장바구니쿠폰적용
  1260. $('#couponApplyForm .cartCpn').each(function(index){
  1261. if ($(this).find("input[name=rdi-cart-coupon]").is(":checked")) {
  1262. custCpnApply($(this), index, "cartCpn");
  1263. }
  1264. });
  1265. // 최대할인혜택적용 체크해제
  1266. if ($("#chk-maxdisc01").is(":checked")) {
  1267. $("#chk-maxdisc").attr("checked", false);
  1268. $("#chk-maxdisc01").attr("checked", false);
  1269. }
  1270. $("#couponModifyPop .close-modal").trigger("click"); // 팝업닫기
  1271. });
  1272. // 1.8.5 쿠폰 최대할인금액 초기화 버튼 설정
  1273. $("#chk-maxdisc01").on("click", function(){
  1274. // 2021.04.23 보유쿠폰이 없을때 적용
  1275. var custCpnCnt = parseInt($("#orderForm input[name=custCpnCnt]").val());
  1276. var custDelvCpnCnt = parseInt($("#orderForm input[name=custDelvCpnCnt]").val());
  1277. if ((custCpnCnt + custDelvCpnCnt) < 1) {
  1278. mcxDialog.alert("적용 가능한 쿠폰이 없습니다.");
  1279. return false;
  1280. }
  1281. if ($(this).is(":checked")) {
  1282. // 2021.04.23
  1283. mcxDialog.alert("선택한 쿠폰이 아닌 보유한 쿠폰을 통해 최대할인 혜택을 받을 수 있도록 쿠폰이 자동 적용됩니다.");
  1284. // 상품&장바구니쿠폰 초기환
  1285. custGoodsCpnInit();
  1286. // 배송비쿠폰 초기환
  1287. custDelvCpnInit();
  1288. $("#chk-maxdisc").attr("checked", true);
  1289. } else {
  1290. $("#chk-maxdisc").attr("checked", false);
  1291. }
  1292. });
  1293. // 1.8.5 쿠폰 최대할인금액 초기화 버튼 설정
  1294. $("#chk-maxdisc").on("click", function(){
  1295. // 2021.04.23 보유쿠폰이 없을때 적용
  1296. var custCpnCnt = parseInt($("#orderForm input[name=custCpnCnt]").val());
  1297. var custDelvCpnCnt = parseInt($("#orderForm input[name=custDelvCpnCnt]").val());
  1298. if ((custCpnCnt + custDelvCpnCnt) < 1) {
  1299. mcxDialog.alert("적용 가능한 쿠폰이 없습니다.");
  1300. return false;
  1301. }
  1302. if ($(this).is(":checked")) {
  1303. // 2021.04.23
  1304. mcxDialog.alert("선택한 쿠폰이 아닌 보유한 쿠폰을 통해 최대할인 혜택을 받을 수 있도록 쿠폰이 자동 적용됩니다.");
  1305. // 상품&장바구니쿠폰 초기환
  1306. custGoodsCpnInit();
  1307. // 배송비쿠폰 초기환
  1308. custDelvCpnInit();
  1309. $("#chk-maxdisc01").attr("checked", true);
  1310. } else {
  1311. $("#chk-maxdisc01").attr("checked", false);
  1312. }
  1313. });
  1314. }
  1315. });
  1316. // 배송비쿠폰 팝업정보로드
  1317. $.ajax( {
  1318. type : "POST",
  1319. url : '/order/delvCouponApplyPop',
  1320. data : JSON.stringify(jsonObj),
  1321. dataType : 'html',
  1322. beforeSend : function(xhr, settings) {
  1323. xhr.setRequestHeader("AJAX" , "true");
  1324. xhr.setRequestHeader('Accept' , 'application/json');
  1325. xhr.setRequestHeader('Content-Type' , 'application/json');
  1326. },
  1327. success : function(result) {
  1328. $("#couponSelectPop02").html(result);
  1329. // 1.8.3 쿠폰적용초기화(할인율최고)(배송비)
  1330. custDelvCpnInit();
  1331. }
  1332. });
  1333. // 배송비상세쿠폰 팝업 열기
  1334. $(".od .area_seldiscount .dlvr_fee_box .select_custom").on("click", function() {
  1335. $('#couponSelectPop02').show().addClass("active");
  1336. $("body").css({"overflow":"hidden"});
  1337. });
  1338. // 1.8.7 포인트 적용버튼 기능
  1339. $("#btn_point_apply").on("click", function(){
  1340. var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
  1341. var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
  1342. var pntDcAmt = parseInt(uncomma($("#orderForm input[name='pntDcAmtStr']").val()));
  1343. var realOrdAmt = parseInt($("#orderAmtForm .realOrdSumAmt").text());
  1344. var pointUseMaxLimit = parseInt($("#orderForm input[name='pointUseMaxLimit']").val());
  1345. var applyPntDcAmt = (realOrdAmt * pointUseMaxLimit) / 100;
  1346. rmPntAmt = rmPntAmt - freegiftUsePnt;
  1347. if (gagajf.isNull($("#orderForm input[name=pntDcAmtStr]").val())) {
  1348. mcxDialog.alert("포인트를 입력하신 후 다시 시도해주세요.");
  1349. $('#orderForm input[name=pntDcAmtStr]').focus();
  1350. return false;
  1351. }
  1352. // 입력여부체크
  1353. if (pntDcAmt < 1) {
  1354. mcxDialog.alert("포인트를 입력하신 후 다시 시도해주세요.");
  1355. // 포인트리셋기능
  1356. pntDcAmtReset();
  1357. return false;
  1358. }
  1359. // 10원단위부터 입력가능
  1360. if (pntDcAmt % 10 > 0) {
  1361. mcxDialog.alert("포인트는 10P단위로 사용이 가능합니다.");
  1362. // 포인트리셋기능
  1363. pntDcAmtReset();
  1364. return false;
  1365. }
  1366. // 결제금액을 초과 할 수 없습니다.
  1367. if (pntDcAmt > realOrdAmt) {
  1368. mcxDialog.alert("포인트를 입력하신 후 다시 시도해주세요.");
  1369. // 포인트리셋기능
  1370. pntDcAmtReset();
  1371. return false;
  1372. }
  1373. // 보유포인트보다 초과 사용 불가
  1374. if (pntDcAmt > rmPntAmt) {
  1375. mcxDialog.alert("입력하신 포인트가 보유한 포인트보다 많습니다.");
  1376. // 포인트리셋기능
  1377. pntDcAmtReset();
  1378. return false;
  1379. }
  1380. // TODO 포인트 사용금액 1000P 이상 사용
  1381. if (pntDcAmt < 1000) {
  1382. mcxDialog.alert("포인트는 최소 1,000P이상 사용해야 합니다.");
  1383. // 포인트리셋기능
  1384. pntDcAmtReset();
  1385. return false;
  1386. }
  1387. // 실결제금액보다 크게 적용 되었을때 적용 불가능
  1388. if (pntDcAmt > applyPntDcAmt) {
  1389. mcxDialog.alert("결제금액의 최대 " + pointUseMaxLimit +"%를 초과 사용 할 수 없습니다.");
  1390. // 포인트리셋기능
  1391. pntDcAmtReset();
  1392. return false;
  1393. }
  1394. // 2021.04.23 추가
  1395. mcxDialog.alert("총 " + getZeroMinusDelAmt(pntDcAmt) + " P를 차감 결제 합니다.");
  1396. // 포인트 적용
  1397. $("#orderAmtForm .pntDcSumAmt").text(pntDcAmt);
  1398. $("#pntDcAmt").text(getZeroMinusDelAmt(pntDcAmt));
  1399. // 상품권리렛기능
  1400. gfcdUseAmtReset();
  1401. });
  1402. // 1.8.8 상품권 적용버튼 기능
  1403. $("#btn_gfcd_apply").on("click", function(){
  1404. var rmGfcdAmt = parseInt($("#orderForm input[name='rmGfcdAmt']").val());
  1405. var gfcdUseAmt = parseInt(uncomma($("#orderForm input[name='gfcdUseAmtStr']").val()));
  1406. var realOrdAmt = parseInt($("#orderAmtForm .realOrdSumAmt").text());
  1407. if (gagajf.isNull($("#orderForm input[name=gfcdUseAmtStr]").val())) {
  1408. mcxDialog.alert("금액을 입력하신 후 다시 시도해주세요.");
  1409. $('#orderForm input[name=gfcdUseAmtStr]').focus();
  1410. return false;
  1411. }
  1412. // 입력여부체크
  1413. if (gfcdUseAmt < 1 || $("#orderForm input[name='gfcdUseAmtStr']").val() == "") {
  1414. mcxDialog.alert("금액을 입력하신 후 다시 시도해주세요.");
  1415. // 상품권리셋기능
  1416. gfcdUseAmtReset();
  1417. return false;
  1418. }
  1419. // 결제금액을 초과 할 수 없습니다.
  1420. if (gfcdUseAmt > realOrdAmt) {
  1421. mcxDialog.alert("입력하신 금액이 결제할 금액보다 많습니다.");
  1422. // 포인트리셋기능
  1423. gfcdUseAmtReset();
  1424. return false;
  1425. }
  1426. // 보유금액보다 초과 사용 불가
  1427. if (gfcdUseAmt > rmGfcdAmt) {
  1428. mcxDialog.alert("보유금액 보다 초과 사용 할 수 없습니다.");
  1429. // 상품권리셋기능
  1430. gfcdUseAmtReset();
  1431. return false;
  1432. }
  1433. // 보유금액보다 초과 사용 불가
  1434. if (gfcdUseAmt > rmGfcdAmt) {
  1435. mcxDialog.alert("보유금액 보다 초과 사용 할 수 없습니다.");
  1436. // 상품권리셋기능
  1437. gfcdUseAmtReset();
  1438. return false;
  1439. }
  1440. // TODO 포인트 사용금액 1000원 이상 사용
  1441. if (gfcdUseAmt < 1000) {
  1442. mcxDialog.alert("상품권 사용금액은 최소 1,000원 이상 사용해야 합니다.");
  1443. // 상품권리셋기능
  1444. gfcdUseAmtReset();
  1445. return false;
  1446. }
  1447. // 2021.04.23 추가
  1448. mcxDialog.alert("총 " + gfcdUseAmt.addComma() + " 원을 상품권 금액에서 차감 결제 합니다.");
  1449. // 상품권 적용
  1450. $("#orderAmtForm .gfcdUseSumAmt").text(gfcdUseAmt);
  1451. $("#gfcdUseAmt").text(getZeroMinusDelAmt(gfcdUseAmt));
  1452. // 금액전체계산
  1453. custCpnSumAmtCal();
  1454. });
  1455. // 금액계산초기화
  1456. custCpnSumAmtCal();
  1457. }
  1458. }
  1459. });
  1460. }
  1461. // 1.10.1 상품쿠폰초기화
  1462. var custGoodsCpnInit = function() {
  1463. // 쿠폰최대할인 적용
  1464. $("#chk-maxdisc").attr("checked", true);
  1465. $("#chk-maxdisc01").attr("checked", true);
  1466. // 쿠폰초기화
  1467. $("#couponModifyPop .goodsCpn").each(function(index){
  1468. // select box 쿠폰 적용
  1469. var cpnCartSq = $(this).find("input[name='cpnCartSq']").val();
  1470. // 장바구니시퀀스 체크
  1471. $("#orderAmtForm .cartSq").each(function(){
  1472. if (cpnCartSq == $(this).text()) {
  1473. $(this).parent().find(".goodsCpnSq").text("0"); // 상품쿠폰시퀀스
  1474. $(this).parent().find(".goodsCpnDcAmt").text("0"); // 상품쿠폰할인금액
  1475. }
  1476. });
  1477. $(this).find("input[name='custCpnSq']").val("0");
  1478. $(this).find("input[name='cpnDcAmt']").val("0");
  1479. // 적용안함 적용
  1480. var index = parseInt($(this).attr("value"));
  1481. var cpnObj = $(".couponSelectPop").eq(index);
  1482. var emptyHtml = cpnObj.find("ul li:last-child").html();
  1483. // 선택기능
  1484. $(this).find("ul li").removeClass("selected");
  1485. cpnObj.find("ul li:last-child").addClass("selected");
  1486. $(this).find(".select .item_coupon").html(emptyHtml);
  1487. });
  1488. // 상품쿠폰 최대할인율 쿠폰적용
  1489. $('#couponModifyPop .goodsCpn').each(function(idx){
  1490. cpnApplyTemp = false;
  1491. // select box 적용
  1492. $("#couponModifyPop .couponSelectPop").eq(idx).find("ul li").each(function(){
  1493. // 쿠폰적용안되었으면실행
  1494. if (cpnApplyTemp == false) {
  1495. // 쿠폰중복적용체크
  1496. if (custCpnDuplicationCheck($(this).attr("value"), idx)) {
  1497. // 쿠폰적용
  1498. custCpnApply($(this), idx, "goodsCpn");
  1499. // 쿠폰할인적용
  1500. cpnApplyTemp = true;
  1501. }
  1502. }
  1503. // 쿠폰 select 버튼기능
  1504. $(this).on("click", function(){
  1505. if (custCpnDuplicationCheck($(this).attr("value"), idx)) {
  1506. // 2021.04.19 주문서 쿠폰 선택오류 수정
  1507. // 전체선택해제
  1508. $(this).parent().find("li").removeClass("selected");
  1509. // 본인선택기능
  1510. $(this).addClass("selected");
  1511. // 쿠폰적용(임시)
  1512. custCpnApplyTemp($(this), idx, "goodsCpn");
  1513. } else {
  1514. custCpnNotApply($(this), idx);
  1515. }
  1516. });
  1517. });
  1518. });
  1519. // 장바구니쿠폰초기화
  1520. custCartCpnInit();
  1521. }
  1522. // 1.10.2 장바구니쿠폰초기화
  1523. var custCartCpnInit = function() {
  1524. // 장바구니쿠폰 초기화 적용
  1525. $("#couponModifyPop .cartCpn").each(function(index) {
  1526. if (index == 0) {
  1527. custCpnApply($(this), index, "cartCpn"); // 쿠폰적용
  1528. }
  1529. // 쿠폰 select 버튼기능
  1530. $(this).on("click", function(){
  1531. custCpnApplyTemp($(this), index, "cartCpn"); // 쿠폰적용
  1532. // 최대할인혜택적용 체크해제
  1533. if ($("#chk-maxdisc01").is(":checked")) {
  1534. $("#chk-maxdisc01").attr("checked", false);
  1535. $("#chk-maxdisc").attr("checked", false);
  1536. }
  1537. });
  1538. });
  1539. // 포인트기능 리셋
  1540. pntDcAmtReset();
  1541. }
  1542. // 1.10.3 배송비쿠폰초기화
  1543. var custDelvCpnInit = function() {
  1544. // 배송비쿠폰 초기화 적용
  1545. $("#couponSelectPop02 .delvCpn").each(function(index) {
  1546. if (index == 0) {
  1547. // 쿠폰적용
  1548. custCpnApply($(this), index, "delvCpn");
  1549. }
  1550. // 쿠폰 select 버튼기능
  1551. $(this).on("click", function(){
  1552. // 쿠폰적용
  1553. custCpnApply($(this), index, "delvCpn");
  1554. });
  1555. });
  1556. }
  1557. // 1.10.4 쿠폰중복사용체크
  1558. var custCpnDuplicationCheck = function(custCpnSq, index) {
  1559. var selCustSq = 0;
  1560. var cnt = 0;
  1561. // 쿠폰적용가능
  1562. if (custCpnSq == 0) {
  1563. return true;
  1564. }
  1565. // 쿠폰중본사용체크
  1566. $("#couponModifyPop .goodsCpn input[name='custCpnSq']").each(function(i){
  1567. if (index != i) {
  1568. selCustSq = $(this).val();
  1569. if (selCustSq == custCpnSq) {
  1570. cnt++;
  1571. }
  1572. }
  1573. });
  1574. // 쿠폰적용불가
  1575. if (cnt > 0) {
  1576. return false;
  1577. }
  1578. // 쿠폰적용가능
  1579. else {
  1580. return true;
  1581. }
  1582. }
  1583. // 1.10.5 임시로 쿠폰적용
  1584. var custCpnApplyTemp = function(obj, idx, cpnType) {
  1585. // 상품쿠폰적용
  1586. if (cpnType == "goodsCpn") {
  1587. var itemHtml = obj.find(".dlvr_coupon").html();
  1588. $("#couponModifyPop .goodsCpn .select .item_coupon").eq(idx).html(itemHtml);
  1589. $("#couponModifyPop .goodsCpn input[name='cpnDcAmt']").eq(idx).val(obj.attr("data"));
  1590. $("#couponModifyPop .goodsCpn input[name='custCpnSq']").eq(idx).val(obj.attr("value"));
  1591. // 장바구니쿠폰 초기화 적용
  1592. $("#couponModifyPop .cartCpn").each(function(index) {
  1593. if (index == 0) {
  1594. custCpnApplyTemp($(this), 0, "cartCpn"); // 쿠폰적용
  1595. }
  1596. });
  1597. // 상품쿠폰 선택불가 처리
  1598. custCpnSqLiDisabled();
  1599. // 상품상세쿠폰 팝업 닫기
  1600. $("#couponModifyPop .lap .popup_close").eq(idx).trigger("click");
  1601. }
  1602. // 장바구니쿠폰적용
  1603. else if (cpnType == "cartCpn") {
  1604. var dcWay = obj.find("input[name='dcWay']").val();
  1605. var dcVal = obj.find("input[name='dcVal']").val();
  1606. var maxDcAmt = obj.find("input[name='maxDcAmt']").val();
  1607. var buyLimitAmt = obj.find("input[name='buyLimitAmt']").val();
  1608. var cartCpnDcSumAmt = 0;
  1609. var tempSumAmt = 0;
  1610. var cartSqLen = $(".cartSq").length;
  1611. var leftAmt = 0;
  1612. var index = 1;
  1613. // 장바구니쿠폰 해당 장바구니상품들 할인가 적용
  1614. obj.find("input[name='cartCpnCartSq']").each(function(){
  1615. var cartCpnCartSq = $(this).val();
  1616. var cartCpnDcAmt = 0;
  1617. // 장바구니시퀀스 체크
  1618. $("#orderAmtForm .cartSq").each(function(){
  1619. if (cartCpnCartSq == $(this).text()) {
  1620. var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
  1621. var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
  1622. var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
  1623. var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
  1624. var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
  1625. var goodsCpnDcAmt = 0;
  1626. $("#couponModifyPop .goodsCpn input[name=cpnCartSq]").each(function(){
  1627. if ($(this).val() == cartCpnCartSq) {
  1628. goodsCpnDcAmt = parseInt($(this).parent().find("input[name=cpnDcAmt]").val());
  1629. }
  1630. });
  1631. var tempAmt = ((orgCurrPrice - cpn1DcAmt) * goodsQty) - tmtb1DcAmt - tmtb2DcAmt - goodsCpnDcAmt;
  1632. tempSumAmt = tempSumAmt + tempAmt;
  1633. // 할인율일때 할인금액
  1634. if (dcWay == "G240_11") {
  1635. cartCpnDcAmt = (tempAmt * dcVal) / 100;
  1636. cartCpnDcSumAmt = cartCpnDcSumAmt + cartCpnDcAmt;
  1637. }
  1638. }
  1639. });
  1640. });
  1641. // 금액일때 할인금액 적용
  1642. if (dcWay == "G240_10") {
  1643. cartCpnDcSumAmt = dcVal;
  1644. }
  1645. // 2021.04.19 최대금액 체크
  1646. if (maxDcAmt > cartCpnDcSumAmt || maxDcAmt == 0) {
  1647. cartCpnDcSumAmt = cartCpnDcSumAmt;
  1648. } else {
  1649. cartCpnDcSumAmt = maxDcAmt;
  1650. }
  1651. obj.find("input[name=rdi-cart-coupon]").prop("checked", true);
  1652. obj.parent().find("input[name=cpnDcAmt]").val(cartCpnDcSumAmt);
  1653. obj.parent().find("input[name=custCpnSq]").val(obj.attr("value"));
  1654. }
  1655. var cpnDcSumAmt = 0;
  1656. var cpnApplyCnt = 0;
  1657. var goodsCartCpnSumAmt = 0;
  1658. var cpnType = "";
  1659. $("#couponModifyPop input[name='cpnDcAmt']").each(function(index){
  1660. cpnType = $(this).parent().find("input[name=cpnType]").val();
  1661. // 상품, 장바구니쿠폰 할인 금액만 합계 적용
  1662. if (cpnType == "goodsCpn" || cpnType == "cartCpn") {
  1663. goodsCartCpnSumAmt = goodsCartCpnSumAmt + parseInt($(this).val());
  1664. }
  1665. });
  1666. // 상품, 장바구니쿠폰 할인 금액만 합계 적용
  1667. $("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt));
  1668. }
  1669. // 1.10.6 쿠폰중복체크 후 적용가능
  1670. var custCpnApply = function(obj, idx, cpnType) {
  1671. // 상품쿠폰적용
  1672. if (cpnType == "goodsCpn") {
  1673. var itemHtml = obj.find(".dlvr_coupon").html();
  1674. $("#couponModifyPop .goodsCpn .select .item_coupon").eq(idx).html(itemHtml);
  1675. $("#couponModifyPop .goodsCpn input[name='cpnDcAmt']").eq(idx).val(obj.attr("data"));
  1676. $("#couponModifyPop .goodsCpn input[name='custCpnSq']").eq(idx).val(obj.attr("value"));
  1677. var cpnCartSq = $("#couponModifyPop .goodsCpn input[name='cpnCartSq']").eq(idx).val();
  1678. // 장바구니시퀀스 체크
  1679. $("#orderAmtForm .cartSq").each(function(){
  1680. if (cpnCartSq == $(this).text()) {
  1681. $(this).parent().find(".goodsCpnSq").text(obj.attr("value")); // 상품쿠폰시퀀스
  1682. $(this).parent().find(".goodsCpnDcAmt").text(obj.attr("data")); // 상품쿠폰할인금액
  1683. }
  1684. });
  1685. // selected 클래스 처리
  1686. $("#couponModifyPop .couponSelectPop").eq(idx).find("ul li").removeClass("selected");
  1687. obj.addClass("selected");
  1688. // 상품쿠폰 선택불가 처리
  1689. custCpnSqLiDisabled();
  1690. }
  1691. // 장바구니쿠폰적용
  1692. else if (cpnType == "cartCpn") {
  1693. var dcWay = obj.find("input[name='dcWay']").val();
  1694. var dcVal = obj.find("input[name='dcVal']").val();
  1695. var maxDcAmt = obj.find("input[name='maxDcAmt']").val();
  1696. var buyLimitAmt = obj.find("input[name='buyLimitAmt']").val();
  1697. var cartCpnDcSumAmt = 0;
  1698. var tempSumAmt = 0;
  1699. var cartSqLen = $("#orderAmtForm .cartSq").length;
  1700. var leftAmt = 0;
  1701. var index = 1;
  1702. // 2021.04.19 장바구니시퀀스 값 초기화
  1703. $("#orderAmtForm .cartSq").each(function(){
  1704. $(this).parent().find(".cartCpnSq").text(0);
  1705. $(this).parent().find(".cartCpnDcAmt").text(0);
  1706. });
  1707. // 장바구니쿠폰 해당 장바구니상품들 할인가 적용
  1708. obj.find("input[name='cartCpnCartSq']").each(function(){
  1709. var cartCpnCartSq = $(this).val();
  1710. var cartCpnDcAmt = 0;
  1711. // 장바구니시퀀스 체크
  1712. $("#orderAmtForm .cartSq").each(function(){
  1713. if (cartCpnCartSq == $(this).text()) {
  1714. var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
  1715. var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
  1716. var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
  1717. var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
  1718. var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
  1719. var goodsCpnDcAmt = parseInt($(this).parent().find(".goodsCpnDcAmt").text());
  1720. var tempAmt = ((orgCurrPrice - cpn1DcAmt) * goodsQty) - tmtb1DcAmt - tmtb2DcAmt - goodsCpnDcAmt;
  1721. tempSumAmt = tempSumAmt + tempAmt;
  1722. // 할인율일때 할인금액
  1723. if (dcWay == "G240_11") {
  1724. cartCpnDcAmt = parseInt((tempAmt * dcVal) / 100);
  1725. cartCpnDcSumAmt = cartCpnDcSumAmt + cartCpnDcAmt;
  1726. $(this).parent().find(".cartCpnSq").text(obj.attr("value"));
  1727. $(this).parent().find(".cartCpnDcAmt").text(cartCpnDcAmt);
  1728. }
  1729. }
  1730. });
  1731. });
  1732. // 장바구니쿠폰 결제가능수단목록조회
  1733. if (obj.find("input[name='payTypeArr']").length > 0) {
  1734. $("#orderForm input[name=rdi-paynormal]").attr("disabled", true);
  1735. $("#orderForm input[name=rdi-paynormal]").attr("checked", false);
  1736. obj.find("input[name='payTypeArr']").each(function(i){
  1737. var payType = $(this).val();
  1738. $('#orderForm .'+payType).attr("disabled", false);
  1739. });
  1740. // 선택안함
  1741. $("#orderForm .payTypeNm").text("선택없음");
  1742. } else {
  1743. // $("#orderForm input[name=rdi-paynormal]").attr("disabled", false);
  1744. }
  1745. // 2021.04.19 최대금액 체크
  1746. if (maxDcAmt > cartCpnDcSumAmt || maxDcAmt == 0) {
  1747. cartCpnDcSumAmt = cartCpnDcSumAmt;
  1748. } else {
  1749. // 최대값 적용 일때는 금액할인 방식을 적용
  1750. cartCpnDcSumAmt = maxDcAmt;
  1751. dcVal = cartCpnDcSumAmt;
  1752. dcWay = "G240_10";
  1753. }
  1754. // 금액일때 할인금액 적용
  1755. if (dcWay == "G240_10") {
  1756. cartCpnDcSumAmt = dcVal;
  1757. leftAmt = dcVal;
  1758. index = 1;
  1759. // 장바구니쿠폰 해당 장바구니상품들 할인가 적용
  1760. obj.find("input[name='cartCpnCartSq']").each(function(){
  1761. var cartCpnCartSq = $(this).val();
  1762. var cartCpnDcAmt = 0;
  1763. // 장바구니시퀀스 체크
  1764. $("#orderAmtForm .cartSq").each(function(){
  1765. if (cartCpnCartSq == $(this).text()) {
  1766. var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
  1767. var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
  1768. var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
  1769. var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
  1770. var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
  1771. var goodsCpnDcAmt = parseInt($(this).parent().find(".goodsCpnDcAmt").text());
  1772. var tempAmt = ((orgCurrPrice - cpn1DcAmt) * goodsQty) - tmtb1DcAmt - tmtb2DcAmt - goodsCpnDcAmt;
  1773. var tempDiv = parseInt((tempAmt / tempSumAmt) * 100);
  1774. var cartCpnDcAmt = 0;
  1775. if (index == cartSqLen) {
  1776. cartCpnDcAmt = leftAmt;
  1777. } else {
  1778. cartCpnDcAmt = parseInt((cartCpnDcSumAmt * tempDiv) / 100);
  1779. leftAmt = leftAmt - cartCpnDcAmt;
  1780. }
  1781. $(this).parent().find(".cartCpnSq").text(obj.attr("value"));
  1782. $(this).parent().find(".cartCpnDcAmt").text(cartCpnDcAmt);
  1783. index++;
  1784. }
  1785. });
  1786. });
  1787. }
  1788. obj.find("input[name=rdi-cart-coupon]").attr("checked", true);
  1789. obj.parent().find("input[name=cpnDcAmt]").val(cartCpnDcSumAmt);
  1790. obj.parent().find("input[name=custCpnSq]").val(obj.attr("value"));
  1791. }
  1792. // 배송비쿠폰적용
  1793. else if (cpnType == "delvCpn") {
  1794. // 적용안함 적용
  1795. var itemHtml = obj.find(".dlvr_coupon").html();
  1796. $("#orderForm .dlvr_fee_box .dlvr_coupon").html(itemHtml);
  1797. obj.parent().find("input[name='cpnDcAmt']").val(obj.attr("data"));
  1798. obj.parent().find("input[name='custCpnSq']").val(obj.attr("value"));
  1799. obj.parent().find("input[name='delvFeeCd']").val(obj.attr("delvfeecd"));
  1800. var delvFeeCd = obj.attr("delvfeecd");
  1801. // 배송비쿠폰 테이블 적용
  1802. $("#orderAmtForm .delvFeeCd").each(function(){
  1803. // 배송비쿠폰적용
  1804. if ($(this).text() == delvFeeCd) {
  1805. $(this).parent().find(".delvCpnSq").text(obj.attr("value"));
  1806. $(this).parent().find(".delvCpnDcAmt").text(obj.attr("data"));
  1807. }
  1808. // 배송비쿠폰적용안함
  1809. else if (delvFeeCd == 0) {
  1810. $(this).parent().find(".delvCpnSq").text(obj.attr("value"));
  1811. $(this).parent().find(".delvCpnDcAmt").text(obj.attr("data"));
  1812. }
  1813. });
  1814. // 배송비팝업닫기
  1815. $('#couponSelectPop02 .popup_close').trigger("click");
  1816. }
  1817. // 포인트기능 리렛
  1818. pntDcAmtReset();
  1819. }
  1820. // 1.11.1 상품쿠폰 선택불가 처리
  1821. var custCpnSqLiDisabled = function() {
  1822. // 상품쿠폰 선택불가 처리
  1823. $("#couponModifyPop .couponSelectPop ul li").each(function(){
  1824. var custCpnSq = $(this).attr("value");
  1825. var liObj = $(this);
  1826. liObj.attr("aria-disabled", false);
  1827. // 선택된 li 제외 (2021.04.08 수정)
  1828. if ($(this).hasClass("selected") == false) {
  1829. // 적용안함 제외
  1830. if (custCpnSq > 0) {
  1831. // 선택된 custCpnSq li와 같으면 선택불가처리
  1832. $("#couponModifyPop .goodsCpn input[name=custCpnSq]").each(function(){
  1833. var inputCustCpSq = $(this).val();
  1834. if (custCpnSq == inputCustCpSq) {
  1835. // 선택불가처리
  1836. liObj.attr("aria-disabled", true);
  1837. }
  1838. });
  1839. }
  1840. }
  1841. });
  1842. }
  1843. // 1.12 쿠폰중복체크 후 적용불가
  1844. var custCpnNotApply = function(obj, idx) {
  1845. /*
  1846. // 이전에 등록된 쿠폰시퀀스
  1847. var custCpnSq = obj.parent().find("input[name='custCpnSq']").val();
  1848. // 이전에 등록된 쿠폰시퀀스 비교후 데이타 원복
  1849. obj.parent().find("li").each(function(){
  1850. if ($(this).attr("value") == custCpnSq) {
  1851. var itemHtml = $(this).find(".item_coupon").html();
  1852. obj.parent().parent().find(".select .item_coupon").html(itemHtml);
  1853. }
  1854. });
  1855. // 포인트기능 리렛
  1856. pntDcAmtReset();
  1857. */
  1858. }
  1859. // 1.14 선포인트리셋기능 (사용안함)
  1860. var prePntDcAmtReset = function() {
  1861. // 2021.04.29 수정
  1862. var rmPrePntAmt = parseInt($("#orderForm input[name='rmPrePntAmt']").val());
  1863. if (rmPrePntAmt > 0) {
  1864. rmPrePntAmt = parseInt($("#orderForm input[name='rmPrePntAmt']").val());
  1865. $("#orderForm input[name='prePntDcAmt']").val(rmPrePntAmt);
  1866. } else {
  1867. rmPrePntAmt = 0;
  1868. }
  1869. // 선포인트사용여부 체크 후 적용
  1870. $("#orderForm input[name='rdi-beforpoint']").each(function(){
  1871. // 선포인트 초기 설정 사용함
  1872. if ($(this).val() == "Y") {
  1873. $(this).attr("checked", true);
  1874. }
  1875. // 버튼기능 구현
  1876. $(this).on("click", function(){
  1877. var rmPrePntAmt = parseInt($("#orderForm input[name='rmPrePntAmt']").val());
  1878. // 선포인트적용
  1879. if ($(this).val() == "Y") {
  1880. $("#prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+"원");
  1881. } else {
  1882. $("#prePntDcAmt").text("0원");
  1883. }
  1884. // 쿠폰할인금액 SUM
  1885. custCpnSumAmtCal();
  1886. });
  1887. });
  1888. $("#prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+"원");
  1889. // 포인트기능 리렛
  1890. pntDcAmtReset();
  1891. }
  1892. // 1.15 포인트리셋기능
  1893. var pntDcAmtReset = function() {
  1894. $("#orderAmtForm .pntDcSumAmt").text("0");
  1895. $("#orderForm input[name='pntDcAmtStr']").val("");
  1896. $("#pntDcAmt").text("0");
  1897. // 상품권리셋기능
  1898. gfcdUseAmtReset();
  1899. }
  1900. // 1.16 상품권리셋기능
  1901. var gfcdUseAmtReset = function() {
  1902. $("#orderAmtForm .gfcdUseSumAmt").text("0");
  1903. $("#orderForm input[name='gfcdUseAmtStr']").val("");
  1904. $("#gfcdUseAmt").text("0");
  1905. // 금액전체계산
  1906. custCpnSumAmtCal();
  1907. }
  1908. // 1.17 쿠폰할인금액합계설정(금액전체계산)
  1909. var custCpnSumAmtCal = function() {
  1910. var cpnDcSumAmt = 0;
  1911. var cpnApplyCnt = 0;
  1912. var goodsCartCpnSumAmt = 0;
  1913. var cpnType = "";
  1914. // 상품쿠폰, 장바구니쿠폰 할인금액 합계
  1915. $("#couponModifyPop input[name='cpnDcAmt']").each(function(){
  1916. cpnType = $(this).parent().find("input[name=cpnType]").val();
  1917. cpnDcSumAmt = cpnDcSumAmt + parseInt($(this).val());
  1918. // 적용된 쿠폰 수량
  1919. if (parseInt($(this).val()) > 0) {
  1920. cpnApplyCnt++;
  1921. }
  1922. // 상품, 장바구니 쿠폰할인금액 저장
  1923. // 상품, 장바구니쿠폰 할인 금액만 합계 적용
  1924. if (cpnType == "goodsCpn" || cpnType == "cartCpn") {
  1925. goodsCartCpnSumAmt = goodsCartCpnSumAmt + parseInt($(this).val());
  1926. }
  1927. });
  1928. // 배송비쿠폰 할인금액 합계
  1929. $("#couponSelectPop02 input[name='cpnDcAmt']").each(function(){
  1930. cpnDcSumAmt = cpnDcSumAmt + parseInt($(this).val());
  1931. });
  1932. // 상품, 장바구니쿠폰 할인 금액만 합계 적용
  1933. $(".maxdisc_amount .goodsCartCpnDcAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt)); // 쿠폰할인금액합계
  1934. $("#couponModifyPop .modal-footer .goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt));
  1935. // 전체쿠폰 할인 금액 합계 적용
  1936. $(".maxdisc_amount .cpnDcAmt").text(getZeroMinusDelAmt(cpnDcSumAmt)); // 쿠폰할인금액합계
  1937. $("#couponDcSumAmt").text(getZeroMinusDelAmt(cpnDcSumAmt)); // 쿠폰할인금액합계
  1938. $("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
  1939. var delvSumAmt = orgSumDelvFee;
  1940. // 배송비할인적용
  1941. $("input[name='cpnType']").each(function(){
  1942. if ($(this).val() == "delvCpn") {
  1943. delvSumAmt = parseInt(orgSumDelvFee) - parseInt($(this).parent().find("input[name='cpnDcAmt']").val());
  1944. }
  1945. });
  1946. // 최종배송비
  1947. $("#delvSumAmt").text(delvSumAmt.addComma());
  1948. $("#orderAmtForm .delvSumAmt").text(delvSumAmt);
  1949. $("#orderForm .delvSumAmt").text(delvSumAmt.addComma());
  1950. // 2021.03.06 주문상세 테이블 적용
  1951. // 포인트금액 상품상세에 포인트금액 분배 작업
  1952. var prePntDcAmtYn = $("#orderForm input[name='rdi-beforpoint']:checked").val();
  1953. var leftPntAmt = parseInt($("#orderAmtForm .pntDcSumAmt").text());
  1954. var leftGfcdAmt = parseInt($("#orderAmtForm .gfcdUseSumAmt").text());
  1955. var cartSqLenght = $("#orderAmtForm .cartSq").length;
  1956. var index = 1;
  1957. var orgGoodsSumAmt = 0;
  1958. var cpn1DcSumAmt = 0;
  1959. var ordSumAmt = 0;
  1960. var tmtb1DcSumAmt = 0;
  1961. var tmtb2DcSumAmt = 0;
  1962. var tmtbDcSumAmt = 0;
  1963. var goodsCpnDcSumAmt = 0;
  1964. var cartCpnDcSumAmt = 0;
  1965. var delvCpnDcSumAmt = 0;
  1966. var cpnDcSumAmt = 0;
  1967. var prePntDcSumAmt = 0;
  1968. var pntDcSumAmt = parseInt($("#orderAmtForm .pntDcSumAmt").text());
  1969. var gfcdUseSumAmt = parseInt($("#orderAmtForm .gfcdUseSumAmt").text());
  1970. var realOrdSumAmt = 0;
  1971. var savePntSumAmt = 0;
  1972. var totDcSumAmt = 0;
  1973. $("#orderAmtForm .cartSq").each(function(){
  1974. var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
  1975. var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
  1976. var optAddPrice = parseInt($(this).parent().find(".optAddPrice").text());
  1977. var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
  1978. var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
  1979. var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
  1980. var goodsCpnDcAmt = parseInt($(this).parent().find(".goodsCpnDcAmt").text());
  1981. var cartCpnDcAmt = parseInt($(this).parent().find(".cartCpnDcAmt").text());
  1982. var prePntDcAmt1 = parseInt($(this).parent().find(".prePntDcAmt1").text());
  1983. var dcSumAmt = 0;
  1984. // 주문금액 = ((판매가 - 즉시할인가) + 옵션추가금액) * 장바구니수량
  1985. orgGoodsSumAmt = orgGoodsSumAmt + (orgCurrPrice + optAddPrice) * goodsQty;
  1986. //orgGoodsSumAmt = orgGoodsSumAmt + orgCurrPrice;
  1987. cpn1DcSumAmt = cpn1DcSumAmt + (cpn1DcAmt * goodsQty);
  1988. tmtb1DcSumAmt = tmtb1DcSumAmt + tmtb1DcAmt;
  1989. tmtb2DcSumAmt = tmtb2DcSumAmt + tmtb2DcAmt;
  1990. tmtbDcSumAmt = tmtbDcSumAmt + (tmtb1DcAmt + tmtb2DcAmt);
  1991. goodsCpnDcSumAmt = goodsCpnDcSumAmt + goodsCpnDcAmt;
  1992. cartCpnDcSumAmt = cartCpnDcSumAmt + cartCpnDcAmt;
  1993. cpnDcSumAmt = cpnDcSumAmt + (goodsCpnDcAmt + cartCpnDcAmt);
  1994. prePntDcSumAmt = prePntDcSumAmt + prePntDcAmt1;
  1995. var ordAmt = ((orgCurrPrice - cpn1DcAmt) + optAddPrice) * goodsQty;
  1996. ordSumAmt = ordSumAmt + ordAmt;
  1997. // 선포인트사용여부
  1998. // 할인금액합계 = 다다익선수량금액 + 다다익선금액금액 + 상품쿠폰금액 + 장바구니금액 + 선포인트금액
  1999. if (prePntDcAmtYn == "Y") {
  2000. dcSumAmt = tmtb1DcAmt + tmtb2DcAmt + goodsCpnDcAmt + cartCpnDcAmt + prePntDcAmt1;
  2001. } else {
  2002. dcSumAmt = tmtb1DcAmt + tmtb2DcAmt + goodsCpnDcAmt + cartCpnDcAmt;
  2003. }
  2004. totDcSumAmt = totDcSumAmt + dcSumAmt;
  2005. // 주문금액설정
  2006. $(this).parent().find(".ordAmt").text(ordAmt);
  2007. $(this).parent().find(".dcSumAmt").text(dcSumAmt);
  2008. });
  2009. // 포인트, 상품권 금액 분배
  2010. $("#orderAmtForm .cartSq").each(function(){
  2011. var cartSq = $(this).text();
  2012. var pntPrate = parseInt($(this).parent().find(".pntPrate").text());
  2013. var pntMrate = parseInt($(this).parent().find(".pntMrate").text());
  2014. var ordAmt = parseInt($(this).parent().find(".ordAmt").text());
  2015. var dcSumAmt = parseInt($(this).parent().find(".dcSumAmt").text());
  2016. var prePntDcAmt1 = parseInt($(this).parent().find(".prePntDcAmt1").text());
  2017. var tempDiv = parseInt((ordAmt / ordSumAmt) * 100);
  2018. var pntDcAmt1 = 0;
  2019. var gfcdUseAmt1 = 0;
  2020. var savePntAmt1 = 0;
  2021. if (index == cartSqLenght) {
  2022. pntDcAmt1 = leftPntAmt;
  2023. gfcdUseAmt1 = leftGfcdAmt;
  2024. } else {
  2025. pntDcAmt1 = parseInt((pntDcSumAmt * tempDiv) / 100);
  2026. gfcdUseAmt1 = parseInt((gfcdUseSumAmt * tempDiv) / 100);
  2027. leftPntAmt = leftPntAmt - pntDcAmt1;
  2028. leftGfcdAmt = leftGfcdAmt - gfcdUseAmt1;
  2029. }
  2030. var realOrdAmt1 = ordAmt - dcSumAmt - pntDcAmt1 - gfcdUseAmt1;
  2031. var realOrdAmt2 = ordAmt - dcSumAmt - pntDcAmt1;
  2032. realOrdSumAmt = realOrdSumAmt + realOrdAmt1;
  2033. // 2021.05.11 최종할인금액으로 적립포인트 적용
  2034. savePntAmt1 = parseInt(realOrdAmt2 * (pntPrate/100));
  2035. // 2021.05.27 적립포인트 설정
  2036. $("#orderForm #orderListInfo .orderListSavePntDcAmt").each(function(){
  2037. var orderListCartSq = $(this).parent().find("input[name=cartSq]").val();
  2038. if (orderListCartSq == cartSq) {
  2039. $(this).text(savePntAmt1.addComma());
  2040. }
  2041. });
  2042. // 선포인트사용여부
  2043. if (prePntDcAmtYn == "Y") {
  2044. if (prePntDcAmt1 < 1) {
  2045. savePntSumAmt = savePntSumAmt + savePntAmt1;
  2046. }
  2047. } else {
  2048. savePntSumAmt = savePntSumAmt + savePntAmt1;
  2049. }
  2050. $(this).parent().find(".pntDcAmt1").text(pntDcAmt1);
  2051. $(this).parent().find(".gfcdUseAmt1").text(gfcdUseAmt1);
  2052. $(this).parent().find(".realOrdAmt1").text(realOrdAmt1);
  2053. $(this).parent().find(".savePntAmt1").text(savePntAmt1);
  2054. index++;
  2055. });
  2056. realOrdSumAmt = realOrdSumAmt + delvSumAmt;
  2057. $("#orderAmtForm .orgGoodsSumAmt").text(orgGoodsSumAmt);
  2058. $("#orderAmtForm .cpn1DcSumAmt").text(cpn1DcSumAmt);
  2059. $("#orderAmtForm .ordSumAmt").text(ordSumAmt);
  2060. $("#orderAmtForm .tmtb1DcSumAmt").text(tmtb1DcSumAmt);
  2061. $("#orderAmtForm .tmtb2DcSumAmt").text(tmtb2DcSumAmt);
  2062. $("#orderAmtForm .tmtbDcSumAmt").text(tmtbDcSumAmt);
  2063. $("#orderAmtForm .goodsCpnDcSumAmt").text(goodsCpnDcSumAmt);
  2064. $("#orderAmtForm .cartCpnDcSumAmt").text(cartCpnDcSumAmt);
  2065. $("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
  2066. $("#orderAmtForm .prePntDcSumAmt").text(prePntDcSumAmt);
  2067. $("#orderAmtForm .realOrdSumAmt").text(realOrdSumAmt);
  2068. $("#orderAmtForm .savePntSumAmt").text(savePntSumAmt);
  2069. $("#realOrdAmt").text(realOrdSumAmt.addComma()); // 총 결제 예정 금액
  2070. $("#orderForm .realOrdAmt").text(realOrdSumAmt.addComma()); // 총 결제 예정 금액
  2071. $("#orderForm .orgGoodsSumAmt").text(orgGoodsSumAmt.addComma());
  2072. $("#orderForm #btn_payment span").text(realOrdSumAmt.addComma()); // 총 결제 예정 금액
  2073. $("#orderForm .dcSumAmt").text(getZeroMinusDelAmt(totDcSumAmt)); // 할인금액합계
  2074. var tempSavePnt = savePntSumAmt - prePntDcAmt;
  2075. // 사은품사용 후 보유포인트
  2076. var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
  2077. var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
  2078. rmPntAmt = rmPntAmt - freegiftUsePnt;
  2079. $("#orderForm .rmPntAmt").text(rmPntAmt.addComma());
  2080. // 2021.04.29 적립포인트금액 선포인트 사용시 사용금액제외
  2081. $("#orderForm #savePntSumAmt").text(savePntSumAmt.addComma() + " P");
  2082. // 사은품정보 설정
  2083. var freegiftValArr = [];
  2084. var freegiftUsePointArr = [];
  2085. $(".gift_box").each(function(){
  2086. $(this).find(".freegiftRdo").each(function(){
  2087. // 사은품필수
  2088. if ($(this).attr("allYn") == "Y" ) {
  2089. freegiftValArr.push($(this).val());
  2090. freegiftUsePointArr.push($(this).attr("usepoint"));
  2091. } else {
  2092. // 라디오버튼 선택 사은품 체크
  2093. if ($(this).is(":checked")) {
  2094. // 수령거부가 아닐때 체크
  2095. if ($(this).val() != "noSel") {
  2096. freegiftValArr.push($(this).val());
  2097. freegiftUsePointArr.push($(this).attr("usepoint"));
  2098. }
  2099. }
  2100. }
  2101. });
  2102. });
  2103. $("#orderAmtForm .freegiftValArr").text(freegiftValArr); // 사은품시퀀스배열
  2104. $("#orderAmtForm .freegiftUsePointArr").text(freegiftUsePointArr); // 사은품사용포인트배열
  2105. };
  2106. // 1.18 배송지정보 설정
  2107. var delvAddrSet = function(delvObj) {
  2108. var rtnStr = "";
  2109. rtnStr += "| recipNm ::: " + delvObj.recipNm;
  2110. rtnStr += "| recipPhnno ::: " + delvObj.recipPhnno;
  2111. rtnStr += "| recipZipcode ::: " + delvObj.recipZipcode;
  2112. rtnStr += "| recipBaseAddr ::: " + delvObj.recipBaseAddr;
  2113. rtnStr += "| recipDtlAddr ::: " + delvObj.recipDtlAddr;
  2114. rtnStr += "| delvMemo ::: " + delvObj.delvMemo;
  2115. // 배송지정보로드실행
  2116. deliveryAddrInfoSet(delvObj, false);
  2117. }
  2118. // 1.19 배송메모설정
  2119. var delvMemoSet = function(delvMemoObj) {
  2120. var rtnStr = "";
  2121. rtnStr += "| delvMemo ::: " + delvMemoObj.delvMemo;
  2122. $("#orderForm input[name=delvMemo]").val(delvMemoObj.delvMemo); // input 값에 설정
  2123. $("#delvMemo").text(delvMemoObj.delvMemo); // 메모 text 설정
  2124. $("#orderAmtForm .delvMemo").text(delvMemoObj.delvMemo); // 메모 text 설정
  2125. }
  2126. </script>
  2127. <script th:inline="javascript">
  2128. $(document).ready( function() {
  2129. //해외배송 입력
  2130. $(document).on('change','.odPayment .area_overseas #rdi-overs1',function(e){
  2131. $('.info_box.overs2').hide();
  2132. $('.info_box.overs1').show();
  2133. return false;
  2134. }).on('change','.odPayment .area_overseas #rdi-overs2',function(e){
  2135. $('.info_box.overs1').hide();
  2136. $('.info_box.overs2').show();
  2137. return false;
  2138. });
  2139. //할인쿠폰 확인
  2140. $(document).on('click','.odPayment .area_seldiscount .btn_coupon_toggle',function(e){
  2141. $('.coupon_list').toggle();
  2142. $(this).toggleClass('on');
  2143. return false;
  2144. });
  2145. //결제수단 선택
  2146. /*
  2147. $(document).on('change','.odPayment .area_paymethod .paymethod_radio input',function(e){
  2148. $('.radio_blk').removeClass('on');
  2149. $(this).parents('.radio_blk').addClass('on');
  2150. $(this).parents('.radio_blk').find('.paymethod_box').show();
  2151. $(this).parents('.radio_blk').siblings('div').find('.paymethod_box').hide();
  2152. var paymethodlabel = $(this).prop('labels');
  2153. $(this).parents('li').find('.fold_head .data span').text($(paymethodlabel).text());
  2154. //간편결제 카드추가 슬라이드
  2155. var swiper = new Swiper('.paymethod_box .card_quickpay .list_card.swiper-container', {
  2156. slidesPerView: 'auto',
  2157. spaceBetween: 160,
  2158. centeredSlides: true,
  2159. navigation: {
  2160. nextEl: '.list_card .swiper-button-next',
  2161. prevEl: '.list_card .swiper-button-prev',
  2162. },
  2163. });
  2164. return false;
  2165. });
  2166. */
  2167. //STYLE24 간편결제 배너닫기
  2168. $(document).on('click','.odPayment .area_paymethod .quickpay_bnr .btn_close_bnr',function(e){
  2169. $('.quickpay_bnr').hide();
  2170. });
  2171. //결제수단 선택 > 즐겨찾기 추가시
  2172. $(document).on('click','.odPayment .area_paymethod .paymethod_box .card .etc .btn_favorcard',function(e){
  2173. $(this).toggleClass('active');
  2174. return false;
  2175. });
  2176. //결제수단 > 일반결제> 실시간계좌이체 선택시
  2177. /*
  2178. $(document).on('change','.odPayment input:radio[name=rdi-paynormal]',function(e){
  2179. var paynormalValue = $(this).attr('id');
  2180. if (paynormalValue == 'rdi-paynormal2') {
  2181. $('.area_paymethod .agree_insurance').show();
  2182. } else {
  2183. $('.area_paymethod .agree_insurance').hide();
  2184. }
  2185. return false;
  2186. });
  2187. */
  2188. //구매조건 확인 및 결제대행 서비스 약관 동의 클릭시
  2189. $(document).on('click','.area_paymentinfo .payinfo_blk_wrap a',function(e){
  2190. e.preventDefault();
  2191. $(this).parent('.payinfo_blk_wrap').toggleClass('on');
  2192. $(this).siblings('.payinfo_blk_parent').toggle();
  2193. var privacyToggle = $(this).find('span');
  2194. $(privacyToggle).text($(privacyToggle).text() == '보기' ? '닫기' : '보기');
  2195. return false;
  2196. });
  2197. //개인정보동의 열고닫기
  2198. $(document).on('click','.area_paymentinfo .payinfo_blk a',function(e){
  2199. e.preventDefault();
  2200. $(this).parents('.payinfo_blk').toggleClass('on');
  2201. var privacyToggle = $(this).find('span');
  2202. $(privacyToggle).text($(privacyToggle).text() == '보기' ? '닫기' : '보기');
  2203. return false;
  2204. });
  2205. //배송지수정 팝업열기
  2206. $(document).on('click','#btn_addrModify_pop',function(e){
  2207. $("#adrsModifyPop").modal("show");
  2208. return false;
  2209. });
  2210. //배송요청사항 팝업열기
  2211. $(document).on('click','#btn_rqstModify_pop',function(e){
  2212. $("#rqstModifyPop").modal("show");
  2213. return false;
  2214. });
  2215. //사은품지급안내 팝업열기
  2216. $(document).on('click','#btn_infoGift_pop',function(e){
  2217. $("#infoGiftPop").modal("show");
  2218. return false;
  2219. });
  2220. //간편결제등록 > STEP1.이용약관 팝업열기
  2221. $(document).on('click','.btn_addcard',function(e){
  2222. $("#qPayAgree_pop").modal("show");
  2223. return false;
  2224. });
  2225. //간편결제등록 > STEP1.이용약관 체크
  2226. $(document).on('click','.area_QpayCk .agr_select button',function(e){
  2227. $(this).parents('.area_QpayCk').find('.info_agrQpay').toggle();
  2228. var payagrToggle = $(this).find('span');
  2229. $(payagrToggle).text($(payagrToggle).text() == '약관열기' ? '약관닫기' : '약관열기');
  2230. return false;
  2231. });
  2232. //간편결제등록 > STEP1.이용약관 체크박스 전체선택
  2233. $(document).on('click','#chk-Qpay-agrAll',function(e){
  2234. $(this).parents(".qPayAgree_pop").find('.agree_Qpay input').prop("checked", $(this).is(":checked"));
  2235. });
  2236. //간편결제등록 > STEP1.이용약관 체크박스 개별선택
  2237. $(document).on("click", ".agree_Qpay input",function(e){
  2238. var is_checked = true;
  2239. $(".agree_Qpay input").each(function(){
  2240. is_checked = is_checked && $(this).is(":checked");
  2241. });
  2242. $("#chk-Qpay-agrAll").prop("checked", is_checked);
  2243. });
  2244. //간편결제등록 > 본인인증 팝업열기
  2245. $(document).on('click','#btn_qPayidConfirm_pop',function(e){
  2246. $("#qPayidConfirm_pop").modal("show");
  2247. return false;
  2248. });
  2249. });
  2250. // PG 카카오페이 결제준비 처리
  2251. var fnKakaoPaymentReady = function() {
  2252. let nextRedirectUrl = $('#order_info input[name=nextRedirectMobileUrl]').val();
  2253. window.location.href = nextRedirectUrl;
  2254. }
  2255. // PG 카카오페이 결제 승인 요청
  2256. var fnKakaoPaymentRequest = function(pgToken) {
  2257. // Token 값 설정
  2258. $('#order_info input[name=pgToken]').val(pgToken);
  2259. // Form Submit
  2260. document.order_info.submit();
  2261. return true;
  2262. }
  2263. // PG 네이버페이 결제준비 처리
  2264. var fnNaverPaymentReady = function() {
  2265. let naverPayUrl = 'https://' + [[${@environment.getProperty('naverPay.payUrl.mob')}]];
  2266. let reserveId = $('#order_info input[name=reserveId]').val();
  2267. let url = naverPayUrl + '/payments/' + reserveId;
  2268. window.location.href = url;
  2269. }
  2270. // PG 네이버페이 결제 승인 요청
  2271. var fnNaverPaymentRequest = function(paymentId) {
  2272. // TID 설정
  2273. $('#order_info input[name=pgTid]').val(paymentId);
  2274. // Form Submit
  2275. document.order_info.submit();
  2276. return true;
  2277. }
  2278. // 0원이하이면 '-' 처리 삭제 함수
  2279. var getZeroMinusDelAmt = function(tempAmt) {
  2280. var rtnAmtStr = "";
  2281. if (tempAmt > 0) {
  2282. rtnAmtStr = "-" + tempAmt.addComma();
  2283. } else {
  2284. rtnAmtStr = tempAmt.addComma();
  2285. }
  2286. return rtnAmtStr;
  2287. }
  2288. // START ::: 2021.04.09 숫자입려 천단위 찍기
  2289. var inputNumberFormat = function(obj) {
  2290. obj.value = comma(uncomma(obj.value));
  2291. }
  2292. var comma = function(str) {
  2293. str = String(str);
  2294. return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
  2295. }
  2296. var uncomma = function(str) {
  2297. str = String(str);
  2298. return str.replace(/[^\d]+/g, '');
  2299. }
  2300. // 2021.04.09 숫자입려 천단위 찍기 ::: END
  2301. </script>
  2302. </th:block>
  2303. </body>
  2304. </html>