|
@@ -0,0 +1,2556 @@
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
|
+<html lang="ko" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="web/common/layout/DefaultLayoutWeb">
|
|
|
|
|
+<!--
|
|
|
|
|
+ *******************************************************************************
|
|
|
|
|
+ * @source : OrderFormWeb.html
|
|
|
|
|
+ * @desc : 주문/결제 Page
|
|
|
|
|
+ *============================================================================
|
|
|
|
|
+ * STYLE24
|
|
|
|
|
+ * Copyright(C) 2020 TSIT, All rights reserved.
|
|
|
|
|
+ *============================================================================
|
|
|
|
|
+ * VER DATE AUTHOR DESCRIPTION
|
|
|
|
|
+ * === =========== ========== =============================================
|
|
|
|
|
+ * 1.0 2021.02.01 jsh77b 최초 작성
|
|
|
|
|
+ *******************************************************************************
|
|
|
|
|
+ -->
|
|
|
|
|
+<body>
|
|
|
|
|
+<th:block layout:fragment="content">
|
|
|
|
|
+
|
|
|
|
|
+<link rel="stylesheet" type="text/css" href="/ux/pc/css/swiper.min.css">
|
|
|
|
|
+<script type="text/javascript" src="/ux/pc/js/swiper.min.js"></script>
|
|
|
|
|
+<script type="text/javascript" src="/ux/pc/js/jquery-ui.js"></script>
|
|
|
|
|
+
|
|
|
|
|
+<!-- payment.js -->
|
|
|
|
|
+<script type="text/javascript" th:src="${@environment.getProperty('pg.kcp.js.url')}" src=""></script>
|
|
|
|
|
+<script type="text/javascript" src="/biz/payment.js"></script>
|
|
|
|
|
+
|
|
|
|
|
+<!-- 주문정보form -->
|
|
|
|
|
+<form id="order_info" name="order_info" method="post" action="/order/pay/result/response" style="display:none"></form>
|
|
|
|
|
+<!-- //주문정보form -->
|
|
|
|
|
+
|
|
|
|
|
+<!-- 주문금액정보표현 -->
|
|
|
|
|
+<form id="orderAmtForm" name="orderAmtForm">
|
|
|
|
|
+ <!-- 주문자정보 -->
|
|
|
|
|
+ <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="orderInfo" id="orderInfo">
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr style="height:30px;">
|
|
|
|
|
+ <td class="custNm"></td>
|
|
|
|
|
+ <td class="email"></td>
|
|
|
|
|
+ <td class="cellPhnno"></td>
|
|
|
|
|
+ <td class="recipNm"></td>
|
|
|
|
|
+ <td class="recipPhnno"></td>
|
|
|
|
|
+ <td class="recipZipcode"></td>
|
|
|
|
|
+ <td class="recipBaseAddr"></td>
|
|
|
|
|
+ <td class="recipDtlAddr"></td>
|
|
|
|
|
+ <td class="delvMemo"></td>
|
|
|
|
|
+ <td class="sexGb"></td>
|
|
|
|
|
+ <td class="birthYmd"></td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <!-- //주문자정보 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 사은품정보 -->
|
|
|
|
|
+ <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="freegiftInfo">
|
|
|
|
|
+ <tr style="height:30px;">
|
|
|
|
|
+ <td class="freegiftValArr"></td>
|
|
|
|
|
+ <td class="freegiftUsePointArr"></td>
|
|
|
|
|
+ <td class="freegiftSqArr"></td>
|
|
|
|
|
+ <td class="freegiftGoodsArr"></td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <!-- //사은품정보 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 주문상세금액 -->
|
|
|
|
|
+ <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="orderDetailInfo" id="orderDetailInfo">
|
|
|
|
|
+ <th:block th:each="delvAllCart, index : ${delvAllCartList}">
|
|
|
|
|
+ <th:block th:if="${delvAllCart != null and #lists.size(delvAllCart) > 0}">
|
|
|
|
|
+ <th:block th:each="goods, i : ${delvAllCart}">
|
|
|
|
|
+ <tr style="height:30px;">
|
|
|
|
|
+ <td class="cartSq" th:text="${goods.cartSq}"></td>
|
|
|
|
|
+ <td class="goodsNm" th:text="${goods.goodsNm}" style="display:none"></td>
|
|
|
|
|
+ <td class="goodsCd" th:text="${goods.goodsCd}"></td>
|
|
|
|
|
+ <td class="goodsType" th:text="${goods.goodsType}"></td>
|
|
|
|
|
+ <td class="itemCd" th:text="${goods.itemCd}"></td>
|
|
|
|
|
+ <td class="optCd" th:text="${goods.optCd}"></td>
|
|
|
|
|
+ <td class="optCd1" th:text="${goods.optCd1}" style="display:none"></td>
|
|
|
|
|
+ <td class="optCd2" th:text="${goods.optCd2}" style="display:none"></td>
|
|
|
|
|
+ <td class="itemQtyr" th:text="${goods.itemQtyr}" style="display:none"></td>
|
|
|
|
|
+ <td class="orgCurrPrice" th:text="${goods.orgCurrPrice}"></td>
|
|
|
|
|
+ <td class="cpn1CpnSq" th:text="${goods.cpn1CpnSq}"></td>
|
|
|
|
|
+ <td class="cpn1DcAmt" th:text="${goods.orgCurrPrice} - ${goods.currPrice}"></td>
|
|
|
|
|
+ <td class="optAddPrice" th:text="${goods.optAddPrice}"></td>
|
|
|
|
|
+ <td class="goodsQty" th:text="${goods.goodsQty}"></td>
|
|
|
|
|
+ <td class="ordAmt">0</td>
|
|
|
|
|
+ <th:block th:if="${goods.applyQtySectionYn} == 'Y' and ${goods.qtyTmtbSq} > 0">
|
|
|
|
|
+ <td class="tmtb1Sq" th:text="${goods.qtyTmtbSq}"></td>
|
|
|
|
|
+ <td class="tmtb1DcAmt" th:text="${goods.tmtb1DcAmt}"></td>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${goods.applyQtySectionYn} != 'Y'">
|
|
|
|
|
+ <td class="tmtb1Sq">0</td>
|
|
|
|
|
+ <td class="tmtb1DcAmt">0</td>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${goods.applyAmtSectionYn} == 'Y' and ${goods.amtTmtbSq} > 0">
|
|
|
|
|
+ <td class="tmtb2Sq" th:text="${goods.amtTmtbSq}"></td>
|
|
|
|
|
+ <td class="tmtb2DcAmt" th:text="${goods.tmtb2DcAmt}"></td>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${goods.applyAmtSectionYn} != 'Y'">
|
|
|
|
|
+ <td class="tmtb2Sq" >0</td>
|
|
|
|
|
+ <td class="tmtb2DcAmt" >0</td>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <td class="goodsCpnSq">0</td>
|
|
|
|
|
+ <td class="goodsCpnDcAmt">0</td>
|
|
|
|
|
+ <td class="cartCpnSq">0</td>
|
|
|
|
|
+ <td class="cartCpnDcAmt">0</td>
|
|
|
|
|
+ <td class="prePntDcAmt1" th:text="${goods.prePntDcAmt}"></td>
|
|
|
|
|
+ <td class="dcSumAmt">0</td>
|
|
|
|
|
+ <td class="pntDcAmt1">0</td>
|
|
|
|
|
+ <td class="gfcdUseAmt1">0</td>
|
|
|
|
|
+ <td class="realOrdAmt1">0</td>
|
|
|
|
|
+ <td class="savePntAmt1">0</td>
|
|
|
|
|
+ <td class="shotDelvYn" th:text="${goods.shotDelvYn}"></td>
|
|
|
|
|
+ <td class="foreignBuyYn" th:text="${goods.foreignBuyYn}"></td>
|
|
|
|
|
+ <td class="orderMadeYn" th:text="${goods.orderMadeYn}"></td>
|
|
|
|
|
+ <td class="delvFeeCd" th:text="${goods.delvFeeCd}"></td>
|
|
|
|
|
+ <td class="pntPrate" th:text="${goods.pntPrate}"></td>
|
|
|
|
|
+ <td class="pntMrate" th:text="${goods.pntMrate}"></td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <!-- //주문상세금액 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 배송단위목록 -->
|
|
|
|
|
+ <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="delvFeeCdInfo" id="delvFeeCdInfo">
|
|
|
|
|
+ <th:block th:each="delvFeeCd, index : ${delvFeeCdList}">
|
|
|
|
|
+ <tr style="height:30px;">
|
|
|
|
|
+ <td class="supplyCompCd" th:text="${delvFeeCd.supplyCompCd}"></td>
|
|
|
|
|
+ <td class="delvFeeCd" th:text="${delvFeeCd.delvFeeCd}"></td>
|
|
|
|
|
+ <td class="delvFee" th:text="${delvFeeCd.delvFee}"></td>
|
|
|
|
|
+ <td class="delvCpnSq">0</td>
|
|
|
|
|
+ <td class="delvCpnDcAmt">0</td>
|
|
|
|
|
+ <td class="delvGfcdUseAmt">0</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <!-- //배송단위목록 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 주문금액합계 -->
|
|
|
|
|
+ <table border="1" style="font-size:10px; text-align:center; margin-top:20px; display:none; width:100%;" name="orderSumAmtInfo" id="orderSumAmtInfo">
|
|
|
|
|
+ <tr style="height:30px;">
|
|
|
|
|
+ <td class="orgGoodsSumAmt">0</td>
|
|
|
|
|
+ <td class="delvSumAmt" th:text="${sumDelvFee}"></td>
|
|
|
|
|
+ <td class="freegiftUsePnt">0</td>
|
|
|
|
|
+ <td class="cpn1DcSumAmt">0</td>
|
|
|
|
|
+ <td class="ordSumAmt">0</td>
|
|
|
|
|
+ <td class="tmtb1DcSumAmt">0</td>
|
|
|
|
|
+ <td class="tmtb2DcSumAmt">0</td>
|
|
|
|
|
+ <td class="tmtbDcSumAmt">0</td>
|
|
|
|
|
+ <td class="goodsCpnDcSumAmt">0</td>
|
|
|
|
|
+ <td class="cartCpnDcSumAmt">0</td>
|
|
|
|
|
+ <td class="delvCpnDcSumAmt">0</td>
|
|
|
|
|
+ <td class="cpnDcSumAmt">0</td>
|
|
|
|
|
+ <td class="prePntDcSumAmt">0</td>
|
|
|
|
|
+ <td class="pntDcSumAmt">0</td>
|
|
|
|
|
+ <td class="gfcdUseSumAmt">0</td>
|
|
|
|
|
+ <td class="realOrdSumAmt">0</td>
|
|
|
|
|
+ <td class="savePntSumAmt">0</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <!-- //주문금액합계 -->
|
|
|
|
|
+</form>
|
|
|
|
|
+<!-- //주문금액정보표현 -->
|
|
|
|
|
+
|
|
|
|
|
+<!-- 주문고객정보 -->
|
|
|
|
|
+<form id="orderForm" name="orderForm">
|
|
|
|
|
+<div id="container" class="container od">
|
|
|
|
|
+ <div class="wrap">
|
|
|
|
|
+ <div class="content odPayment">
|
|
|
|
|
+ <!-- 페이지특정 클래스 = odPayment -->
|
|
|
|
|
+ <div class="cont_head">
|
|
|
|
|
+ <h2>주문/결제</h2>
|
|
|
|
|
+ <div class="oder_steps">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li>01 쇼핑백</li>
|
|
|
|
|
+ <li class="on">02 주문/결제</li>
|
|
|
|
|
+ <li>03 주문완료</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cont_body">
|
|
|
|
|
+ <!-- CONT-BODY -->
|
|
|
|
|
+ <div class="od_cont">
|
|
|
|
|
+ <form class="form_wrap">
|
|
|
|
|
+ <div class="sec_head">
|
|
|
|
|
+ <div class="tbl type4">
|
|
|
|
|
+ <table>
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col width="240">
|
|
|
|
|
+ <col width="*">
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>총 <span class="number" id="delvFeeCdCnt" th:text="${delvFeeCdCnt}"></span> 건으로 나뉘어 배송 예정</th>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <span> 총알배송<em class="number" th:text="${shotCnt}" id="shotCnt"></em>건</span>
|
|
|
|
|
+ <span> STYLE24<em class="number" th:text="${wmsCnt}" id="wmsCnt"></em>건</span>
|
|
|
|
|
+ <span> 업체직배송<em class="number" th:text="${delvCnt}"></em>건</span>
|
|
|
|
|
+ <span> 예약배송<em class="number" th:text="${resCnt}"></em>건</span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="sec_body">
|
|
|
|
|
+ <!-- -->
|
|
|
|
|
+ <div class="foldGroup">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <!-- 주문고객정보 -->
|
|
|
|
|
+ <li class="fold_mbinfo" id="custemerInfo" style="display:none"></li>
|
|
|
|
|
+ <!-- //주문고객정보 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 배송지정보 -->
|
|
|
|
|
+ <li class="fold_mbinfo" id="deliveryAddrInfo" style="display:none"></li>
|
|
|
|
|
+ <!-- //배송지정보 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- //사은품정보 -->
|
|
|
|
|
+ <li id="freegiftInfo" style="display:none"></li>
|
|
|
|
|
+ <!-- //사은품정보 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 할인/혜택 사용 -->
|
|
|
|
|
+ <li id="dcAmtInfo" style="display:none"></li>
|
|
|
|
|
+ <!-- //할인/혜택 사용 -->
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 결제수단 선택 -->
|
|
|
|
|
+ <li class="fold_paymethod" id="paymentInfo" style="display:none"></li>
|
|
|
|
|
+ <!-- //결제수단 선택 -->
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="area_paymentinfo">
|
|
|
|
|
+ <!-- @ 2021.06.11 자사만, (무통장, 실시간) 미노출 -->
|
|
|
|
|
+ <!-- @ 입점있으면 무조건 노출 -->
|
|
|
|
|
+ <div class="paymentinfo">
|
|
|
|
|
+ <div class="payinfo_blk">
|
|
|
|
|
+ <a href="javascript:void(0);">개인정보 제공에 대한 동의<span>보기</span></a>
|
|
|
|
|
+ <div class="infotxt">STYLE24는 다음과 같이 회원님의 개인정보를 제3자에게 제공합니다.
|
|
|
|
|
+ <table>
|
|
|
|
|
+ <colgroup>
|
|
|
|
|
+ <col width="25%">
|
|
|
|
|
+ <col width="*">
|
|
|
|
|
+ <col width="25%">
|
|
|
|
|
+ <col width="25%">
|
|
|
|
|
+ </colgroup>
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>제공받는 자</th>
|
|
|
|
|
+ <th>제공하는 항목</th>
|
|
|
|
|
+ <th>제공 목적</th>
|
|
|
|
|
+ <th>보유 및 이용기간</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <tr class="paymentinfo agree1">
|
|
|
|
|
+ <td>서울보증보험㈜, ㈜유세이프</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ 구매자명, 구매자 생년월일,
|
|
|
|
|
+ 구매자 성별, 구매자 연락처
|
|
|
|
|
+ (일반전화 및 핸드폰), 구매자
|
|
|
|
|
+ 이메일, 주문번호,
|
|
|
|
|
+ 배송지 정보, 주문 금액
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>쇼핑몰보증보험 가입 및 보험가입 제반 사항</td>
|
|
|
|
|
+ <td>개별서비스 제공기간</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <!-- 입점업체가 있을때 노출 -->
|
|
|
|
|
+ <th:block th:if="${delvCnt} > 0">
|
|
|
|
|
+ <tr class="paymentinfo agree2">
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <th:block th:each="delvFeeCd, i : ${delvFeeCdList}">
|
|
|
|
|
+ <th:block th:unless="${delvFeeCd.delvFeeCd} == 'WMS'">
|
|
|
|
|
+ <th:block th:if="${i.count == #lists.size(delvFeeCdList)}">
|
|
|
|
|
+ <th:block th:text="|${delvFeeCd.supplyCompNm}|"></th:block>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${i.count < #lists.size(delvFeeCdList)}">
|
|
|
|
|
+ <th:block th:text="|${delvFeeCd.supplyCompNm},|"></th:block>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>성명, 주소, 연락처</td>
|
|
|
|
|
+ <td>주문상품의 배송, 고객상담 및 불만처리</td>
|
|
|
|
|
+ <td>이용목적 달성 시 까지</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <!-- //입점업체가 있을때 노출 -->
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="agree_payment">
|
|
|
|
|
+ 위 주문내역을 확인 하였으며, 회원 본인은 결제에 동의합니다. (전자상거래법 제 8조 제2항)
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="area_paybtn">
|
|
|
|
|
+ <div class="form_field">
|
|
|
|
|
+ <button type="button" class="btn btn_primary btn_block" id="btn_payment">
|
|
|
|
|
+ <span>동의 후 <em class="realOrdAmt"></em> 결제하기</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="od_side">
|
|
|
|
|
+ <div class="area_order">
|
|
|
|
|
+ <div class="tit_box">
|
|
|
|
|
+ <h3>주문내역</h3>
|
|
|
|
|
+ <span> <em class="number" th:text="${goodsTotCnt}"></em> 개의 상품
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div id="orderListInfo" style="display:none"></div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="od_amount_box">
|
|
|
|
|
+ <dl>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>상품금액</dt>
|
|
|
|
|
+ <dd id="orgGoodsSumAmt" th:text="|${#numbers.formatInteger(listSumAmt, 1, 'COMMA')} 원|"></dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>배송비</dt>
|
|
|
|
|
+ <dd id="delvSumAmt" th:text="|${#numbers.formatInteger(sumDelvFee, 1, 'COMMA')} 원|"></dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>상품할인금액</dt>
|
|
|
|
|
+ <th:block th:if="${goodsDcSumAmt} > 0">
|
|
|
|
|
+ <dd><span class="disc_amount" th:text="|-${#numbers.formatInteger(goodsDcSumAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${goodsDcSumAmt} < 1">
|
|
|
|
|
+ <dd><span class="disc_amount" th:text="|${#numbers.formatInteger(goodsDcSumAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>즉시할인금액</dt>
|
|
|
|
|
+ <th:block th:if="${cpn1DcSumAmt} > 0">
|
|
|
|
|
+ <dd><span class="disc_amount" id="cpn1DcSumAmt" th:text="|-${#numbers.formatInteger(cpn1DcSumAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${cpn1DcSumAmt} < 1">
|
|
|
|
|
+ <dd><span class="disc_amount" id="cpn1DcSumAmt" th:text="|${#numbers.formatInteger(cpn1DcSumAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- 회원인경우 노출 -->
|
|
|
|
|
+ <th:block th:if="${isLogin}">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>다다익선할인금액</dt>
|
|
|
|
|
+ <th:block th:if="${tmtbDcSumAmt} > 0">
|
|
|
|
|
+ <dd><span class="disc_amount" id="tmtbDcSumAmt" th:text="|-${#numbers.formatInteger(tmtbDcSumAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${tmtbDcSumAmt} < 1">
|
|
|
|
|
+ <dd><span class="disc_amount" id="tmtbDcSumAmt" th:text="|${#numbers.formatInteger(tmtbDcSumAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>쿠폰할인</dt>
|
|
|
|
|
+ <dd><span class="disc_amount" id="couponDcSumAmt"></span></dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>선포인트 사용</dt>
|
|
|
|
|
+ <th:block th:if="${prePntDcAmt} > 0">
|
|
|
|
|
+ <dd><span class="disc_amount" id="prePntDcAmt" th:text="|-${#numbers.formatInteger(prePntDcAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ <th:block th:if="${prePntDcAmt} < 1">
|
|
|
|
|
+ <dd><span class="disc_amount" id="prePntDcAmt" th:text="|${#numbers.formatInteger(prePntDcAmt, 1, 'COMMA')} 원|"></span></dd>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>포인트 사용</dt>
|
|
|
|
|
+ <dd><span class="disc_amount" id="pntDcAmt"></span></dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>상품권 사용</dt>
|
|
|
|
|
+ <dd><span class="disc_amount" id="gfcdUseAmt"></span></dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </th:block>
|
|
|
|
|
+ </dl>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="totalprice_box">
|
|
|
|
|
+ <dl>
|
|
|
|
|
+ <dt>총 결제 예정 금액</dt>
|
|
|
|
|
+ <dd><span id="realOrdAmt"></span> 원</dd>
|
|
|
|
|
+ </dl>
|
|
|
|
|
+ <p class="info_point">
|
|
|
|
|
+ <!-- 회원인경우 노출 -->
|
|
|
|
|
+ <th:blcok th:if="${isLogin}">
|
|
|
|
|
+ <span span class="save_point" id="savePntSumAmt" th:text="|${#numbers.formatInteger(savePntSumAmt, 1, 'COMMA')} P|"></span> 적립예정
|
|
|
|
|
+ </th:blcok>
|
|
|
|
|
+ <!-- 비회원인경우 노출-->
|
|
|
|
|
+ <th:blcok th:if="!${isLogin}">
|
|
|
|
|
+ 회원가입 후 구매하면 <span span class="save_point" id="savePntSumAmt" th:text="|${#numbers.formatInteger(savePntSumAmt, 1, 'COMMA')} P|"></span> 적립예정
|
|
|
|
|
+ </th:blcok>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- // CONT-BODY -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
+</form>
|
|
|
|
|
+
|
|
|
|
|
+<!-- 사은품지급안내 팝업 -->
|
|
|
|
|
+<div class="modal fade infoGift_pop" id="infoGiftPop" tabindex="-1" role="dialog" aria-labelledby="infoGiftLabel" aria-hidden="true">
|
|
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <div class="modal-header"><h5 class="modal-title" id="infoGiftLabel">STYLE24 사은품 지급 안내</h5></div>
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+ <div class="pop_cont">
|
|
|
|
|
+ <div class="cont_box">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li>스타일포인트 차감 사은품을 선택하신 경우, 결제 시 고객님의 누적 포인트에서 차감됩니다.</li>
|
|
|
|
|
+ <li>보유한 포인트의 금액을 넘어선 사은품은 신청이 불가합니다.</li>
|
|
|
|
|
+ <li>사은품 신청 시 해외배송은 불가합니다. <br> <span class="t_info">(적립포인트 사은품 및 온라인 사은품 제외)</span></li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <a href="#close-modal" rel="modal:close" id="infoGiftPop_close" class="close-modal">Close</a>
|
|
|
|
|
+</div>
|
|
|
|
|
+<!-- //사은품지급안내 팝업 -->
|
|
|
|
|
+
|
|
|
|
|
+<!-- 할인쿠폰 변겅 팝업 -->
|
|
|
|
|
+<div class="modal fade couponModify_pop" id="couponModifyPop" tabindex="-1" role="dialog" aria-labelledby="couponModifyLabel" aria-hidden="true">
|
|
|
|
|
+ <div class="modal-dialog" role="document">
|
|
|
|
|
+ <div class="modal-content">
|
|
|
|
|
+ <!-- 할인쿠폰 변겅 팝업 내용 -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <a href="#close-modal" rel="modal:close" id="couponModifyPop_close" class="close-modal">Close</a>
|
|
|
|
|
+</div>
|
|
|
|
|
+<!-- //할인쿠폰 변겅 팝업 -->
|
|
|
|
|
+
|
|
|
|
|
+<script th:inline="javascript">
|
|
|
|
|
+// 배송관련정보 변수선언
|
|
|
|
|
+var cartGoodsList = [[${cartGoodsList}]] // 배송목록
|
|
|
|
|
+var shotCnt = [[${shotCnt}]]; // 자사 총알 배송건수
|
|
|
|
|
+var wmsCnt = [[${wmsCnt}]]; // 자사 일반 배송건수
|
|
|
|
|
+var shotWmsCnt = [[${shotWmsCnt}]]; // 자사 총알,일반 배송건수
|
|
|
|
|
+var resCnt = [[${resCnt}]]; // 자사 예약 배송건수
|
|
|
|
|
+var delvCnt = [[${delvCnt}]]; // 입점 일반 배송건수
|
|
|
|
|
+var orgSumDelvFee = [[${sumDelvFee}]]; // 최초배송비합계
|
|
|
|
|
+var prePntDcAmt = [[${prePntDcAmt}]]; // 선포인트사용가능금액
|
|
|
|
|
+
|
|
|
|
|
+var custNm = [[${order.custNm}]]; // 주문자명
|
|
|
|
|
+var cellPhnno = [[${order.cellPhnno}]]; // 핸드폰번호
|
|
|
|
|
+var email = [[${order.email}]]; // 이메일
|
|
|
|
|
+var recipZipcode = [[${order.recipZipcode}]]; // 우편번호
|
|
|
|
|
+var recipBaseAddr = [[${order.recipBaseAddr}]]; // 기본주소
|
|
|
|
|
+var recipDtlAddr = [[${order.recipDtlAddr}]]; // 상세주소
|
|
|
|
|
+var cartSqArr = [[${order.cartSqArr}]]; // 장바구니시퀀스 목록
|
|
|
|
|
+var shotDelvUseYn = [[${order.shotDelvUseYn}]]; // 총알배송사용여부(장바구니)
|
|
|
|
|
+var shotDelvYn = [[${order.shotDelvUseYn}]]; // 총알배송사용여부(장바구니)
|
|
|
|
|
+var foreignBuyYn = [[${order.foreignBuyYn}]]; // 해외구매대행
|
|
|
|
|
+
|
|
|
|
|
+var foreignBuyYn = [[${foreignBuyYn}]]; // 해외구매대행여부
|
|
|
|
|
+var orderMadeYn = [[${orderMadeYn}]]; // 주문제작상품여부
|
|
|
|
|
+var isLogin = [[${isLogin}]]; // 로그인여부
|
|
|
|
|
+var devTempYn = [[${devTempYn}]]; // 개발자모드가능여부
|
|
|
|
|
+var frontGb = [[${frontGb}]]; // 프론트구분
|
|
|
|
|
+
|
|
|
|
|
+var custCpnSq = 0;
|
|
|
|
|
+var cpnIndex = 0;
|
|
|
|
|
+var cpnApplyTemp = false;
|
|
|
|
|
+
|
|
|
|
|
+//AJAX 로드를 위한 변수 설정
|
|
|
|
|
+var jsonObj = {};
|
|
|
|
|
+
|
|
|
|
|
+// 컨텐츠 호출
|
|
|
|
|
+$(document).ready( function() {
|
|
|
|
|
+
|
|
|
|
|
+ var dispYn = "N";
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니시퀀스 배열 변환
|
|
|
|
|
+ cartSqArr = String(cartSqArr).split(",");
|
|
|
|
|
+
|
|
|
|
|
+ if (isLogin == false) {
|
|
|
|
|
+ //dispYn = "Y";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // AJAX 로드를 위한 변수 설정
|
|
|
|
|
+ jsonObj = {
|
|
|
|
|
+ "custNm" : custNm
|
|
|
|
|
+ , "cellPhnno" : cellPhnno
|
|
|
|
|
+ , "email" : email
|
|
|
|
|
+ , "recipZipcode" : recipZipcode
|
|
|
|
|
+ , "recipBaseAddr" : recipBaseAddr
|
|
|
|
|
+ , "recipDtlAddr" : recipDtlAddr
|
|
|
|
|
+ , "cartSqArr" : cartSqArr
|
|
|
|
|
+ , "dispYn" : dispYn
|
|
|
|
|
+ , "shotDelvYn" : shotDelvUseYn
|
|
|
|
|
+ , "shotDelvUseYn" : shotDelvUseYn
|
|
|
|
|
+ , "foreignBuyYn" : foreignBuyYn
|
|
|
|
|
+ , "orderMadeYn" : orderMadeYn
|
|
|
|
|
+ , "custDelvAddrSq" : 0
|
|
|
|
|
+ , "cartGoodsList" : cartGoodsList
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ jsonData = JSON.stringify(jsonObj);
|
|
|
|
|
+
|
|
|
|
|
+ // 1. AJAX 정보(회원정보로드)
|
|
|
|
|
+ custemerInfoSet();
|
|
|
|
|
+
|
|
|
|
|
+ // 999. 개발화면정보설정
|
|
|
|
|
+ var devTemp = true;
|
|
|
|
|
+ var arr = []
|
|
|
|
|
+ arr[0] = "orderInfo";
|
|
|
|
|
+ arr[1] = "freegiftInfo";
|
|
|
|
|
+ arr[2] = "orderDetailInfo";
|
|
|
|
|
+ arr[3] = "delvFeeCdInfo";
|
|
|
|
|
+ arr[4] = "orderSumAmtInfo";
|
|
|
|
|
+
|
|
|
|
|
+ // 개발자모드실행
|
|
|
|
|
+ if (devTemp == true && devTempYn == true) {
|
|
|
|
|
+ $("table").each(function(){
|
|
|
|
|
+ var name = $(this).attr("name");
|
|
|
|
|
+ for (i=0 ; i<arr.length ; i++) {
|
|
|
|
|
+ if (name == arr[i]) {
|
|
|
|
|
+ $(this).show();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+// 1. 함수기능 정의
|
|
|
|
|
+// 1.1 고객정보로드
|
|
|
|
|
+var custemerInfoSet = function() {
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/custemerInfo',
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ $("#custemerInfo").css("display", "block");
|
|
|
|
|
+ $("#custemerInfo").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ // 고객정보설정
|
|
|
|
|
+ $("#orderAmtForm .custNm").text($("#orderForm input[name='custNm']").val());
|
|
|
|
|
+ $("#orderAmtForm .email").text($("#orderForm input[name='email']").val());
|
|
|
|
|
+ $("#orderAmtForm .cellPhnno").text($("#orderForm input[name='cellPhnno']").val());
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderAmtForm .sexGb").text($("#orderForm input[name='sexGb']").val());
|
|
|
|
|
+ $("#orderAmtForm .birthYmd").text($("#orderForm input[name='birthYmd']").val());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 1.2 배송정보로드
|
|
|
|
|
+ deliveryAddrInfoSet(jsonObj, true);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.2 배송정보로드
|
|
|
|
|
+var deliveryAddrInfoSet = function(delvObj, temp) {
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.29 AJAX 로드를 위한 변수 설정
|
|
|
|
|
+ delvObj.foreignBuyYn = foreignBuyYn;
|
|
|
|
|
+ delvObj.orderMadeYn = orderMadeYn;
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/deliveryAddrInfo',
|
|
|
|
|
+ data : JSON.stringify(delvObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ $("#deliveryAddrInfo").css("display", "block");
|
|
|
|
|
+ $("#deliveryAddrInfo").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.05.16 배송정보가 있으면 노출
|
|
|
|
|
+ if ($("#orderForm input[name='recipZipcode']").val() != "00000") {
|
|
|
|
|
+ $("#orderForm .area_receiveinfo.exist").show();
|
|
|
|
|
+ $("#orderForm .area_receiveinfo.none").hide();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#orderForm .area_receiveinfo.exist").hide();
|
|
|
|
|
+ $("#orderForm .area_receiveinfo.none").show();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 배송정보설정
|
|
|
|
|
+ $("#orderAmtForm .recipNm").text($("#orderForm input[name='recipNm']").val());
|
|
|
|
|
+ $("#orderAmtForm .recipPhnno").text($("#orderForm input[name='recipPhnno']").val());
|
|
|
|
|
+ $("#orderAmtForm .recipZipcode").text($("#orderForm input[name='recipZipcode']").val());
|
|
|
|
|
+ $("#orderAmtForm .recipBaseAddr").text($("#orderForm input[name='recipBaseAddr']").val());
|
|
|
|
|
+ $("#orderAmtForm .recipDtlAddr").text($("#orderForm input[name='recipDtlAddr']").val());
|
|
|
|
|
+ $("#orderAmtForm .delvMemo").text($("#orderForm input[name='delvMemo']").val());
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 버튼기능구현
|
|
|
|
|
+ // 2.1 회원 배송지변경 팝업열기
|
|
|
|
|
+ $('#orderForm .btn_adrsChange_pop').on("click", function(){
|
|
|
|
|
+ // 회원인경우
|
|
|
|
|
+ if (isLogin == true) {
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/common/delvAddrChangePop',
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ $("#adrsChangePop .modal-dialog .modal-content").html(result);
|
|
|
|
|
+ $("#adrsChangePop").modal("show");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ // 비회원인경우
|
|
|
|
|
+ else {
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/common/delvAddrAddPop',
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ $("#adrsAddPop .modal-dialog .modal-content").html(result);
|
|
|
|
|
+ $("#adrsAddPop").modal("show");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2.2 배송요청사항 팝업열기
|
|
|
|
|
+ $("#btn_rqstModify_pop").on("click", function(e){
|
|
|
|
|
+ var jsonObj = new Object();
|
|
|
|
|
+ jsonObj.delvMemo = $("#orderForm input[name=delvMemo]").val();
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : "/common/delvMemoChangePop",
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : "html",
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ $("#rqstModifyPop .modal-dialog .modal-content").html(result);
|
|
|
|
|
+ $("#rqstModifyPop").modal("show");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.07.06 값이 있으면 체크박스 활성화
|
|
|
|
|
+ if ($("#orderForm input[name=entryNo]").val() != "") {
|
|
|
|
|
+ if ($("#orderForm #chk-overs-agr").is(":checked") == false) {
|
|
|
|
|
+ $("#orderForm #chk-overs-agr").trigger("click");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 1.3 총알배송가능 지역, 총알배송 가능 시간 체크(초기로드정보)
|
|
|
|
|
+ fnGetDailyDeliveryCheck(temp);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.3 총알배송가능 지역, 총알배송 가능 시간 체크
|
|
|
|
|
+var fnGetDailyDeliveryCheck = function (temp) {
|
|
|
|
|
+
|
|
|
|
|
+ jsonData = JSON.stringify(jsonObj);
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니 총알배송 사용여부 체크 N
|
|
|
|
|
+ if (shotDelvUseYn == "N") {
|
|
|
|
|
+ // 초기에 한번 데이타 로드
|
|
|
|
|
+ if (temp) {
|
|
|
|
|
+ // 1.4 주문상품목록로드
|
|
|
|
|
+ orderListInfoSet(jsonData, temp);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 배송지 우편번호 체크
|
|
|
|
|
+ var zipcode = $("#orderForm input[name='recipZipcode']").val();
|
|
|
|
|
+
|
|
|
|
|
+ // 총알배송여부 체크 배송지정보 존재여부 체크
|
|
|
|
|
+ if (zipcode == null || zipcode == '') {
|
|
|
|
|
+ //alert("배송지정보가 없습니다. 기본 총알배송 가능지역으로 설정 합니다.");
|
|
|
|
|
+ zipcode = "04320"; // 기본 서울역 우편번호로 설정
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var shotDelvObj = {"recipZipcode" : zipcode};
|
|
|
|
|
+
|
|
|
|
|
+ gagajf.ajaxJsonSubmit(
|
|
|
|
|
+ "/order/getDailyDeliveryCheck"
|
|
|
|
|
+ , JSON.stringify(shotDelvObj)
|
|
|
|
|
+ , function (result) {
|
|
|
|
|
+ // 총알배송여부체크
|
|
|
|
|
+ var tempShotDelvYn = "N";
|
|
|
|
|
+ if (parseInt(result) > 0) {
|
|
|
|
|
+ tempShotDelvYn = "Y";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // json 값 설정
|
|
|
|
|
+ var orderListObj = {
|
|
|
|
|
+ "cartSqArr" : cartSqArr
|
|
|
|
|
+ , "shotDelvYn" : tempShotDelvYn
|
|
|
|
|
+ , "cartGoodsList" : cartGoodsList
|
|
|
|
|
+ };
|
|
|
|
|
+ var orderListJsonData = JSON.stringify(orderListObj);
|
|
|
|
|
+
|
|
|
|
|
+ if (temp) {
|
|
|
|
|
+ // 1.3 주문상품목록로드
|
|
|
|
|
+ orderListInfoSet(orderListJsonData, temp);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (tempShotDelvYn != shotDelvYn) {
|
|
|
|
|
+ orderListInfoSet(orderListJsonData, temp);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ shotDelvYn = tempShotDelvYn;
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.4 주문상품목록로드
|
|
|
|
|
+var orderListInfoSet = function(orderListJsonData, temp) {
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/orderListInfo',
|
|
|
|
|
+ data : orderListJsonData,
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ $("#orderListInfo").css("display", "block");
|
|
|
|
|
+ $("#orderListInfo").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ $("#delvFeeCdCnt").text($("#orderForm input[name=delvFeeCdCnt]").val());
|
|
|
|
|
+ $("#shotCnt").text($("#orderForm input[name=shotCnt]").val());
|
|
|
|
|
+ $("#wmsCnt").text($("#orderForm input[name=wmsCnt]").val());
|
|
|
|
|
+
|
|
|
|
|
+ // 총알배송건수가 있으면 총알배송 태그 표시
|
|
|
|
|
+ if (parseInt($("#orderForm input[name=shotCnt]").val()) > 0 ) {
|
|
|
|
|
+ $("#orderForm .shotDelv").show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#orderForm .shotDelv").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 1.5 사은품정보로드
|
|
|
|
|
+ if (temp) {
|
|
|
|
|
+ freegiftInfoSet();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.5 사은품정보로드
|
|
|
|
|
+var freegiftInfoSet = function() {
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/freegiftInfo',
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ $("#freegiftInfo").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ var total_gift = 0;
|
|
|
|
|
+ var total_deduct = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 2.2 사은품선택 라디오 버튼 기능
|
|
|
|
|
+ $("#orderForm .freegiftRdo").on("click", function() {
|
|
|
|
|
+ total_gift = 0;
|
|
|
|
|
+ total_deduct = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.14 사은품 사용 포인트가 보유포인트보다 작아야 한다.
|
|
|
|
|
+ var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
|
|
|
|
|
+ var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
|
|
|
|
|
+ var usepoint = parseInt($(this).attr("usepoint"));
|
|
|
|
|
+ rmPntAmt = rmPntAmt - freegiftUsePnt - usepoint;
|
|
|
|
|
+
|
|
|
|
|
+ if (rmPntAmt < 0) {
|
|
|
|
|
+ mcxDialog.alert("보유포인트가 부족합니다.");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderForm .freegiftRdo").each(function(){
|
|
|
|
|
+ if ($(this).attr("allYn") == "Y" ) {
|
|
|
|
|
+ total_gift += 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 라디오버튼 사은품 체크
|
|
|
|
|
+ if ($(this).is(":checked")) {
|
|
|
|
|
+ // 수령거부가 아닐때 체크
|
|
|
|
|
+ if ($(this).val() != "noSel") {
|
|
|
|
|
+ total_gift += 1;
|
|
|
|
|
+ total_deduct += parseInt($(this).attr("usepoint"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderForm .total_gift").text(total_gift); // 사은품총선택개수
|
|
|
|
|
+ $("#orderForm .total_deduct").text(total_deduct.addComma()); // 사은품총사용포인트
|
|
|
|
|
+ $("#orderAmtForm .freegiftUsePnt").text(total_deduct);
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.29 사은품기능 리셋
|
|
|
|
|
+ var pntDcAmt = parseInt($("#orderAmtForm .pntDcSumAmt").text());
|
|
|
|
|
+ if (pntDcAmt > 0) {
|
|
|
|
|
+ mcxDialog.alert("적용된 할인/혜택이 초기화 됩니다.");
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.05.07 금액계산실행
|
|
|
|
|
+ custCpnSumAmtCal();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.07.05 선택사은품 무료가 2개일때 첫번째 무료만 선택
|
|
|
|
|
+ var countArr = [];
|
|
|
|
|
+ var temp = true;
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.29 무료사은품 기본선택
|
|
|
|
|
+ $("#orderForm .gift_box .freegiftRdo").each(function(){
|
|
|
|
|
+ var usepoint = parseInt($(this).attr("usepoint"));
|
|
|
|
|
+ var count = parseInt($(this).attr("count"));
|
|
|
|
|
+
|
|
|
|
|
+ temp = true;
|
|
|
|
|
+
|
|
|
|
|
+ // 첫번째 무료 선택
|
|
|
|
|
+ if (usepoint == 0 && count != 100) {
|
|
|
|
|
+ for (i=0 ; i<countArr.length ; i++) {
|
|
|
|
|
+ if (count == countArr[i]) {
|
|
|
|
|
+ temp = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (temp) {
|
|
|
|
|
+ countArr.push(count);
|
|
|
|
|
+ $(this).trigger("click");
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.14 사은품 사용 포인트가 보유포인트보다 작아야 한다.
|
|
|
|
|
+ var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
|
|
|
|
|
+ var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
|
|
|
|
|
+ var usepoint = parseInt($(this).attr("usepoint"));
|
|
|
|
|
+ rmPntAmt = rmPntAmt - freegiftUsePnt - usepoint;
|
|
|
|
|
+
|
|
|
|
|
+ if (rmPntAmt < 0) {
|
|
|
|
|
+ mcxDialog.alert("보유포인트가 부족합니다.");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.06.11 사은품 초기화 작업
|
|
|
|
|
+ total_gift = 0;
|
|
|
|
|
+ $("#orderForm .freegiftRdo").each(function(){
|
|
|
|
|
+ if ($(this).attr("allYn") == "Y" ) {
|
|
|
|
|
+ total_gift += 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 라디오버튼 사은품 체크
|
|
|
|
|
+ if ($(this).is(":checked")) {
|
|
|
|
|
+ // 수령거부가 아닐때 체크
|
|
|
|
|
+ if ($(this).val() != "noSel") {
|
|
|
|
|
+ total_gift += 1;
|
|
|
|
|
+ total_deduct += parseInt($(this).attr("usepoint"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderForm .total_gift").text(total_gift); // 사은품총선택개수
|
|
|
|
|
+ $("#orderForm .total_deduct").text(total_deduct.addComma()); // 사은품총사용포인트
|
|
|
|
|
+ $("#orderAmtForm .freegiftUsePnt").text(total_deduct);
|
|
|
|
|
+
|
|
|
|
|
+ // 포인트초기화기능
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.29 사은품동의 체크 기능
|
|
|
|
|
+ /*
|
|
|
|
|
+ $("#orderForm #chk-agree_gift").on("click", function(){
|
|
|
|
|
+ if ($(this).is(":checked") == false) {
|
|
|
|
|
+ mcxDialog.alert("미동의시 사은품 지급이 되지 않습니다.");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ */
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 1.6 결제타입로드
|
|
|
|
|
+ paymentInfoSet();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.6 결제타입로드 (결제버튼기능구현)
|
|
|
|
|
+var paymentInfoSet = function() {
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/paymentInfo',
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ $("#paymentInfo").css("display", "block");
|
|
|
|
|
+ $("#paymentInfo").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ var payType = "";
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.07.05 결제타입초기값 체크
|
|
|
|
|
+ if ($(".payTypeNm").text() != "선택없음") {
|
|
|
|
|
+ if ($("#chk-agree_paymethod").is(":checked") == false) {
|
|
|
|
|
+ $("#chk-agree_paymethod").trigger("click");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 결제타입명칭 설정
|
|
|
|
|
+ $("#orderForm .area_paymethod .paymethod_box ul li").on("click", function(){
|
|
|
|
|
+ payType = $(this).find(".payType").text();
|
|
|
|
|
+ if ($(this).find("input[name=rdi-paynormal]").is(":checked")) {
|
|
|
|
|
+ $("#orderForm .payTypeNm").text(payType);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.29 수정
|
|
|
|
|
+ if ($("#orderForm input[name=insuranceYn]").is(":checked")) {
|
|
|
|
|
+ $("#orderForm input[name=insuranceYn]").trigger("click");
|
|
|
|
|
+ }
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .agree1").hide();
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.25 실시간계좌이체, 무통장입금시 보증보험 신청 약관 노출
|
|
|
|
|
+ if (payType == "실시간계좌이체" || payType == "무통장입금" ) {
|
|
|
|
|
+ $("#orderForm .area_paymethod .agree_insurance").show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#orderForm .area_paymethod .agree_insurance").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (delvCnt > 0) {
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .paymentinfo.agree2").show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .paymentinfo.agree2").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.25 실시간계좌이체, 무통장입금시 보증보험 신청 약관 노출
|
|
|
|
|
+ // 2021.05.16 동의박스체크시노출
|
|
|
|
|
+ $("#orderForm input[name=insuranceYn]").on("click", function(){
|
|
|
|
|
+ var displayTemp = true;
|
|
|
|
|
+ if (payType == "실시간계좌이체" || payType == "무통장입금" ) {
|
|
|
|
|
+ if ($(this).is(":checked")) {
|
|
|
|
|
+ $("#orderForm .area_paymethod .agree_insurance").show();
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .paymentinfo").show();
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .agree1").show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ displayTemp = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ displayTemp = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (displayTemp == false) {
|
|
|
|
|
+ if (delvCnt > 0) {
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .paymentinfo.agree2").show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .paymentinfo.agree2").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .agree1").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (delvCnt > 0) {
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .paymentinfo.agree2").show();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .paymentinfo.agree2").hide();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.05.16 초기값설정
|
|
|
|
|
+ $("#orderForm .area_paymentinfo .agree1").hide();
|
|
|
|
|
+
|
|
|
|
|
+ // 결제하기
|
|
|
|
|
+ $("#btn_payment").on("click", function(){
|
|
|
|
|
+ // 사은품정보
|
|
|
|
|
+ var prePntDcAmtYn = $("#orderForm input[name='rdi-beforpoint']:checked").val();
|
|
|
|
|
+ var paynormal = $("#orderForm input[name='rdi-paynormal']:checked").val();
|
|
|
|
|
+ var orderDetailList = [];
|
|
|
|
|
+ var delvFeeCdList = [];
|
|
|
|
|
+ var ordGoodsQty = 0;
|
|
|
|
|
+ var goodsNm = "";
|
|
|
|
|
+ var orgEntryNo = "";
|
|
|
|
|
+ var entryNo = "";
|
|
|
|
|
+ var insuranceYn = "N";
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.25
|
|
|
|
|
+ if ($("#orderForm input[name=insuranceYn]").is(":checked")) {
|
|
|
|
|
+ insuranceYn = "Y";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 배송주소등록
|
|
|
|
|
+ if ($("#orderAmtForm .recipZipcode").text() == "00000") {
|
|
|
|
|
+ mcxDialog.alert("배송정보를 등록해 주세요.");
|
|
|
|
|
+ // 배송정보화면노출
|
|
|
|
|
+ deliveryAddrInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // TODO 개인통관번호 동의 체크시 통관번호 등록
|
|
|
|
|
+ if (foreignBuyYn == "Y") {
|
|
|
|
|
+ if ($("#orderForm input[name=rdi-overseas]:checked").val() == "Y") {
|
|
|
|
|
+ if (gagajf.isNull($("#orderForm input[name=entryNo]").val())) {
|
|
|
|
|
+ mcxDialog.alert("개인통관고유부호를 입력해주세요.");
|
|
|
|
|
+ $('#orderForm input[name=entryNo]').focus();
|
|
|
|
|
+
|
|
|
|
|
+ // 배송정보화면노출
|
|
|
|
|
+ deliveryAddrInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ orgEntryNo = $("#orderForm input[name=entryNo]").val();
|
|
|
|
|
+
|
|
|
|
|
+ if (orgEntryNo.substr(0,1) != "P") {
|
|
|
|
|
+ mcxDialog.alert("개인통관고유부호가 유효하지 않습니다.");
|
|
|
|
|
+ $('#orderForm input[name=entryNo]').focus();
|
|
|
|
|
+
|
|
|
|
|
+ // 배송정보화면노출
|
|
|
|
|
+ deliveryAddrInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (orgEntryNo.length < 13) {
|
|
|
|
|
+ mcxDialog.alert("개인통관고유부호가 유효하지 않습니다.");
|
|
|
|
|
+ $('#orderForm input[name=entryNo]').focus();
|
|
|
|
|
+
|
|
|
|
|
+ // 배송정보화면노출
|
|
|
|
|
+ deliveryAddrInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!$("#orderForm #chk-overs-agr").is(":checked")) {
|
|
|
|
|
+ mcxDialog.alert("개인통관정보고유부호 정보 동의/저장항목을 체크해주세요.");
|
|
|
|
|
+
|
|
|
|
|
+ // 배송정보화면노출
|
|
|
|
|
+ deliveryAddrInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 주문제작상품일때 주문제작정보동의
|
|
|
|
|
+ if (orderMadeYn == "Y") {
|
|
|
|
|
+ if (!$("#orderForm #chk-custom-agr1").is(":checked")) {
|
|
|
|
|
+ mcxDialog.alert("주문제작상품에 대한 동의를 하지 않으실 경우 해당 상품을 쇼핑백에서 제외하신 후 다시 결제를 시도해주세요.");
|
|
|
|
|
+
|
|
|
|
|
+ // 배송정보화면노출
|
|
|
|
|
+ deliveryAddrInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 사은품지급할 경우 체크 2020.04.29 사은품지급이 필수가 아닙니다.
|
|
|
|
|
+ if ($("#orderAmtForm .freegiftValArr").text().length > 0) {
|
|
|
|
|
+ if (!$("#orderForm #chk-agree_gift").is(":checked")) {
|
|
|
|
|
+ mcxDialog.alert("사은품 지급 정보 동의를 체크해주세요.");
|
|
|
|
|
+
|
|
|
|
|
+ // 배송정보화면노출
|
|
|
|
|
+ freegiftInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 결재수단
|
|
|
|
|
+ if (gagajf.isNull(paynormal)) {
|
|
|
|
|
+ mcxDialog.alert("결제수단을 선택해 주세요.");
|
|
|
|
|
+
|
|
|
|
|
+ // 결제수단정보노출
|
|
|
|
|
+ paymentInfoDispYn("Y");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var paynormalArr = paynormal.split("|");
|
|
|
|
|
+ var pgGb = paynormalArr[0];
|
|
|
|
|
+ var payMeans = paynormalArr[1];
|
|
|
|
|
+ var custPayMeans = "N";
|
|
|
|
|
+
|
|
|
|
|
+ // 자주쓰는결제타입
|
|
|
|
|
+ if ($("#orderForm #chk-agree_paymethod").is(":checked") == true) {
|
|
|
|
|
+ custPayMeans = "Y";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 주문상세데이타 생성
|
|
|
|
|
+ $("#orderDetailInfo .cartSq").each(function(){
|
|
|
|
|
+
|
|
|
|
|
+ // 주문상세단위 총알배송여부 변경
|
|
|
|
|
+ var orderDetailShotDelvYn = $(this).parent().find(".shotDelvYn").text();
|
|
|
|
|
+ if (orderDetailShotDelvYn == "Y") {
|
|
|
|
|
+ if (shotDelvYn == "N") {
|
|
|
|
|
+ orderDetailShotDelvYn = "N";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 개인통관번호
|
|
|
|
|
+ if ($(this).parent().find(".foreignBuyYn").text() == "Y") {
|
|
|
|
|
+ entryNo = orgEntryNo;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ entryNo = "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var orderDetailData = {
|
|
|
|
|
+ "cartSq" : $(this).text()
|
|
|
|
|
+ ,"currPrice" : $(this).parent().find(".orgCurrPrice").text()
|
|
|
|
|
+ ,"optAddPrice" : $(this).parent().find(".optAddPrice").text()
|
|
|
|
|
+ ,"ordAmt" : $(this).parent().find(".ordAmt").text()
|
|
|
|
|
+ ,"cpn1CpnSq" : $(this).parent().find(".cpn1CpnSq").text()
|
|
|
|
|
+ ,"cpn1DcAmt" : $(this).parent().find(".cpn1DcAmt").text()
|
|
|
|
|
+ ,"goodsQty" : $(this).parent().find(".goodsQty").text()
|
|
|
|
|
+ ,"tmtb1Sq" : $(this).parent().find(".tmtb1Sq").text()
|
|
|
|
|
+ ,"tmtb1DcAmt" : $(this).parent().find(".tmtb1DcAmt").text()
|
|
|
|
|
+ ,"tmtb2Sq" : $(this).parent().find(".tmtb2Sq").text()
|
|
|
|
|
+ ,"tmtb2DcAmt" : $(this).parent().find(".tmtb2DcAmt").text()
|
|
|
|
|
+ ,"goodsCpnSq" : $(this).parent().find(".goodsCpnSq").text()
|
|
|
|
|
+ ,"goodsCpnDcAmt" : $(this).parent().find(".goodsCpnDcAmt").text()
|
|
|
|
|
+ ,"cartCpnSq" : $(this).parent().find(".cartCpnSq").text()
|
|
|
|
|
+ ,"cartCpnDcAmt" : $(this).parent().find(".cartCpnDcAmt").text()
|
|
|
|
|
+ ,"prePntDcAmt" : $(this).parent().find(".prePntDcAmt1").text()
|
|
|
|
|
+ ,"pntDcAmt" : $(this).parent().find(".pntDcAmt1").text()
|
|
|
|
|
+ ,"gfcdUseAmt" : $(this).parent().find(".gfcdUseAmt1").text()
|
|
|
|
|
+ ,"realOrdAmt" : $(this).parent().find(".realOrdAmt1").text()
|
|
|
|
|
+ ,"savePntAmt" : $(this).parent().find(".savePntAmt1").text()
|
|
|
|
|
+ ,"shotDelvYn" : orderDetailShotDelvYn
|
|
|
|
|
+ ,"foreignBuyYn" : $(this).parent().find(".foreignBuyYn").text()
|
|
|
|
|
+ ,"makeGoodsYn" : $(this).parent().find(".orderMadeYn").text()
|
|
|
|
|
+ ,"delvFeeCd" : $(this).parent().find(".delvFeeCd").text()
|
|
|
|
|
+ ,"goodsCd" : $(this).parent().find(".goodsCd").text()
|
|
|
|
|
+ ,"itemCdArr" : $(this).parent().find(".itemCd").text().split(",")
|
|
|
|
|
+ ,"optCdArr" : $(this).parent().find(".optCd").text().split(",")
|
|
|
|
|
+ ,"optCd1Arr" : $(this).parent().find(".optCd1").text().split(",")
|
|
|
|
|
+ ,"optCd2Arr" : $(this).parent().find(".optCd2").text().split(",")
|
|
|
|
|
+ ,"itemQtyArr" : $(this).parent().find(".itemQtyr").text().split(",")
|
|
|
|
|
+ ,"goodsType" : $(this).parent().find(".goodsType").text()
|
|
|
|
|
+ ,"entryNo" : entryNo
|
|
|
|
|
+ ,"giftPackYn" : "N"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 상품수
|
|
|
|
|
+ ordGoodsQty++;
|
|
|
|
|
+
|
|
|
|
|
+ orderDetailList.push(orderDetailData);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 주문배송업체정보 생성
|
|
|
|
|
+ $("#delvFeeCdInfo .delvFeeCd").each(function(){
|
|
|
|
|
+ var delvFeeCdData = {
|
|
|
|
|
+ "delvFeeCd" : $(this).text()
|
|
|
|
|
+ ,"supplyCompCd" : $(this).parent().find(".supplyCompCd").text()
|
|
|
|
|
+ ,"delvFee" : $(this).parent().find(".delvFee").text()
|
|
|
|
|
+ ,"delvCpnSq" : $(this).parent().find(".delvCpnSq").text()
|
|
|
|
|
+ ,"delvCpnDcAmt" : $(this).parent().find(".delvCpnDcAmt").text()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ delvFeeCdList.push(delvFeeCdData);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.29 상픈품 체크박스 미동의시 사은품 미지급
|
|
|
|
|
+ var freegiftValArr = $("#orderAmtForm .freegiftValArr").text().split(",");
|
|
|
|
|
+ var freegiftSqArr = $("#orderAmtForm .freegiftSqArr").text().split(",");
|
|
|
|
|
+ var freegiftGoodsArr = $("#orderAmtForm .freegiftGoodsArr").text().split(",");
|
|
|
|
|
+ var freegiftUsePointArr = $("#orderAmtForm .freegiftUsePointArr").text().split(",");
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ if (!$("#orderForm #chk-agree_gift").is(":checked") == false) {
|
|
|
|
|
+ freegiftValArr = "";
|
|
|
|
|
+ freegiftSqArr = "";
|
|
|
|
|
+ freegiftGoodsArr = "";
|
|
|
|
|
+ freegiftUsePointArr = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.07.15 상품권 100% 결제시
|
|
|
|
|
+ if (parseInt($("#orderAmtForm .realOrdSumAmt").text()) < 1) {
|
|
|
|
|
+ pgGb = "KCP";
|
|
|
|
|
+ payMeans = "G014_70";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 주문데이타 생성
|
|
|
|
|
+ var orderData = {
|
|
|
|
|
+ "custNm" : $("#orderAmtForm .custNm").text()
|
|
|
|
|
+ ,"email" : $("#orderAmtForm .email").text()
|
|
|
|
|
+ ,"recipNm" : $("#orderAmtForm .recipNm").text()
|
|
|
|
|
+ ,"recipPhnno" : $("#orderAmtForm .recipPhnno").text()
|
|
|
|
|
+ ,"recipZipcode" : $("#orderAmtForm .recipZipcode").text()
|
|
|
|
|
+ ,"recipBaseAddr" : $("#orderAmtForm .recipBaseAddr").text()
|
|
|
|
|
+ ,"recipDtlAddr" : $("#orderAmtForm .recipDtlAddr").text()
|
|
|
|
|
+ ,"delvMemo" : $("#orderAmtForm .delvMemo").text()
|
|
|
|
|
+ ,"insuranceYn" : insuranceYn
|
|
|
|
|
+ ,"sexGb" : $("#orderAmtForm .sexGb").text()
|
|
|
|
|
+ ,"birthYmd" : $("#orderAmtForm .birthYmd").text()
|
|
|
|
|
+ ,"prePntDcAmtYn" : prePntDcAmtYn
|
|
|
|
|
+ ,"orderDetailList" : orderDetailList
|
|
|
|
|
+ ,"delvFeeCdList" : delvFeeCdList
|
|
|
|
|
+ ,"shotDelvYn" : shotDelvYn
|
|
|
|
|
+ ,"entryNo" : entryNo
|
|
|
|
|
+ ,"pgGb" : pgGb
|
|
|
|
|
+ ,"payMeans" : payMeans // 네이버페이, 카카오페이
|
|
|
|
|
+ ,"payAmt" : $("#orderAmtForm .realOrdSumAmt").text()
|
|
|
|
|
+ ,"ordNm" : $("#orderAmtForm .custNm").text()
|
|
|
|
|
+ ,"ordPhnno" : $("#orderAmtForm .cellPhnno").text()
|
|
|
|
|
+ ,"goodsNm" : $("#orderAmtForm .goodsNm").eq(0).text()
|
|
|
|
|
+ ,"ordGoodsQty" : ordGoodsQty
|
|
|
|
|
+ ,"freegiftValArr" : freegiftValArr
|
|
|
|
|
+ ,"freegiftSqArr" : freegiftSqArr
|
|
|
|
|
+ ,"freegiftGoodsArr" : freegiftGoodsArr
|
|
|
|
|
+ ,"freegiftUsePointArr" : freegiftUsePointArr
|
|
|
|
|
+ ,"giftMsg" : ""
|
|
|
|
|
+ ,"custPayMeans" : custPayMeans
|
|
|
|
|
+ ,"cartSqArr" : cartSqArr
|
|
|
|
|
+ ,"orgGoodsSumAmt" : $("#orderAmtForm .orgGoodsSumAmt").text()
|
|
|
|
|
+ ,"cpn1DcSumAmt" : $("#orderAmtForm .cpn1DcSumAmt").text()
|
|
|
|
|
+ ,"tmtb1DcSumAmt" : $("#orderAmtForm .tmtb1DcSumAmt").text()
|
|
|
|
|
+ ,"tmtb2DcSumAmt" : $("#orderAmtForm .tmtb2DcSumAmt").text()
|
|
|
|
|
+ ,"goodsCpnDcSumAmt" : $("#orderAmtForm .goodsCpnDcSumAmt").text()
|
|
|
|
|
+ ,"cartCpnDcSumAmt" : $("#orderAmtForm .cartCpnDcSumAmt").text()
|
|
|
|
|
+ ,"prePntDcSumAmt" : $("#orderAmtForm .prePntDcSumAmt").text()
|
|
|
|
|
+ ,"pntDcSumAmt" : $("#orderAmtForm .pntDcSumAmt").text()
|
|
|
|
|
+ ,"gfcdUseSumAmt" : $("#orderAmtForm .gfcdUseSumAmt").text()
|
|
|
|
|
+ ,"realOrdSumAmt" : $("#orderAmtForm .realOrdSumAmt").text()
|
|
|
|
|
+ ,"delvSumAmt" : $("#orderAmtForm .delvSumAmt").text()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/create/preOrder',
|
|
|
|
|
+ data : JSON.stringify(orderData),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ // 결재정보로드
|
|
|
|
|
+ $("#order_info").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ var pgGb = $("#order_info input[name=pgGb]").val();
|
|
|
|
|
+
|
|
|
|
|
+ if (pgGb == "NAVER") {
|
|
|
|
|
+ fnNaverPaymentReady();
|
|
|
|
|
+ } else if (pgGb == "KAKAO") {
|
|
|
|
|
+ fnKakaoPaymentReady();
|
|
|
|
|
+ } else if (pgGb == "KCP" || pgGb == "PAYCO") {
|
|
|
|
|
+ if(payMeans == "G014_70") {
|
|
|
|
|
+ $("#order_info input[name=tran_cd]").val("ISTYLE");
|
|
|
|
|
+ $("#order_info input[name=pgTid]").val("ISTYLE");
|
|
|
|
|
+ $("#order_info").submit();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ jsf__pay(document.order_info);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 2021.07.15 상품권 100% 결제
|
|
|
|
|
+ else if (pgGb == "ISTYLE") {
|
|
|
|
|
+ $("#order_info input[name=tran_cd]").val("ISTYLE");
|
|
|
|
|
+ $("#order_info input[name=pgTid]").val("ISTYLE");
|
|
|
|
|
+ $("#order_info").submit();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8 할인영역 설정 (로그인여부일때 동작)
|
|
|
|
|
+ if (isLogin == true) {
|
|
|
|
|
+ dcAmtInfoSet();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 금액계산초기화
|
|
|
|
|
+ custCpnSumAmtCal();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.7 프로모션 쿠폰 적용 함수
|
|
|
|
|
+var serialCpnApply = function(){
|
|
|
|
|
+
|
|
|
|
|
+ if (gagajf.isNull($("#serialCpnNm").val())) {
|
|
|
|
|
+ mcxDialog.alert("할인코드를 입력해주세요.");
|
|
|
|
|
+ $('#serialCpnNm').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ rdCpnNm : $("#serialCpnNm").val()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/cart/list/serialCpnApply',
|
|
|
|
|
+ contentType : 'application/json',
|
|
|
|
|
+ dataType : 'json',
|
|
|
|
|
+ data : JSON.stringify(data),
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ // 프로모션쿠폰적용 후 할인영역 노출
|
|
|
|
|
+ jsonObj.dispYn = "Y";
|
|
|
|
|
+
|
|
|
|
|
+ // 성공일때는 쿠폰정보 및 포인트 정보 reset
|
|
|
|
|
+ if (result.serialCpnInfo.result == "SUCCESS") {
|
|
|
|
|
+ mcxDialog.alert("쿠폰 등록이 되었습니다.");
|
|
|
|
|
+ // 1.8 할인영역 재로드
|
|
|
|
|
+ dcAmtInfoSet(jsonData);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ mcxDialog.alert(result.serialCpnInfo.result);
|
|
|
|
|
+ $("#serialCpnNm").val("");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.8 할인영역 설정 (쿠폰, 선포인트, 포인트, 상품권)
|
|
|
|
|
+var dcAmtInfoSet = function() {
|
|
|
|
|
+ // 1.8.1 할인정보로드
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/dcAmtInfo',
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ $("#dcAmtInfo").css("display", "block");
|
|
|
|
|
+ $("#dcAmtInfo").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰팝업정보로드
|
|
|
|
|
+ $.ajax( {
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ url : '/order/couponApplyPop',
|
|
|
|
|
+ data : JSON.stringify(jsonObj),
|
|
|
|
|
+ dataType : 'html',
|
|
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ $("#couponModifyPop").html(result);
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8.1 선포인트기능초기화
|
|
|
|
|
+ prePntDcAmtReset();
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8.2 쿠폰적용초기화(할인율최고)(상품,장바구니)
|
|
|
|
|
+ custGoodsCpnInit();
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8.3 쿠폰적용초기화(할인율최고)(배송비)
|
|
|
|
|
+ custDelvCpnInit();
|
|
|
|
|
+
|
|
|
|
|
+ var custCpnCnt = parseInt($("#orderForm input[name=custCpnCnt]").val());
|
|
|
|
|
+ var custDelvCpnCnt = parseInt($("#orderForm input[name=custDelvCpnCnt]").val());
|
|
|
|
|
+ var applyCpnCnt = custCpnCnt + custDelvCpnCnt;
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.23 보유쿠폰이 없을때 적용
|
|
|
|
|
+ if (applyCpnCnt < 1) {
|
|
|
|
|
+ if ($("#orderForm #chk-maxdisc").is(":checked")) {
|
|
|
|
|
+ $("#orderForm #chk-maxdisc").trigger("click");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8.4 쿠폰적용버튼
|
|
|
|
|
+ $("#btn_coupon_apply").on("click", function(){
|
|
|
|
|
+
|
|
|
|
|
+ // 상품쿠폰적용
|
|
|
|
|
+ $('#couponApplyForm .goodsCpn ul li.selected').each(function(index){
|
|
|
|
|
+ custCpnApply($(this));
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니쿠폰적용
|
|
|
|
|
+ $('#couponApplyForm .cartCpn').each(function(index){
|
|
|
|
|
+ if ($(this).find("input[name=rdi-cart-coupon]").is(":checked")) {
|
|
|
|
|
+ custCpnApply($(this));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 최대할인혜택적용 체크해제
|
|
|
|
|
+ if ($("#chk-maxdisc").is(":checked")) {
|
|
|
|
|
+ $("#chk-maxdisc").attr("checked", false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(".close-modal").trigger("click"); // 팝업닫기
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8.5 쿠폰 최대할인금액 초기화 버튼 설정
|
|
|
|
|
+ $("#chk-maxdisc").on("click", function(){
|
|
|
|
|
+ // 2021.04.23 보유쿠폰이 없을때 적용
|
|
|
|
|
+ if (applyCpnCnt < 1) {
|
|
|
|
|
+ mcxDialog.alert("적용 가능한 쿠폰이 없습니다.");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($(this).is(":checked")) {
|
|
|
|
|
+ // 2021.04.23
|
|
|
|
|
+ mcxDialog.alert("선택한 쿠폰이 아닌 보유한 쿠폰을 통해 최대할인 혜택을 받을 수 있도록 쿠폰이 자동 적용됩니다.");
|
|
|
|
|
+
|
|
|
|
|
+ // 상품&장바구니쿠폰 초기화
|
|
|
|
|
+ custGoodsCpnInit();
|
|
|
|
|
+
|
|
|
|
|
+ // 배송비쿠폰 초기화
|
|
|
|
|
+ custDelvCpnInit();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰변경팝업호출
|
|
|
|
|
+ $("#btn_couponModify_pop").on("click", function(){
|
|
|
|
|
+ // 2021.04.23 보유쿠폰이 없을때 적용
|
|
|
|
|
+ var custCpnCnt = parseInt($("#orderForm input[name=custCpnCnt]").val());
|
|
|
|
|
+ if (custCpnCnt < 1) {
|
|
|
|
|
+ mcxDialog.alert("적용 가능한 쿠폰이 없습니다.");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰초기화
|
|
|
|
|
+ custGoodsCpnInit();
|
|
|
|
|
+
|
|
|
|
|
+ $("#couponModifyPop").modal("show");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8.7 포인트 적용버튼 기능
|
|
|
|
|
+ $("#btn_point_apply").on("click", function(){
|
|
|
|
|
+ var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
|
|
|
|
|
+ var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
|
|
|
|
|
+ var pntDcAmt = parseInt(uncomma($("#orderForm input[name='pntDcAmtStr']").val()));
|
|
|
|
|
+ var realOrdAmt = parseInt($("#orderAmtForm .realOrdSumAmt").text());
|
|
|
|
|
+ var pointUseMaxLimit = parseInt($("#orderForm input[name='pointUseMaxLimit']").val());
|
|
|
|
|
+ var applyPntDcAmt = (realOrdAmt * pointUseMaxLimit) / 100;
|
|
|
|
|
+
|
|
|
|
|
+ rmPntAmt = rmPntAmt - freegiftUsePnt;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (gagajf.isNull($("#orderForm input[name=pntDcAmtStr]").val())) {
|
|
|
|
|
+ mcxDialog.alert("포인트를 입력한 후 다시 시도해주세요.");
|
|
|
|
|
+ $('#orderForm input[name=pntDcAmtStr]').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 입력여부체크
|
|
|
|
|
+ if (pntDcAmt < 1) {
|
|
|
|
|
+ mcxDialog.alert("포인트를 입력한 후 다시 시도해주세요.");
|
|
|
|
|
+ // 포인트리셋기능
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 10원단위부터 입력가능
|
|
|
|
|
+ if (pntDcAmt % 10 > 0) {
|
|
|
|
|
+ mcxDialog.alert("포인트는 10P단위로 사용이 가능합니다.");
|
|
|
|
|
+ // 포인트리셋기능
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 결제금액을 초과 할 수 없습니다.
|
|
|
|
|
+ if (pntDcAmt > realOrdAmt) {
|
|
|
|
|
+ mcxDialog.alert("입력한 포인트가 결제 금액보다 많습니다.");
|
|
|
|
|
+ // 포인트리셋기능
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 보유포인트보다 초과 사용 불가
|
|
|
|
|
+ if (pntDcAmt > rmPntAmt) {
|
|
|
|
|
+ mcxDialog.alert("입력한 포인트가 보유한 포인트보다 많습니다.");
|
|
|
|
|
+ // 포인트리셋기능
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // TODO 포인트 사용금액 1000P 이상 사용
|
|
|
|
|
+ if (pntDcAmt < 1000) {
|
|
|
|
|
+ mcxDialog.alert("포인트는 최소 1,000P이상 사용해야 합니다.");
|
|
|
|
|
+ // 포인트리셋기능
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 실결제금액보다 크게 적용 되었을때 적용 불가능
|
|
|
|
|
+ if (pntDcAmt > applyPntDcAmt) {
|
|
|
|
|
+ mcxDialog.alert("결제금액의 최대 " + pointUseMaxLimit +"%를 초과 사용 할 수 없습니다.");
|
|
|
|
|
+ // 포인트리셋기능
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.23 추가
|
|
|
|
|
+ mcxDialog.alert("총 " + pntDcAmt + " P를 차감 결제 합니다.");
|
|
|
|
|
+
|
|
|
|
|
+ // 포인트 적용
|
|
|
|
|
+ $("#orderAmtForm .pntDcSumAmt").text(pntDcAmt);
|
|
|
|
|
+ $("#pntDcAmt").text(getZeroMinusDelAmt(pntDcAmt)+" 원");
|
|
|
|
|
+
|
|
|
|
|
+ // 상품권리렛기능
|
|
|
|
|
+ gfcdUseAmtReset();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 1.8.8 상품권 적용버튼 기능
|
|
|
|
|
+ $("#btn_gfcd_apply").on("click", function(){
|
|
|
|
|
+ var rmGfcdAmt = parseInt($("#orderForm input[name='rmGfcdAmt']").val());
|
|
|
|
|
+ var gfcdUseAmt = parseInt(uncomma($("#orderForm input[name='gfcdUseAmtStr']").val()));
|
|
|
|
|
+ var realOrdAmt = parseInt($("#orderAmtForm .realOrdSumAmt").text());
|
|
|
|
|
+
|
|
|
|
|
+ if (gagajf.isNull($("#orderForm input[name=gfcdUseAmtStr]").val())) {
|
|
|
|
|
+ mcxDialog.alert("금액을 입력한 후 다시 시도해주세요.");
|
|
|
|
|
+ $('#orderForm input[name=gfcdUseAmtStr]').focus();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 입력여부체크
|
|
|
|
|
+ if (gfcdUseAmt < 1 || $("#orderForm input[name='gfcdUseAmtStr']").val() == "") {
|
|
|
|
|
+ mcxDialog.alert("금액을 입력한 후 다시 시도해주세요.");
|
|
|
|
|
+ // 상품권리셋기능
|
|
|
|
|
+ gfcdUseAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 결제금액을 초과 할 수 없습니다.
|
|
|
|
|
+ if (gfcdUseAmt > realOrdAmt) {
|
|
|
|
|
+ mcxDialog.alert("입력한 금액이 결제할 금액보다 많습니다.");
|
|
|
|
|
+ // 포인트리셋기능
|
|
|
|
|
+ gfcdUseAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 보유금액보다 초과 사용 불가
|
|
|
|
|
+ if (gfcdUseAmt > rmGfcdAmt) {
|
|
|
|
|
+ mcxDialog.alert("보유금액 보다 초과 사용 할 수 없습니다.");
|
|
|
|
|
+ // 상품권리셋기능
|
|
|
|
|
+ gfcdUseAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 보유금액보다 초과 사용 불가
|
|
|
|
|
+ if (gfcdUseAmt > rmGfcdAmt) {
|
|
|
|
|
+ mcxDialog.alert("보유금액 보다 초과 사용 할 수 없습니다.");
|
|
|
|
|
+ // 상품권리셋기능
|
|
|
|
|
+ gfcdUseAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // TODO 포인트 사용금액 1000원 이상 사용
|
|
|
|
|
+ if (gfcdUseAmt < 1000) {
|
|
|
|
|
+ mcxDialog.alert("상품권 사용금액은 최소 1,000원 이상 사용해야 합니다.");
|
|
|
|
|
+
|
|
|
|
|
+ // 상품권리셋기능
|
|
|
|
|
+ gfcdUseAmtReset();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.23 추가
|
|
|
|
|
+ mcxDialog.alert("총 " + gfcdUseAmt.addComma() + " 원을 상품권 금액에서 차감 결제 합니다.");
|
|
|
|
|
+
|
|
|
|
|
+ // 상품권 적용
|
|
|
|
|
+ $("#orderAmtForm .gfcdUseSumAmt").text(gfcdUseAmt);
|
|
|
|
|
+ $("#gfcdUseAmt").text(getZeroMinusDelAmt(gfcdUseAmt)+" 원");
|
|
|
|
|
+
|
|
|
|
|
+ // 금액전체계산
|
|
|
|
|
+ custCpnSumAmtCal();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 금액계산초기화
|
|
|
|
|
+ custCpnSumAmtCal();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.9.1 상품쿠폰초기화
|
|
|
|
|
+var custGoodsCpnInit = function() {
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰최대할인 적용
|
|
|
|
|
+ $("#chk-maxdisc").attr("checked", true);
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰초기화
|
|
|
|
|
+ $(".goodsCpn").each(function(index){
|
|
|
|
|
+ // select box 쿠폰 적용
|
|
|
|
|
+ var cpnCartSq = $(this).find("input[name='cpnCartSq']").val();
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니시퀀스 체크
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ if (cpnCartSq == $(this).text()) {
|
|
|
|
|
+ $(this).parent().find(".goodsCpnSq").text("0"); // 상품쿠폰시퀀스
|
|
|
|
|
+ $(this).parent().find(".goodsCpnDcAmt").text("0"); // 상품쿠폰할인금액
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $(this).find("input[name='custCpnSq']").val("0");
|
|
|
|
|
+ $(this).find("input[name='cpnDcAmt']").val("0");
|
|
|
|
|
+
|
|
|
|
|
+ // 적용안함 적용
|
|
|
|
|
+ var emptyHtml = $(this).find("ul li .item_coupon.empty").html();
|
|
|
|
|
+ $(this).find(".select .item_coupon").html(emptyHtml);
|
|
|
|
|
+
|
|
|
|
|
+ $(this).find("ul li").removeClass("selected");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 최대할인율 쿠폰적용
|
|
|
|
|
+ $('.goodsCpn').each(function(index){
|
|
|
|
|
+ cpnIndex = 0;
|
|
|
|
|
+ cpnApplyTemp = false;
|
|
|
|
|
+
|
|
|
|
|
+ // select 박스 반복문 실행
|
|
|
|
|
+ $(this).find("ul li").each(function(i){
|
|
|
|
|
+ cpnIndex++;
|
|
|
|
|
+ if (cpnApplyTemp == false) {
|
|
|
|
|
+ if (custCpnDuplicationCheck($(this).attr("value"), cpnIndex)) {
|
|
|
|
|
+ // 쿠폰적용
|
|
|
|
|
+ custCpnApply($(this));
|
|
|
|
|
+ // 쿠폰할인적용
|
|
|
|
|
+ cpnApplyTemp = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰 select 버튼기능
|
|
|
|
|
+ $(this).on("click", function(){
|
|
|
|
|
+ if (custCpnDuplicationCheck($(this).attr("value"), cpnIndex)) {
|
|
|
|
|
+ // 쿠폰적용
|
|
|
|
|
+ custCpnApplyTemp($(this));
|
|
|
|
|
+ // 쿠폰할인적용
|
|
|
|
|
+ cpnApplyTemp = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ custCpnNotApply($(this));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니쿠폰초기화
|
|
|
|
|
+ custCartCpnInit();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.9.2 장바구니쿠폰초기화
|
|
|
|
|
+var custCartCpnInit = function() {
|
|
|
|
|
+ // 장바구니쿠폰 초기화 적용
|
|
|
|
|
+ $(".cartCpn").each(function(index) {
|
|
|
|
|
+ if (index == 0) {
|
|
|
|
|
+ custCpnApply($(this)); // 쿠폰적용
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰 select 버튼기능
|
|
|
|
|
+ $(this).on("click", function(){
|
|
|
|
|
+ custCpnApplyTemp($(this)); // 쿠폰적용
|
|
|
|
|
+
|
|
|
|
|
+ // 최대할인혜택적용 체크해제
|
|
|
|
|
+ if ($("#chk-maxdisc").is(":checked")) {
|
|
|
|
|
+ $("#chk-maxdisc").attr("checked", false);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 포인트기능 리셋
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.9.3 배송비쿠폰초기화
|
|
|
|
|
+var custDelvCpnInit = function() {
|
|
|
|
|
+ // 배송비쿠폰 초기화 적용
|
|
|
|
|
+ $(".delvCpn").each(function(index) {
|
|
|
|
|
+ if (index == 0) {
|
|
|
|
|
+ // 쿠폰적용
|
|
|
|
|
+ custCpnApply($(this));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰 select 버튼기능
|
|
|
|
|
+ $(this).on("click", function(){
|
|
|
|
|
+ // 쿠폰적용
|
|
|
|
|
+ custCpnApply($(this));
|
|
|
|
|
+
|
|
|
|
|
+ // 최대할인혜택적용 체크해제
|
|
|
|
|
+ if ($("#chk-maxdisc").is(":checked")) {
|
|
|
|
|
+ $("#chk-maxdisc").trigger("click");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.10 쿠폰중복사용체크
|
|
|
|
|
+var custCpnDuplicationCheck = function(custCpnSq, index) {
|
|
|
|
|
+ var selCustSq = 0;
|
|
|
|
|
+ var cnt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰적용가능
|
|
|
|
|
+ if (custCpnSq == 0) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰중본사용체크
|
|
|
|
|
+ $(".goodsCpn input[name='custCpnSq']").each(function(i){
|
|
|
|
|
+ if (index != i) {
|
|
|
|
|
+ selCustSq = $(this).val();
|
|
|
|
|
+ if (selCustSq == custCpnSq) {
|
|
|
|
|
+ cnt++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰적용불가
|
|
|
|
|
+ if (cnt > 0) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 쿠폰적용가능
|
|
|
|
|
+ else {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.11.0 임시로 쿠폰적용
|
|
|
|
|
+var custCpnApplyTemp = function(obj) {
|
|
|
|
|
+ // select box 쿠폰 적용
|
|
|
|
|
+ var cpnType = obj.parent().find("input[name='cpnType']").val();
|
|
|
|
|
+
|
|
|
|
|
+ // 상품쿠폰적용
|
|
|
|
|
+ if (cpnType == "goodsCpn") {
|
|
|
|
|
+ var itemHtml = obj.find(".item_coupon").html();
|
|
|
|
|
+ obj.parent().parent().find(".select .item_coupon").html(itemHtml);
|
|
|
|
|
+ obj.parent().find("input[name='cpnDcAmt']").val(obj.attr("data"));
|
|
|
|
|
+ obj.parent().find("input[name='custCpnSq']").val(obj.attr("value"));
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니쿠폰 초기화 적용
|
|
|
|
|
+ $("#couponApplyForm .cartCpn").each(function(index) {
|
|
|
|
|
+ if (index == 0) {
|
|
|
|
|
+ custCpnApplyTemp($(this)); // 쿠폰적용
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //상품쿠폰 선택불가 처리
|
|
|
|
|
+ custCpnSqLiDisabled();
|
|
|
|
|
+ }
|
|
|
|
|
+ // 장바구니쿠폰적용
|
|
|
|
|
+ else if (cpnType == "cartCpn") {
|
|
|
|
|
+ var dcWay = obj.find("input[name='dcWay']").val();
|
|
|
|
|
+ var dcVal = obj.find("input[name='dcVal']").val();
|
|
|
|
|
+ var maxDcAmt = obj.find("input[name='maxDcAmt']").val();
|
|
|
|
|
+ var buyLimitAmt = obj.find("input[name='buyLimitAmt']").val();
|
|
|
|
|
+ var cartCpnDcSumAmt = 0;
|
|
|
|
|
+ var tempSumAmt = 0;
|
|
|
|
|
+ var cartSqLen = $(".cartSq").length;
|
|
|
|
|
+ var leftAmt = 0;
|
|
|
|
|
+ var index = 1;
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니쿠폰 해당 장바구니상품들 할인가 적용
|
|
|
|
|
+ obj.find("input[name='cartCpnCartSq']").each(function(){
|
|
|
|
|
+ var cartCpnCartSq = $(this).val();
|
|
|
|
|
+ var cartCpnDcAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니시퀀스 체크
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ if (cartCpnCartSq == $(this).text()) {
|
|
|
|
|
+ var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
|
|
|
|
|
+ var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
|
|
|
|
|
+ var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
|
|
|
|
|
+ var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
|
|
|
|
|
+ var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
|
|
|
|
|
+ var goodsCpnDcAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderForm .goodsCpn input[name=cpnCartSq]").each(function(){
|
|
|
|
|
+ if ($(this).val() == cartCpnCartSq) {
|
|
|
|
|
+ goodsCpnDcAmt = parseInt($(this).parent().find("input[name=cpnDcAmt]").val());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var tempAmt = ((orgCurrPrice - cpn1DcAmt) * goodsQty) - tmtb1DcAmt - tmtb2DcAmt - goodsCpnDcAmt;
|
|
|
|
|
+ tempSumAmt = tempSumAmt + tempAmt;
|
|
|
|
|
+
|
|
|
|
|
+ // 할인율일때 할인금액
|
|
|
|
|
+ if (dcWay == "G240_11") {
|
|
|
|
|
+ cartCpnDcAmt = (tempAmt * dcVal) / 100;
|
|
|
|
|
+ cartCpnDcSumAmt = cartCpnDcSumAmt + cartCpnDcAmt;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 금액일때 할인금액 적용
|
|
|
|
|
+ if (dcWay == "G240_10") {
|
|
|
|
|
+ cartCpnDcSumAmt = dcVal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.19 최대금액 체크
|
|
|
|
|
+ if (maxDcAmt > cartCpnDcSumAmt || maxDcAmt == 0) {
|
|
|
|
|
+ cartCpnDcSumAmt = cartCpnDcSumAmt;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cartCpnDcSumAmt = maxDcAmt;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ obj.find("input[name=rdi-cart-coupon]").prop("checked", true);
|
|
|
|
|
+ obj.parent().find("input[name=cpnDcAmt]").val(cartCpnDcSumAmt);
|
|
|
|
|
+ obj.parent().find("input[name=custCpnSq]").val(obj.attr("value"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var cpnDcSumAmt = 0;
|
|
|
|
|
+ var cpnApplyCnt = 0;
|
|
|
|
|
+ var goodsCartCpnSumAmt = 0;
|
|
|
|
|
+ var cpnType = "";
|
|
|
|
|
+
|
|
|
|
|
+ $("#couponApplyForm input[name='cpnDcAmt']").each(function(){
|
|
|
|
|
+ cpnType = $(this).parent().find("input[name=cpnType]").val();
|
|
|
|
|
+
|
|
|
|
|
+ // 상품, 장바구니쿠폰 할인 금액만 합계 적용
|
|
|
|
|
+ if (cpnType == "goodsCpn" || cpnType == "cartCpn") {
|
|
|
|
|
+ goodsCartCpnSumAmt = goodsCartCpnSumAmt + parseInt($(this).val());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 상품, 장바구니쿠폰 할인 금액만 합계 적용
|
|
|
|
|
+ $("#couponApplyForm .modal-footer .goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.11 쿠폰중복체크 후 적용가능
|
|
|
|
|
+var custCpnApply = function(obj) {
|
|
|
|
|
+ // select box 쿠폰 적용
|
|
|
|
|
+ var cpnType = obj.parent().find("input[name='cpnType']").val();
|
|
|
|
|
+
|
|
|
|
|
+ // 상품쿠폰적용
|
|
|
|
|
+ if (cpnType == "goodsCpn") {
|
|
|
|
|
+ var itemHtml = obj.find(".item_coupon").html();
|
|
|
|
|
+ obj.parent().parent().find(".select .item_coupon").html(itemHtml);
|
|
|
|
|
+ obj.parent().find("input[name='cpnDcAmt']").val(obj.attr("data"));
|
|
|
|
|
+ obj.parent().find("input[name='custCpnSq']").val(obj.attr("value"));
|
|
|
|
|
+
|
|
|
|
|
+ var cpnCartSq = obj.parent().parent().find("input[name='cpnCartSq']").val();
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니시퀀스 체크
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ if (cpnCartSq == $(this).text()) {
|
|
|
|
|
+ $(this).parent().find(".goodsCpnSq").text(obj.prop("value")); // 상품쿠폰시퀀스
|
|
|
|
|
+ $(this).parent().find(".goodsCpnDcAmt").text(obj.attr("data")); // 상품쿠폰할인금액
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 선택활성화
|
|
|
|
|
+ $(obj).addClass("selected");
|
|
|
|
|
+
|
|
|
|
|
+ //상품쿠폰 선택불가 처리
|
|
|
|
|
+ custCpnSqLiDisabled();
|
|
|
|
|
+ }
|
|
|
|
|
+ // 장바구니쿠폰적용
|
|
|
|
|
+ else if (cpnType == "cartCpn") {
|
|
|
|
|
+ var dcWay = obj.find("input[name='dcWay']").val();
|
|
|
|
|
+ var dcVal = obj.find("input[name='dcVal']").val();
|
|
|
|
|
+ var maxDcAmt = obj.find("input[name='maxDcAmt']").val();
|
|
|
|
|
+ var buyLimitAmt = obj.find("input[name='buyLimitAmt']").val();
|
|
|
|
|
+ var cartCpnDcSumAmt = 0;
|
|
|
|
|
+ var tempSumAmt = 0;
|
|
|
|
|
+ var cartSqLen = $("#orderAmtForm .cartSq").length;
|
|
|
|
|
+ var leftAmt = 0;
|
|
|
|
|
+ var index = 1;
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.19 장바구니시퀀스 값 초기화
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ $(this).parent().find(".cartCpnSq").text(0);
|
|
|
|
|
+ $(this).parent().find(".cartCpnDcAmt").text(0);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니쿠폰 해당 장바구니상품들 할인가 적용
|
|
|
|
|
+ obj.find("input[name='cartCpnCartSq']").each(function(){
|
|
|
|
|
+ var cartCpnCartSq = $(this).val();
|
|
|
|
|
+ var cartCpnDcAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니시퀀스 체크
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ if (cartCpnCartSq == $(this).text()) {
|
|
|
|
|
+ var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
|
|
|
|
|
+ var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
|
|
|
|
|
+ var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
|
|
|
|
|
+ var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
|
|
|
|
|
+ var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
|
|
|
|
|
+ var goodsCpnDcAmt = parseInt($(this).parent().find(".goodsCpnDcAmt").text());
|
|
|
|
|
+
|
|
|
|
|
+ var tempAmt = ((orgCurrPrice - cpn1DcAmt) * goodsQty) - tmtb1DcAmt - tmtb2DcAmt - goodsCpnDcAmt;
|
|
|
|
|
+ tempSumAmt = tempSumAmt + tempAmt;
|
|
|
|
|
+
|
|
|
|
|
+ // 할인율일때 할인금액
|
|
|
|
|
+ if (dcWay == "G240_11") {
|
|
|
|
|
+ cartCpnDcAmt = parseInt((tempAmt * dcVal) / 100);
|
|
|
|
|
+ cartCpnDcSumAmt = cartCpnDcSumAmt + cartCpnDcAmt;
|
|
|
|
|
+
|
|
|
|
|
+ $(this).parent().find(".cartCpnSq").text(obj.attr("value"));
|
|
|
|
|
+ $(this).parent().find(".cartCpnDcAmt").text(cartCpnDcAmt);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니쿠폰 결제가능수단목록조회
|
|
|
|
|
+ if (obj.find("input[name='payTypeArr']").length > 0) {
|
|
|
|
|
+ $("#orderForm input[name=rdi-paynormal]").attr("disabled", true);
|
|
|
|
|
+ $("#orderForm input[name=rdi-paynormal]").attr("checked", false);
|
|
|
|
|
+
|
|
|
|
|
+ obj.find("input[name='payTypeArr']").each(function(i){
|
|
|
|
|
+ var payType = $(this).val();
|
|
|
|
|
+ $('#orderForm .'+payType).attr("disabled", false);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 선택안함
|
|
|
|
|
+ $("#orderForm .payTypeNm").text("선택없음");
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.06.18 장바구니쿠폰 PG 제어가 있으면 초기화하고 결제타입 펼침
|
|
|
|
|
+ //paymentInfoDispYn("Y");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#orderForm input[name=rdi-paynormal]").attr("disabled", false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.25 실시간계좌이체, 무통장입금시 보증보험 신청 약관 노출 감추는기능
|
|
|
|
|
+ $("#orderForm .insuranceYn").hide();
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.19 최대금액 체크
|
|
|
|
|
+ if (maxDcAmt > cartCpnDcSumAmt || maxDcAmt == 0) {
|
|
|
|
|
+ cartCpnDcSumAmt = cartCpnDcSumAmt;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 최대값 적용 일때는 금액할인 방식을 적용
|
|
|
|
|
+ cartCpnDcSumAmt = maxDcAmt;
|
|
|
|
|
+ dcVal = cartCpnDcSumAmt;
|
|
|
|
|
+ dcWay = "G240_10";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 금액일때 할인금액 적용
|
|
|
|
|
+ if (dcWay == "G240_10") {
|
|
|
|
|
+ cartCpnDcSumAmt = dcVal;
|
|
|
|
|
+ leftAmt = dcVal;
|
|
|
|
|
+ index = 1;
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니쿠폰 해당 장바구니상품들 할인가 적용
|
|
|
|
|
+ obj.find("input[name='cartCpnCartSq']").each(function(){
|
|
|
|
|
+ var cartCpnCartSq = $(this).val();
|
|
|
|
|
+ var cartCpnDcAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니시퀀스 체크
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ if (cartCpnCartSq == $(this).text()) {
|
|
|
|
|
+ var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
|
|
|
|
|
+ var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
|
|
|
|
|
+ var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
|
|
|
|
|
+ var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
|
|
|
|
|
+ var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
|
|
|
|
|
+ var goodsCpnDcAmt = parseInt($(this).parent().find(".goodsCpnDcAmt").text());
|
|
|
|
|
+
|
|
|
|
|
+ var tempAmt = ((orgCurrPrice - cpn1DcAmt) * goodsQty) - tmtb1DcAmt - tmtb2DcAmt - goodsCpnDcAmt;
|
|
|
|
|
+ var tempDiv = parseInt((tempAmt / tempSumAmt) * 100);
|
|
|
|
|
+ var cartCpnDcAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (index == cartSqLen) {
|
|
|
|
|
+ cartCpnDcAmt = leftAmt;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cartCpnDcAmt = parseInt((cartCpnDcSumAmt * tempDiv) / 100);
|
|
|
|
|
+ leftAmt = leftAmt - cartCpnDcAmt;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(this).parent().find(".cartCpnSq").text(obj.attr("value"));
|
|
|
|
|
+ $(this).parent().find(".cartCpnDcAmt").text(cartCpnDcAmt);
|
|
|
|
|
+
|
|
|
|
|
+ index++;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ obj.find("input[name=rdi-cart-coupon]").prop("checked", true);
|
|
|
|
|
+ obj.parent().find("input[name=cpnDcAmt]").val(cartCpnDcSumAmt);
|
|
|
|
|
+ obj.parent().find("input[name=custCpnSq]").val(obj.attr("value"));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 배송비쿠폰적용
|
|
|
|
|
+ else if (cpnType == "delvCpn") {
|
|
|
|
|
+ // 적용안함 적용
|
|
|
|
|
+ var itemHtml = obj.find(".dlvr_coupon").html();
|
|
|
|
|
+ obj.parent().parent().find(".select .dlvr_coupon").html(itemHtml);
|
|
|
|
|
+
|
|
|
|
|
+ obj.parent().find("input[name='cpnDcAmt']").val(obj.attr("data"));
|
|
|
|
|
+ obj.parent().find("input[name='custCpnSq']").val(obj.attr("value"));
|
|
|
|
|
+ obj.parent().find("input[name='delvFeeCd']").val(obj.attr("delvfeecd"));
|
|
|
|
|
+
|
|
|
|
|
+ var delvFeeCd = obj.attr("delvfeecd");
|
|
|
|
|
+
|
|
|
|
|
+ // 배송비쿠폰 테이블 적용
|
|
|
|
|
+ $("#orderAmtForm .delvFeeCd").each(function(){
|
|
|
|
|
+ // 배송비쿠폰적용
|
|
|
|
|
+ if ($(this).text() == delvFeeCd) {
|
|
|
|
|
+ $(this).parent().find(".delvCpnSq").text(obj.attr("value"));
|
|
|
|
|
+ $(this).parent().find(".delvCpnDcAmt").text(obj.attr("data"));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 배송비쿠폰적용안함
|
|
|
|
|
+ else if (delvFeeCd == 0) {
|
|
|
|
|
+ $(this).parent().find(".delvCpnSq").text(obj.attr("value"));
|
|
|
|
|
+ $(this).parent().find(".delvCpnDcAmt").text(obj.attr("data"));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 포인트기능 리렛
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.11.1 상품쿠폰 선택불가 처리
|
|
|
|
|
+var custCpnSqLiDisabled = function() {
|
|
|
|
|
+ // 상품쿠폰 선택불가 처리
|
|
|
|
|
+ $(".goodsCpn ul li").each(function(){
|
|
|
|
|
+ var custCpnSq = $(this).attr("value");
|
|
|
|
|
+ var liObj = $(this);
|
|
|
|
|
+
|
|
|
|
|
+ liObj.attr("aria-disabled", false);
|
|
|
|
|
+
|
|
|
|
|
+ // 선택된 li 제외
|
|
|
|
|
+ if ($(this).hasClass("selected") == false) {
|
|
|
|
|
+ // 적용안함 제외
|
|
|
|
|
+ if (custCpnSq > 0) {
|
|
|
|
|
+ // 선택된 custCpnSq li와 같으면 선택불가처리
|
|
|
|
|
+ $(".area_item_coupon input[name=custCpnSq]").each(function(){
|
|
|
|
|
+ var inputCustCpSq = $(this).val();
|
|
|
|
|
+ if (custCpnSq == inputCustCpSq) {
|
|
|
|
|
+ // 선택불가처리
|
|
|
|
|
+ liObj.attr("aria-disabled", true);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.12 쿠폰중복체크 후 적용불가
|
|
|
|
|
+var custCpnNotApply = function(obj) {
|
|
|
|
|
+ // 이전에 등록된 쿠폰시퀀스
|
|
|
|
|
+ var custCpnSq = obj.parent().find("input[name='custCpnSq']").val();
|
|
|
|
|
+
|
|
|
|
|
+ // 이전에 등록된 쿠폰시퀀스 비교후 데이타 원복
|
|
|
|
|
+ obj.parent().find("li").each(function(){
|
|
|
|
|
+ if ($(this).attr("value") == custCpnSq) {
|
|
|
|
|
+ var itemHtml = $(this).find(".item_coupon").html();
|
|
|
|
|
+ obj.parent().parent().find(".select .item_coupon").html(itemHtml);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 포인트기능리셋
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.14 선포인트리셋기능 (사용안함)
|
|
|
|
|
+var prePntDcAmtReset = function() {
|
|
|
|
|
+ // 2021.04.29 수정
|
|
|
|
|
+ var rmPrePntAmt = parseInt($("#orderForm input[name='rmPrePntAmt']").val());
|
|
|
|
|
+ if (rmPrePntAmt > 0) {
|
|
|
|
|
+ rmPrePntAmt = parseInt($("#orderForm input[name='rmPrePntAmt']").val());
|
|
|
|
|
+ $("#orderForm input[name='prePntDcAmt']").val(rmPrePntAmt);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ rmPrePntAmt = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 선포인트사용여부 체크 후 적용
|
|
|
|
|
+ $("#orderForm input[name='rdi-beforpoint']").each(function(){
|
|
|
|
|
+ // 선포인트 초기 설정 사용함
|
|
|
|
|
+ if ($(this).val() == "Y") {
|
|
|
|
|
+ $(this).attr("checked", true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 버튼기능 구현
|
|
|
|
|
+ $(this).on("click", function(){
|
|
|
|
|
+ var rmPrePntAmt = parseInt($("#orderForm input[name='rmPrePntAmt']").val());
|
|
|
|
|
+
|
|
|
|
|
+ // 선포인트적용
|
|
|
|
|
+ if ($(this).val() == "Y") {
|
|
|
|
|
+ $("#prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+" 원");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#prePntDcAmt").text("0 원");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 쿠폰할인금액 SUM
|
|
|
|
|
+ custCpnSumAmtCal();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderForm #prePntDcAmt").text(getZeroMinusDelAmt(rmPrePntAmt)+" 원");
|
|
|
|
|
+
|
|
|
|
|
+ // 포인트기능 리렛
|
|
|
|
|
+ pntDcAmtReset();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.15 포인트리셋기능
|
|
|
|
|
+var pntDcAmtReset = function() {
|
|
|
|
|
+ $("#orderAmtForm .pntDcSumAmt").text("0");
|
|
|
|
|
+ $("#orderForm input[name='pntDcAmtStr']").val("");
|
|
|
|
|
+ $("#pntDcAmt").text("0 원");
|
|
|
|
|
+
|
|
|
|
|
+ // 상품권리셋기능
|
|
|
|
|
+ gfcdUseAmtReset();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.16 상품권리셋기능
|
|
|
|
|
+var gfcdUseAmtReset = function() {
|
|
|
|
|
+ $("#orderAmtForm .gfcdUseSumAmt").text("0");
|
|
|
|
|
+ $("#orderForm input[name='gfcdUseAmtStr']").val("");
|
|
|
|
|
+ $("#gfcdUseAmt").text("0 원");
|
|
|
|
|
+
|
|
|
|
|
+ // 금액전체계산
|
|
|
|
|
+ custCpnSumAmtCal();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.17 쿠폰할인금액합계설정(금액전체계산)
|
|
|
|
|
+var custCpnSumAmtCal = function() {
|
|
|
|
|
+ var cpnDcSumAmt = 0;
|
|
|
|
|
+ var cpnApplyCnt = 0;
|
|
|
|
|
+ var goodsCartCpnSumAmt = 0;
|
|
|
|
|
+ var cpnType = "";
|
|
|
|
|
+
|
|
|
|
|
+ $("input[name='cpnDcAmt']").each(function(){
|
|
|
|
|
+ cpnType = $(this).parent().find("input[name=cpnType]").val();
|
|
|
|
|
+ cpnDcSumAmt = cpnDcSumAmt + parseInt($(this).val());
|
|
|
|
|
+
|
|
|
|
|
+ // 적용된 쿠폰 수량
|
|
|
|
|
+ if (parseInt($(this).val()) > 0) {
|
|
|
|
|
+ cpnApplyCnt++;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 상품, 장바구니쿠폰 할인 금액만 합계 적용
|
|
|
|
|
+ if (cpnType == "goodsCpn" || cpnType == "cartCpn") {
|
|
|
|
|
+ goodsCartCpnSumAmt = goodsCartCpnSumAmt + parseInt($(this).val());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 상품, 장바구니쿠폰 할인 금액만 합계 적용
|
|
|
|
|
+ $(".maxdisc_amount .goodsCartCpnDcAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt)); // 쿠폰할인금액합계
|
|
|
|
|
+ $(".goodsCartCpnSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt)); // 쿠폰할인금액합계
|
|
|
|
|
+
|
|
|
|
|
+ // 전체쿠폰 할인 금액 합계 적용
|
|
|
|
|
+ $(".maxdisc_amount .cpnDcAmt").text(getZeroMinusDelAmt(cpnDcSumAmt)); // 쿠폰할인금액합계
|
|
|
|
|
+ $("#couponDcSumAmt").text(getZeroMinusDelAmt(goodsCartCpnSumAmt)+ " 원"); // 쿠폰할인금액합계
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
|
|
|
|
|
+
|
|
|
|
|
+ var delvSumAmt = orgSumDelvFee;
|
|
|
|
|
+
|
|
|
|
|
+ // 배송비할인적용
|
|
|
|
|
+ $("input[name='cpnType']").each(function(){
|
|
|
|
|
+ if ($(this).val() == "delvCpn") {
|
|
|
|
|
+ delvSumAmt = parseInt(orgSumDelvFee) - parseInt($(this).parent().find("input[name='cpnDcAmt']").val());
|
|
|
|
|
+
|
|
|
|
|
+ // 최종배송비
|
|
|
|
|
+ $("#delvSumAmt").text(delvSumAmt.addComma() + " 원");
|
|
|
|
|
+ $("#orderAmtForm .delvSumAmt").text(delvSumAmt);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.03.06 주문상세 테이블 적용
|
|
|
|
|
+ // 포인트금액 상품상세에 포인트금액 분배 작업
|
|
|
|
|
+ var prePntDcAmtYn = $("#orderForm input[name='rdi-beforpoint']:checked").val();
|
|
|
|
|
+ var leftPntAmt = parseInt($("#orderAmtForm .pntDcSumAmt").text());
|
|
|
|
|
+ var leftGfcdAmt = parseInt($("#orderAmtForm .gfcdUseSumAmt").text());
|
|
|
|
|
+ var cartSqLenght = $("#orderAmtForm .cartSq").length;
|
|
|
|
|
+ var index = 1;
|
|
|
|
|
+
|
|
|
|
|
+ var orgGoodsSumAmt = 0;
|
|
|
|
|
+ var cpn1DcSumAmt = 0;
|
|
|
|
|
+ var ordSumAmt = 0;
|
|
|
|
|
+ var tmtb1DcSumAmt = 0;
|
|
|
|
|
+ var tmtb2DcSumAmt = 0;
|
|
|
|
|
+ var tmtbDcSumAmt = 0;
|
|
|
|
|
+ var goodsCpnDcSumAmt = 0;
|
|
|
|
|
+ var cartCpnDcSumAmt = 0;
|
|
|
|
|
+ var delvCpnDcSumAmt = 0;
|
|
|
|
|
+ var cpnDcSumAmt = 0;
|
|
|
|
|
+ var prePntDcSumAmt = 0;
|
|
|
|
|
+ var pntDcSumAmt = parseInt($("#orderAmtForm .pntDcSumAmt").text());
|
|
|
|
|
+ var gfcdUseSumAmt = parseInt($("#orderAmtForm .gfcdUseSumAmt").text());
|
|
|
|
|
+ var realOrdSumAmt = 0;
|
|
|
|
|
+ var savePntSumAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ var orgCurrPrice = parseInt($(this).parent().find(".orgCurrPrice").text());
|
|
|
|
|
+ var cpn1DcAmt = parseInt($(this).parent().find(".cpn1DcAmt").text());
|
|
|
|
|
+ var optAddPrice = parseInt($(this).parent().find(".optAddPrice").text());
|
|
|
|
|
+ var goodsQty = parseInt($(this).parent().find(".goodsQty").text());
|
|
|
|
|
+ var tmtb1DcAmt = parseInt($(this).parent().find(".tmtb1DcAmt").text());
|
|
|
|
|
+ var tmtb2DcAmt = parseInt($(this).parent().find(".tmtb2DcAmt").text());
|
|
|
|
|
+ var goodsCpnDcAmt = parseInt($(this).parent().find(".goodsCpnDcAmt").text());
|
|
|
|
|
+ var cartCpnDcAmt = parseInt($(this).parent().find(".cartCpnDcAmt").text());
|
|
|
|
|
+ var prePntDcAmt1 = parseInt($(this).parent().find(".prePntDcAmt1").text());
|
|
|
|
|
+ var dcSumAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 주문금액 = ((판매가 - 즉시할인가) + 옵션추가금액) * 장바구니수량
|
|
|
|
|
+ orgGoodsSumAmt = orgGoodsSumAmt + (orgCurrPrice + optAddPrice) * goodsQty;
|
|
|
|
|
+ //orgGoodsSumAmt = orgGoodsSumAmt + orgCurrPrice;
|
|
|
|
|
+ cpn1DcSumAmt = cpn1DcSumAmt + (cpn1DcAmt * goodsQty);
|
|
|
|
|
+ tmtb1DcSumAmt = tmtb1DcSumAmt + tmtb1DcAmt;
|
|
|
|
|
+ tmtb2DcSumAmt = tmtb2DcSumAmt + tmtb2DcAmt;
|
|
|
|
|
+ tmtbDcSumAmt = tmtbDcSumAmt + (tmtb1DcAmt + tmtb2DcAmt);
|
|
|
|
|
+ goodsCpnDcSumAmt = goodsCpnDcSumAmt + goodsCpnDcAmt;
|
|
|
|
|
+ cartCpnDcSumAmt = cartCpnDcSumAmt + cartCpnDcAmt;
|
|
|
|
|
+ cpnDcSumAmt = cpnDcSumAmt + (goodsCpnDcAmt + cartCpnDcAmt);
|
|
|
|
|
+ prePntDcSumAmt = prePntDcSumAmt + prePntDcAmt1;
|
|
|
|
|
+
|
|
|
|
|
+ var ordAmt = ((orgCurrPrice - cpn1DcAmt) + optAddPrice) * goodsQty;
|
|
|
|
|
+ ordSumAmt = ordSumAmt + ordAmt;
|
|
|
|
|
+
|
|
|
|
|
+ // 선포인트사용여부
|
|
|
|
|
+ // 할인금액합계 = 다다익선수량금액 + 다다익선금액금액 + 상품쿠폰금액 + 장바구니금액 + 선포인트금액
|
|
|
|
|
+ if (prePntDcAmtYn == "Y") {
|
|
|
|
|
+ dcSumAmt = tmtb1DcAmt + tmtb2DcAmt + goodsCpnDcAmt + cartCpnDcAmt + prePntDcAmt1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dcSumAmt = tmtb1DcAmt + tmtb2DcAmt + goodsCpnDcAmt + cartCpnDcAmt;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 주문금액설정
|
|
|
|
|
+ $(this).parent().find(".ordAmt").text(ordAmt);
|
|
|
|
|
+ $(this).parent().find(".dcSumAmt").text(dcSumAmt);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.07.15 상품권사용금액 배송비
|
|
|
|
|
+ var delvGfcdUseAmt = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 포인트, 상품권 금액 분배
|
|
|
|
|
+ $("#orderAmtForm .cartSq").each(function(){
|
|
|
|
|
+ var pntPrate = parseInt($(this).parent().find(".pntPrate").text());
|
|
|
|
|
+ var pntMrate = parseInt($(this).parent().find(".pntMrate").text());
|
|
|
|
|
+ var ordAmt = parseInt($(this).parent().find(".ordAmt").text());
|
|
|
|
|
+ var dcSumAmt = parseInt($(this).parent().find(".dcSumAmt").text());
|
|
|
|
|
+ var prePntDcAmt1 = parseInt($(this).parent().find(".prePntDcAmt1").text());
|
|
|
|
|
+ var tempDiv = parseInt((ordAmt / ordSumAmt) * 100);
|
|
|
|
|
+ var pntDcAmt1 = 0;
|
|
|
|
|
+ var gfcdUseAmt1 = 0;
|
|
|
|
|
+ var savePntAmt1 = 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (index == cartSqLenght) {
|
|
|
|
|
+ pntDcAmt1 = leftPntAmt;
|
|
|
|
|
+ gfcdUseAmt1 = leftGfcdAmt;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ pntDcAmt1 = parseInt((pntDcSumAmt * tempDiv) / 100);
|
|
|
|
|
+ gfcdUseAmt1 = parseInt((gfcdUseSumAmt * tempDiv) / 100);
|
|
|
|
|
+ leftPntAmt = leftPntAmt - pntDcAmt1;
|
|
|
|
|
+ leftGfcdAmt = leftGfcdAmt - gfcdUseAmt1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var realOrdAmt1 = ordAmt - dcSumAmt - pntDcAmt1 - gfcdUseAmt1;
|
|
|
|
|
+ var realOrdAmt2 = ordAmt - dcSumAmt - pntDcAmt1;
|
|
|
|
|
+ realOrdSumAmt = realOrdSumAmt + realOrdAmt1;
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.05.11 최종할인금액으로 적립포인트 적용
|
|
|
|
|
+ if (frontGb == 'P') {
|
|
|
|
|
+ savePntAmt1 = parseInt(realOrdAmt2 * (pntPrate/100));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ savePntAmt1 = parseInt(realOrdAmt2 * (pntMrate/100));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 선포인트사용여부
|
|
|
|
|
+ if (prePntDcAmtYn == "Y") {
|
|
|
|
|
+ if (prePntDcAmt1 < 1) {
|
|
|
|
|
+ savePntSumAmt = savePntSumAmt + savePntAmt1;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ savePntSumAmt = savePntSumAmt + savePntAmt1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(this).parent().find(".pntDcAmt1").text(pntDcAmt1);
|
|
|
|
|
+ $(this).parent().find(".gfcdUseAmt1").text(gfcdUseAmt1);
|
|
|
|
|
+ $(this).parent().find(".realOrdAmt1").text(realOrdAmt1);
|
|
|
|
|
+ $(this).parent().find(".savePntAmt1").text(savePntAmt1);
|
|
|
|
|
+
|
|
|
|
|
+ index++;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.07.15 배송비 상품권 사용금액설정
|
|
|
|
|
+ if (parseInt(delvGfcdUseAmt) > 0) {
|
|
|
|
|
+ var leftDelvGfcdUseAmt = delvGfcdUseAmt;
|
|
|
|
|
+ $("#orderAmtForm .delvFeeCd").each(function(){
|
|
|
|
|
+ var delvFee = parseInt($(this).parent().find(".delvFee").text());
|
|
|
|
|
+ var delvCpnDcAmt = parseInt($(this).parent().find(".delvCpnDcAmt").text());
|
|
|
|
|
+ var realDelvFee = delvFee - delvCpnDcAmt;
|
|
|
|
|
+
|
|
|
|
|
+ if (realDelvFee > 0) {
|
|
|
|
|
+ if (realDelvFee > leftDelvGfcdUseAmt) {
|
|
|
|
|
+ delvGfcdUseAmt = leftDelvGfcdUseAmt;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ delvGfcdUseAmt = realDelvFee;
|
|
|
|
|
+ leftDelvGfcdUseAmt = leftDelvGfcdUseAmt - realDelvFee;
|
|
|
|
|
+ }
|
|
|
|
|
+ $(this).parent().find(".delvCpnDcAmt").text(delvGfcdUseAmt);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ realOrdSumAmt = realOrdSumAmt + delvSumAmt;
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderAmtForm .orgGoodsSumAmt").text(orgGoodsSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .cpn1DcSumAmt").text(cpn1DcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .ordSumAmt").text(ordSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .tmtb1DcSumAmt").text(tmtb1DcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .tmtb2DcSumAmt").text(tmtb2DcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .tmtbDcSumAmt").text(tmtbDcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .goodsCpnDcSumAmt").text(goodsCpnDcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .cartCpnDcSumAmt").text(cartCpnDcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .cpnDcSumAmt").text(cpnDcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .prePntDcSumAmt").text(prePntDcSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .realOrdSumAmt").text(realOrdSumAmt);
|
|
|
|
|
+ $("#orderAmtForm .savePntSumAmt").text(savePntSumAmt);
|
|
|
|
|
+
|
|
|
|
|
+ $("#realOrdAmt").text(realOrdSumAmt.addComma()); // 총 결제 예정 금액
|
|
|
|
|
+ $("#orderForm .realOrdAmt").text(realOrdSumAmt.addComma() + " 원"); // 총 결제 예정 금액
|
|
|
|
|
+
|
|
|
|
|
+ // 2021.04.29 적립포인트금액 선포인트 사용시 사용금액제외
|
|
|
|
|
+ $("#orderForm #savePntSumAmt").text(savePntSumAmt.addComma() + " P");
|
|
|
|
|
+
|
|
|
|
|
+ var tempSavePnt = savePntSumAmt - prePntDcAmt;
|
|
|
|
|
+
|
|
|
|
|
+ // 사은품사용 후 보유포인트
|
|
|
|
|
+ var rmPntAmt = parseInt($("#orderForm input[name='rmPntAmt']").val());
|
|
|
|
|
+ var freegiftUsePnt = parseInt($("#orderAmtForm .freegiftUsePnt").text());
|
|
|
|
|
+ rmPntAmt = rmPntAmt - freegiftUsePnt;
|
|
|
|
|
+ $("#orderForm .rmPntAmt").text(rmPntAmt.addComma());
|
|
|
|
|
+
|
|
|
|
|
+ // 적립포인트
|
|
|
|
|
+ $("#savePntSumAmt").text(savePntSumAmt.addComma()+" P");
|
|
|
|
|
+
|
|
|
|
|
+ // 사은품정보 설정
|
|
|
|
|
+ var freegiftValArr = [];
|
|
|
|
|
+ var freegiftUsePointArr = [];
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderForm .gift_box").each(function(){
|
|
|
|
|
+ $(this).find(".freegiftRdo").each(function(){
|
|
|
|
|
+ // 사은품필수
|
|
|
|
|
+ if ($(this).attr("allYn") == "Y" ) {
|
|
|
|
|
+ freegiftValArr.push($(this).val());
|
|
|
|
|
+ freegiftUsePointArr.push($(this).attr("usepoint"));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 라디오버튼 선택 사은품 체크
|
|
|
|
|
+ if ($(this).is(":checked")) {
|
|
|
|
|
+ // 수령거부가 아닐때 체크
|
|
|
|
|
+ if ($(this).val() != "noSel") {
|
|
|
|
|
+ freegiftValArr.push($(this).val());
|
|
|
|
|
+ freegiftUsePointArr.push($(this).attr("usepoint"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderAmtForm .freegiftValArr").text(freegiftValArr); // 사은품시퀀스배열
|
|
|
|
|
+ $("#orderAmtForm .freegiftUsePointArr").text(freegiftUsePointArr); // 사은품사용포인트배열
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 1.18 배송지정보 설정
|
|
|
|
|
+var delvAddrSet = function(delvObj) {
|
|
|
|
|
+
|
|
|
|
|
+ var rtnStr = "";
|
|
|
|
|
+ rtnStr += "| recipNm ::: " + delvObj.recipNm;
|
|
|
|
|
+ rtnStr += "| recipPhnno ::: " + delvObj.recipPhnno;
|
|
|
|
|
+ rtnStr += "| recipZipcode ::: " + delvObj.recipZipcode;
|
|
|
|
|
+ rtnStr += "| recipBaseAddr ::: " + delvObj.recipBaseAddr;
|
|
|
|
|
+ rtnStr += "| recipDtlAddr ::: " + delvObj.recipDtlAddr;
|
|
|
|
|
+ rtnStr += "| delvMemo ::: " + delvObj.delvMemo;
|
|
|
|
|
+
|
|
|
|
|
+ // 배송지정보로드실행
|
|
|
|
|
+ deliveryAddrInfoSet(delvObj, false);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 1.19 배송메모설정
|
|
|
|
|
+var delvMemoSet = function(delvMemoObj) {
|
|
|
|
|
+
|
|
|
|
|
+ var rtnStr = "";
|
|
|
|
|
+ rtnStr += "| delvMemo ::: " + delvMemoObj.delvMemo;
|
|
|
|
|
+
|
|
|
|
|
+ $("#orderForm input[name=delvMemo]").val(delvMemoObj.delvMemo); // input 값에 설정
|
|
|
|
|
+ $("#delvMemo").text(delvMemoObj.delvMemo); // 메모 text 설정
|
|
|
|
|
+ $("#orderAmtForm .delvMemo").text(delvMemoObj.delvMemo); // 메모 text 설정
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<script th:inline="javascript">
|
|
|
|
|
+
|
|
|
|
|
+$(document).ready( function() {
|
|
|
|
|
+ //해외배송 입력
|
|
|
|
|
+ $(document).on('change','.odPayment .area_overseas #rdi-overs1',function(e){
|
|
|
|
|
+ $('.info_box.overs2').hide();
|
|
|
|
|
+ $('.info_box.overs1').show();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }).on('change','.odPayment .area_overseas #rdi-overs2',function(e){
|
|
|
|
|
+ $('.info_box.overs1').hide();
|
|
|
|
|
+ $('.info_box.overs2').show();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //할인쿠폰 확인
|
|
|
|
|
+ $(document).on('click','.odPayment .area_seldiscount .btn_coupon_toggle',function(e){
|
|
|
|
|
+ $('.coupon_list').toggle();
|
|
|
|
|
+ $(this).toggleClass('on');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //STYLE24 간편결제 배너닫기
|
|
|
|
|
+ $(document).on('click','.odPayment .area_paymethod .quickpay_bnr .btn_close_bnr',function(e){
|
|
|
|
|
+ $('.quickpay_bnr').hide();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //결제수단 선택 > 즐겨찾기 추가시
|
|
|
|
|
+ $(document).on('click','.odPayment .area_paymethod .paymethod_box .card .etc .btn_favorcard',function(e){
|
|
|
|
|
+ $(this).toggleClass('active');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 개인정보동의 열고닫기
|
|
|
|
|
+ $(document).on('click','.area_paymentinfo .payinfo_blk a',function(e){
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ $(this).parents('.payinfo_blk').toggleClass('on');
|
|
|
|
|
+ var privacyToggle = $(this).find('span');
|
|
|
|
|
+ $(privacyToggle).text($(privacyToggle).text() == '보기' ? '닫기' : '보기');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //사은품지급안내 팝업열기
|
|
|
|
|
+ $(document).on('click','#btn_infoGift_pop',function(e){
|
|
|
|
|
+ $("#infoGiftPop").modal("show");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //간편결제등록 > STEP1.이용약관 팝업열기
|
|
|
|
|
+ $(document).on('click','.btn_addcard',function(e){
|
|
|
|
|
+ $("#qPayAgree_pop").modal("show");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //간편결제등록 > STEP1.이용약관 체크
|
|
|
|
|
+ $(document).on('click','.area_QpayCk .agr_select button',function(e){
|
|
|
|
|
+ $(this).parents('.area_QpayCk').find('.info_agrQpay').toggle();
|
|
|
|
|
+ var payagrToggle = $(this).find('span');
|
|
|
|
|
+ $(payagrToggle).text($(payagrToggle).text() == '약관열기' ? '약관닫기' : '약관열기');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //간편결제등록 > STEP1.이용약관 체크박스 전체선택
|
|
|
|
|
+ $(document).on('click','#chk-Qpay-agrAll',function(e){
|
|
|
|
|
+ $(this).parents(".qPayAgree_pop").find('.agree_Qpay input').prop("checked", $(this).is(":checked"));
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //간편결제등록 > STEP1.이용약관 체크박스 개별선택
|
|
|
|
|
+ $(document).on("click", ".agree_Qpay input",function(e){
|
|
|
|
|
+ var is_checked = true;
|
|
|
|
|
+ $(".agree_Qpay input").each(function(){
|
|
|
|
|
+ is_checked = is_checked && $(this).is(":checked");
|
|
|
|
|
+ });
|
|
|
|
|
+ $("#chk-Qpay-agrAll").prop("checked", is_checked);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ //간편결제등록 > 본인인증 팝업열기
|
|
|
|
|
+ $(document).on('click','#btn_qPayidConfirm_pop',function(e){
|
|
|
|
|
+ $("#qPayidConfirm_pop").modal("show");
|
|
|
|
|
+ return false;
|
|
|
|
|
+ });
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+// PG 카카오페이 결제준비 처리
|
|
|
|
|
+var fnKakaoPaymentReady = function() {
|
|
|
|
|
+ let nextRedirectUrl = $('#order_info input[name=nextRedirectPcUrl]').val();
|
|
|
|
|
+ let option = 'width=420, height=520';
|
|
|
|
|
+
|
|
|
|
|
+ window.open(nextRedirectUrl, 'kakaoPaymentPopup', option);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// PG 카카오페이 결제 승인 요청
|
|
|
|
|
+var fnKakaoPaymentRequest = function(pgToken) {
|
|
|
|
|
+ // Token 값 설정
|
|
|
|
|
+ $('#order_info input[name=pgToken]').val(pgToken);
|
|
|
|
|
+
|
|
|
|
|
+ // Form Submit
|
|
|
|
|
+ document.order_info.submit();
|
|
|
|
|
+
|
|
|
|
|
+ return true;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// PG 네이버페이 결제준비 처리
|
|
|
|
|
+var fnNaverPaymentReady = function() {
|
|
|
|
|
+ let naverPayUrl = 'https://' + [[${@environment.getProperty('naverPay.payUrl.web')}]];
|
|
|
|
|
+ let reserveId = $('#order_info input[name=reserveId]').val();
|
|
|
|
|
+ let url = naverPayUrl + '/payments/' + reserveId;
|
|
|
|
|
+ let option = 'width=750, height=' + $(window).height();
|
|
|
|
|
+
|
|
|
|
|
+ window.open(url, 'naverPaymentPopup', option);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// PG 네이버페이 결제 승인 요청
|
|
|
|
|
+var fnNaverPaymentRequest = function(paymentId) {
|
|
|
|
|
+ // TID 설정
|
|
|
|
|
+ $('#order_info input[name=pgTid]').val(paymentId);
|
|
|
|
|
+
|
|
|
|
|
+ // Form Submit
|
|
|
|
|
+ document.order_info.submit();
|
|
|
|
|
+
|
|
|
|
|
+ return true;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 0원이하이면 '-' 처리 삭제 함수
|
|
|
|
|
+var getZeroMinusDelAmt = function(tempAmt) {
|
|
|
|
|
+ var rtnAmtStr = "";
|
|
|
|
|
+
|
|
|
|
|
+ if (tempAmt > 0) {
|
|
|
|
|
+ rtnAmtStr = "-" + tempAmt.addComma();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ rtnAmtStr = tempAmt.addComma();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return rtnAmtStr;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//START ::: 2021.04.09 숫자입려 천단위 찍기
|
|
|
|
|
+var inputNumberFormat = function(obj) {
|
|
|
|
|
+ obj.value = comma(uncomma(obj.value));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+var comma = function(str) {
|
|
|
|
|
+ str = String(str);
|
|
|
|
|
+ return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+var uncomma = function(str) {
|
|
|
|
|
+ str = String(str);
|
|
|
|
|
+ return str.replace(/[^\d]+/g, '');
|
|
|
|
|
+}
|
|
|
|
|
+// 2021.04.09 숫자입려 천단위 찍기 ::: END
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+</th:block>
|
|
|
|
|
+</body>
|
|
|
|
|
+</html>
|