공유하기 INTERFACEID 없을시 처리

This commit is contained in:
JSYOO 2021-11-22 10:56:03 +09:00
parent 8332914efb
commit 757ee74776
4 changed files with 23 additions and 19 deletions

View File

@ -137,7 +137,7 @@ public class InterestController extends NlibCommonController
totalCount = interestService.countListInterests(searchCollectionVO);
String mbInfoId = getMbInfoId(request);
operList = collectionService.setDetailInfoForList(interestList, getMbInfoId(request), NlibProperty.getString("thumbnail.image.url.small"));
operList = collectionService.setDetailInfoForList(interestList, getMbInfoId(request));
//-------------------------------
// JSON변환 응답 처리
//-------------------------------

View File

@ -205,7 +205,6 @@ public class NlibSearchController extends NlibCommonController {
//로그인 상태인지 확인
model.addAttribute("loginVO", loginVO);
model.addAttribute("pdfUri", NlibProperty.getProperty("pdf.uri"));
searchVO.setQuery(searchVO.getQuery().replaceAll("\\\"", """));
return "nlib/collection/searchList";
}
@ -320,7 +319,6 @@ public class NlibSearchController extends NlibCommonController {
model.addAttribute("result", vo);
model.addAttribute("searchVO", searchVO);
model.addAttribute("loginVO", loginVO);
model.addAttribute("pdfUri", NlibProperty.getProperty("pdf.uri"));
return "nlib/collection/searchItemDetail";
}

View File

@ -128,7 +128,7 @@ function goList(){
<c:if test='${result.MUseYn != "Y"}'>
<button type="button" class="favorit" onclick="fn_changeInterestBtn('${result.masterId }', 'on');">즐겨찾기</button>
</c:if>
<button type="button" class="share" data-curl="${pdfUri}<c:out value="${result.interfaceId}"/>">공유</button>
<button type="button" class="share" onclick="gfn_setSnsShare('<c:out value="${result.interfaceId}"/>','<c:out value="${result.masterId}"/>','<c:out value="${result.typeDivCd}"/>','<c:out value="${result.dtlsTypeDivCd}"/>')";>공유</button>
</div>
<div class="con-2">
<div class="de-data">

View File

@ -406,8 +406,26 @@ function gfn_showDocPdf(interfaceId,masterId,typeDivCd,dtlsTypeDivCd) {
var openNewWindow = window.open(url + interfaceId, "_blank");
}
function snsShare(snsType, url) {
function gfn_setSnsShare(interfaceId,masterId,typeDivCd,dtlsTypeDivCd){
var url=window.location.protocol + "//" + window.location.host + window.location.pathname + "?masterId=" + masterId;
if(interfaceId != null && interfaceId != '')
{
if(typeDivCd == "IT_PHOTO" && (dtlsTypeDivCd == "C199" || dtlsTypeDivCd == "C01")){
url = IMAGE_VIEW_URL;
}else if((typeDivCd == "IT_VIDEO") && (dtlsTypeDivCd == "C290" || dtlsTypeDivCd == "C02" || dtlsTypeDivCd == "C03")){
url = VIDEO_VIEW_URL;
}else{
url = DOC_VIEW_URL;
}
}
$('#div_pop-sharing img').attr('data-cUrl',url); // url 모두 맵핑
if(url != null && url != ''){
getShortUrlData(url);
}
}
function gfn_snsShare(snsType, url) {
var url,name,specs,changedUrl,title;
if(document.title.indexOf("|") > -1){
title = encodeURIComponent($.trim(document.title.split("|")[1]));
@ -438,22 +456,10 @@ function snsShare(snsType, url) {
window.open(url, name, specs);
}
$( document ).on('click' , 'button.share', function (e) {
//e.preventDefault();
var tUrl = $(this).attr('data-cUrl');
$('#div_pop-sharing img').attr('data-cUrl',tUrl); // url 모두 맵핑
if(tUrl != null && tUrl != ''){
/*if(tUrl.indexOf(location.host) == -1){
tUrl = location.protocol + '//' + location.host + tUrl;
}*/
getShortUrlData(tUrl);
}
});
$( document )
.on('click', '#div_pop-sharing img.sns-pop', function(e) {
e.preventDefault();
snsShare($(this).attr('data-sType'),$(this).attr('data-cUrl'));
gfn_snsShare($(this).attr('data-sType'),$(this).attr('data-cUrl'));
})
.on('click', '#div_pop-sharing button.btn-close-pop', function(e) {
e.preventDefault();