";
$("#popupHtml").append(html);
}
var cnt = 0;
$("#popupHtml").find("img").each(function() {
++cnt;
});
if(cnt > 0){
$("#popupImageList").empty();
var arr_href = [];
console.log("log"+$("#popupHtml").html());
$("#popupHtml").find("img").each(function() {
console.log("logs"+($(this).parent().prop('tagName')));
if($(this).prev().prop('tagName') == "A"){
alert($(this).prev());
}
arr_href.push($(this).attr("href")) ;
//console.log("log"+arr_href);
});
$("#popupHtml").find("img").each(function() {
if($(this).parent().prop('tagName') == "A" && $(this).parent().attr("mobile_href") != null && $.trim($(this).parent().attr("mobile_href")) != "" ){
$("#popupImageList").append('
');
} else{
$("#popupImageList").append('
'+'' + '
');
}
});
$('.pop-slider').slick({
arrows:false,
dots:true
});
UI.layerPopUp({selId:'#pop-main'});
}
}
}
$.nshop.closeLoadingImage();
}
});
});
function indexRemainTime(endYmdhm, flag){
var now = moment();
var endTime = moment(endYmdhm);
if (endTime.diff(now) <= 0) {
return "";
}
if(flag == "HH"){
return zeroNum(moment.duration(endTime.diff(now)).asHours());
}else if(flag == "MM"){
return zeroNum(moment.duration(endTime.diff(now)).minutes());
}else if(flag == "SS"){
return zeroNum(moment.duration(endTime.diff(now)).seconds());
}
}
function zeroNum(num) {
var txt = parseInt(num) + "";
return "00".substring(txt.length) + txt;
}
// MainBrnDtl
function getMainBnrDtl(mainSectId){
$.nshop.request("adm.DISPLAY@PMAINDSPMGMT_pGetMainBnr", {
url: _NOSESSION_REQ_URL,
data: {
dataSet: {
fields: {
"MAIN_SECT_ID": mainSectId
, "CONT_TYP_CD": "CT04" /*모바일*/
}
}
}
})
.done(function(res) {
if ($.nshop.checkRequestResult(res)) {
var detailList = res.dataSet.recordSets.bnrList.nc_list;
var html = '';
for(var idx in detailList){
var detail = detailList[idx];
var backUrl = $.nshop.getImageUrl(detail.BACK_FILE_ID, detail.FILE_NM);
$("#main_bnr_img_"+(parseInt(idx)+1)).html('
');
$("#main_href_"+(parseInt(idx)+1)).attr("href", detail.BNR_URL);
$("#bannerBackUrl_"+(parseInt(idx)+1)).css("background-image", "url('"+backUrl+"')");
$("#bannerSubject_"+(parseInt(idx)+1)).html(detail.BNR_SUB);
$("#bannerSubject_"+(parseInt(idx)+1)).css("color", "#"+detail.EFFECT_TITLE_CD);//제목색깔
$("#bannerDesc_"+(parseInt(idx)+1)).html(detail.BNR_DESC);
$("#bannerDesc_"+(parseInt(idx)+1)).css("color", "#"+detail.EFFECT_CONTENT_CD);//내용색깔
$("#slideItem"+(parseInt(idx)+1)).show();
html += '
';
html += ' ';
html += ' ';
html += ' '+detail.BNR_SUB+'';
html += ' '+detail.BNR_DESC+'
';
html += ' ';
html += ' ';
html += '';
}
$("#eventBannerHtml").val(html);
// slide총 5개 하드코딩 ,bo에서 설정되 갯수따라 값이 없는 item 제외처리 _slickRemove (index, removeBefore, removeAll)
if(detailList.length != 5){
for(var i = 5; i > detailList.length; i--) {
var j = i-1; //index은 0으로 시작 해서 -1처리 함
$('.visual-slider').slick('slickRemove',j);
}
}
}
//$("html, body").animate({scrollTop: 0}, "slow");
});
}
//IctStory Detail
function getIctStoryDtl(ictId){
$.nshop.request("adm.DISPLAY@PMAINDSPMGMT_pIctStorySelect", {
url: _NOSESSION_REQ_URL,
data: {
dataSet: {
fields: {
"ICT_ID": ictId
}
}
}
})
.done(function(res) {
if ($.nshop.checkRequestResult(res)) {
var ictStoryList = res.dataSet.recordSets.ictStoryList.nc_list;
$("#ictStoryList").empty();
for(idx in ictStoryList){
var detail = ictStoryList[idx];
if(idx == 0){
$("#ictStoryTitle").html(detail.ICT_TITLE);
//$("#ictStoryTitle").css("color","#"+detail.EFFECT_TITLE_CD);
$("#ictStorySubTitle").html(detail.ICT_SUB_TITLE);
//$("#ictStorySubTitle").css("color","#"+detail.EFFECT_TITLE_CD);
$("#ictStoryDesc").html(detail.ICT_CONTENT);
$("#ictStoryDesc").css("color","#"+detail.EFFECT_CONTENT_CD);
$("#ictStoryDesc2").html(detail.ICT_CONTENT_SUB);
$("#ictStoryDesc2").css("color","#"+detail.EFFECT_CONTENT_CD);
$("#bgStoryBack").css("background-image", "url('"+$.nshop.getImageUrl(detail.ICT_MAIN_IMG, detail.ICT_MAIN_IMG_NM)+"')");
$("#ictStoryMoreBtn").attr("href", _CTX_PATH + "mo/main/IctStory.htmlx?ICT_ID="+detail.ICT_ID);
}
var html = '';
html = html + '
';
html = html + ' ';
html = html + ' ';
//html = html + '
';
html = html + '
';
html = html + '
';
html = html + ' '+detail.PROD_NM+'
';
html = html + ' ';
if(userTypeCd == COMMON_CODE.MBR_TYP_CD.NOMEMBER){
html = html + ' 회원전용';
}else{
html = html + ' ' + $.nshop.currency(detail.PROD_SPRC) +'원';
}
html = html + '
';
html = html + ' ';
html = html + '';
$("#ictStoryList").append(html);
}
}
});
}
//베스트 상품
function goProdBestProd(activeCate){
$.nshop.request("mo.MOMAIN@PMOMAIN_pCateProdBest", {
url: _NOSESSION_REQ_URL,
data: {
dataSet: {
fields: {
"CTG_GRP_CD": activeCate
}
}
}
})
.done(function(res) {
var idx = 0;
if ($.nshop.checkRequestResult(res)) {
var ictStoryList = res.dataSet.recordSets.cateProdBestList.nc_list;
mCategoryCd = res.dataSet.fields.CTG_CD;
for(idx in ictStoryList){
var detail = ictStoryList[idx];
$("#best_price_body_"+(parseInt(idx)+1)).show();
if(userTypeCd != COMMON_CODE.MBR_TYP_CD.NOMEMBER){
$("#best_prod_url_"+(parseInt(idx)+1)).attr("href", _CTX_PATH + 'mo/prod/ProductDtl.htmlx?PROD_CD='+ detail.PROD_CD);
}else{
$("#best_prod_url_"+(parseInt(idx)+1)).attr("href", "javascript:goLogin()");
}
if(detail.SOLD_OUT_DSP_YN == "Y"){
$("#best_prod_mark_"+(parseInt(idx)+1)).show();
$('#best_price_body_'+(parseInt(idx)+1)).addClass("sold-out");
}
if(detail.FILE_ID6 === ""){
detail.FILE_ID6 = detail.FILE_ID;
}
$("#best_prod_img_"+(parseInt(idx)+1)).html('
');
$("#best_prod_nm_"+(parseInt(idx)+1)).html(detail.PROD_NM);
var html = '';
if(userTypeCd == COMMON_CODE.MBR_TYP_CD.NOMEMBER){
html = html + '
회원전용';
}else{
if( parseInt(detail.PROD_SPRC) < parseInt(detail.PROD_RPRC) ){
html = html + '
'+$.nshop.currency(detail.PROD_RPRC)+' 원';
}
html = html + '
'+$.nshop.currency(detail.PROD_SPRC)+' 원';
}
$("#best_price_"+(parseInt(idx)+1)).html(html);
}
}
if(idx < 3){
for(; idx < 4; ++idx){
$("#best_price_body_"+(idx+1)).hide();
}
}
});
//mCategoryCd = activeCate;
}
/* 2019-12-13 타이머 추가 */
function specialTimer() {
var interval = setInterval(function(){
var hours = parseInt($('#time-hour').text()),
minutes = parseInt($('#time-min').text()),
seconds = parseInt($('#time-sec').text());
seconds--;
if(seconds < 0){
if(minutes >= 0){
seconds = 59;
minutes--;
}
}
if(minutes < 0){
if(hours !== 0) {
minutes = 59;
hours--;
}
}
if(hours < 0) hours = 0;
if (hours === 0 && minutes === 0 && seconds === 0 ) {
clearInterval(interval);
}
hours = hours < 10 ? "0" + hours : hours;
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
$('#time-hour').text(hours);
$('#time-min').text(minutes);
$('#time-sec').text(seconds);
}, 1000);
}
function goCategory(){
window.location.href = _CTX_PATH + '/mo/prod/ProductList.htmlx?CTG_CD='+mCategoryCd;
}
function goEventProd(flag){
$("#popListEvent").html($("#eventBannerHtml").val());
UI.layerPopUp({selId:'#pop-event'});
}
function closePopup() {
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + 1 );
document.cookie = "B2BPOPUPEXPIRE=NOPOP;expires=" + todayDate.toUTCString() + ";path=/";
UI.layerPopUp({selId:'#pop-main',st:'close'});
}
function goTimeBox(){
if(userTypeCd != COMMON_CODE.MBR_TYP_CD.NOMEMBER){
UI.layerPopUp({selId:'#pop-time-sale'});
}
}
function goLogin(){
window.location.href = _CTX_PATH + '/mo/member/LoginMain.htmlx';
}
function goNPointList(){
window.location.href = _CTX_PATH + '/mo/mypage/NPointList.htmlx';
}
이달의 정책모델
MD Pick
요즘 트랜드는 나에게 맡겨~
Luck Deal
싸다. 다시 봐도 싸다. 싸다~싸
이달의 신상
따끈따끈한 신상을 확인하세요.
N# ICT Story
#엔샵_우리만의_이야기
신입생을 위한
IT 인싸 코디
강의시간 아이패드는
기본 장착!
더보기
Nshop BEST
모두가 반한 베스트 상품
입점 브랜드 관