/
shop.couponzone.js
37 lines (32 loc) · 1.06 KB
/
shop.couponzone.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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("쿠폰이 발급됐습니다.");
}
});
});
});