쿠폰존 추가

This commit is contained in:
chicpro
2016-09-09 13:57:57 +09:00
parent ac89a2d512
commit 6e1aa4ac0c
27 changed files with 1446 additions and 9 deletions

37
js/shop.couponzone.js Normal file
View File

@ -0,0 +1,37 @@
$(function() {
$("button.coupon_download").on("click", function() {
if(g5_is_member != "1") {
alert("회원 로그인 후 이용해 주십시오.");
return false;
}
var $this = $(this);
var cz_id = $this.data("cid");
if($this.hasClass("disabled")) {
alert("이미 다운로드하신 쿠폰입니다.");
return false;
}
$this.addClass("disabled").attr("disabled", true);
$.ajax({
type: "GET",
data: { cz_id: cz_id },
url: g5_url+"/shop/ajax.coupondownload.php",
cache: false,
async: true,
dataType: "json",
success: function(data) {
if(data.error != "") {
$this.removeClass("disabled").attr("disabled", false);
alert(data.error);
return false;
}
$this.attr("disabled", false);
alert("쿠폰이 발급됐습니다.");
}
});
});
});