OrderFormMob.html 91 KB

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