-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathorder-single.html
More file actions
232 lines (215 loc) · 8.09 KB
/
order-single.html
File metadata and controls
232 lines (215 loc) · 8.09 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html lang="en">
<head>
<title>Developer's community - Develonity</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Mukta:300,400,700"
/>
<link rel="stylesheet" href="fonts/icomoon/style.css" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/magnific-popup.css" />
<link rel="stylesheet" href="css/jquery-ui.css" />
<link rel="stylesheet" href="css/owl.carousel.min.css" />
<link rel="stylesheet" href="css/owl.theme.default.min.css" />
<link rel="stylesheet" href="css/aos.css" />
<link rel="stylesheet" href="css/style.css" />
</head>
<style>
.card {
width: 500px;
margin: auto;
}
</style>
<body>
<div class="site-wrap">
<header class="site-navbar" role="banner">
<div class="site-navbar-top">
<div class="container">
<div class="row align-items-center">
<div
class="col-6 col-md-4 order-2 order-md-1 site-search-icon text-left"
>
<form action="" class="site-block-top-search">
<!-- <span class="icon icon-search2"></span>
<input type="text" class="form-control border-0" placeholder="Search"> -->
</form>
</div>
<div
class="col-12 mb-3 mb-md-0 col-md-4 order-1 order-md-2 text-center"
>
<div class="site-logo">
<a href="index.html" class="js-logo-clone">Develonity</a>
</div>
</div>
<div class="col-6 col-md-4 order-3 order-md-3 text-right">
<div class="site-top-icons">
<ul>
<li id="logoutPlace"></li>
<li id="loginedPerson">
<a href="signUp.html" class="icon icon-person"> </a>
</li>
<li>
<a href="#" class="icon icon-heart-o"></a>
</li>
<li>
<a href="orderList.html" class="site-cart">
<span class="icon icon-shopping_cart"></span>
</a>
</li>
<li class="d-inline-block d-md-none ml-md-0">
<a href="#" class="site-menu-toggle js-menu-toggle"
><span class="icon-menu"></span
></a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<nav
class="site-navigation text-right text-md-center"
role="navigation"
>
<div class="container">
<ul class="site-menu js-clone-nav d-none d-md-block">
<li><a href="index.html">Home</a></li>
<li><a onclick="community()">Community</a></li>
<li><a href="QnA.html">Q&A</a></li>
<li><a href="shop.html">GiftCard Shop</a></li>
</ul>
</div>
</nav>
</header>
<div class="bg-light py-3">
<div class="container">
<div class="row">
<div class="col-md-12 mb-0">
<a href="index.html">Home</a> <span class="mx-2 mb-0">/</span>
<strong class="text-black"
><a href="orderList.html">주문 내역</a></strong
><span class="mx-2 mb-0">/</span
><strong class="text-black">주문 상세보기</strong>
</div>
</div>
</div>
</div>
<div class="site-section">
<div class="container">
<div class="row" id="orderDetails"></div>
</div>
</div>
</div>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/aos.js"></script>
<script src="js/main.js"></script>
<script>
$(document).ready(function () {
getOrderDetails(localStorage.getItem("orderId"));
});
</script>
<script>
$(function () {
var settings = {
url: "http://52.79.252.88:8080/api/user/me/profile",
method: "GET",
timeout: 0,
headers: {
Authorization: localStorage.getItem("accessToken"),
},
};
$.ajax(settings)
.done(function (response) {
console.log(response);
$("#loginedPerson").empty();
$("#loginedPerson").append(
`<a href=myProfile.html class="icon icon-person"> </a>`
);
$("#logoutPlace").append(
`<button style="font-size: 12px; cursor: pointer" onclick="logout()">
로그아웃
</button>`
);
})
.fail(function (response) {
var settings2 = {
url: "http://52.79.252.88:8080/api/reissue",
method: "POST",
timeout: 0,
headers: {
Refresh: localStorage.getItem("refreshToken"),
},
};
$.ajax(settings2).done(function (response) {
localStorage.setItem("accessToken", response.accessToken);
localStorage.setItem("refreshToken", response.refreshToken);
location.reload(true);
});
});
});
</script>
<script>
function community() {
alert(
"해당 기능은 시간관계상 프론트 구현을 하지 못하여 이용이 어렵습니다. 죄송합니다."
);
}
function getOrderDetails(id) {
$("#orderDetails").empty();
var settings = {
url: `http://52.79.252.88:8080/api/user/orders/${id}`,
method: "GET",
timeout: 0,
headers: {
Authorization: localStorage.getItem("accessToken"),
},
};
$.ajax(settings).done(function (response) {
console.log(response);
let orderId = response["orderId"];
let image = response["image"];
let giftCardName = response["giftCardName"];
let orderDate = response["orderDate"];
let orderStatus = response["orderStatus"];
let phoneNumber = response["phoneNumber"];
let purchasePrice = response["purchasePrice"];
let recipientName = response["recipientName"];
let userId = response["userId"];
if (orderStatus === "PAYMENT_COMPLETED") {
orderStatus = "결제 완료";
} else if (orderStatus === "SEND_FAIL") {
orderStatus = "발송 실패";
} else if (orderStatus === "SEND_SUCCESS") {
orderStatus = "발송 성공";
}
let temp_html = ` <div class="card" style="width: 35rem;">
<img src="${image}" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">주문상세</h5>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">주문번호 : ${orderId}</li>
<li class="list-group-item">받는분 : ${recipientName}</li>
<li class="list-group-item">휴대폰 : ${phoneNumber}</li>
<li class="list-group-item">주문 일자 : ${orderDate}</li>
<li class="list-group-item">주문 가격 : ${purchasePrice}</li>
<li class="list-group-item">주문 현황 : ${orderStatus}</li>
</ul>
</div>`;
$("#orderDetails").append(temp_html);
});
}
</script>
</body>
</html>