이벤트 결제하기 화면 다음 결제시 결제수단 UPDATE 기능추가
@b1cc058ad69cb39d3202921cdcf7a719e24122cd
--- src/main/webapp/WEB-INF/jsp/web/event/pay/EventPayViewV2.jsp
+++ src/main/webapp/WEB-INF/jsp/web/event/pay/EventPayViewV2.jsp
... | ... | @@ -15,6 +15,9 @@ |
| 15 | 15 |
var tabType = "${tabType}";
|
| 16 | 16 |
|
| 17 | 17 |
$(document).ready(function(){
|
| 18 |
+ //다음 결제시 결제수단 SELECT |
|
| 19 |
+ getNextPayMethod(); |
|
| 20 |
+ |
|
| 18 | 21 |
// 충전금액 세팅 |
| 19 | 22 |
setPriceMake(); |
| 20 | 23 |
|
... | ... | @@ -24,9 +27,116 @@ |
| 24 | 27 |
if (tabType == "2") {
|
| 25 | 28 |
$("#btnDdedicatedAccount").trigger("click");
|
| 26 | 29 |
} |
| 27 |
- |
|
| 28 | 30 |
}); |
| 29 | 31 |
|
| 32 |
+//다음 결제시 결제수단 SELECT |
|
| 33 |
+function getNextPayMethod() {
|
|
| 34 |
+ var nextPayMethod = ""; |
|
| 35 |
+ $.ajax({
|
|
| 36 |
+ type: "POST", |
|
| 37 |
+ url: "/web/member/pay/selectNextPayMethodAjax.do", |
|
| 38 |
+ data: {},
|
|
| 39 |
+ dataType:'json', |
|
| 40 |
+ async: false, |
|
| 41 |
+ success: function (data) {
|
|
| 42 |
+ if (data.isSuccess) {
|
|
| 43 |
+ if (data.nextPayMethod != '') {
|
|
| 44 |
+ nextPayMethod = data.nextPayMethod; |
|
| 45 |
+ |
|
| 46 |
+ // 버튼 영역 |
|
| 47 |
+ $(".btn_tab").removeClass("active");
|
|
| 48 |
+ // 금액 영역 |
|
| 49 |
+ $(".area_tabcont").removeClass("on");
|
|
| 50 |
+ |
|
| 51 |
+ if (nextPayMethod == "CARD") {
|
|
| 52 |
+ $(".btn_charge1").addClass("active");
|
|
| 53 |
+ $("#tab2_1").addClass("area_tabcont on");
|
|
| 54 |
+ } |
|
| 55 |
+ else if (nextPayMethod == "VBANK") {
|
|
| 56 |
+ $(".btn_charge2").addClass("active");
|
|
| 57 |
+ $("#tab2_2").addClass("area_tabcont on");
|
|
| 58 |
+ } |
|
| 59 |
+ else if (nextPayMethod == "BANK") {
|
|
| 60 |
+ $(".btn_charge3").addClass("active");
|
|
| 61 |
+ $("#tab2_3").addClass("area_tabcont on");
|
|
| 62 |
+ } |
|
| 63 |
+ else if (nextPayMethod == "CELLPHONE") {
|
|
| 64 |
+ // 휴대폰일경우 카드결제 초기화 |
|
| 65 |
+ $(".btn_charge1").addClass("active");
|
|
| 66 |
+ $("#tab2_1").addClass("area_tabcont on");
|
|
| 67 |
+ } |
|
| 68 |
+ else if (nextPayMethod == "NAV") {
|
|
| 69 |
+ $(".btn_charge5").addClass("active");
|
|
| 70 |
+ $("#tab2_5").addClass("area_tabcont on");
|
|
| 71 |
+ } |
|
| 72 |
+ else if (nextPayMethod == "KKO") {
|
|
| 73 |
+ $(".btn_charge6").addClass("active");
|
|
| 74 |
+ $("#tab2_6").addClass("area_tabcont on");
|
|
| 75 |
+ } |
|
| 76 |
+ else if (nextPayMethod == "TOS") {
|
|
| 77 |
+ $(".btn_charge7").addClass("active");
|
|
| 78 |
+ $("#tab2_7").addClass("area_tabcont on");
|
|
| 79 |
+ } |
|
| 80 |
+ else if (nextPayMethod == "PYC") {
|
|
| 81 |
+ $(".btn_charge8").addClass("active");
|
|
| 82 |
+ $("#tab2_8").addClass("area_tabcont on");
|
|
| 83 |
+ } |
|
| 84 |
+ |
|
| 85 |
+ // 체크박스 |
|
| 86 |
+ $("input:checkbox[id='agree']").prop("checked", true);
|
|
| 87 |
+ } |
|
| 88 |
+ } |
|
| 89 |
+ }, |
|
| 90 |
+ error: function (e) {
|
|
| 91 |
+ |
|
| 92 |
+ } |
|
| 93 |
+ }); |
|
| 94 |
+} |
|
| 95 |
+ |
|
| 96 |
+// 다음 결제시 결제수단 UPDATE |
|
| 97 |
+function setNextPayMethod() {
|
|
| 98 |
+ var nextPayMethod = ""; |
|
| 99 |
+ if ($("input:checkbox[id='agree']").is(":checked") == true) {
|
|
| 100 |
+ var $currentTab = $('.area_tab').children('.active').index();
|
|
| 101 |
+ if ($currentTab == 0) {
|
|
| 102 |
+ nextPayMethod = "CARD"; |
|
| 103 |
+ } else if ($currentTab == 1) {
|
|
| 104 |
+ nextPayMethod = "VBANK"; |
|
| 105 |
+ } else if ($currentTab==2) {
|
|
| 106 |
+ nextPayMethod = "BANK"; |
|
| 107 |
+ } else {
|
|
| 108 |
+ if ($currentTab == 3) {
|
|
| 109 |
+ nextPayMethod = "NAV"; // 네이버페이 |
|
| 110 |
+ } else if ($currentTab==4) {
|
|
| 111 |
+ nextPayMethod = "KKO"; // 카카오페이 |
|
| 112 |
+ } else if ($currentTab==5) {
|
|
| 113 |
+ nextPayMethod = "TOS"; // 토스페이 |
|
| 114 |
+ } else if ($currentTab==6) {
|
|
| 115 |
+ nextPayMethod = "PYC"; // 페이코 |
|
| 116 |
+ } |
|
| 117 |
+ } |
|
| 118 |
+ } |
|
| 119 |
+ else {
|
|
| 120 |
+ nextPayMethod = ""; |
|
| 121 |
+ } |
|
| 122 |
+ |
|
| 123 |
+ // 업데이트 |
|
| 124 |
+ $.ajax({
|
|
| 125 |
+ type: "POST", |
|
| 126 |
+ url: "/web/member/pay/updateNextPayMethodAjax.do", |
|
| 127 |
+ data: {"nextPayMethod" : nextPayMethod},
|
|
| 128 |
+ dataType:'json', |
|
| 129 |
+ async: false, |
|
| 130 |
+ success: function (data) {
|
|
| 131 |
+ if (data.isSuccess) {
|
|
| 132 |
+ |
|
| 133 |
+ } |
|
| 134 |
+ }, |
|
| 135 |
+ error: function (e) {
|
|
| 136 |
+ |
|
| 137 |
+ } |
|
| 138 |
+ }); |
|
| 139 |
+} |
|
| 30 | 140 |
|
| 31 | 141 |
//결제수단 상태 체크 |
| 32 | 142 |
function checkPayTypeStatusAjax(payMethod) {
|
... | ... | @@ -189,6 +299,9 @@ |
| 189 | 299 |
return false; |
| 190 | 300 |
} |
| 191 | 301 |
|
| 302 |
+ // 다음 결제시 결제수단 UPDATE |
|
| 303 |
+ setNextPayMethod(); |
|
| 304 |
+ |
|
| 192 | 305 |
var payMethod = ""; |
| 193 | 306 |
document.pgForm.action = "/web/member/pay/PayActionAjax.do"; |
| 194 | 307 |
|
... | ... | @@ -536,6 +649,9 @@ |
| 536 | 649 |
|
| 537 | 650 |
} |
| 538 | 651 |
|
| 652 |
+ // 다음 결제시 결제수단 UPDATE |
|
| 653 |
+ setNextPayMethod(); |
|
| 654 |
+ |
|
| 539 | 655 |
var data = new FormData(document.pgForm); |
| 540 | 656 |
url = "/web/member/pay/updateVacsAccountUsrIdAjax.do"; |
| 541 | 657 |
|
... | ... | @@ -820,12 +936,12 @@ |
| 820 | 936 |
<ul class="area_tab type03"> |
| 821 | 937 |
<li class="btn_charge1 btn_tab active"><button type="button" onclick="TabTypePay(this,'1');"><i></i>신용카드</button></li> |
| 822 | 938 |
<li class="btn_charge2 btn_tab"><button type="button" onclick="TabTypePay(this,'2');" id="btnDdedicatedAccount"><i></i>전용계좌</button></li> |
| 823 |
- <li class="btn_charge3 btn_tab"><button type="button" onclick="TabTypePay(this,'4');"><i></i>즉시이체</button></li> |
|
| 939 |
+ <li class="btn_charge3 btn_tab"><button type="button" onclick="TabTypePay(this,'3');"><i></i>즉시이체</button></li> |
|
| 824 | 940 |
|
| 825 |
- <li class="btn_charge5 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'6');"><i></i></button></li> |
|
| 826 |
- <li class="btn_charge6 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'7');"><i></i></button></li> |
|
| 827 |
- <li class="btn_charge7 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'8');"><i></i></button></li> |
|
| 828 |
- <li class="btn_charge8 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'9');"><i></i></button></li> |
|
| 941 |
+ <li class="btn_charge5 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'5');"><i></i></button></li> |
|
| 942 |
+ <li class="btn_charge6 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'6');"><i></i></button></li> |
|
| 943 |
+ <li class="btn_charge7 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'7');"><i></i></button></li> |
|
| 944 |
+ <li class="btn_charge8 btn_tab simple_pay event_simple"><button type="button" onclick="TabTypePay(this,'8');"><i></i></button></li> |
|
| 829 | 945 |
</ul> |
| 830 | 946 |
<div class="checkbox_wrap"><input type="checkbox" id="agree"><label for="agree">선택한 수단을 다음 충전 시에도 이용합니다.</label></div> |
| 831 | 947 |
|
... | ... | @@ -994,7 +1110,7 @@ |
| 994 | 1110 |
<!-- //전용계좌 --> |
| 995 | 1111 |
|
| 996 | 1112 |
<!-- 즉시이체 --> |
| 997 |
- <div class="area_tabcont" id="tab2_4"> |
|
| 1113 |
+ <div class="area_tabcont" id="tab2_3"> |
|
| 998 | 1114 |
<p class="tType1_title"><img src="/publish/images/content/icon_charging5_small.png" alt=""> 즉시이체</p> |
| 999 | 1115 |
<table class="tType1"> |
| 1000 | 1116 |
<caption></caption> |
... | ... | @@ -1052,7 +1168,7 @@ |
| 1052 | 1168 |
<!-- //즉시이체 --> |
| 1053 | 1169 |
|
| 1054 | 1170 |
<!-- 네이버페이 --> |
| 1055 |
- <div class="area_tabcont" id="tab2_6"> |
|
| 1171 |
+ <div class="area_tabcont" id="tab2_5"> |
|
| 1056 | 1172 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> 네이버페이</p> |
| 1057 | 1173 |
<table class="tType1"> |
| 1058 | 1174 |
<colgroup> |
... | ... | @@ -1121,7 +1237,7 @@ |
| 1121 | 1237 |
<!-- //네이버페이 --> |
| 1122 | 1238 |
|
| 1123 | 1239 |
<!-- 카카오페이 --> |
| 1124 |
- <div class="area_tabcont current" id="tab2_7"> |
|
| 1240 |
+ <div class="area_tabcont current" id="tab2_6"> |
|
| 1125 | 1241 |
<!-- 신규계좌발급 시 --> |
| 1126 | 1242 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> 카카오페이</p> |
| 1127 | 1243 |
<table class="tType1"> |
... | ... | @@ -1190,7 +1306,7 @@ |
| 1190 | 1306 |
<!-- //카카오페이 --> |
| 1191 | 1307 |
|
| 1192 | 1308 |
<!-- 토스페이 --> |
| 1193 |
- <div class="area_tabcont current" id="tab2_8"> |
|
| 1309 |
+ <div class="area_tabcont current" id="tab2_7"> |
|
| 1194 | 1310 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> 토스페이</p> |
| 1195 | 1311 |
<table class="tType1"> |
| 1196 | 1312 |
<caption></caption> |
... | ... | @@ -1249,7 +1365,7 @@ |
| 1249 | 1365 |
<!-- //토스페이 --> |
| 1250 | 1366 |
|
| 1251 | 1367 |
<!-- 페이코 --> |
| 1252 |
- <div class="area_tabcont current" id="tab2_9"> |
|
| 1368 |
+ <div class="area_tabcont current" id="tab2_8"> |
|
| 1253 | 1369 |
<p class="tType1_title"><img src="/publish/images/simple_small.png" alt="간편결제"> PAYCO</p> |
| 1254 | 1370 |
<table class="tType1"> |
| 1255 | 1371 |
<caption></caption> |
--- src/main/webapp/WEB-INF/jsp/web/pay/PayViewV2.jsp
+++ src/main/webapp/WEB-INF/jsp/web/pay/PayViewV2.jsp
... | ... | @@ -19,6 +19,9 @@ |
| 19 | 19 |
var tabType = "${tabType}";
|
| 20 | 20 |
|
| 21 | 21 |
$(document).ready(function(){
|
| 22 |
+ //다음 결제시 결제수단 SELECT |
|
| 23 |
+ getNextPayMethod(); |
|
| 24 |
+ |
|
| 22 | 25 |
// 충전금액 세팅 |
| 23 | 26 |
setPriceMake(); |
| 24 | 27 |
|
... | ... | @@ -29,9 +32,6 @@ |
| 29 | 32 |
$("#btnDdedicatedAccount").trigger("click");
|
| 30 | 33 |
} |
| 31 | 34 |
|
| 32 |
- //다음 결제시 결제수단 SELECT |
|
| 33 |
- getNextPayMethod(); |
|
| 34 |
- |
|
| 35 | 35 |
// 등급제 대상 여부 |
| 36 | 36 |
getMberGrdChk(); |
| 37 | 37 |
}); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?