fix : 쇼핑몰 구독서비스 - 구독서비스 정보 조건부 숨김처리

fix : 관리자 구독서비스 수정 - 기본&판매정보 입력값 0 허용, 재고정책 변경 시 판매가능 재고수량 초기화
This commit is contained in:
이대환
2026-04-01 15:14:24 +09:00
parent 92a50f7b39
commit 784ea1a6aa
5 changed files with 83 additions and 16 deletions

View File

@@ -51,6 +51,7 @@
$('#subsvcDc').html(
data.mblSubsvcDcPcSameAt === "N" ? data.mblSubsvcDc : data.subsvcDc
);
fn_hide_subsvcDetail(data.subPd, data.dlvyCnt, data.selpric);
switch (data.subsvcSttusCd) {
case '01':
@@ -72,6 +73,25 @@
});
}
/******************************************************
* 구독서비스 상세 숨기기
* ****************************************************/
const fn_hide_subsvcDetail = function(subPd, dlvyCnt, selpric) {
function isEmpty(val) {
return !val || val === 0;
}
function hideIf(condition, find, base) {
let target = base ? $(base).closest(find) : $(find);
$(target).toggle(!condition);
}
hideIf(isEmpty(subPd), 'dl', '#subPd');
hideIf(isEmpty(dlvyCnt), 'dl', '#dlvyCnt');
hideIf(isEmpty(subPd) && isEmpty(dlvyCnt), '.productDetailInfo__info');
hideIf(isEmpty(selpric), '.productDetailInfo__price');
hideIf(isEmpty(selpric), '#subscribeBtn');
}
/*************************************************************
구매하기 버튼
**************************************************************/
@@ -105,6 +125,11 @@
padding: 16px;
}
.productDetailInfo__info > dl > dt,
.productDetailInfo__info > dl > dd {
font-size: 14px;
}
#subsvcDc {
padding: clamp(12px, 3%, 18px);
border-radius: 8px;
@@ -147,9 +172,6 @@
<span id="dscntRaito" class="percent" style="color: red">%</span>
</div>
</div>
<div id="subsvcDc" class="ck-content">
구독 서비스 상품 설명
</div>
<div class="productDetailInfo__info">
<dl>
<dt>구독기간</dt>
@@ -170,6 +192,9 @@
</dd>
</dl>
</div>
<div id="subsvcDc" class="ck-content">
구독 서비스 상품 설명
</div>
</div>
<div class="bottomFixedControls">