|
|
@@ -44,7 +44,7 @@
|
|
|
<th>delvMemo</th>
|
|
|
<th>sexGb</th>
|
|
|
<th>birthYmd</th>
|
|
|
- <th>orderGiftYn</th>
|
|
|
+ <th>giftPackYn</th>
|
|
|
</tr>
|
|
|
<tr style="height:30px;">
|
|
|
<td class="custNm"></td>
|
|
|
@@ -58,7 +58,7 @@
|
|
|
<td class="delvMemo"></td>
|
|
|
<td class="sexGb"></td>
|
|
|
<td class="birthYmd"></td>
|
|
|
- <td class="orderGiftYn" th:text="${orderGiftYn}"></td>
|
|
|
+ <td class="giftPackYn" th:text="${giftPackYn}"></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -410,7 +410,7 @@ var foreignBuyYn = [[${order.foreignBuyYn}]]; // 해외구매대행
|
|
|
var foreignBuyYn = [[${foreignBuyYn}]]; // 해외구매대행여부
|
|
|
var orderMadeYn = [[${orderMadeYn}]]; // 주문제작상품여부
|
|
|
var isLogin = [[${isLogin}]]; // 로그인여부
|
|
|
-var orderGiftYn = [[${orderGiftYn}]]; // 선물받기여부
|
|
|
+var giftPackYn = [[${giftPackYn}]]; // 선물받기여부
|
|
|
|
|
|
var custCpnSq = 0;
|
|
|
var cpnIndex = 0;
|
|
|
@@ -462,7 +462,7 @@ $(document).ready( function() {
|
|
|
, "foreignBuyYn" : foreignBuyYn
|
|
|
, "orderMadeYn" : orderMadeYn
|
|
|
, "custDelvAddrSq" : 0
|
|
|
- , "orderGiftYn" : "Y"
|
|
|
+ , "giftPackYn" : "Y"
|
|
|
}
|
|
|
|
|
|
jsonData = JSON.stringify(jsonObj);
|
|
|
@@ -511,7 +511,7 @@ var custemerInfoSet = function() {
|
|
|
}
|
|
|
|
|
|
// 1.4 선물하기여부체크
|
|
|
- if (orderGiftYn == "Y") {
|
|
|
+ if (giftPackYn == "Y") {
|
|
|
// 1.4.1 선물하기정보로드
|
|
|
orderGiftInfoSet(jsonObj, true);
|
|
|
} else {
|
|
|
@@ -579,6 +579,24 @@ var orderGiftInfoSet = function() {
|
|
|
$("#orderGiftInfo").css("display", "block");
|
|
|
$("#orderGiftInfo").html(result);
|
|
|
|
|
|
+ // 직접입력 선택 버튼
|
|
|
+ $("#orderGiftInfo .gift_tab .fold_cont ul li").on("click", function(){
|
|
|
+ $(this).parent().find("li").removeClass("active");
|
|
|
+ $(this).addClass("active");
|
|
|
+
|
|
|
+ $(this).parent().parent().find("input[name=recipNm]").val("");
|
|
|
+ $(this).parent().parent().find("input[name=recipPhnno]").val("");
|
|
|
+
|
|
|
+ // 직접입력시 입력창 활성화
|
|
|
+ if ($(this).find("span").text() == "직접입력") {
|
|
|
+ $(this).parent().parent().find("input[name=recipNm]").attr("readOnly", false);
|
|
|
+ $(this).parent().parent().find("input[name=recipPhnno]").attr("readOnly", false);
|
|
|
+ } else {
|
|
|
+ $(this).parent().parent().find("input[name=recipNm]").attr("readOnly", true);
|
|
|
+ $(this).parent().parent().find("input[name=recipPhnno]").attr("readOnly", true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// 주문목록정보로드
|
|
|
orderListInfoSet(JSON.stringify(jsonObj), true);
|
|
|
}
|
|
|
@@ -773,6 +791,17 @@ var freegiftInfoSet = 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).is(":checked")) {
|
|
|
@@ -853,43 +882,38 @@ var paymentInfoSet = function() {
|
|
|
var goodsNm = "";
|
|
|
var orgEntryNo = "";
|
|
|
var entryNo = "";
|
|
|
-
|
|
|
- // 주문데이타 생성
|
|
|
- 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()
|
|
|
- ,"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" : $("#orderAmtForm .freegiftValArr").text().split(",")
|
|
|
- ,"freegiftSqArr" : $("#orderAmtForm .freegiftSqArr").text().split(",")
|
|
|
- ,"freegiftGoodsArr" : $("#orderAmtForm .freegiftGoodsArr").text().split(",")
|
|
|
- ,"freegiftUsePointArr" : $("#orderAmtForm .freegiftUsePointArr").text().split(",")
|
|
|
- };
|
|
|
+ var giftMsg = "감사합니다.";
|
|
|
|
|
|
// 선물받기일때 배송지주소 받지않음
|
|
|
- if (orderGiftYn == "N") {
|
|
|
+ if (giftPackYn == "N") {
|
|
|
if ($("#orderAmtForm .recipZipcode").text() == "0000" || gagajf.isNull($("#orderAmtForm .recipZipcode").text())) {
|
|
|
- mcxDialog.alert("배송지주소를를 입력해주세요.");
|
|
|
+ mcxDialog.alert("배송정보를 입력해주세요.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (gagajf.isNull($("#orderForm #orderGiftInfo input[name=recipNm]").val())) {
|
|
|
+ mcxDialog.alert("선물받을분 이름을 입력해주세요.");
|
|
|
+ $("#orderForm #orderGiftInfo input[name=recipNm]").focus();
|
|
|
+
|
|
|
+ orderGiftInfoDispYn("Y");
|
|
|
return false;
|
|
|
}
|
|
|
+ if (gagajf.isNull($("#orderForm #orderGiftInfo input[name=recipPhnno]").val())) {
|
|
|
+ mcxDialog.alert("선물받을분 휴대폰번호를 입력해주세요.");
|
|
|
+ $("#orderForm #orderGiftInfo input[name=recipPhnno]").focus();
|
|
|
+
|
|
|
+ orderGiftInfoDispYn("Y");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#orderAmtForm .recipNm").text($("#orderForm #orderGiftInfo input[name=recipNm]").val());
|
|
|
+ $("#orderAmtForm .recipPhnno").text($("#orderForm #orderGiftInfo input[name=recipPhnno]").val());
|
|
|
+
|
|
|
+ if (gagajf.isNull($("#orderForm #orderGiftInfo input[name=recipPhnno]").val())) {
|
|
|
+ giftMsg = "감사합니다.";
|
|
|
+ } else {
|
|
|
+ giftMsg = $("textarea#giftMsg").val();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// TODO 개인통관번호 동의 체크시 통관번호 등록
|
|
|
@@ -1008,7 +1032,7 @@ var paymentInfoSet = function() {
|
|
|
,"itemQtyArr" : $(this).parent().find(".itemQtyr").text().split(",")
|
|
|
,"goodsType" : $(this).parent().find(".goodsType").text()
|
|
|
,"entryNo" : entryNo
|
|
|
- ,"giftPackYn" : orderGiftYn
|
|
|
+ ,"giftPackYn" : giftPackYn
|
|
|
}
|
|
|
|
|
|
// 상품수
|
|
|
@@ -1058,6 +1082,7 @@ var paymentInfoSet = function() {
|
|
|
,"freegiftSqArr" : $("#orderAmtForm .freegiftSqArr").text().split(",")
|
|
|
,"freegiftGoodsArr" : $("#orderAmtForm .freegiftGoodsArr").text().split(",")
|
|
|
,"freegiftUsePointArr" : $("#orderAmtForm .freegiftUsePointArr").text().split(",")
|
|
|
+ ,"giftMsg" : giftMsg
|
|
|
};
|
|
|
|
|
|
$.ajax( {
|
|
|
@@ -1072,24 +1097,18 @@ var paymentInfoSet = function() {
|
|
|
gagajf.showProgressbar(true);
|
|
|
},
|
|
|
success : function(result) {
|
|
|
- // 유효성체크 통과
|
|
|
- if (result.message == "SUCCESS") {
|
|
|
- // 결재정보로드
|
|
|
- $("#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") {
|
|
|
- jsf__pay(document.order_info);
|
|
|
- }
|
|
|
- return;
|
|
|
- } else {
|
|
|
- alert(result.message);
|
|
|
- return false;
|
|
|
+
|
|
|
+ // 결재정보로드
|
|
|
+ $("#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") {
|
|
|
+ jsf__pay(document.order_info);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -2098,7 +2117,7 @@ var custCpnSumAmtCal = function() {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- $("#orderAmtForm .freegiftValArr").text(freegiftValArr); // 사은품시퀀스배열
|
|
|
+ $("#orderAmtForm .freegiftValArr").text(freegiftValArr); // 사은품시퀀스배열
|
|
|
$("#orderAmtForm .freegiftUsePointArr").text(freegiftUsePointArr); // 사은품사용포인트배열
|
|
|
};
|
|
|
|