-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmentoringdetail.html
431 lines (371 loc) · 16.5 KB
/
mentoringdetail.html
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<!DOCTYPE html>
<html lang="utf-8">
<head>
<link th:href="@{/plugins/colorbox/colorbox.css}" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" th:href="@{/styles/course.css}">
<link rel="stylesheet" type="text/css" th:href="@{/styles/course_responsive.css}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+KR:wght@300&display=swap" rel="stylesheet">
<script th:src="@{/plugins/colorbox/jquery.colorbox-min.js}"></script>
<script th:src="@{/js/course.js}"></script>
<script src="https://t1.kakaocdn.net/kakao_js_sdk/2.0.1/kakao.min.js"
integrity="sha384-eKjgHJ9+vwU/FCSUG3nV1RKFolUXLsc6nLQ2R1tD0t4YFPCvRmkcF8saIfOZNWf/" crossorigin="anonymous"></script>
<style>
.cont-select {
position: relative;
width: 200px;
}
.btn-select {
width: 100%;
padding: 13px 30px 13px 14px;
font-size: 15px;
line-height: 14px;
background-color: #fff;
border: 1px solid #C4C4C4;
box-sizing: border-box;
border-radius: 10px;
cursor: pointer;
text-align: left;
/* 말줄임 */
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.btn-select:hover,
.btn-select:focus {
border: 1px solid #005b00;
outline: 3px solid #005b00;
}
.list-member {
display: none;
position: absolute;
width: 100%;
top: 49px;
left: 0;
border: 1px solid #C4C4C4;
box-sizing: border-box;
box-shadow: 4px 4px 14px rgba(0, 0, 0, 0.15);
border-radius: 10px;
background-color: #fff;
}
.btn-select.on {
}
.btn-select.on+.list-member {
display: block;
}
.list-member li {
height: 40px;
padding: 5px 8px;
box-sizing: border-box;
}
.list-member li button {
width: 100%;
padding: 7px 10px;
border: none;
background-color: white;
border-radius: 8px;
cursor: pointer;
text-align: left;
/* 말줄임 */
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-size: 15px;
}
.list-member li button:hover,
.list-member li button:focus {
background-color: #005b00;
}
</style>
<script>
// 시간선택 버튼 클릭시 value 값 input에 받아오기
function timeChange(statusTime) { // 버튼 클릭시 함수 시작
var selectTime = $(statusTime).text(); // 버튼의 value값 받아오기
$('#time').val(selectTime); // 버튼의 value값 input에 받아오기
};
</script>
</head>
<!-- Home -->
<div class="home">
<div class="breadcrumbs_container">
<div class="container">
<div class="row">
<div class="col">
<div class="breadcrumbs">
<ul>
<li><a th:href="@{/}">홈</a></li>
<li><a th:href="@{/mentoring/defaultmentoring}">멘토링</a></li>
<li>멘토링 디테일</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Course -->
<div th:each="mto:${mto} "class="course">
<div class="container">
<div class="row">
<!-- Course -->
<div class="col-lg-8">
<div class="course_container">
<div class="course_title" id="mtitle" th:text="${mto.mtitle}" style="float:left; font-family: 'IBM Plex Sans KR', sans-serif;">Software Training</div>
<ul style="list-style:none;"><li><a id="kakaotalksharingbtn"><img th:onclick="shareMessage([[${mto.mentoringid}]],[[${mto.mtitle}]])" style="margin-top:10px; margin-bottom:18px;float:left;" src="https://developers.kakao.com/assets/img/about/logos/kakaotalksharing/kakaotalk_sharing_btn_small.png" alt="카카오톡 공유 보내기 버튼" /></a></li></ul>
<div class="teacher_meta_text ml-auto"
th:if="${mto.date_difference >= 0 }">
<span class="badge badge-pill badge-primary"
style="margin-top:10px; margin-bottom:18px;float:right;color: #FFFFFF">진행가능</span>
</div>
<div class="teacher_meta_text ml-auto"
th:if="${mto.date_difference < 0}">
<span class="badge badge-pill badge-danger"
style="margin-top:10px; margin-bottom:18px;float:right;color: #FFFFFF">진행완료</span>
</div>
<div class="teacher_meta_text ml-auto"
th:if="${mto.mentorurl == 'nonface'}">
<span class="badge badge-pill badge-primary"
style="margin-top:10px; margin-bottom:18px;float:right;background-color: #006400; color: #FFFFFF;">비대면</span>
</div>
<div class="teacher_meta_text ml-auto"
th:if="${mto.mentorurl == 'face'}">
<span class="badge badge-pill badge-danger"
style="margin-top:10px; margin-bottom:18px;float:right;background-color: #FF8C00;color: #FFFFFF;">대면</span>
</div>
<div class="teacher_meta_text ml-auto"
th:if="${mto.mcaring == 1}">
<span class="badge badge-pill badge-danger"
style="margin-top:10px; margin-bottom:18px;float:right;background-color: #4B0082;color: #FFFFFF;">care</span>
</div>
<div class="course_info d-flex flex-lg-row flex-column align-items-lg-center align-items-start justify-content-start">
<!-- Course Info Item -->
<div class="course_info_item">
<div class="course_info_title" style="font-family: 'IBM Plex Sans KR', sans-serif;">시간별 모집 정원</div>
<div class="course_info_text" th:text="${mto.mmemberidcnt}"><a href="#">Jacke Masito</a></div>
</div>
<!-- Course Info Item -->
<div class="course_info_item">
<div class="course_info_title" style="font-family: 'IBM Plex Sans KR', sans-serif;">멘토링 진행 날짜</div>
<div class="rating_r rating_r_4" id="mentoringdate" th:text="${#dates.format(mto.mentoringdate,'yyyy-MM-dd')}"></div>
</div>
<!-- Course Info Item -->
<div class="course_info_item">
<div class="course_info_title" style="font-family: 'IBM Plex Sans KR', sans-serif;">카테고리</div>
<div class="course_info_text" th:text="${mto.mcate_mname}" style="font-family: 'IBM Plex Sans KR', sans-serif;"><a href="#">Languages</a></div>
</div>
</div>
<!-- Course Image -->
<div class="course_image"><img th:src="@{/img/}+${mto.mentoringimg}" alt=""></div>
<!-- Course Tabs -->
<div class="course_tabs_container">
<div class="tabs d-flex flex-row align-items-center justify-content-start">
<div class="tab" style="font-family: 'IBM Plex Sans KR', sans-serif; font-weight:bold;">멘토링 설명</div>
<div class="tab" id="kakaomap" style="font-family: 'IBM Plex Sans KR', sans-serif; font-weight:bold;">대면 장소</div>
</div>
<div class="tab_panels">
<!-- Description -->
<div class="tab_panel active">
<p class="tab_panel_content" th:text="${mto.mcontents}" style="white-space:pre-wrap; font-weight:bold; font-size:18px; color:black; font-family:'IBM Plex Sans KR', sans-serif;"></p>
</div>
<!-- Curriculum -->
<div class="tab_panel active">
<div class="tab_panel_content">
<div id="map" style="width:100%;height:350px;"></div>
<!-- kakao map -->
<script type="text/javascript" th:src="@{//dapi.kakao.com/v2/maps/sdk.js?appkey=aa0b8f301544c68fe928d59bb6b4f627&libraries=services}"></script>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Course Sidebar -->
<div class="col-lg-4">
<div class="sidebar">
<!-- Feature_course -->
<div class="sidebar_section">
<div>
<button type="submit" class="home_search_button" th:if="${mto.date_difference >= 0 }" th:onclick="purchase()" style="margin-top:20px; width:150px;">구매하기</button>
<button type="submit" class="home_search_button" th:if="${mto.date_difference < 0 }" style="margin-top:20px; width:170px; background-color:#BFBCBB; font-family: 'IBM Plex Sans KR', sans-serif;">이미 진행된 멘토링입니다</button>
</div>
<div class="sidebar_feature">
<div class="sidebar_section_title" style="margin-top:65px; margin-bottom:18px; font-family:'IBM Plex Sans KR', sans-serif;">멘토링 가격</div>
<span style = "font-size:22px; font-weight:bold; color:black; font-family:'IBM Plex Sans KR', sans-serif;">가격 : </span>
<span style="display:inline-block; font-weight:bold; font-family:'IBM Plex Sans KR', sans-serif;" id="mentoring_price" class="course_price" th:text="${mto.mentoringprice}"></span>
<span style = "font-size:18px; font-weight:bold; color:black; font-family:'IBM Plex Sans KR', sans-serif;">₩</span>
<div class="sidebar_section_title" style="margin-top:65px; margin-bottom:18px; font-family:'IBM Plex Sans KR', sans-serif;">남은 인원</div>
<div th:each="mttime:${mttime}">
<span style="display:inline-block; font-size:18px; font-weight:bold; color:black; font-family:'IBM Plex Sans KR', sans-serif;"
id="remaining" class="course_price" th:text="${mttime.mentoringtime} + '시' + ' ' + ${mttime.moptionstock} + '명'"></span>
</div>
<br>
<br>
<!-- Features -->
<div class="feature_list" style="z-index:10;">
<div class="sidebar_section_title" style="margin-bottom:18px; margin-top:35px; font-family:'IBM Plex Sans KR', sans-serif;">시간 선택</div>
<!-- Feature -->
<article class="cont-select">
<button id="time" value="" class="btn-select">시간을 선택하세요</button>
<ul class="list-member">
<li th:if="${mttime.moptionstock != 0}" th:each="mttime:${mttime}"><button type="button" th:text="${mttime.mentoringtime}"></button></li>
</ul>
</article>
<script>
const btn = document.querySelector('.btn-select');
const list = document.querySelector('.list-member');
btn.addEventListener('click', () => {
btn.classList.toggle('on');
});
list.addEventListener('click', (event) => {
if (event.target.nodeName === "BUTTON") {
btn.innerText = event.target.innerText;
btn.classList.remove('on');
}
});
</script>
</div>
</div>
<!-- Feature -->
<div class="sidebar_section" style="z-index:1;">
<div class="sidebar_section_title" style="margin-top:180px; font-family:'IBM Plex Sans KR', sans-serif;">멘토 정보</div>
<div class="sidebar_teacher">
<div class="teacher_title_container d-flex flex-row align-items-center justify-content-start">
<div class="teacher_image"><a th:onclick="request()"><img style="cursor:pointer" th:src="@{/img/}+${mto.mentor_mentorimg}" alt=""></a></div>
<div class="teacher_title">
<div style="display:inline; color:#808080;"><span>Mentor ID :</span></div>
<div style="display:inline; color:#808080;" class="teacher_name" th:text="${mto.user_userid}" th:href="@{/mentor/mentordetail}"><a href="#"></a></div>
<br>
<div style="display:inline; color:#808080;"><span style="font-family: 'IBM Plex Sans KR', sans-serif;">현직 회사 :</span></div>
<div style="display:inline; color:#808080; font-family: 'IBM Plex Sans KR', sans-serif;" class="teacher_name" th:text="${mto.mentor_mentorcom}"><a href="#"></a></div>
</div>
</div>
 
 
</div>
</div>
<!-- Latest Course -->
<div class="sidebar_section">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
//구매하기(choyunyoung add)
//mentorname,mentoringoptionid
function purchase() {
var mentoringid ='[[${mto.mentoringid}]]';//mentoringid
var mtitle = '[[${mto.mtitle}]]'; //mtitle
var mentorid = '[[${mto.user_userid}]]';
var mentoringdate =$('#mentoringdate').text(); //mentoringdate
var mentoring_mentoringdate = new Date('[[${mto.mentoringdate}]]');
var mentoringtime =$('#time').text(); //mentoringtime
var mplace = '[[${mto.mplace}]]'; //mplace
var mentoringprice='[[${mto.mentoringprice}]]';//mentoringprice
//mentoringoptionid(controller에서 만들어줌)
location.href = '[[@{/purchase/idcheck?mentoring_mentoringid=}]]'
+ mentoringid + '&[[@{mentoring_mtitle=}]]' + mtitle + '&[[@{mentoring_mentoringdate=}]]' + mentoringdate + '&[[@{mentoringoption_mentoringtime=}]]' + mentoringtime + '&[[@{mentoring_mplace=}]]'
+ mplace + '&[[@{mentoring_mentoringprice=}]]' + mentoringprice + '&[[@{mentor_userid=}]]' + mentorid;
}
</script>
<!-- kakao map -->
<script>
$('#kakaomap').click(function(){
var mapContainer = document.getElementById('map'), // 지도를 표시할 div
mapOption = {
center: new kakao.maps.LatLng(33.450701, 126.570667), // 지도의 중심좌표
level: 3 // 지도의 확대 레벨
};
//지도를 생성합니다
var map = new kakao.maps.Map(mapContainer, mapOption);
//주소-좌표 변환 객체를 생성합니다
var geocoder = new kakao.maps.services.Geocoder();
//주소로 좌표를 검색합니다
geocoder.addressSearch('[[${mto.mplace}]]', function(result, status) {
// 정상적으로 검색이 완료됐으면
if (status === kakao.maps.services.Status.OK) {
var coords = new kakao.maps.LatLng(result[0].y, result[0].x);
// 결과값으로 받은 위치를 마커로 표시합니다
var marker = new kakao.maps.Marker({
map: map,
position: coords
});
// 인포윈도우로 장소에 대한 설명을 표시합니다
var infowindow = new kakao.maps.InfoWindow({
content: '<div style="width:150px;text-align:center;padding:6px 0; color:black;"><strong style="color:#005b00; font-size:16px;">대면 멘토링 장소</strong><br>[[${mto.mplace}]]</div>'
});
infowindow.open(map, marker);
// 지도의 중심을 결과값으로 받은 위치로 이동시킵니다
map.setCenter(coords);
};
});
//다시 지도를 찾음
map.relayout();
//center지정 다시 해주기
map.setCenter(new kakao.maps.LatLng(37.503376, 127.049776));
// 마커가 표시될 위치입니다
var markerPosition = new kakao.maps.LatLng(37.503376, 127.049776);
// 마커를 생성합니다
var marker = new kakao.maps.Marker({
position: markerPosition
});
// 마커가 지도 위에 표시되도록 설정합니다
marker.setMap(map);
var iwContent = '<div style="width:150px;text-align:center;padding:6px 0; color:black;"><strong style="color:#005b00; font-size:16px;">MOGOTCO 본사</strong><br>비대면 멘토링 입니다</div>', // 인포윈도우에 표출될 내용으로 HTML 문자열이나 document element가 가능합니다
iwPosition = new kakao.maps.LatLng(33.450701, 126.570667); //인포윈도우 표시 위치입니다
// 인포윈도우를 생성합니다
var infowindow = new kakao.maps.InfoWindow({
position : iwPosition,
content : iwContent
});
// 마커 위에 인포윈도우를 표시합니다. 두번째 파라미터인 marker를 넣어주지 않으면 지도 위에 표시됩니다
infowindow.open(map, marker);
});
</script>
<script>
function request(){
var mentorid = '[[${mtg.mentorid}]]';
location.href='[[@{/mentor/idcheck?mentorid=}]]'+mentorid;
}
</script>
<script>
Kakao.init('b67794657ed6e950ec05402c7a55d07f'); // 사용하려는 앱의 JavaScript 키 입력
</script>
<script>
function shareMessage(mentoringid,mtitle) {
Kakao.Share.sendDefault({
objectType: 'feed',
content: {
title: 'Mogotco mentor',
description: 'mentorid : '+mtitle,
imageUrl:
'',
link: {
// [내 애플리케이션] > [플랫폼] 에서 등록한 사이트 도메인과 일치해야 함
mobileWebUrl: 'http://49.50.174.57:8080//mogotco/mentoring/mentoringdetail?mentoringid='+mentoringid,
webUrl: 'http://49.50.174.57:8080//mogotco/mentoring/mentoringdetail?mentoringid='+mentoringid,
},
},
buttons: [
{
title: 'web',
link: {
mobileWebUrl: 'http://49.50.174.57:8080//mogotco/mentoring/mentoringdetail?mentoringid='+mentoringid,
webUrl: 'http://49.50.174.57:8080//mogotco/mentoring/mentoringdetail?mentoringid='+mentoringid,
},
},
{
title: 'app',
link: {
mobileWebUrl: 'http://49.50.174.57:8080//mogotco/mentoring/mentoringdetail?mentoringid='+mentoringid,
webUrl: 'http://49.50.174.57:8080//mogotco/mentoring/mentoringdetail?mentoringid='+mentoringid,
},
},
],
});
}
</script>
</html>