기진쌤 프로필 - 메세지보내기 | 클래스톡
'); $(this).html(thisTxt).addClass('short-txt'); }); // 상품 상세페이지로 이동 // $('.top-class-name').each(function(){ // $(this).off('click').on('click', function(){ // location.href= '/class/classDetail/'+ $(this).data('id'); // }); // }); // 피드 상세페이지 이동 $('.move-detail, .btn-comment').each(function(){ $(this).off('click').on('click', function(){ // 비로그인시 로그인 if("" == "") { openLoginPop(); } else { var commentId = $(this).parents('.activity-list-box').data('comment-id'); location.href= '/class/detail/'+ commentId; } }); }); // 좋아요 $('.lcs-btns .btn-like').each(function(){ $(this).off('click').on('click', function(){ // 비로그인시 로그인 if("" == "") { openLoginPop(); } else { var likeCountNum = likeCountNum = $(this).parents('.activity-list-box').find('.like-count span'); var commentId = $(this).parent().data('comment-id'); if( $(this).hasClass('on') ){ $(this).removeClass('on'); _api_call("https://api2.enfit.net/api/v3/squareLike"+"?hash=d41d8cd98f00b204e9800998ecf8427e", 'POST', { type : 'delete', comment_id : commentId }, 'json'); likeCountNum.text( Number(likeCountNum.text()) - 1 ); if(likeCountNum.text() < 1) { likeCountNum.hide(); } } else { $(this).addClass('on'); _api_call("https://api2.enfit.net/api/v3/squareLike"+"?hash=d41d8cd98f00b204e9800998ecf8427e", 'POST', { comment_id : commentId }, 'json'); likeCountNum.show().text( Number(likeCountNum.text()) + 1 ); } } }); }); // 스크랩 $('.lcs-btns .btn-scrap').each(function(){ $(this).off('click').on('click', function(){ // 비로그인시 로그인 if("" == "") { openLoginPop(); } else { var commentId = $(this).parent().data('comment-id'); if( $(this).hasClass('on') ){ $(this).removeClass('on'); _api_call("https://api2.enfit.net/api/v3/squareScrap"+"?hash=d41d8cd98f00b204e9800998ecf8427e", 'POST', { type : 'delete', comment_id : commentId }, 'json'); } else { $(this).addClass('on'); _api_call("https://api2.enfit.net/api/v3/squareScrap"+"?hash=d41d8cd98f00b204e9800998ecf8427e", 'POST', { comment_id : commentId }, 'json'); } } }); }); // 더 보기 // seeMoreTxt('.move-detail > .content-txt', 82, 160); // seeMoreTxt('.story-box .content-txt', 70, 135); // seeMoreTxt('.question-txt > span', 70, 135); // seeMoreTxt('.answer-txt > span', 20, 50); }, error : function(xhr, status) { } }); // end ajax } // 상단 정보 data function profileInfoData(){ $.ajax({ url: 'https://api2.enfit.net/api/v3/profileInfo/148237'+"?hash=d41d8cd98f00b204e9800998ecf8427e", type: 'GET', cache: false, dataType: 'json', success: function (data) { var manage_template = ''; var activity_template = ''; var review_template = ''; var scrap_template = ''; var profileData = data.results; var profileData_userInfo = data.results.user_info; var profileData_levelInfo = data.results.level_info; // 닉네임 $('.profile-top h1 span').text( profileData_userInfo.user_name ); // 함께해요 숫자 if(profileData_userInfo.together_cnt != null) { $('.count-num').text(addComma(profileData_userInfo.together_cnt)); } // 나이 직업 성별 var profileTxt = ''; if(profileData_levelInfo.level_name != null) { profileTxt += ''+ profileData_levelInfo.level_name +''; } if(profileData_userInfo.birthday_year != null) { profileTxt += ''+ profileData_userInfo.birthday_year +'세'; } if(profileData_userInfo.job_name != null) { profileTxt += ''+ profileData_userInfo.job_name +''; } var genderTxt = ''; profileData_userInfo.gender == "M" ? genderTxt = '남성 ' : genderTxt = '여성 ' if(genderTxt != '') { profileTxt += ''+ genderTxt +''; } if(profileTxt == '') { profileTxt += ' 프로필을 입력해주세요.'; } $('.user-info-txt').append(profileTxt); // 프로필 이미지 $('.user-profile-img').css('background-image', 'url('+ profileData_userInfo.user_photo +')'); // 자기소개 $('.user-intro-txt span').html(profileData_userInfo.profile_comment); // 관심사 태그 if (profileData_userInfo.interest_list!=null) { for(var i=0; i#'+ profileData_userInfo.interest_list[i].name +''); } } } // 관심사 태그 + 버튼 $('.interest-tags span').length < 1 ? $('.interest-tags').hide() : $('.interest-tags').show(); // 친구추가 영역 ===================================================================================== var friend_tem = ''; friend_tem += '
\n'; $('.btn-friend-box').append(friend_tem); if(profileData_userInfo.friend_status != "Y") { $('.friend-add').show(); $('.friend-remove').hide(); } else { $('.friend-add').hide(); $('.friend-remove').show(); } // 친구 추가하기 $('.friend-add button').off('click').on('click', function(){ // 비로그인시 로그인 if("" == "") { Cookies.set('click_friend', '2', { expires: 1 }); // console.log('Cookies.set, 비로그인 '+ Cookies.get('click_friend')) openLoginPop(); } else { // console.log('로그인 성공 - 친추추가 클릭 성공'); var _click_id = $(this).data('id'); _api_call("https://api2.enfit.net/api/v3/friend/"+_click_id+"?hash=d41d8cd98f00b204e9800998ecf8427e", 'POST', null, 'json'); $('.count-num').text(parseInt($('.count-num').text()) + 1 ); $('.friend-add').hide(); $('.friend-remove').show(); } }); // 친구 삭제하기 $('.btn-friend-remove').off('click').on('click', function(){ var _click_id = $(this).data('id'); _api_call("https://api2.enfit.net/api/v3/friend/"+_click_id+"?hash=d41d8cd98f00b204e9800998ecf8427e", 'POST', {mode:'delete'}, 'json'); $('.count-num').text(parseInt($('.count-num').text()) - 1 ); $('.friend-add').show(); $('.friend-remove').hide(); }); // 메세지 보내기 $('.btn-send-message').off('click').on('click', function(){ var _room_id = "148237"; if(mobileIF.ModooiOS()) { webkit.messageHandlers.goToChatDetail.postMessage(_room_id); } else if(mobileIF.ModooAnd()) { window.android.goToChatDetail(_room_id); } else { location.href="/class/chat/148237?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvd3d3LmNsYXNzdG9rLm5ldFwvY2xhc3NcL3VzZXJcL2ZyaWVuZF9wcm9maWxlXC8xNDgyMzciLCJpYXQiOjE1OTY5MzgwNDMsImV4cCI6MTU5ODE0NzY0MywibmJmIjoxNTk2OTM4MDQzLCJqdGkiOiI5RGVRZXpVaTV1MlpsOXd2Iiwic3ViIjoxMTAxNiwicHJ2IjoiOTYyYTE0ZDQ4YzQyOWUzYTZhYWIzNjEwYzAzNTJiZmJiNDVlZmM1OCJ9.ME8AHq80eQtN89i17GRkr-Q66WMKoWuxYMjWKxMfaEY"; } }); // 운영중인 클래스 ===================================================================================== // if(profileData.manage_class_total > 6 ) { // $('.manage-box .btn-more-box').addClass('on'); // } if( profileData_userInfo.coach_grade > 0 && profileData.manage_class.length > 0 ) { $('.manage-box h1 span').text(profileData.manage_class_total); $('.manage-box').addClass('on'); for(var i=0; i< profileData.manage_class.length; i++) { manage_template += '