From fdc845a2649b9c31eac90de0b63518463fac0948 Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 1 Aug 2013 11:54:45 +0900 Subject: [PATCH 1/5] =?UTF-8?q?js=20=ED=8C=8C=EC=9D=BC=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- head.sub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/head.sub.php b/head.sub.php index 7f069dc09..9f757b1cc 100644 --- a/head.sub.php +++ b/head.sub.php @@ -82,7 +82,7 @@ if ($is_admin) { set_cookie("device_width", screen.width, 6, g4_cookie_domain); '.PHP_EOL; - echo ''.PHP_EOL; // overflow scroll 감지 + echo ''.PHP_EOL; // overflow scroll 감지 } //if(!defined('G4_IS_ADMIN')) echo $config['cf_add_script']; From 8080c356c49aeabbe7a8f666b598b3381136a1c1 Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 1 Aug 2013 11:55:16 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EC=95=88=EB=93=9C=EB=A1=9C=EC=9D=B4?= =?UTF-8?q?=EB=93=9C=20=EA=B8=B0=EA=B8=B0=EC=97=90=EC=84=9C=20=EC=98=B5?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80=20=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/shop.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/js/shop.js b/js/shop.js index b16ebf6da..87069bcd0 100644 --- a/js/shop.js +++ b/js/shop.js @@ -1,5 +1,6 @@ var option_add = false; var supply_add = false; +var isAndroid = (navigator.userAgent.toLowerCase().indexOf("android") > -1); $(function() { // 선택옵션 @@ -35,9 +36,15 @@ $(function() { } }); - $("select[name='it_option[]']").live("mousedown", function() { - option_add = true; - }); + if(isAndroid) { + $("select[name='it_option[]']").live("touchend", function() { + option_add = true; + }); + } else { + $("select[name='it_option[]']").live("mousedown", function() { + option_add = true; + }); + } $("select[name='it_option[]']").live("change", function() { var sel_count = $("select[name='it_option[]']").size(); @@ -129,9 +136,15 @@ $(function() { } }); - $("select[name='it_supply[]']").live("mousedown", function() { - supply_add = true; - }); + if(isAndroid) { + $("select[name='it_supply[]']").live("touchend", function() { + supply_add = true; + }); + } else { + $("select[name='it_supply[]']").live("mousedown", function() { + supply_add = true; + }); + } $("select[name='it_supply[]']").live("change", function() { var $el = $(this); From db44a013ab37882f645f24fbd571d551c60c81ff Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 1 Aug 2013 13:20:22 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20=EC=A3=BC?= =?UTF-8?q?=EB=AC=B8=EC=8B=9C=20=EA=B2=B0=EC=A0=9C=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20=ED=9B=84=20=EC=A3=BC=EB=AC=B8=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EC=B2=98=EB=A6=AC=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/shop/kcp/order_approval_form.php | 10 +-- mobile/shop/orderform.php | 96 ++++++++++++++++++++++--- 2 files changed, 92 insertions(+), 14 deletions(-) diff --git a/mobile/shop/kcp/order_approval_form.php b/mobile/shop/kcp/order_approval_form.php index b9ab36776..1f2bec3b0 100644 --- a/mobile/shop/kcp/order_approval_form.php +++ b/mobile/shop/kcp/order_approval_form.php @@ -203,11 +203,13 @@ of.param_opt_3.value = ""; var od = window.opener.document; - od.getElementById("show_req_btn").style.display = "none"; - od.getElementById("show_progress").style.display = "block"; - od.getElementById("show_pay_btn").style.display = "inline"; + od.getElementById("display_pay_button").style.display = "none"; + //od.getElementById("show_req_btn").style.display = "none"; + //od.getElementById("show_progress").style.display = "block"; + //od.getElementById("show_pay_btn").style.display = "inline"; - alert("주문하기를 클릭하셔야 주문이 완료됩니다."); + //alert("주문하기를 클릭하셔야 주문이 완료됩니다."); + window.opener.forderform_check(); window.close(); } else { kcp_AJAX(); diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index 975a5af4f..d1f2e32e0 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -338,7 +338,7 @@ ob_end_clean();
-
+ @@ -634,7 +634,7 @@ ob_end_clean(); if ($temp_point > $member_point) $temp_point = $member_point; - echo '
결제포인트 : 점 (100점 단위로 입력하세요.)
'; + echo '
결제포인트 : 점 (100점 단위로 입력하세요.)
'; echo '
회원님의 보유포인트('.display_point($member['mb_point']).')중 '.display_point($temp_point).'(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.
'; $multi_settle++; } @@ -678,7 +678,7 @@ ob_end_clean();
- + 취소
@@ -1123,6 +1123,48 @@ function kcp_approval() var f = document.sm_form; var pf = document.forderform; + errmsg = ""; + errfld = ""; + var deffld = ""; + + check_field(pf.od_name, "주문하시는 분 이름을 입력하십시오."); + if (typeof(pf.od_pwd) != 'undefined') + { + clear_field(pf.od_pwd); + if( (pf.od_pwd.value.length<3) || (pf.od_pwd.value.search(/([^A-Za-z0-9]+)/)!=-1) ) + error_field(pf.od_pwd, "회원이 아니신 경우 주문서 조회시 필요한 비밀번호를 3자리 이상 입력해 주십시오."); + } + check_field(pf.od_tel, "주문하시는 분 전화번호를 입력하십시오."); + check_field(pf.od_addr1, "우편번호 찾기를 이용하여 주문하시는 분 주소를 입력하십시오."); + check_field(pf.od_addr2, " 주문하시는 분의 상세주소를 입력하십시오."); + check_field(pf.od_zip1, ""); + check_field(pf.od_zip2, ""); + + clear_field(pf.od_email); + if(pf.od_email.value=='' || pf.od_email.value.search(/(\S+)@(\S+)\.(\S+)/) == -1) + error_field(pf.od_email, "E-mail을 바르게 입력해 주십시오."); + + if (typeof(pf.od_hope_date) != "undefined") + { + clear_field(pf.od_hope_date); + if (!pf.od_hope_date.value) + error_field(pf.od_hope_date, "희망배송일을 선택하여 주십시오."); + } + + check_field(pf.od_b_name, "받으시는 분 이름을 입력하십시오."); + check_field(pf.od_b_tel, "받으시는 분 전화번호를 입력하십시오."); + check_field(pf.od_b_addr1, "우편번호 찾기를 이용하여 받으시는 분 주소를 입력하십시오."); + check_field(pf.od_b_addr2, "받으시는 분의 상세주소를 입력하십시오."); + check_field(pf.od_b_zip1, ""); + check_field(pf.od_b_zip2, ""); + + if (errmsg) + { + alert(errmsg); + errfld.focus(); + return false; + } + var settle_case = document.getElementsByName("od_settle_case"); var settle_check = false; var settle_method = ""; @@ -1143,6 +1185,7 @@ function kcp_approval() var tot_amount = ; var max_point = 0; + var temp_point = 0; if (typeof(pf.max_temp_point) != "undefined") max_point = parseInt(pf.max_temp_point.value); @@ -1182,15 +1225,42 @@ function kcp_approval() pf.od_temp_point.select(); return false; } - - // pg 결제 금액에서 포인트 금액 차감 - if(settle_method != "무통장" && temp_point > 0) { - f.good_mny.value = parseInt(f.good_mny.value) - temp_point; - } } } } + if (document.getElementById("od_settle_iche")) { + if (document.getElementById("od_settle_iche").checked) { + if (tot_amount - temp_point < 150) { + alert("계좌이체는 150원 이상 결제가 가능합니다."); + return false; + } + } + } + + if (document.getElementById("od_settle_card")) { + if (document.getElementById("od_settle_card").checked) { + if (tot_amount - temp_point < 1000) { + alert("신용카드는 1000원 이상 결제가 가능합니다."); + return false; + } + } + } + + if (document.getElementById("od_settle_hp")) { + if (document.getElementById("od_settle_hp").checked) { + if (tot_amount - temp_point < 350) { + alert("휴대폰은 350원 이상 결제가 가능합니다."); + return false; + } + } + } + + // pg 결제 금액에서 포인트 금액 차감 + if(settle_method != "무통장" && temp_point > 0) { + f.good_mny.value = parseInt(f.good_mny.value) - temp_point; + } + f.buyr_name.value = pf.od_name.value; f.buyr_mail.value = pf.od_email.value; f.buyr_tel1.value = pf.od_tel.value; @@ -1214,8 +1284,9 @@ function kcp_approval() f.submit(); } -function forderform_check(f) +function forderform_check() { + var f = document.forderform; errmsg = ""; errfld = ""; var deffld = ""; @@ -1361,7 +1432,12 @@ function forderform_check(f) } } - return true; + + if(settle_method == "무통장") + calculate_tax(); + + + f.submit(); } // 구매자 정보와 동일합니다. From a14a101c3243422db4b153e20df325fa442442cb Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 1 Aug 2013 13:28:01 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20=EC=A3=BC?= =?UTF-8?q?=EB=AC=B8=EC=8B=9C=20=EA=B3=BC=EC=84=B8=20=EB=B9=84=EA=B3=BC?= =?UTF-8?q?=EC=84=B8=20=EA=B8=88=EC=95=A1=20=EA=B8=B0=EB=A1=9D=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/shop/orderform.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index d1f2e32e0..4f3e7a46a 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -673,6 +673,12 @@ ob_end_clean(); + + + + + + From 861d380200bc92418de7142c01c0bfde351680cb Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 1 Aug 2013 14:18:08 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20=ED=8F=BC?= =?UTF-8?q?=EC=B2=B4=ED=81=AC=20=EC=9E=90=EB=B0=94=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EA=B0=84=EC=86=8C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/shop/orderform.php | 177 ++++++++------------------------------ 1 file changed, 35 insertions(+), 142 deletions(-) diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index 4f3e7a46a..bef131349 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -1124,143 +1124,21 @@ function calculate_tax() } /* 결제방법에 따른 처리 후 결제등록요청 실행 */ +var settle_method = ""; +var temp_point = 0; + function kcp_approval() { var f = document.sm_form; var pf = document.forderform; - errmsg = ""; - errfld = ""; - var deffld = ""; - - check_field(pf.od_name, "주문하시는 분 이름을 입력하십시오."); - if (typeof(pf.od_pwd) != 'undefined') - { - clear_field(pf.od_pwd); - if( (pf.od_pwd.value.length<3) || (pf.od_pwd.value.search(/([^A-Za-z0-9]+)/)!=-1) ) - error_field(pf.od_pwd, "회원이 아니신 경우 주문서 조회시 필요한 비밀번호를 3자리 이상 입력해 주십시오."); - } - check_field(pf.od_tel, "주문하시는 분 전화번호를 입력하십시오."); - check_field(pf.od_addr1, "우편번호 찾기를 이용하여 주문하시는 분 주소를 입력하십시오."); - check_field(pf.od_addr2, " 주문하시는 분의 상세주소를 입력하십시오."); - check_field(pf.od_zip1, ""); - check_field(pf.od_zip2, ""); - - clear_field(pf.od_email); - if(pf.od_email.value=='' || pf.od_email.value.search(/(\S+)@(\S+)\.(\S+)/) == -1) - error_field(pf.od_email, "E-mail을 바르게 입력해 주십시오."); - - if (typeof(pf.od_hope_date) != "undefined") - { - clear_field(pf.od_hope_date); - if (!pf.od_hope_date.value) - error_field(pf.od_hope_date, "희망배송일을 선택하여 주십시오."); - } - - check_field(pf.od_b_name, "받으시는 분 이름을 입력하십시오."); - check_field(pf.od_b_tel, "받으시는 분 전화번호를 입력하십시오."); - check_field(pf.od_b_addr1, "우편번호 찾기를 이용하여 받으시는 분 주소를 입력하십시오."); - check_field(pf.od_b_addr2, "받으시는 분의 상세주소를 입력하십시오."); - check_field(pf.od_b_zip1, ""); - check_field(pf.od_b_zip2, ""); - - if (errmsg) - { - alert(errmsg); - errfld.focus(); + // 필드체크 + if(!orderfield_check(pf)) return false; - } - var settle_case = document.getElementsByName("od_settle_case"); - var settle_check = false; - var settle_method = ""; - for (i=0; i; - var max_point = 0; - var temp_point = 0; - if (typeof(pf.max_temp_point) != "undefined") - max_point = parseInt(pf.max_temp_point.value); - - if (typeof(pf.od_temp_point) != "undefined") { - if (pf.od_temp_point.value) - { - if (pf.od_temp_point.value) - { - temp_point = parseInt(pf.od_temp_point.value); - - if (temp_point < 0) { - alert("포인트를 0 이상 입력하세요."); - pf.od_temp_point.select(); - return false; - } - - if (temp_point > tot_amount) { - alert("주문금액 보다 많이 포인트결제할 수 없습니다."); - pf.od_temp_point.select(); - return false; - } - - if (temp_point > ) { - alert("회원님의 포인트보다 많이 결제할 수 없습니다."); - pf.od_temp_point.select(); - return false; - } - - if (temp_point > max_point) { - alert(max_point + "점 이상 결제할 수 없습니다."); - pf.od_temp_point.select(); - return false; - } - - if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) { - alert("포인트를 100점 단위로 입력하세요."); - pf.od_temp_point.select(); - return false; - } - } - } - } - - if (document.getElementById("od_settle_iche")) { - if (document.getElementById("od_settle_iche").checked) { - if (tot_amount - temp_point < 150) { - alert("계좌이체는 150원 이상 결제가 가능합니다."); - return false; - } - } - } - - if (document.getElementById("od_settle_card")) { - if (document.getElementById("od_settle_card").checked) { - if (tot_amount - temp_point < 1000) { - alert("신용카드는 1000원 이상 결제가 가능합니다."); - return false; - } - } - } - - if (document.getElementById("od_settle_hp")) { - if (document.getElementById("od_settle_hp").checked) { - if (tot_amount - temp_point < 350) { - alert("휴대폰은 350원 이상 결제가 가능합니다."); - return false; - } - } - } // pg 결제 금액에서 포인트 금액 차감 if(settle_method != "무통장" && temp_point > 0) { @@ -1280,10 +1158,6 @@ function kcp_approval() f.rcvr_add2.value = pf.od_b_addr2.value; f.settle_method.value = settle_method; - - calculate_tax(); - - var new_win = window.open("about:blank", "tar_opener", "scrollbars=yes,resizable=yes"); f.target = "tar_opener"; @@ -1293,6 +1167,26 @@ function kcp_approval() function forderform_check() { var f = document.forderform; + + // 필드체크 + if(!orderfield_check(f)) + return false; + + // 금액체크 + if(!payment_check(f)) + return false; + + if(settle_method != "무통장" && f.res_cd.value != "0000") { + alert("결제등록요청 후 주문해 주십시오."); + return false; + } + + f.submit(); +} + +// 주문폼 필드체크 +function orderfield_check(f) +{ errmsg = ""; errfld = ""; var deffld = ""; @@ -1348,7 +1242,6 @@ function forderform_check() var settle_case = document.getElementsByName("od_settle_case"); var settle_check = false; - var settle_method = ""; for (i=0; i; if (typeof(f.max_temp_point) != "undefined") var max_point = parseInt(f.max_temp_point.value); - var temp_point = 0; if (typeof(f.od_temp_point) != "undefined") { if (f.od_temp_point.value) { @@ -1439,11 +1333,10 @@ function forderform_check() } - if(settle_method == "무통장") - calculate_tax(); + calculate_tax(); - f.submit(); + return true; } // 구매자 정보와 동일합니다.