1let uid = getCookie('uid'); 2let gradeObj = { 3 "ì¼ë°" : { 4 "text":"normal", 5 "addPoint":"0" 6 }, 7 "ì¤ë²" : { 8 "text":"silver", 9 "addPoint":"1" 10 }, 11 "골ë" : { 12 "text":"gold", 13 "addPoint":"3" 14 }, 15 "VIP" : { 16 "text":"vip", 17 "addPoint":"5" 18 } 19} 20let curDate = new Date(); 21let curObj = date2obj(curDate); 22 23let score_so = 10; 24let score_comp = 30; 25let score_ad = 3; 26// let score_so = 20; 27// let score_comp = 90; 28// let score_ad = 5; 29 30let recommand_code = ''; 31let direct_code = ''; 32let url = window.location.protocol + '//' + window.location.host + '/account/signup'; 33 34let copyURL = el_ => { 35 let device = navigator.userAgent; 36 if (device.indexOf('ANDROID_APP') > -1) { 37 // globalAlert('ìëë¡ì´ë ì±ì ì§ìíì§ ììµëë¤.<br>ë¸ë¼ì°ì ë PC를 ì´ì©í´ì£¼ì¸ì.', 'alert'); 38 // return; 39 $(el_).select(); 40 document.execCommand('copy'); 41 $(el_).prop('disabled', true); 42 setTimeout(() => { 43 $(el_).prop('disabled', false); 44 }); 45 globalAlert('ë³µì¬ ì±ê³µ', 'success'); 46 } else { 47 navigator.clipboard.writeText($(el_).val()).then(() => { 48 globalAlert('ë³µì¬ ì±ê³µ', 'success'); 49 }); 50 } 51} 52 53let sendKaKao_before = () => { 54 let device = navigator.userAgent; 55 if (device.indexOf('ANDROID_APP') > -1) { 56 // globalAlert('ìëë¡ì´ë ì±ì ì§ìíì§ ììµëë¤.<br>ë¸ë¼ì°ì ë PC를 ì´ì©í´ì£¼ì¸ì.', 'alert'); 57 globalAlert('ì ë²ì ì¼ë¡ ì ë°ì´í¸ íì ë¤ì ì´ì©í ì ììµëë¤.', 'alert'); 58 return; 59 } 60 if (device.indexOf('IOS_APP') > -1) { 61 // globalAlert('IOS ì±ì ì§ìíì§ ììµëë¤.<br>ë¸ë¼ì°ì ë PC를 ì´ì©í´ì£¼ì¸ì.', 'alert'); 62 globalAlert('ì ë²ì ì¼ë¡ ì ë°ì´í¸ íì ë¤ì ì´ì©í ì ììµëë¤.', 'alert'); 63 return; 64 } 65 66 let title = `ì¶ì²ì½ë : ${recommand_code}`; 67 let desc = 'ì ì¶ì²ì½ë ì ë ¥íì¬ íìê°ì ìë£íë©´ 1,000ì ì 립!'; 68 let imgUrl = 'https://www.surveylink.co.kr/inc/imgs/event/event29_kakaoThum.png'; 69 let sendUrl = `${url}?reCode=${direct_code}`; 70 let btnTitle = 'ê°ì íê³ ì ë¦½ê¸ ë°ê¸°'; 71 sendKakao(title, desc, imgUrl, sendUrl, btnTitle); 72} 73 74let getInfo = () => { 75 let sendData = new Object(); 76 sendData.dummy = cr_dummy(); 77 78 $.ajax({ 79 url: `/serviceApi/mypage/index/${uid}`, 80 type: 'get', 81 data: sendData, 82 dataType: 'json', 83 headers: { authorization: getCookie('token') }, 84 success: r => { 85 if (r.success) { 86 $('#recommand-code').text(r.recommand_code); 87 recommand_code = r.recommand_code; 88 $('#user-grade-img').attr({ 89 'src':`/inc/imgs/mypage/grade_${gradeObj[r.grade].text}.png`, 90 'alt':`${r.grade}ë±ê¸` 91 }); 92 $('#user-grade-add-point').text(gradeObj[r.grade].addPoint); 93 $('#user-id').text(getCookie('id')); 94 $('#user-grade').text(r.grade); 95 $('#ap-average').text(r.ap_average); 96 97 let nextDate = new Date(parseInt(curObj.year, 10), parseInt(curObj.month, 10)); 98 let nextObj = date2obj(nextDate); 99 $('#grade-apply-date').text(`${curObj.year}-${curObj.month}-10 ~ ${nextObj.year}-${nextObj.month}-09`); 100 $('#grade-next-date').text(`${nextObj.year}-${nextObj.month}-10`); 101 102 if (parseInt(r.ap_month_d1.replace(/ë |ì/g, '') , 10) < 202302) { 103 score_so = 20; 104 score_comp = 90; 105 score_ad = 5; 106 } else { 107 $('#m0-ad-label').text('ì¶ìì²´í¬'); 108 } 109 110 $('#m0-month').text(r.ap_month_d1.replace(/\d+ë (\d+)ì/, '$1')); 111 $('#m0-ap').text(r.ap_d1); 112 $('#m0-so').text(commify(r.userDetailInfo_d1[0].SUM)); 113 $('#m0-so-cnt').text(r.userDetailInfo_d1[0].SUM / score_so); 114 $('#m0-comp').text(commify(r.userDetailInfo_d1[1].SUM)); 115 $('#m0-comp-cnt').text(r.userDetailInfo_d1[1].SUM / score_comp); 116 $('#m0-ad').text(commify(r.userDetailInfo_d1[2].SUM)); 117 $('#m0-ad-cnt').text(r.userDetailInfo_d1[2].SUM / score_ad); 118 119 if (parseInt(r.ap_month_d2.replace(/ë |ì/g, '') , 10) < 202302) { 120 score_so = 20; 121 score_comp = 90; 122 score_ad = 5; 123 } else { 124 $('#m1-ad-label').text('ì¶ìì²´í¬'); 125 } 126 127 $('#m1-month').text(r.ap_month_d2.replace(/\d+ë (\d+)ì/, '$1')); 128 $('#m1-ap').text(r.ap_d2); 129 $('#m1-so').text(commify(r.userDetailInfo_d2[0].SUM)); 130 $('#m1-so-cnt').text(r.userDetailInfo_d2[0].SUM / score_so); 131 $('#m1-comp').text(commify(r.userDetailInfo_d2[1].SUM)); 132 $('#m1-comp-cnt').text(r.userDetailInfo_d2[1].SUM / score_comp); 133 $('#m1-ad').text(commify(r.userDetailInfo_d2[2].SUM)); 134 $('#m1-ad-cnt').text(r.userDetailInfo_d2[2].SUM / score_ad); 135 136 if (parseInt(r.ap_month_d3.replace(/ë |ì/g, '') , 10) < 202302) { 137 score_so = 20; 138 score_comp = 90; 139 score_ad = 5; 140 } else { 141 $('#m2-ad-label').text('ì¶ìì²´í¬'); 142 } 143
144 $('#m2-month').text(r.ap_month_d3.replace(/\d+ë (\d+)ì/, '$1')); 145 $('#m2-ap').text(r.ap_d3); 146 $('#m2-so').text(commify(r.userDetailInfo_d3[0].SUM)); 147 $('#m2-so-cnt').text(r.userDetailInfo_d3[0].SUM / score_so); 148 $('#m2-comp').text(commify(r.userDetailInfo_d3[1].SUM)); 149 $('#m2-comp-cnt').text(r.userDetailInfo_d3[1].SUM / score_comp); 150 $('#m2-ad').text(commify(r.userDetailInfo_d3[2].SUM)); 151 $('#m2-ad-cnt').text(r.userDetailInfo_d3[2].SUM / score_ad); 152 } 153 }, 154 error: ajaxError 155 }); 156} 157let getPoint = () => { 158 let sendData = new Object(); 159 sendData.dummy = cr_dummy(); 160 sendData.uid = uid; 161 162 $.ajax({ 163 url: `/serviceApi/mypage/userPoint`, 164 type: 'get', 165 data: sendData, 166 dataType: 'json', 167 headers: { authorization: getCookie('token') }, 168 success: r => { 169 if (r.success) { 170 $('#user-point').text(commify(r.myPoint.POINT || '0')); 171 $('#user-point-acc').text(commify(r.accPoint.acc || '0')); 172 $('#user-point-refund').text(commify(r.refundPoint.refund || '0')); 173 } else { 174 globalAlert(r.err_desc, 'alert'); 175 } 176 }, 177 error: ajaxError 178 }); 179} 180 181let getRefundHistory = () => { 182 let sendData = new Object(); 183 sendData.dummy = cr_dummy(); 184 sendData.uid = uid; 185 186 $.ajax({ 187 url: `/serviceApi/mypage/refundHistory`, 188 type: 'get', 189 data: sendData, 190 dataType: 'json', 191 headers: { authorization: getCookie('token') }, 192 success: r => { 193 if (r.success) { 194 let { list } = r; 195 let tmp = ''; 196 let total = 0; 197 for (let i=0; i<list.length; i++) { 198 let item = list[i]; 199 let dateObj = date2obj(new Date(item.REQ_DATETIME)); 200 tmp += ` 201 <tr> 202 <td>${dateObj.year}.${dateObj.month}.${dateObj.date}</td> 203 <td>${commify(item.MONEY)}</td> 204 </tr> 205 `; 206 total += parseInt(item.MONEY, 10); 207 } 208 tmp += ` 209 <tr> 210 <td><strong>TOTAL</strong></td> 211 <td><strong>${commify(total)}</strong></td> 212 </tr> 213 `; 214 215 $('#m-acc-history').empty(); 216 $('#m-acc-history').append(tmp); 217 } else { 218 globalAlert(r.err_desc, 'alert'); 219 } 220 }, 221 error: ajaxError 222 }); 223} 224 225let getDirectCode = () => { 226 let sendData = new Object(); 227 sendData.dummy = cr_dummy(); 228 229 $.ajax({ 230 url: `/serviceApi/mypage/kakaoLink/${uid}`, 231 type: 'get', 232 data: sendData, 233 dataType: 'json', 234 success: r => { 235 if (r.success) { 236 direct_code = r.recommand_send_code; 237 $('#copy-url-area').val(`${url}?reCode=${direct_code}`); 238 } 239 } 240 }); 241} 242 243 244 245let ph_startDate = ''; 246let ph_endDate = ''; 247let ph_curPage = 1; 248let ph_cutPage = 5; 249 250let getPointHistory = function() { 251 // $('tbody').children().remove(); 252 showLoader(); 253 let obj = new Object(); 254 obj.dummy = cr_dummy(); 255 obj.page = ph_curPage; 256 obj.startdate = ph_startDate; 257 obj.enddate = ph_endDate; 258 259 $.ajax({ 260 url: `/serviceApi/point/history/${uid}`, 261 data: obj, 262 dataType: 'JSON', 263 type: 'get', 264 headers: { authorization: getCookie('token') }, 265 success: function(r) { 266 $('#pointHistoryTbd').empty(); 267 268 if(r.success == true) { 269 let pointHistory = r.point_history ?? []; 270 let pointInfo = r.point_info; 271 let temp = ""; 272 let point = ""; 273 let count = 0; 274 let totalPage = 0; 275 276 // $('#my-point').text(`${pointInfo.POINT_MY}P`); 277 278 for (let i = 0; i < pointHistory.length; i++) { 279 if (pointHistory[i].GUBUN_ENG =="ADD") { 280 point = pointHistory[i].ADD_POINT; 281 } else if (pointHistory[i].GUBUN_ENG =="USE") { 282 point = '- '+pointHistory[i].USE_POINT; 283 }; 284 temp +=`<tr> 285 <td scope="row" data-label="ë ì§">${pointHistory[i].POINT_DATE}</td> 286 <td data-label="ì¹´í ê³ ë¦¬">${pointHistory[i].GUBUN_TYPE}</td> 287 <td data-label="ì 목">${pointHistory[i].TITLE}</td> 288 <td data-label="í¬ì¸í¸"><strong>${point} P</strong></td> 289 </tr> 290 `; 291 count++; 292 293 if (i == 0) { 294 totalPage = pointHistory[0].TOTAL_PAGE 295 } 296 }; 297 298 $('#pointHistoryTbd').append(temp); 299 300 if (totalPage > 0) { 301 cr_pagination($('.pagenation'), ph_curPage, ph_cutPage, totalPage, cb_pageFunc); 302 } 303 304 if(count==0){ 305 let historyEmpty = ""; 306 historyEmpty += ` 307 <tr> 308 <td colspan="4" class="empty">í¬ì¸í¸ ì¡°íë´ìì´ ììµëë¤.</td> 309 </tr>` 310 $('#pointHistoryTbd').append(historyEmpty); 311 } 312 } 313 314 },error: ajaxError 315 , complete: function () { 316 if (getParam('sec') === 'point') { 317 let elemY = $('.point-history')[0].getBoundingClientRect().top + window.scrollY; 318 window.scrollTo(0, elemY-30); 319 } else if ( getParam('sec') === 'mygrade' ) { 320 let elemY = $('.mygrade')[0].getBoundingClientRect().top + window.scrollY; 321 window.scrollTo(0, elemY - 110); 322 } 323 closeLoader(280); 324 } 325 }); 326} 327 328let cb_pageFunc = page_ => { 329 ph_curPage = page_; 330 getPointHistory(); 331} 332 333let setDate = d_ => { 334 let now = new Date(); 335 let obj_now = date2obj(now); 336 337 let prev = new Date(now.setMonth(parseInt(obj_now.month, 10) - 1 + d_)); 338 let obj_prev = date2obj(prev); 339 340 ph_startDate = obj_prev.year + obj_prev.month + obj_prev.date;
341 ph_endDate = obj_now.year + obj_now.month + obj_now.date; 342 343 ph_curPage = 1; 344 345 $(`.tab-item`).removeClass('active'); 346 $(`.tab-item[m="${d_}"]`).addClass('active'); 347 348 $('#search_startDate').val(ph_startDate.replace(/(\d{4})(\d{2})(\d{2})/,'$1-$2-$3')); 349 $('#search_endDate').val(ph_endDate.replace(/(\d{4})(\d{2})(\d{2})/,'$1-$2-$3')); 350 351 getPointHistory(); 352} 353 354let searchHistory = () => { 355 let startDate = $('#search_startDate').val().replace(/-/g, ''); 356 let endDate = $('#search_endDate').val().replace(/-/g, ''); 357 358 if (startDate == '') { 359 globalAlert('ì¡°í ìì ë ì§ë¥¼ ì íí´ì£¼ì¸ì.', 'alert'); 360 return; 361 } 362 if (endDate == '') { 363 globalAlert('ì¡°í ì¢ ë£ ë ì§ë¥¼ ì íí´ì£¼ì¸ì.', 'alert'); 364 return; 365 } 366 if (parseInt(startDate, 10) > parseInt(endDate, 10)) { 367 globalAlert('ì¡°í ë ì§ë¥¼ íì¸í´ì£¼ì¸ì.', 'alert'); 368 return; 369 } 370 let { year, month, date } = date2obj(new Date()); 371 let curTime = (new Date(year, parseInt(month, 10)-1, date)).getTime(); 372 let sTime = (new Date(startDate.substring(0,4), parseInt(startDate.substring(4,6), 10)-1, startDate.substring(6,8))).getTime(); 373 if ( 374 (parseInt(startDate.substring(0,4), 10) % 4 == 0 && (curTime - sTime) / (1000*60*60*24) > 366) 375 || (parseInt(startDate.substring(0,4), 10) % 4 > 0 && (curTime - sTime) / (1000*60*60*24) > 365) 376 ) { 377 globalAlert('[ìì ë ì§] 1ë ì´ë´ì ë ì§ë¥¼ ì íí´ì£¼ì¸ì.', 'alert'); 378 return; 379 } 380 let eTime = (new Date(endDate.substring(0,4), parseInt(endDate.substring(4,6), 10)-1, endDate.substring(6,8))).getTime(); 381 if ( 382 (parseInt(endDate.substring(0,4), 10) % 4 == 0 && (curTime - eTime) / (1000*60*60*24) > 366) 383 || (parseInt(endDate.substring(0,4), 10) % 4 > 0 && (curTime - eTime) / (1000*60*60*24) > 365) 384 ) { 385 globalAlert('[ì¢ ë£ ë ì§] 1ë ì´ë´ì ë ì§ë¥¼ ì íí´ì£¼ì¸ì.', 'alert'); 386 return; 387 } 388 389 ph_startDate = startDate; 390 ph_endDate = endDate; 391 ph_curPage = 1; 392 393 $(`.tab-item`).removeClass('active'); 394 395 getPointHistory(); 396} 397 398let goCurrentEventPage = () => { 399 $.ajax({ 400 url: '/eventProc/currentEvents', 401 type: 'POST', 402 data: { 403 dummy: cr_dummy(), 404 }, 405 success: function(r) { 406 console.log(r.data); 407 if ( r.success ) { 408 for ( let i=0;i < r.data.length;i++ ) { 409 const item = r.data[i]; 410 if ( item.EVENT_TYPE == '1' ) { 411 sessionStorage.setItem('event-mypage', '1'); 412 location.href = `/event/view/${item.SEQ}`; 413 return; 414 } 415 } 416 // ì´ë²¤í¸ê° ì§íì¤ì´ì§ ìì ë. 417 commonCopyTxt($('#copy-url-area')); 418 } 419 } 420 }); 421} 422 423$(() => { 424 getInfo(); 425 getPoint(); 426 getRefundHistory(); 427 getDirectCode(); 428 429 if (flutterApp) { 430 $('.show-flutter').removeClass('hide'); 431 } else { 432 $('.show-not-flutter').removeClass('hide'); 433 } 434 435 setDate(-1); 436 // date min, max ì¤ì 437 let now = new Date(); 438 let obj_now = date2obj(now); 439 440 let prev = new Date(now); 441 prev.setMonth(prev.getMonth() - 12); 442 let obj_prev = date2obj(prev); 443 444 $('#search_startDate').attr({ 445 'min' : `${obj_prev.year}-${obj_prev.month}-${obj_prev.date}`, 446 'max' : `${obj_now.year}-${obj_now.month}-${obj_now.date}` 447 }); 448 $('#search_endDate').attr({ 449 'min' : `${obj_prev.year}-${obj_prev.month}-${obj_prev.date}`, 450 'max' : `${obj_now.year}-${obj_now.month}-${obj_now.date}` 451 }); 452 453});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.