초기소스

This commit is contained in:
jazz
2025-10-29 17:08:05 +09:00
parent e531aa9540
commit 439a379a02
7551 changed files with 1234427 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,712 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : BbscttRegistC.jsp
Description : 게시글 등록 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05-09 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function () {
fn_collect_event();
/*사이드바 current 부여*/
if ($(".cscMenu").length > 0) {
$(".cscMenu").each(function () {
if ($(this).attr("id") === $("#bbsId").val()) {
$(this).addClass("current");
}
});
}
});
/*************************************************************
이벤트 함수
*************************************************************/
const fn_collect_event = ()=> {
//내용 텍스트 <br>태그 엔터값으로 replace
const textarea = $("textarea[name=cn]");
let cn = textarea.attr("placeholder");
cn = fn_remove_tag(cn);
textarea.attr("placeholder", cn);
//답변받기 여부에 따른 핸드폰 번호 disabled 처리
$("#answSmsRecptn").on("click", function () {
if ($(this).is(":checked")) {
$("#answMbtlnb").prop("disabled", false);
} else {
$("#answMbtlnb").prop("disabled", true);
}
});
//분류 change시 hidden value값 set
$(document).on('change', '#qesitmNmC', function () {
$("#qesitmInnb").val("");
$("#qesitmNm").val("");
$("#answCn").val("");
const option = $('option:selected', this);
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if ($(this).val() !== "") {
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmNm").val(qesitmNm);
$("#qesitmAt").val("Y");
} else {
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmNm").val("");
$("#qesitmAt").val("N");
}
if(option.val() == '1022901') {
$('textarea[name="cn"]').val('회사명 or 판매자명 : \n웹사이트 주소(인스타그램,카페,홈페이지 등) : \n공동구매 희망 제품 : \n담당자 연락처 :');
} else {
$('textarea[name="cn"]').val('');
}
});
//추가입력 항목 라디오 'click' 이벤트
$(document).on('click', '.answRadioC', function () {
const radio = $(this);
//추가입력 항목 내용 요소 get
const answ = radio.closest(".custom-radio-container").find('[name="answCnArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest(".custom-radio-container").find('[name="qesitmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest(".custom-radio-container").find('.answRadio');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest(".custom-radio-container").find('[name="itmInnbArr[]"]');
//라디오 클릭 시 disabled 비활성
if (radio.is(":checked")) {
//답변 내용 초기화
answ.val("");
const radioVal = $(radio).attr('itm-cn');
answ.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
radio.closest(".custom-radio-container").find(".answRadioAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
radio.closest(".custom-radio-container").find(".answRadioAt").val("N");
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
$(document).on('change', '.answSelectC', function () {
const select = $(this);
const answ = select.closest("td").find('[name="answCnArr[]"]');
const qesitmInnb = select.closest("td").find('[name="qesitmInnbArr[]"]');
const contrlTarget = select.closest("td").find('.answSelect');
const option = $('option:selected', this);
if (select.val() != "") {
//답변 내용 초기화
answ.val("");
const selectVal = $(option).attr('itm-cn');
answ.val(selectVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(option).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//셀렉트 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
select.closest("td").find(".answSelectAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
select.closest("td").find(".answSelectAt").val("N");
});
}
});
//추가입력 항목 체크박스 'click'이벤트
$(document).on('click', '.answChkC', function () {
const check = $(this);
const contrlTarget = check.closest("div").find('.answChk');
var isChecked = $(this).is(":checked");
//클릭한 체크박스 주위 input값 disable false처리
contrlTarget.each(function () {
if (isChecked) {
$(this).prop("disabled", false);
} else {
$(this).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = $('.answChkC:checked').length > 0;
contrlTarget.each(function () {
if (anyChecked) {
check.closest("td").find(".answChkAt").val("Y");
} else {
check.closest("td").find(".answChkAt").val("N");
}
});
});
//추가입력 항목 텍스트 'input'이벤트
$(document).on('input', '.answTxtC', function () {
const txt = $(this);
const contrlTarget = txt.closest(".input-grow-container").find('.answTxt');
const contrlAt = txt.closest(".input-grow-container").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
//파일 업로드
$(document).on("change", "#fileUpload", function () {
addFiles(event, 0);
});
//등록 버튼 이벤트
$(document).on("click", "#regBtn", function () {
fn_regist_bbsctt();
});
//등록 완료 모달 > 확인 버튼 이벤트 (새로고침)
$(document).on("click","#alertBtn",function(){
$('html').scrollTop(0);
//단순 등록 , 목록에서 등록 구분
const listAt = $("#listAt").val();
if(listAt == 'list'){
fn_move_list();
}else {
location.reload();
}
});
//등록 취소 버튼(이전 페이지 이동);
$(document).on("click","#cancelBtn",function(){
const reqDv = $("#reqDv").val();
if(reqDv === 'list'){
fn_move_list();
}else{
history.go(-1);
}
});
//휴대폰번호 포매팅
fn_set_event("#answMbtlnb","input",fn_fmt_telno);
}
/*textarea내 태그 제거 함수*/
const fn_remove_tag = (cn) => {
cn = cn.replaceAll(/<br>/ig, '\n');
cn = cn.replaceAll(/<\/br>/ig, '\n');
cn = cn.replaceAll(/<br \/>/ig, '\n');
//내용 내 태그 없애기
cn = cn.replace(/<\/?[^>]+(>|$)/g, "");
cn = decodeHTMLEntities(cn);
return cn;
}
// HTML 엔티티 디코딩 함수
const decodeHTMLEntities = (str) => {
const txt = document.createElement('textarea');
txt.innerHTML = str;
return txt.value;
}
//목록 조회에서 취소 누를 시 해당 게시판 목록으로 이동
const fn_move_list = () => {
const form = document.createElement("form");
form.id = "listForm";
form.action = "/sopmal/csc/selectSubPageListForm";
form.method = "POST";
fn_create_input("bbsId", $("#bbsId").val(), form);
document.body.appendChild(form);
form.submit();
}
//input 생성 함수
const fn_create_input = (name, value, tgtForm) => {
const input = document.createElement('input');
input.setAttribute("type", "hidden");
input.setAttribute("name", name);
input.setAttribute("value", value);
tgtForm.appendChild(input);
}
/*********************************************************
* 게시글 등록
*********************************************************/
const fn_regist_bbsctt = function () {
let url = '<c:url value="/sopmal/csc/insertBbscttRegist"/>';
let saveForm = $('#bbsRegForm');
let formData = new FormData();
//파일 업로드
if($("#contact-dropzone").length > 0){
let myDropzone = Dropzone.forElement("#contact-dropzone");
myDropzone.files.forEach(function (file) {
formData.append("files", file);
});
}
$('.checkbox input[type="checkbox"]').each(function () {
if (!$(this).prop('checked')) {
fn_ctrl_disable([".checkbox"],);
}
});
//폼 내 input값 append
saveForm.serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
//사용자 등록 시 노출 여부 Y
formData.append("expsrAt", "Y");
disableButton("#regBtn");
if (confirm('게시글을 <spring:message code="confirm.common.insert"/>')) {
$.ajax({
type: 'post',
url: url,
enctype:"multipart/form-data",
data: formData,
processData: false,
contentType: false,
success: function (result) {
enableButton("#regBtn");
$("#result-alert").modal();
/*파일 temp 배열 초기화*/
filesTempArr = [];
}
});
}
fn_ctrl_disable("",[".checkbox"]);
enableButton("#regBtn");
}
function fn_prevent_click(event) {
event.preventDefault(); // 체크박스 상태 변경 방지
}
</script>
<body>
<%--시큐리티정보가져오기--%>
<c:set value = "${resultMap.regusrInfo}" var = "regusrInfo"/>
<c:set value = "${resultMap.bbscttVO}" var = "bbscttVO"/>
<c:set value = "${resultMap.bbsInfo}" var = "bbsInfo"/>
<c:set value = "${resultMap.qesitmList.qesitmList}" var = "qesitmList"/>
<c:set value = "${resultMap.qesitmList.itmCnList}" var = "itmCnList"/>
<c:set value = "${resultMap.itmList}" var = "itmList"/>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<c:choose>
<c:when test = "${bbscttVO.reqUrl eq 'subPage'}"><%--서브페이지 등록 폼 분기 처리--%>
<div class="page-title center">
<h2 class="page-title__title" id = "bbsNm"><c:out value="${bbsInfo.bbsNm}"/></h2>
</div>
</c:when>
<c:otherwise><%--고객센터 등록 폼 분기 처리--%>
<div class="sub-rl">
<jsp:include page="/WEB-INF/views/comm/csc/CscLeft.jsp"/>
<div class="sub-right-content">
<h3 class="sub-right-content__title"><c:out value="${bbsInfo.bbsNm}"/></h3>
</c:otherwise>
</c:choose>
<div class="table-wrapper">
<form id="bbsRegForm">
<table class="table write">
<caption>게시글 등록</caption>
<colgroup>
<col style="width: 200px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>작성자<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<c:choose>
<c:when test="${regusrInfo.regusrDvCd eq '99'}">
<input type="text" class="input-text lg" name="regusrNm" placeholder="작성자명"
title="작성자명">
</c:when>
<c:otherwise>
<div class="td-inner"><c:out value='${regusrInfo.regusrNm}'/></div>
<input type="hidden" name="regusrNm" value="tempNm">
</c:otherwise>
</c:choose>
</div>
</tr>
<c:if test = "${bbsInfo.answRegist eq 'Y' && bbsInfo.bbscttSndngMthCd ne '03'}"><%--답변사용여부와 게시글 문자사용여부 체크--%>
<tr>
<th>답변수신</th>
<td>
<div class="td-inner">
<c:if test="${empty regusrInfo.answMbtlnb}">
<input type="text" class="input-text" id = "answMbtlnb" name="answMbtlnb" placeholder="'-'없이 입력" title="답변핸드폰번호" maxlength="13">
</c:if>
<div class="input-container">
<label class="b-checkbox checkbox">
<input type="checkbox" name="answSmsRecptn" value="Y" id = "answSmsRecptn" checked>
<span class="check"></span>
<span class="control-label">답변받기</span>
</label>
</div>
</div>
</td>
</tr>
</c:if>
<c:if test="${not empty itmList}">
<tr>
<th>분류<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<div class="select-box">
<%--문항답변필수여부 --%>
<input type="hidden" name="qesitmEssntlAtArr[]" value="Y">
<%--문항명 --%>
<input type="hidden" name="qesitmNmArr[]" id="qesitmNm" value="분류"/>
<%--문항고유번호 --%>
<input type="hidden" name="qesitmInnbArr[]" id="qesitmInnb"/>
<%--답변내용 --%>
<input type="hidden" name="answCnArr[]" id="answCn"/>
<%--답변여부 --%>
<input type="hidden" name="qesitmAtArr[]" id="qesitmAt" value="N">
<select class="md" id="qesitmNmC" name="itmInnbArr[]">
<option value="">분류 선택</option>
<c:forEach var="itm" items="${itmList}" varStatus="status">
<option value="<c:out value="${itm.itmInnb}"/>"
qesitm-innb="${itm.qesitmInnb}"
answ-Cn="${itm.itmCn}"
qesitm-nm="${itm.qesitmNm}">
<c:out value="${itm.itmCn}"/>
</option>
</c:forEach>
</select>
</div>
</div>
</td>
</tr>
</c:if>
<c:if test="${not empty qesitmList}">
<c:forEach var="qesitmList" items="${qesitmList}">
<tr>
<c:if test="${ qesitmList.itmTyCd eq '01'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt}"
class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm}">
<input type="hidden" name="qesitmAtArr[]"
class="answRadioAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]"
class="answRadio"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answRadio"
disabled>
<input type="hidden" name="itmInnbArr[]" class="answRadio"
disabled>
<c:forEach items="${itmCnList}" var="itmCnList1"
varStatus="status">
<c:if test="${itmCnList1.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="custom-radio is-medium">
<input type="radio"
name="itmInnbArr<c:out value="${ qesitmList.qesitmInnb }"/>[]"
id="answCn<c:out value="${ status.index }"/>"
class="answRadioC"
value="<c:out value="${ itmCnList1.itmInnb}"/>"
qesitm-innb='<c:out value="${itmCnList1.qesitmInnb}"/>'
itm-cn="<c:out value="${ itmCnList1.itmCn }"/>">
<label for="answCn<c:out value="${ status.index }"/>">
<c:out value="${ itmCnList1.itmCn }"/>
</label>
</div>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '02'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answSelectAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]" class="answSelect"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answSelect" disabled>
<div class="select-box">
<select class="md answSelectC" name="itmInnbArr[]">
<option value="">전체</option>
<c:forEach items="${itmCnList}" var="itmCnList2">
<c:if test="${itmCnList2.qesitmInnb eq qesitmList.qesitmInnb}">
<option value="${ itmCnList2.itmInnb }"
itm-cn="${ itmCnList2.itmCn}"
qesitm-innb='${itmCnList2.qesitmInnb}'>${ itmCnList2.itmCn }</option>
</c:if>
</c:forEach>
</select>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '03'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answChkAt qesitmAtChk"
value="N">
<c:forEach items="${itmCnList}" var="itmCnList3">
<c:if test="${itmCnList3.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<label class="b-checkbox checkbox">
<input type="hidden" class="answChk"
name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" class="answChk"
name="answCnArr[]"
value="${ itmCnList3.itmCn }" disabled>
<input type="checkbox" class="answChkC"
name="itmInnbArr[]"
value="${ itmCnList3.itmInnb }">
<span class="check"></span>
<span class="control-label">${ itmCnList3.itmCn }</span>
</label>
</div>
</c:if>
</c:forEach>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '04'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<c:forEach items="${itmCnList}" var="itmCnList4">
<c:if test="${itmCnList4.qesitmInnb eq qesitmList.qesitmInnb}">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }"
class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answTxtAt qesitmAtChk" value="N">
<input type="hidden" class="answTxt"
name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="text" class="input-text lg answTxtC" maxlength = "1333"
name="answCnArr[]" title="추가문항답변"
placeholder="${ itmCnList4.itmCn }"
maxlength="666">
<input type="hidden" class="answTxt"
name="itmInnbArr[]"
value="${ itmCnList4.itmInnb }" disabled>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
</tr>
</c:forEach>
</c:if>
<tr>
<th>제목<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<input class="input-text lg" type="text" title="제목 입력란" name = "sj" maxlength = '100'
placeholder="제목을 입력하세요." value="">
<%--게시판설정(비밀글사용여부)--%>
<c:if test="${bbsInfo.secretBbsctt eq 'Y'}">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="secretBbscttAt" checked
<c:if test="${bbsInfo.bbsTyCd eq '05'}">onclick="fn_prevent_click(event);"</c:if>>
<span class="check"></span>
<span class="control-label">비밀글</span>
</label>
</div>
</c:if>
</div>
</div>
</td>
</tr>
<c:if test="${regusrInfo.regusrDvCd eq '99'}">
<tr>
<th>비밀번호<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<input class="input-text lg" type="password"
title="비밀번호 입력란"
name="password" maxlength='20'
placeholder="비밀번호를 입력하세요." value="">
</div>
</td>
</tr>
</c:if>
<tr>
<th>내용<span class="required-asterisk">*</span></th>
<td>
<textarea class="textarea" rows="12" title="내용 입력란" name = "cn"
placeholder="<c:out value = "${bbsInfo.dftCn}"/>"></textarea>
</td>
</tr>
<%--게시판설정(파일첨부사용여부)--%>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.extensions.images')" var="acceptFileExtensions"/>
<input type = "hidden" value = "<c:out value = '${bbsInfo.filAtch}'/>" name ="filAtch">
<c:if test="${bbsInfo.filAtch eq 'Y'}">
<tr>
<th>이미지 등록</th>
<td>
<div class="dropzone-wrapper">
<div class="dropzone" id="contact-dropzone">
</div>
</div>
<ul class="contact-upload-info">
<li>사진, 동영상 첨부는 최대 10MB 이하이며 3개까지 등록할 수 있습니다.</li>
<li>등록 가능 파일은 ${acceptFileExtensions} 파일만 가능합니다.</li>
<li>상품과 무관한 내용이거나 음란 불법적인 내용은 통보없이 삭제할 수 있습니다.</li>
</ul>
</td>
</tr>
</c:if>
</tbody>
</table>
<%--리스트에서 등록으로 왔는지 단순 등록인지 체크--%>
<input type = "hidden" id = "sopmalCd" value = "<c:out value = '${bbscttVO.sopmalCd}'/>" name = "sopmalCd"/>
<input type = "hidden" id = "listAt" value = "<c:out value = '${bbscttVO.listAt}'/>" name = "listAt"/>
<input type = "hidden" id = "bbsId" value = "<c:out value = '${bbsInfo.bbsId}'/>" name = "bbsId"/>
<input type = "hidden" id = "bbsNm" value = "<c:out value = '${bbsInfo.bbsNm}'/>" name = "bbsNm"/>
<input type = "hidden" id = "regusrDvCd" value = "<c:out value = '${regusrInfo.regusrDvCd}'/>" name = "regusrDvCd"/>
<input type = "hidden" id = "bbscttSndngMthCd" value = "<c:out value = '${bbsInfo.bbscttSndngMthCd}'/>" name = "bbscttSndngMthCd"/>
<input type = "hidden" name = "acceptFileExtensions" id = "acceptFileExtensions" value = "${acceptFileExtensions}"/>
</form>
</div>
<div class="sub-bottom-btn-container">
<button class="btn xl outline" id = "cancelBtn" value = "<c:out value = '${bbsInfo.bbsId}'/>">
<c:choose>
<c:when test = "${bbscttVO.listAt eq 'list'}"><spring:message code="button.catalog"/></c:when>
<c:otherwise><spring:message code="button.cancel"/></c:otherwise>
</c:choose>
</button>
<button class="btn xl theme" id = "regBtn"><spring:message code="button.insert"/></button>
</div>
<c:choose>
<c:when test="${bbscttVO.reqUrl eq 'subPage'}"> <%--서브페이지 등록 폼 분기 처리--%>
</div>
</c:when>
<c:otherwise> <%--고객센터 등록 폼 분기 처리--%>
</div>
</div>
</c:otherwise>
</c:choose>
</div>
</div>
<!-- 수정/등록 알림 -->
<div id="result-alert" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
<spring:message code="success.common.insert"/>
</p>
</div>
<div class="alert-btn-container">
<button class="alert-btn alert-btn--confirm" id = "alertBtn"><spring:message code="button.ok"/></button>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<script>
// Dropzone 파일업로드
if ($("#contact-dropzone").length > 0) {
const maxFiles = 3;
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#contact-dropzone", {
url: "/file-upload",
maxFilesize: 10,
maxFiles: maxFiles,
acceptedFiles: "${acceptFileExtensions}",
autoProcessQueue: false,
addRemoveLinks: true,
dictDefaultMessage: "",
dictRemoveFile: "삭제",
dictCancelUpload: "취소",
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
dictResponseError: "서버에서 응답을 받지 못했습니다.",
});
var inputElement = $('input[type="file"].dz-hidden-input');
// name 부여
inputElement.attr('name', 'file');
// id 부여
inputElement.attr('id', 'fileUpload');
// 파일 추가 이벤트
myDropzone.on("addedfile", function(file) {
if (myDropzone.files.length >= maxFiles) {
$(".dz-message").hide();
}
// 파일 크기가 최대 파일 크기보다 큰 경우
if (file.size > this.options.maxFilesize * 1024 * 1024) {
this.removeFile(file);
alert("파일 크기가 너무 큽니다. 최대 " + this.options.maxFilesize + "MB까지 허용됩니다.");
}
});
myDropzone.on("removedfile", function(file) {
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
}
});
myDropzone.on("maxfilesexceeded", function(file) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
this.removeFile(file);
$(file.previewElement).find(".dz-remove").attr("disabled", true);
});
}
</script>
</body>
</html>

View File

@@ -0,0 +1,655 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : BbscttRegistPopupC.jsp
Description : 게시글 등록 팝업 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05-09 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<script>
$(document).ready(function () {
/*파일 temp 배열 초기화*/
filesTempArr = [];
/*sms 답변 여부에 따른 disabled처리*/
$("#answSmsRecptn").on("click", function () {
if ($(this).is(":checked")) {
$("#answMbtlnb").prop("disabled", false);
} else {
$("#answMbtlnb").prop("disabled", true);
}
});
//내용 텍스트 <br>태그 엔터값으로 replace
const textarea = $("textarea[name=cn]");
let cn = textarea.attr("placeholder");
if (cn) {
cn = fn_remove_tag(cn);
textarea.attr("placeholder", cn);
}
fn_set_niceSelect_datePicker("#qna-pop-regist");
/*휴대전화 포매팅*/
fn_set_event("#answMbtlnb", "keyup", fn_fmt_telno);
//분류 change시 hidden value값 set
$('#qesitmNmC').on('change', function () {
$("#qesitmInnb").val("");
$("#qesitmNm").val("");
$("#answCn").val("");
const option = $('option:selected', this);
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if ($(this).val() !== "") {
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmNm").val(qesitmNm);
$("#qesitmAt").val("Y");
} else {
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmNm").val("");
$("#qesitmAt").val("N");
}
});
//추가입력 항목 라디오 'click' 이벤트
$('.answRadioC').on('click', function () {
const radio = $(this);
//추가입력 항목 내용 요소 get
const answ = radio.closest(".custom-radio-container").find('[name="answCnArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest(".custom-radio-container").find('[name="qesitmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest(".custom-radio-container").find('.answRadio');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest(".custom-radio-container").find('[name="itmInnbArr[]"]');
//라디오 클릭 시 disabled 비활성
if (radio.is(":checked")) {
//답변 내용 초기화
answ.val("");
const radioVal = $(radio).attr('itm-cn');
answ.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
radio.closest(".custom-radio-container").find(".answRadioAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
radio.closest(".custom-radio-container").find(".answRadioAt").val("N");
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
$('.answSelectC').on('change', function () {
const select = $(this);
const answ = select.closest("td").find('[name="answCnArr[]"]');
const qesitmInnb = select.closest("td").find('[name="qesitmInnbArr[]"]');
const contrlTarget = select.closest("td").find('.answSelect');
const option = $('option:selected', this);
if (select.val() != "") {
//답변 내용 초기화
answ.val("");
const selectVal = $(option).attr('itm-cn');
answ.val(selectVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(option).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//셀렉트 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
select.closest("td").find(".answSelectAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
select.closest("td").find(".answSelectAt").val("N");
});
}
});
//추가입력 항목 체크박스 'click'이벤트
$('.answChkC').on('click', function () {
const check = $(this);
const contrlTarget = check.closest("div").find('.answChk');
var isChecked = $(this).is(":checked");
//클릭한 체크박스 주위 input값 disable false처리
contrlTarget.each(function () {
if (isChecked) {
$(this).prop("disabled", false);
} else {
$(this).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = $('.answChkC:checked').length > 0;
contrlTarget.each(function () {
if (anyChecked) {
check.closest("td").find(".answChkAt").val("Y");
} else {
check.closest("td").find(".answChkAt").val("N");
}
});
});
//추가입력 항목 텍스트 'input'이벤트
$('.answTxtC').on('input', function () {
const txt = $(this);
const contrlTarget = txt.closest(".input-grow-container").find('.answTxt');
const contrlAt = txt.closest(".input-grow-container").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
//파일 업로드
$("#fileUpload").on("change", function () {
addFiles(event, 0);
});
//등록 버튼 이벤트
$("#regBtn").on("click", function () {
fn_regist_bbsctt();
});
//등록 완료 모달 > 확인 버튼 이벤트 (새로고침)
$("#alertBtn").on("click", function () {
$(".close").each(function () {
$(this).click();
});
/*상품 상세 등록시 qna 목록 재조회*/
if ($("#listAt").val() === 'list') {
fn_select_qna(1);
}
});
});
/*********************************************************
* 게시글 등록
*********************************************************/
if (typeof fn_regist_bbsctt === 'undefined') {
function fn_regist_bbsctt() {
let url = '<c:url value="/sopmal/csc/insertBbscttRegist"/>';
let saveForm = $('#bbsRegForm');
let formData = new FormData();
//파일 업로드
if ($("#contact-dropzone").length > 0) {
let myDropzone = Dropzone.forElement("#contact-dropzone");
myDropzone.files.forEach(function (file) {
formData.append("files", file);
});
}
/*문항 답변 체크박스 disabled*/
$('.answChk').each(function () {
if (!$(this).prop('checked')) {
fn_ctrl_disable([".answChk"],);
}
});
//여부 N처리
$('.chkAt').each(function () {
if (!$(this).prop('checked')) {
$(this).val("N");
}
});
//폼 내 input값 append
saveForm.serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
//사용자 등록 시 노출 여부 Y
formData.append("expsrAt", "Y");
disableButton("#regBtn");
if (confirm('게시글을 <spring:message code="confirm.common.insert"/>')) {
$.ajax({
type: 'post',
url: url,
enctype: "multipart/form-data",
data: formData,
processData: false,
contentType: false,
success: function (result) {
enableButton("#regBtn");
$("#resultAlert").text("<spring:message code="success.common.insert"/>");
$("#result-alert-regist").modal();
}
});
}
fn_ctrl_disable("", [".checkbox"]);
enableButton("#regBtn");
}
}
/*상품qna 버튼 클릭 제어*/
if (typeof fn_prevent_click === 'undefined') {
function fn_prevent_click(event){
event.preventDefault(); // 체크박스 상태 변경 방지
}
}
</script>
<body>
<c:set value="${resultMap.regusrInfo}" var="regusrInfo"/>
<c:set value="${resultMap.bbscttVO}" var="bbscttVO"/>
<c:set value="${resultMap.bbsInfo}" var="bbsInfo"/>
<c:set value="${resultMap.qnaGoodsInfo}" var="qnaGoodsInfo"/>
<c:set value="${resultMap.qesitmList.qesitmList}" var="qesitmList"/>
<c:set value="${resultMap.qesitmList.itmCnList}" var="itmCnList"/>
<c:set value="${resultMap.itmList}" var="itmList"/>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.extensions.images')"
var="acceptFileExtensions"/><%--허용파일확장자--%>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/><%--이미지경로--%>
<div id="qna-pop-regist" class="modal default" style="max-width: 720px;">
<div class="modal-header">
<div class="modal-header__title"><c:out value='${bbsInfo.bbsNm}'/></div>
</div>
<div class="modal-content">
<div class="table-wrapper">
<form id="bbsRegForm">
<table class="table write">
<caption>게시글 등록</caption>
<colgroup>
<col style="width: 200px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>이름<span class="required-asterisk">*</span></th>
<td>
<c:choose>
<c:when test="${regusrInfo.regusrDvCd eq '99'}">
<input type="text" class="input-text lg" name="regusrNm" title="작성자명"
placeholder="이름">
</c:when>
<c:otherwise>
<div class="td-inner"><c:out value='${regusrInfo.regusrNm}'/></div>
<input type="hidden" name="regusrNm"
value="<c:out value='${regusrInfo.regusrNm}'/>">
</c:otherwise>
</c:choose>
</td>
</tr>
<c:if test="${bbsInfo.answRegist eq 'Y'&& bbsInfo.bbscttSndngMthCd ne '03'}"><%--답변사용여부와 게시글 문자사용여부 체크--%>
<tr>
<th>답변수신</th>
<td>
<div class="td-inner">
<c:if test="${empty regusrInfo.answMbtlnb}">
<input type="text" class="input-text" id="answMbtlnb" name="answMbtlnb"
placeholder="핸드폰번호'-'없이" title="답변핸드폰번호" maxlength="13">
</c:if>
<div class="input-container">
<label class="b-checkbox checkbox">
<input type="checkbox" name="answSmsRecptn" value="Y" id="answSmsRecptn"
checked>
<span class="check"></span>
<span class="control-label">SMS 알림요청</span>
</label>
</div>
</div>
</td>
</tr>
</c:if>
<c:if test="${not empty itmList}">
<tr>
<th>문의유형<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<div class="select-box">
<%--문항답변필수여부 --%>
<input type="hidden" name="qesitmEssntlAtArr[]" value="Y">
<%--문항명 --%>
<input type="hidden" name="qesitmNmArr[]" id="qesitmNm" value="분류"/>
<%--문항고유번호 --%>
<input type="hidden" name="qesitmInnbArr[]" id="qesitmInnb"/>
<%--답변내용 --%>
<input type="hidden" name="answCnArr[]" id="answCn"/>
<%--답변여부 --%>
<input type="hidden" name="qesitmAtArr[]" id="qesitmAt" value="N">
<select class="md" id="qesitmNmC" name="itmInnbArr[]">
<option value="">문의 유형을 선택해 주세요.</option>
<c:forEach var="itm" items="${itmList}" varStatus="status">
<option value="<c:out value="${itm.itmInnb}"/>"
qesitm-innb="${itm.qesitmInnb}"
answ-Cn="${itm.itmCn}"
qesitm-nm="${itm.qesitmNm}">
<c:out value="${itm.itmCn}"/>
</option>
</c:forEach>
</select>
</div>
</div>
</td>
</tr>
</c:if>
<c:if test="${not empty qesitmList}">
<c:forEach var="qesitmList" items="${qesitmList}">
<tr>
<c:if test="${ qesitmList.itmTyCd eq '01'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt}"
class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm}">
<input type="hidden" name="qesitmAtArr[]"
class="answRadioAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]"
class="answRadio"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answRadio"
disabled>
<input type="hidden" name="itmInnbArr[]" class="answRadio"
disabled>
<c:forEach items="${itmCnList}" var="itmCnList1"
varStatus="status">
<c:if test="${itmCnList1.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="custom-radio is-medium">
<input type="radio"
name="itmInnbArr<c:out value="${ qesitmList.qesitmInnb }"/>[]"
id="answCn<c:out value="${ status.index }"/>"
class="answRadioC"
value="<c:out value="${ itmCnList1.itmInnb}"/>"
qesitm-innb='<c:out value="${itmCnList1.qesitmInnb}"/>'
itm-cn="<c:out value="${ itmCnList1.itmCn }"/>">
<label for="answCn<c:out value="${ status.index }"/>">
<c:out value="${ itmCnList1.itmCn }"/>
</label>
</div>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '02'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answSelectAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]" class="answSelect"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answSelect" disabled>
<div class="select-box">
<select class="md answSelectC" name="itmInnbArr[]">
<option value="">전체</option>
<c:forEach items="${itmCnList}" var="itmCnList2">
<c:if test="${itmCnList2.qesitmInnb eq qesitmList.qesitmInnb}">
<option value="${ itmCnList2.itmInnb }"
itm-cn="${ itmCnList2.itmCn}"
qesitm-innb='${itmCnList2.qesitmInnb}'>${ itmCnList2.itmCn }</option>
</c:if>
</c:forEach>
</select>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '03'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answChkAt qesitmAtChk"
value="N">
<c:forEach items="${itmCnList}" var="itmCnList3">
<c:if test="${itmCnList3.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<label class="b-checkbox checkbox">
<input type="hidden" class="answChk"
name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" class="answChk"
name="answCnArr[]"
value="${ itmCnList3.itmCn }" disabled>
<input type="checkbox" class="answChkC"
name="itmInnbArr[]"
value="${ itmCnList3.itmInnb }">
<span class="check"></span>
<span class="control-label">${ itmCnList3.itmCn }</span>
</label>
</div>
</c:if>
</c:forEach>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '04'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<c:forEach items="${itmCnList}" var="itmCnList4">
<c:if test="${itmCnList4.qesitmInnb eq qesitmList.qesitmInnb}">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }"
class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answTxtAt qesitmAtChk" value="N">
<input type="hidden" class="answTxt"
name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="text" class="input-text lg answTxtC"
name="answCnArr[]" title="추가문항답변"
placeholder="${ itmCnList4.itmCn }"
maxlength="666">
<input type="hidden" class="answTxt"
name="itmInnbArr[]"
value="${ itmCnList4.itmInnb }" disabled>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
</tr>
</c:forEach>
</c:if>
<c:if test="${bbsInfo.bbsTyCd eq '05'}">
<tr>
<th>문의상품</th>
<td>
<img src="<c:out value = '${cdnurl}${qnaGoodsInfo.img}'/>" alt="qnaGoods">
<br>
<span><c:out value='${qnaGoodsInfo.goodsNm}'/></span>
<input type="hidden" name="goodsInnbArr[]" value="${qnaGoodsInfo.goodsInnb}"/>
</td>
</tr>
</c:if>
<tr>
<th>제목<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<input class="input-text xl" type="text" title="제목 입력란" name="sj"
placeholder="제목을 입력하세요." maxlength="100">
<%--게시판설정(비밀글사용여부)--%>
<c:if test="${bbsInfo.secretBbsctt eq 'Y'}">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="secretBbscttAt" class="chkAt"
checked<c:if test="${bbsInfo.bbsTyCd eq '05'}"> onclick="fn_prevent_click(event);"</c:if>>
<span class="check"></span>
<span class="control-label">비밀글</span>
</label>
</div>
</c:if>
</div>
</div>
</td>
</tr>
<c:if test="${regusrInfo.regusrDvCd eq '99'}">
<tr>
<th>비밀번호<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<input class="input-text lg" type="password"
title="비밀번호 입력란"
name="password" maxlength='20'
placeholder="비밀번호를 입력하세요." value="">
</div>
</td>
</tr>
</c:if>
<tr>
<th>내용</th>
<td>
<textarea class="textarea" rows="12" title="내용 입력란" name="cn"
placeholder="<c:out value = "${bbsInfo.dftCn}"/>"></textarea>
</td>
</tr>
<%--게시판설정(파일첨부사용여부)--%>
<input type="hidden" value="<c:out value = '${bbsInfo.filAtch}'/>" name="filAtch">
<c:if test="${bbsInfo.filAtch eq 'Y'}">
<tr>
<th>이미지 등록</th>
<td>
<div class="dropzone-wrapper">
<div class="dropzone" id="contact-dropzone">
</div>
</div>
<ul class="contact-upload-info">
<li>사진, 동영상 첨부는 최대 10MB 이하이며 3개까지 등록할 수 있습니다.</li>
<li>등록 가능 파일은 <c:out value="${acceptFileExtensions}"/> 파일만 가능합니다.</li>
<li>상품과 무관한 내용이거나 음란 불법적인 내용은 통보없이 삭제할 수 있습니다.</li>
</ul>
</td>
</tr>
</c:if>
</tbody>
</table>
<input type="hidden" id="listAt" value="<c:out value = '${bbscttVO.listAt}'/>" name="listAt"/>
<input type="hidden" id="sopmalCd" value="<c:out value = '${bbscttVO.sopmalCd}'/>" name="sopmalCd"/>
<input type="hidden" id="bbsId" value="<c:out value = '${bbsInfo.bbsId}'/>" name="bbsId"/>
<input type="hidden" id="bbsNm" value="<c:out value = '${bbsInfo.bbsNm}'/>" name="bbsNm"/>
<input type="hidden" id="regusrDvCd" value="<c:out value = '${regusrInfo.regusrDvCd}'/>"
name="regusrDvCd"/>
<input type="hidden" id="bbscttSndngMthCd" value="<c:out value = '${bbsInfo.bbscttSndngMthCd}'/>"
name="bbscttSndngMthCd"/>
<input type="hidden" name="acceptFileExtensions" id="acceptFileExtensions"
value="${acceptFileExtensions}"/>
</form>
</div>
</div>
<div class="modal-footer">
<a href="#" rel="modal:close" class="btn large outline close"><spring:message code="button.close"/></a>
<button class="btn large gray2" id="regBtn"><spring:message code="button.insert"/></button>
</div>
</div>
<!--등록결과모달-->
<div id="result-alert-regist" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
<spring:message code="success.common.insert"/>
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="btn large outline close"><spring:message code="button.close"/></a>
<button class="alert-btn alert-btn--confirm" id="alertBtn"><spring:message code="button.ok"/></button>
</div>
</div>
</body>
<script>
// Dropzone 파일업로드
if ($("#contact-dropzone").length > 0) {
const maxFiles = 3;
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#contact-dropzone", {
url: "/file-upload",
maxFilesize: 10,
maxFiles: maxFiles,
acceptedFiles: "${acceptFileExtensions}",
autoProcessQueue: false,
addRemoveLinks: true,
dictDefaultMessage: "",
dictRemoveFile: "삭제",
dictCancelUpload: "취소",
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
dictResponseError: "서버에서 응답을 받지 못했습니다.",
});
var inputElement = $('input[type="file"].dz-hidden-input');
if(inputElement.length > 1){
inputElement.eq(0).remove();
}
// name 부여
inputElement.attr('name', 'file');
// id 부여
inputElement.attr('id', 'fileUpload');
// 파일 추가 이벤트
myDropzone.on("addedfile", function(file) {
if (myDropzone.files.length >= maxFiles) {
$(".dz-message").hide();
}
$("#filExtAt").val("Y");
});
myDropzone.on("removedfile", function(file) {
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
}
});
myDropzone.on("maxfilesexceeded", function(file) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
this.removeFile(file);
$(file.previewElement).find(".dz-remove").attr("disabled", true);
});
}
</script>
</html>

View File

@@ -0,0 +1,944 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : BbscttUpdtPopupU.jsp
Description : 게시글 수정 팝업 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05-09 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<script>
$(document).ready(function(){
/*파일 temp 배열 초기화*/
filesTempArr = [];
/*폼 기본 세팅*/
fn_select_cn();
//1.내용 텍스트 <br>태그 엔터값으로 replace
const textarea = $("textarea[name=cn]");
let cn = textarea.attr("placeholder");
if (cn) {
cn = fn_remove_tag(cn);
textarea.attr("placeholder", cn);
}
/*sms 답변 여부에 따른 disabled처리*/
$("#answSmsRecptn").on("click",function(){
if($(this).is("checked")){
$("#answMbtlnb").prop("disabled",false);
}else{
$("#answMbtlnb").prop("disabled",true);
}
});
//2.내용 텍스트 <br>태그 엔터값으로 replace
const target = $("#cnBbsUpdt");
let str = target.text();
str = str.trim();
target.val(str);
//3.나이스셀렉터 적용
fn_set_niceSelect_datePicker("#qna-update-pop");
/*4.휴대전화 포매팅*/
if ($("#answMbtlnb").val().length > 0) {
$("#answMbtlnb").val(fn_format_mbtlnb($("#answMbtlnb").val()));
fn_set_event("#answMbtlnb", "keyup", fn_fmt_telno);
}
//6.hidden value set
fn_update_hidden_value();
//분류 change시 hidden value값 set
$('#qesitmNmC').on('change', function () {
$("#qesitmInnb").val("");
$("#qesitmNm").val("");
$("#answCn").val("");
const option = $('option:selected', this);
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if ($(this).val() !== "") {
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmNm").val(qesitmNm);
$("#qesitmAt").val("Y");
} else {
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmNm").val("");
$("#qesitmAt").val("N");
}
});
//추가입력 항목 라디오 'click' 이벤트
$('.answRadioC').on('click', function () {
const radio = $(this);
//추가입력 항목 내용 요소 get
const answ = radio.closest(".custom-radio-container").find('[name="answCnArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest(".custom-radio-container").find('[name="qesitmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest(".custom-radio-container").find('.answRadio');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest(".custom-radio-container").find('[name="itmInnbArr[]"]');
//라디오 클릭 시 disabled 비활성
if (radio.is(":checked")) {
//답변 내용 초기화
answ.val("");
const radioVal = $(radio).attr('itm-cn');
answ.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
radio.closest(".custom-radio-container").find(".answRadioAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
radio.closest(".custom-radio-container").find(".answRadioAt").val("N");
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
$('.answSelectC').on('change', function () {
const select = $(this);
const answ = select.closest("td").find('[name="answCnArr[]"]');
const qesitmInnb = select.closest("td").find('[name="qesitmInnbArr[]"]');
const contrlTarget = select.closest("td").find('.answSelect');
const option = $('option:selected', this);
if (select.val() != "") {
//답변 내용 초기화
answ.val("");
const selectVal = $(option).attr('itm-cn');
answ.val(selectVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(option).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//셀렉트 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
select.closest("td").find(".answSelectAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
select.closest("td").find(".answSelectAt").val("N");
});
}
});
//추가입력 항목 체크박스 'click'이벤트
$('.answChkC').on('click', function () {
const check = $(this);
const contrlTarget = check.closest("div").find('.answChk');
var isChecked = $(this).is(":checked");
//클릭한 체크박스 주위 input값 disable false처리
contrlTarget.each(function () {
if (isChecked) {
$(this).prop("disabled", false);
} else {
$(this).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = $('.answChkC:checked').length > 0;
contrlTarget.each(function () {
if (anyChecked) {
check.closest("td").find(".answChkAt").val("Y");
check.closest("td").find(".answChkAt").prop("disabled", false);
} else {
check.closest("td").find(".answChkAt").val("N");
check.closest("td").find(".answChkAt").prop("disabled", true);
}
});
});
//추가입력 항목 텍스트 'input'이벤트
$('.answTxtC').on('input', function () {
const txt = $(this);
const contrlTarget = txt.closest("div").find('.answTxt');
const contrlAt = txt.closest("div").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
//파일 업로드
$("#fileUpload").on("change", function () {
addFiles(event, 0);
});
//수정 버튼 이벤트
$("#updtBtn").on("click", function () {
fn_update_bbsctt();
});
//수정 완료시
$("#alertUpdtBtn").on("click", function () {
/*상품 상세 수정시 qna 목록 재조회*/
if ($("#listAt").val() === 'list') {
fn_select_qna(1);
}
$(".close").each(function () {
$(this).click();
});
});
/*닫기버튼클릭*/
$("#updtCloseBtn").on("click", function () {
fn_close_modal("qna-update-pop");
});
});
/*********************************************************
* 게시글 수정
*********************************************************/
if(typeof fn_update_hidden_value === 'undefined'){
function fn_update_hidden_value() {
//분류 항목
const option = $('option:selected', $("#qesitmNmC"));
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if ($("#qesitmNmC").val() != "") {
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmAt").val("Y");
} else {
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmAt").val("N");
}
// 추가평가항목 라디오
const radio = $(".answRadioC:checked");
radio.each(function (idx) {
if (radio.eq(idx).val()) {
let radioAnsw = radio.eq(idx).closest("td").find('[name="answCnArr[]"]');
let radioQesitmInnb = radio.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let radioItmInnb = radio.eq(idx).closest("td").find('[name="itmInnbArr[]"]');
let radioQesitmAt = radio.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let radioContrlTarget = radio.eq(idx).closest("td").find('.answRadio');
// 답변 내용 set
radioAnsw.val(radio.eq(idx).attr('itm-cn'));
// 항목 내용 set
radioQesitmInnb.val(radio.eq(idx).attr('qesitm-innb'));
// 항목고유번호 내용 set
radioItmInnb.val(radio.eq(idx).val());
// 답변 여부
radioQesitmAt.val("Y");
// 라디오 주위 input값 disable false처리
radioContrlTarget.each(function (idx) {
radioContrlTarget.eq(idx).prop("disabled", false);
});
} else {
let radioAnsw = radio.eq(idx).closest("td").find('[name="answCnArr[]"]');
let radioQesitmInnb = radio.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let radioItmInnb = radio.eq(idx).closest("td").find('[name="itmInnbArr[]"]');
let radioQesitmAt = radio.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let radioContrlTarget = radio.eq(idx).closest("div").find('.answRadio');
// 답변 내용 set
radioAnsw.val("");
// 항목 내용 set
radioQesitmInnb.val("");
// 항목고유번호 내용 set
radioItmInnb.val("");
// 답변 여부
radioQesitmAt.val("N");
// 라디오 주위 input값 disable false처리
radioContrlTarget.each(function (idx) {
radioContrlTarget.eq(idx).prop("disabled", true);
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
const select = $('select.answSelectC[name="itmInnbArr[]"]');
select.each(function (idx) {
let selectIndex = select.eq(idx).find('option:selected').index();
if (selectIndex > 0) {
let selectQesitmAt = select.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let selectQesitmInnb = select.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let selectAnsw = select.eq(idx).closest("td").find('[name="answCnArr[]"]');
let selectOption = $('option:selected', select.eq(idx));
let selectContrlTarget = select.eq(idx).closest("td").find('.answSelect');
// 답변 여부
selectQesitmAt.val("Y");
// 항목 내용 set
selectQesitmInnb.val(selectOption.attr('qesitm-innb'));
// 답변 내용 set
selectAnsw.val(selectOption.attr('itm-cn'));
// 라디오 주위 input값 disable false처리
selectContrlTarget.each(function (idx) {
selectContrlTarget.eq(idx).prop("disabled", false);
});
} else {
let selectQesitmAt = select.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let selectQesitmInnb = select.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let selectAnsw = select.eq(idx).closest("td").find('[name="answCnArr[]"]');
let selectContrlTarget = select.eq(idx).closest("td").find('.answSelect');
// 답변 여부
selectQesitmAt.val("N");
// 항목 내용 set
selectQesitmInnb.val("");
// 답변 내용 set
selectAnsw.val("");
// 라디오 주위 input값 disable false처리
selectContrlTarget.each(function (idx) {
selectContrlTarget.eq(idx).prop("disabled", true);
});
}
});
const check = $(".answChkC");
//클릭한 체크박스 주위 input값 disable false처리
check.each(function (idx) {
let checkContrlTarget = check.eq(idx).closest(".checkbox").find('.answChk');
let isChecked = check.eq(idx).is(":checked");
checkContrlTarget.each(function (index) {
if (isChecked) {
checkContrlTarget.eq(index).prop("disabled", false);
} else {
checkContrlTarget.eq(index).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = check.eq(idx).closest("td").find(".answChkC:checked").length > 0;
if (anyChecked) {
check.eq(idx).closest("td").find(".answChkAt").val("Y");
} else {
check.eq(idx).closest("td").find(".answChkAt").val("N");
}
});
//추가입력 항목 텍스트 'input'이벤트
const txt = $('.answTxtC');
txt.each(function (idx) {
let contrlTarget = txt.eq(idx).closest("div").find('.answTxt');
let contrlAt = txt.eq(idx).closest("div").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
}
}
/*********************************************************
* 게시글 내용 조회
*********************************************************/
if (typeof fn_select_cn === 'undefined') {
function fn_select_cn () {
let bbscttInnb = $("#bbscttInnb").val();
let bbsId = $("#bbsId").val();
let sopmalCd = $("#sopmalCd").val();
$.ajax({
type: "post",
url: "<c:url value ='/ajax/bbscttAjax/selectBOBbscttCnAjax'/>",
contentType: 'application/json',
data: JSON.stringify({
bbsId: bbsId,
bbscttInnb: bbscttInnb,
sopmalCd: sopmalCd
}),
success: function (data) {
let cn = data.result.cn;
$("#cnBbsUpdt").val(cn);
}
});
}
}
/*********************************************************
* 게시글 수정
*********************************************************/
if (typeof fn_update_bbsctt === 'undefined') {
function fn_update_bbsctt() {
let url = '<c:url value="/sopmal/csc/updateBbscttupdt"/>';
let saveForm = $('#bbsUpdtForm');
let formData = new FormData();
//파일 업로드
if ($("#contact-dropzone").length > 0) {
let myDropzone = Dropzone.forElement("#contact-dropzone");
myDropzone.files.forEach(function (file) {
formData.append("files", file);
});
}
/*문항 답변 체크박스 disabled*/
$('.answChk').each(function () {
if (!$(this).prop('checked')) {
fn_ctrl_disable([".answChk"],);
}
});
//여부 N처리
$('.chkAt').each(function () {
if (!$(this).prop('checked')) {
$(this).val("N");
}
});
//사용자 등록 시 노출 여부 Y
formData.append("expsrAt", "Y");
//폼 내 input값 append
saveForm.serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
disableButton("#updtBtn");
//사용자 등록 시 노출 여부 Y
if (confirm('게시글을 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'post',
url: url,
enctype: "multipart/form-data",
data: formData,
processData: false,
contentType: false,
success: function (result) {
enableButton("#updtBtn");
let updateMsg = "<spring:message code="success.common.update"/>";
$("#resultAlert").text(updateMsg);
$("#result-alert-update").modal();
}
});
}
enableButton("#updtBtn");
fn_ctrl_disable("", [".answChk"]);
}
}
/*상품qna 버튼 클릭 제어*/
if (typeof fn_prevent_click === 'undefined') {
function fn_prevent_click(event) {
event.preventDefault(); // 체크박스 상태 변경 방지
}
}
</script>
<body>
<c:set value="${resultMap.bbscttInfo.bbscttInfo}" var="bbscttInfo"/>
<c:set value="${resultMap.bbscttVO}" var="bbscttVO"/>
<c:set value="${resultMap.bbscttInfo.qesitmAnswList}" var="qesitmAnswList"/>
<c:set value="${resultMap.bbscttInfo.fileInfoGson}" var="fileInfoGson"/>
<c:set value="${resultMap.bbscttInfo.goods}" var="goods"/>
<c:set value="${resultMap.bbscttInfo.wrter}" var="wrter"/>
<c:set value="${resultMap.bbsInfo}" var="bbsInfo"/>
<c:set value="${resultMap.qesitmList.qesitmList}" var="qesitmList"/>
<c:set value="${resultMap.qesitmList.itmCnList}" var="itmCnList"/>
<c:set value="${resultMap.itmList}" var="itmList"/>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<div id="qna-update-pop" class="modal default" style="max-width: 720px;">
<div class="modal-header">
<div class="modal-header__title"><c:out value = '${bbsInfo.bbsNm}'/></div>
</div>
<div class="modal-content">
<div class="table-wrapper">
<form id="bbsUpdtForm">
<input type="hidden" name="setupInfoInnb" value="${bbsInfo.setupInfoInnb }"/>
<input type="hidden" name="sopmalCd" value="${bbscttVO.sopmalCd }" id="sopmalCd"/>
<input type="hidden" name="filAtch" value="${bbsInfo.filAtch }"/>
<input type="hidden" name="slangFlterUseAt" value="${bbsInfo.slangFlterUseAt}"/>
<input type="hidden" name="regusrNm" value="${bbscttInfo.regusrNm}"/>
<input type="hidden" id = "bbsId" name="bbsId" value="${bbsInfo.bbsId }"/>
<input type="hidden" id = "bbsTyCd" name="bbsTyCd" value="${bbsInfo.bbsTyCd }"/>
<input type="hidden" id="reqDv" value="<c:out value = '${bbsctt.reqDv}'/>" name="reqDv"/>
<input type="hidden" id="pgeVtcCnt" name="pgeVtcCnt" value="${ bbsInfo.pgeVtcCnt }"/>
<input type="hidden" id="pgeWthCnt" name="pgeWthCnt" value="${ bbsInfo.pgeWthCnt }"/>
<input type="hidden" id="bbscttInnb" name="bbscttInnb" value="${ bbscttInfo.bbscttInnb }"/>
<input type="hidden" id="listAt" name="listAt" value="${ bbscttVO.listAt }"/>
<input type="hidden" id="prevNext" name="prevNext" value="${ bbsInfo.prevNext }"/>
<input type="hidden" id="sknTyCd" name="sknTyCd" value="${ bbsInfo.sknTyCd }"/>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.extensions.images')" var="acceptFileExtensions"/>
<input type="hidden" id="acceptFileExtensions" name="acceptFileExtensions" value="${acceptFileExtensions}"/>
<table class="table write">
<caption>게시글 수정</caption>
<colgroup>
<col style="width: 200px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>이름</th>
<td>
<div class="td-inner"><c:out value = "${bbscttInfo.regusrNm}"/></div>
</td>
</tr>
<c:if test="${not empty itmList}">
<tr>
<th>분류<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<div class="select-box">
<%--문항답변필수여부 --%>
<input type="hidden" name="qesitmEssntlAtArr[]" value="Y">
<%--문항명 --%>
<input type="hidden" name="qesitmNmArr[]" id="qesitmNm" value="분류"/>
<%--문항고유번호 --%>
<input type="hidden" name="qesitmInnbArr[]" id="qesitmInnb"
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
value = <c:out value="${itmAnswList.qesitmInnb}"/>
</c:if>
</c:forEach>/>
<%--답변내용 --%>
<input type="hidden" name="answCnArr[]" id="answCn"<c:forEach
var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
value = <c:out value="${itmAnswList.answCn}"/>
</c:if>
</c:forEach>/>
<%--답변여부 --%>
<input type="hidden" name="qesitmAtArr[]" id="qesitmAt"
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
<c:choose>
<c:when test="${empty itmAnswList.answCn}">value="N"</c:when>
<c:otherwise>value="Y"</c:otherwise>
</c:choose>
</c:if>
</c:forEach>>
<select class="md" id="qesitmNmC" name="itmInnbArr[]">
<option value="">문의 유형</option>
<c:forEach var="itm" items="${itmList}" varStatus="status">
<option value="<c:out value="${itm.itmInnb}"/>"
qesitm-innb="${itm.qesitmInnb}" answ-Cn="${itm.itmCn}"
qesitm-nm="${itm.qesitmNm}"
<%--분류 답변 값 유지--%>
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
<c:if test="${itm.itmInnb eq itmAnswList.itmInnb }">selected</c:if>
</c:if>
</c:forEach>>
<c:out value="${itm.itmCn}"/>
</option>
</c:forEach>
</select>
</div>
</div>
</td>
</tr>
</c:if>
<c:if test="${not empty qesitmList}">
<c:forEach var="qesitmList" items="${qesitmList}">
<tr>
<c:if test="${ qesitmList.itmTyCd eq '01'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt}"
class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm}">
<input type="hidden" name="qesitmAtArr[]"
class="answRadioAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]"
class="answRadio"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answRadio"
disabled>
<input type="hidden" name="itmInnbArr[]" class="answRadio"
disabled>
<c:forEach items="${itmCnList}" var="itmCnList1" varStatus="status">
<c:if test="${itmCnList1.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="custom-radio is-medium">
<input type="radio" id="answCn${ status.index }"
class="answRadioC"
qesitm-innb='${itmCnList1.qesitmInnb}'
name="itmInnbArr${ qesitmList.qesitmInnb}[]"
value="${ itmCnList1.itmInnb}"
itm-cn="${ itmCnList1.itmCn }"
<c:forEach var="qesitmAnswList1" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList1.itmTyCd eq '01'}">
<c:if test="${qesitmAnswList1.itmInnb eq itmCnList1.itmInnb}">checked</c:if>
</c:if>
</c:forEach>>
<label for="answCn${ status.index }">${ itmCnList1.itmCn }</label>
</div>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '02'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answSelectAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]" class="answSelect"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answSelect" disabled>
<div class="select-box">
<select class="md answSelectC" name="itmInnbArr[]">
<option value="">전체</option>
<c:forEach items="${itmCnList}" var="itmCnList2">
<c:if test="${itmCnList2.qesitmInnb eq qesitmList.qesitmInnb}">
<c:set var="selected" value=""/>
<c:forEach var="qesitmAnswList2" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList2.itmInnb eq itmCnList2.itmInnb}">
<c:set var="selected" value="selected"/>
</c:if>
</c:forEach>
<option value="${itmCnList2.itmInnb}"
itm-cn="${itmCnList2.itmCn}"
qesitm-innb="${itmCnList2.qesitmInnb}" ${selected}>
${itmCnList2.itmCn}
</option>
</c:if>
</c:forEach>
</select>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '03'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answChkAt qesitmAtChk"
value="N">
<c:forEach items="${itmCnList}" var="itmCnList3">
<c:if test="${itmCnList3.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<label class="b-checkbox checkbox">
<input type="hidden" class="answChk" name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" class="answChk" name="answCnArr[]"
value="${ itmCnList3.itmCn }" disabled>
<input type="checkbox" class="answChkC" name="itmInnbArr[]"
value="${ itmCnList3.itmInnb }"
itm-cn="${ itmCnList3.itmCn }"
qesitm-innb="${itmCnList3.qesitmInnb}"
<c:forEach var="qesitmAnswList3" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList3.itmInnb eq itmCnList3.itmInnb}">checked</c:if>
</c:forEach>>
<span class="check"></span>
<span class="control-label">${ itmCnList3.itmCn }</span>
</label>
</div>
</c:if>
</c:forEach>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '04'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<c:forEach items="${itmCnList}" var="itmCnList4">
<c:if test="${itmCnList4.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answTxtAt" value="N">
<input type="hidden" class="answTxt"
name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" class="answTxt" name="itmInnbArr[]"
value="${ itmCnList4.itmInnb }" disabled>
<input type="text" class="input-text mm answTxtC"
name="answCnArr[]" title="추가문항답변"
placeholder="${ itmCnList4.itmCn }"
maxlength="666"
itm-cn="${ itmCnList4.itmCn }"
qesitm-innb="${itmCnList4.qesitmInnb}"
itm-innb="${itmCnList4.itmInnb}"
<c:forEach var="qesitmAnswList4"
items="${qesitmAnswList}">
<c:if test="${qesitmAnswList4.itmInnb eq itmCnList4.itmInnb}">
value="<c:out value = '${qesitmAnswList4.answCn}'/>"
</c:if>
</c:forEach>>
</div>
<br>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
</tr>
</c:forEach>
</c:if>
<c:if test="${bbsInfo.answRegist eq 'Y'&& bbsInfo.bbscttSndngMthCd ne '03'}"><%--답변사용여부와 게시글 문자사용여부 체크--%>
<tr>
<th>답변받기</th>
<td>
<div class="td-inner">
<input class="input-text" type="text" title="해당 인풋에 대한 설명" name="answMbtlnb"
id="answMbtlnb" maxlength="13" value = "<c:out value = '${bbscttInfo.answMbtlnb}'/>"
placeholder="휴대폰번호'-'없이 입력">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="answSmsRecptn" class="chkAt"
<c:if test="${bbscttInfo.answSmsRecptn eq 'Y'}">checked</c:if>>
<span class="check"></span>
<span class="control-label">SMS 알림요청</span>
</label>
</div>
</div>
</td>
</tr>
</c:if>
<c:if test="${bbsInfo.bbsTyCd eq '05'}">
<tr>
<th>문의상품</th>
<td>
<c:forEach var = "goods" items="${goods}">
<img src="${cdnurl}<c:out value = '${goods.img}'/>" onerror = "this.src='/pc/images/image_placeholder.png'" alt="qnaGoods"
width="100px" height="100px">
<span><c:out value='${goods.goodsNm}'/></span>
<input type="hidden" name="goodsInnbArr[]" value="${goods.goodsInnb}"/>
</c:forEach>
</td>
</tr>
</c:if>
<tr>
<th>제목</th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<input class="input-text xl" type="text" title="해당 인풋에 대한 설명" name="sj"
placeholder="제목을 입력하세요." maxlength="100"
value="<c:out value = "${bbscttInfo.sj}"/>">
<c:if test="${bbsInfo.secretBbsctt eq 'Y'}">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="secretBbscttAt" class="chkAt"
<c:if test="${bbscttInfo.secretBbscttAt eq 'Y'}">checked</c:if>
<c:if test="${bbsInfo.bbsTyCd eq '05'}">onclick="fn_prevent_click(event);"</c:if>>
<span class="check"></span>
<span class="control-label">비밀글</span>
</label>
</div>
</c:if>
</div>
</div>
</td>
</tr>
<tr>
<th>내용</th>
<td>
<textarea class="textarea" rows="12" title="내용 입력란" id="cnBbsUpdt" name = "cn">
</textarea>
</td>
</tr>
<%--게시판설정(파일첨부사용여부)--%>
<c:if test="${bbsInfo.filAtch eq 'Y'}">
<tr>
<th>이미지 등록</th>
<td>
<div class="dropzone-wrapper">
<div class="dropzone" id="contact-dropzone">
</div>
</div>
<ul class="contact-upload-info">
<li>사진 첨부는 최대 10MB 이하이며 3개까지 등록할 수 있습니다.</li>
<li>등록 가능 파일은 ${acceptFileExtensions} 파일만 가능합니다.</li>
<li>상품과 무관한 내용이거나 음란 불법적인 내용은 통보없이 삭제할 수 있습니다.</li>
</ul>
</td>
</tr>
</c:if>
</tbody>
</table>
</form>
</div>
</div>
<div class="modal-footer">
<button type = "button" class="btn large outline close" id = "updtCloseBtn"><spring:message code="button.close"/></button>
<button type = "button" class="btn large gray2" id = "updtBtn"><spring:message code="button.update"/></button>
</div>
</div>
<!--수정결과모달-->
<div id="result-alert-update" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
<spring:message code="success.common.update"/>
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="btn large outline close"><spring:message code="button.close"/></a>
<button class="alert-btn alert-btn--confirm" id = "alertUpdtBtn"><spring:message code="button.ok"/></button>
</div>
</div>
<script>
// Dropzone 파일업로드
if ($("#contact-dropzone").length > 0) {
const maxFiles = 3;
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#contact-dropzone", {
url: "/file-upload",
maxFilesize: 10,
maxFiles: maxFiles,
acceptedFiles: "${acceptFileExtensions}",
autoProcessQueue: false,
addRemoveLinks: true,
dictDefaultMessage: "",
dictRemoveFile: "삭제",
dictCancelUpload: "취소",
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
dictResponseError: "서버에서 응답을 받지 못했습니다.",
init: function () {
let dropzoneInstance = this;
let imageData = ${fileInfoGson};
// 각 이미지를 Dropzone에 추가
$.each(imageData, function (index, image) {
// Dropzone 파일 객체 생성
let mockFile = {name: image.orginlFilNm, size: image.filMg};
dropzoneInstance.emit("addedfile", mockFile);
let cdnurl = '<c:out value="${cdnurl}"/>';
let filCours = `\${image.filCours}`;
let sysFilNm = `\${image.sysFilNm}`;
const imagePath = cdnurl + filCours + sysFilNm;
dropzoneInstance.emit("thumbnail", mockFile, imagePath);
// 이미지 오류 처리
$(mockFile.previewElement).find("img").on("error", function () {
this.src = '/mobile/images/image_placeholder.png'; // 대체 이미지 경로로 설정
});
// Dropzone에 파일 추가
mockFile.customId = image.bbscttAtchmnfilInnb;
dropzoneInstance.files.push(mockFile);
});
// 파일이 삭제될 때마다 호출되는 이벤트 핸들러
this.on("removedfile", function (file) {
const result = dropzoneDeleteFiles("" + file.customId + "", '<c:out value="${bbscttVO.sopmalCd}"/>', "BDFL", 1);
if (result === "N") {//파일 삭제 안할 시 복원
file.customData = {restored: true, customId: file.customId}; //삭제 취소에 의한 구분자 부여
myDropzone.emit("addedfile", file); // 파일을 다시 추가하여 삭제 취소
myDropzone.emit("thumbnail", file, file.dataURL); // 파일의 썸네일을 복원
}
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
}
});
//파일 추가
this.on("addedfile", function (file) {
let restoreAt = '';
if (file.customData) { //파일 삭제 복구시
restoreAt = true;
} else {//새파일 추가시
restoreAt = false;
}
if (restoreAt) {// 파일 삭제 복구시 해당 id 재부여
file.customId = file.customData.customId;
} else {//새파일 추가시 임시 id 부여
let fileLength = myDropzone.files.length;
file.customId = "temp" + fileLength;
if (fileLength > maxFiles) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
this.removeFile(file);
$(file.previewElement).find(".dz-remove").attr("disabled", true);
}
// 파일 크기가 최대 파일 크기보다 큰 경우
if (file.size > this.options.maxFilesize * 1024 * 1024) {
this.removeFile(file);
alert("파일 크기가 너무 큽니다. 최대 " + this.options.maxFilesize + "MB까지 허용됩니다.");
}
}
});
// maxFiles 제한 관련 이벤트 핸들러
this.on("maxfilesexceeded", function (file) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
// 파일 제거
this.removeFile(file);
});
}
});
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
} else {
$(".dz-message").hide();
}
var inputElement = $('input[type="file"].dz-hidden-input');
if(inputElement.length > 1){
inputElement.eq(0).remove();
}
// name 부여
inputElement.attr('name', 'file');
// id 부여
inputElement.attr('id', 'fileUpload');
}
</script>
</body>
</html>

View File

@@ -0,0 +1,996 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : BbscttUpdtU.jsp
Description : 게시글 수정 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05-21 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function () {
/*폼 기본 세팅*/
fn_select_cn();
//hidden value set
fn_update_hidden_value();
/*값 set*/
if($("#answMbtlnb").length > 0){
/*휴대전화 포매팅 함수*/
fn_set_event("#answMbtlnb", "input", fn_fmt_telno);
const fmtMbtlnb = fn_format_mbtlnb($("#answMbtlnb").val());
$("#answMbtlnb").val(fmtMbtlnb);
}
//내용 텍스트 <br>태그 엔터값으로 replace
const cn = $("#cnBbsUpdt");
let str = cn.text();
str = str.replaceAll(/<br>/ig, '\n');
str = str.replaceAll(/<\/br>/ig, '\n');
str = str.replaceAll(/<br \/>/ig, '\n');
//내용 내 태그 없애기
str = str.replace(/<\/?[^>]+(>|$)/g, "");
//내용 앞에 첫 문자열 앞 공백 지우기
str = str.trim();
cn.text(str);
//분류 change시 hidden value값 set
$(document).on('change', '#qesitmNmC', function () {
$("#qesitmInnb").val("");
$("#qesitmNm").val("");
$("#answCn").val("");
const option = $('option:selected', this);
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if ($(this).val() !== "") {
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmNm").val(qesitmNm);
$("#qesitmAt").val("Y");
$(this).closest("td").find("input[name='qesitmAtArr[]']").val("Y");
} else {
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmNm").val("");
$("#qesitmAt").val("N");
$(this).closest("td").find("input[name='qesitmAtArr[]']").val("N");
}
});
//추가입력 항목 라디오 'click' 이벤트
$(document).on('click', '.answRadioC', function () {
const radio = $(this);
//추가입력 항목 내용 요소 get
const answ = radio.closest(".custom-radio-container").find('[name="answCnArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest(".custom-radio-container").find('[name="qesitmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest(".custom-radio-container").find('.answRadio');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest(".custom-radio-container").find('[name="itmInnbArr[]"]');
//라디오 클릭 시 disabled 비활성
if (radio.is(":checked")) {
//답변 내용 초기화
answ.val("");
const radioVal = $(radio).attr('itm-cn');
answ.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
radio.closest(".custom-radio-container").find(".answRadioAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
radio.closest(".custom-radio-container").find(".answRadioAt").val("N");
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
$(document).on('change', '.answSelectC', function () {
const select = $(this);
const answ = select.closest("td").find('[name="answCnArr[]"]');
const qesitmInnb = select.closest("td").find('[name="qesitmInnbArr[]"]');
const contrlTarget = select.closest("td").find('.answSelect');
const option = $('option:selected', this);
if (select.val() != "") {
//답변 내용 초기화
answ.val("");
const selectVal = $(option).attr('itm-cn');
answ.val(selectVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(option).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//셀렉트 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
select.closest("td").find(".answSelectAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
select.closest("td").find(".answSelectAt").val("N");
});
}
});
//추가입력 항목 체크박스 'click'이벤트
$(document).on('click', '.answChkC', function () {
const check = $(this);
const contrlTarget = check.closest("div").find('.answChk');
var isChecked = $(this).is(":checked");
//클릭한 체크박스 주위 input값 disable false처리
contrlTarget.each(function () {
if (isChecked) {
$(this).prop("disabled", false);
} else {
$(this).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = $('.answChkC:checked').length > 0;
contrlTarget.each(function () {
if (anyChecked) {
check.closest("td").find(".answChkAt").val("Y");
check.closest("td").find(".answChkAt").prop("disabled", false);
} else {
check.closest("td").find(".answChkAt").val("N");
check.closest("td").find(".answChkAt").prop("disabled", true);
}
});
});
//추가입력 항목 텍스트 'input'이벤트
$(document).on('input', '.answTxtC', function () {
const txt = $(this);
const contrlTarget = txt.closest("div").find('.answTxt');
const contrlAt = txt.closest("div").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
//파일 업로드
$(document).on("change", "#fileUpload", function () {
addFiles(event, 0);
});
//수정 버튼 이벤트
$(document).on("click", "#updtBtn", function () {
fn_update_bbsctt();
});
//수정 완료 모달 > 확인 버튼 이벤트 (새로고침)
$(document).on("click", "#alertBtn", function () {
$('html').scrollTop(0);
location.reload();
});
//수정 취소 버튼(이전 페이지 이동);
$(document).on("click", "#cancelBtn", function () {
const listAt = $("#listAt").val();
if (listAt === 'list') {
fn_move_list();
} else {
fn_move_dtl();
}
});
});
/*********************************************************
* 게시글 내용 조회
*********************************************************/
const fn_select_cn = function () {
let bbscttInnb = $("#bbscttInnb").val();
let bbsId = $("#bbsId").val();
let sopmalCd = $("#sopmalCd").val();
$.ajax({
type: "post",
url: "<c:url value ='/ajax/bbscttAjax/selectBOBbscttCnAjax'/>",
contentType: 'application/json',
data: JSON.stringify({
bbsId: bbsId,
bbscttInnb: bbscttInnb,
sopmalCd: sopmalCd
}),
success: function (data) {
let cn = data.result.cn;
$("#cnBbsUpdt").val(cn);
$("#cnBbsUpdt").addClass("ck-content");
}
});
}
//목록 조회에서 취소 누를 시 해당 게시판 목록으로 이동
const fn_move_list = () => {
const form = document.createElement("form");
form.id = "listForm";
form.action = "/sopmal/csc/selectSubPageListForm";
form.method = "POST";
fn_create_input("bbsId", $("#bbsId").val(), form);
fn_create_input("pageIndex", "1", form);
document.body.appendChild(form);
form.submit();
}
//input 생성 함수
const fn_create_input = (name, value, tgtForm) => {
const input = document.createElement('input');
input.setAttribute("type", "hidden");
input.setAttribute("name", name);
input.setAttribute("value", value);
tgtForm.append(input);
}
//상세조회
const fn_move_dtl = () => {
const hiddenForm = $("#hiddenForm");
if(hiddenForm.length > 0){
hiddenForm.remove();
}
const form = document.createElement("form");
form.id = "dtlForm";
form.action = "/sopmal/csc/selectBbscttDtlInqire";
form.method = "POST";
fn_create_input("bbscttInnb", $("#bbscttInnb").val(), form);
fn_create_input("bbsTyCd", $("#bbsTyCd").val(), form);
fn_create_input("bbsId", $("#bbsId").val(), form);
fn_create_input("useAt", "Y", form);
fn_create_input("expsrAt", "Y", form);
fn_create_input("reqUrl", "subPage", form);
fn_create_input("pageIndex", "1", form);
fn_create_input("prevNext", $("#prevNext").val(), form);
let pageUnit = '';
//갤러리 페이지 유닛 계산
if(sknTyCd === '02'){
const pgeVtcCnt = $("#pgeVtcCnt").val();//열 개수
const pgeWthCnt = $("#pgeWthCnt").val();//행 개수
pageUnit = pgeVtcCnt * pgeWthCnt;
}else{
pageUnit = '10';
}
fn_create_input("pageUnit", pageUnit, form);
document.body.appendChild(form);
form.submit();
}
/*********************************************************
* 게시글 수정
*********************************************************/
const fn_update_bbsctt = function () {
let url = '<c:url value="/sopmal/csc/updateBbscttupdt"/>';
let saveForm = $('#bbsUpdtForm');
let formData = new FormData();
//파일 업로드
if ($("#contact-dropzone").length > 0) {
let myDropzone = Dropzone.forElement("#contact-dropzone");
myDropzone.files.forEach(function (file) {
formData.append("files", file);
});
//hidden 파일이 존재여부 Flag Setting y/n ========================
}
//사용자 등록 시 노출 여부 Y
formData.append("expsrAt", "Y");
//비밀번호 set
const password = "<c:out value = "${ resultMap.bbscttInfo.bbscttInfo.password }"/>";
if (password.length){
formData.append("password", password);
}
//입력항목 체크박스 disabled처리
$('.checkbox input[type="checkbox"]').each(function () {
if (!$(this).prop('checked')) {
fn_ctrl_disable([".checkbox"],);
}
});
//폼 내 input값 append
saveForm.serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
disableButton("#updtBtn");
if (confirm('게시글을 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'post',
url: url,
enctype:"multipart/form-data",
data: formData,
processData: false,
contentType: false,
success: function (result) {
enableButton("#updtBtn");
$("#result-alert").modal();
/*파일 temp 배열 초기화*/
filesTempArr = [];
}
});
}
enableButton("#updtBtn");
fn_ctrl_disable("", [".checkbox"]);
}
//답변 관련 정보 set
function fn_update_hidden_value () {
//분류 항목
const option = $('option:selected', $("#qesitmNmC"));
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if($("#qesitmNmC").val()!= ""){
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmAt").val("Y");
}else{
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmAt").val("N");
}
// 추가평가항목 라디오
const radio = $(".answRadioC:checked");
radio.each(function(idx) {
if (radio.eq(idx).val()) {
let radioAnsw = radio.eq(idx).closest("td").find('[name="answCnArr[]"]');
let radioQesitmInnb = radio.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let radioItmInnb = radio.eq(idx).closest("td").find('[name="itmInnbArr[]"]');
let radioQesitmAt = radio.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let radioContrlTarget = radio.eq(idx).closest("td").find('.answRadio');
// 답변 내용 set
radioAnsw.val(radio.eq(idx).attr('itm-cn'));
// 항목 내용 set
radioQesitmInnb.val(radio.eq(idx).attr('qesitm-innb'));
// 항목고유번호 내용 set
radioItmInnb.val(radio.eq(idx).val());
// 답변 여부
radioQesitmAt.val("Y");
// 라디오 주위 input값 disable false처리
radioContrlTarget.each(function(idx){
radioContrlTarget.eq(idx).prop("disabled", false);
});
} else {
let radioAnsw = radio.eq(idx).closest("td").find('[name="answCnArr[]"]');
let radioQesitmInnb = radio.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let radioItmInnb = radio.eq(idx).closest("td").find('[name="itmInnbArr[]"]');
let radioQesitmAt = radio.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let radioContrlTarget = radio.eq(idx).closest("div").find('.answRadio');
// 답변 내용 set
radioAnsw.val("");
// 항목 내용 set
radioQesitmInnb.val("");
// 항목고유번호 내용 set
radioItmInnb.val("");
// 답변 여부
radioQesitmAt.val("N");
// 라디오 주위 input값 disable false처리
radioContrlTarget.each(function(idx){
radioContrlTarget.eq(idx).prop("disabled", true);
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
const select =$('select.answSelectC[name="itmInnbArr[]"]');
select.each(function(idx) {
let selectIndex = select.eq(idx).find('option:selected').index();
if (selectIndex > 0) {
let selectQesitmAt = select.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let selectQesitmInnb = select.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let selectAnsw = select.eq(idx).closest("td").find('[name="answCnArr[]"]');
let selectOption = $('option:selected', select.eq(idx));
let selectContrlTarget = select.eq(idx).closest("td").find('.answSelect');
// 답변 여부
selectQesitmAt.val("Y");
// 항목 내용 set
selectQesitmInnb.val(selectOption.attr('qesitm-innb'));
// 답변 내용 set
selectAnsw.val(selectOption.attr('itm-cn'));
// 라디오 주위 input값 disable false처리
selectContrlTarget.each(function(idx){
selectContrlTarget.eq(idx).prop("disabled", false);
});
} else {
let selectQesitmAt = select.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let selectQesitmInnb = select.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let selectAnsw = select.eq(idx).closest("td").find('[name="answCnArr[]"]');
let selectContrlTarget = select.eq(idx).closest("td").find('.answSelect');
// 답변 여부
selectQesitmAt.val("N");
// 항목 내용 set
selectQesitmInnb.val("");
// 답변 내용 set
selectAnsw.val("");
// 라디오 주위 input값 disable false처리
selectContrlTarget.each(function(idx){
selectContrlTarget.eq(idx).prop("disabled", true);
});
}
});
const check = $(".answChkC");
//클릭한 체크박스 주위 input값 disable false처리
check.each(function(idx){
let checkContrlTarget = check.eq(idx).closest(".checkbox").find('.answChk');
let isChecked = check.eq(idx).is(":checked");
checkContrlTarget.each(function (index) {
if (isChecked) {
checkContrlTarget.eq(index).prop("disabled", false);
} else {
checkContrlTarget.eq(index).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = check.eq(idx).closest("td").find(".answChkC:checked").length > 0;
if (anyChecked) {
check.eq(idx).closest("td").find(".answChkAt").val("Y");
} else {
check.eq(idx).closest("td").find(".answChkAt").val("N");
}
});
//추가입력 항목 텍스트 'input'이벤트
const txt = $('.answTxtC');
txt.each(function (idx) {
let contrlTarget = txt.eq(idx).closest("div").find('.answTxt');
let contrlAt = txt.eq(idx).closest("div").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
}
/*상품qna 버튼 클릭 제어*/
function fn_prevent_click(event) {
event.preventDefault(); // 체크박스 상태 변경 방지
}
</script>
<body>
<c:set value="${resultMap.bbscttInfo.bbscttInfo}" var="bbscttInfo"/>
<c:set value="${resultMap.bbscttVO}" var="bbscttVO"/>
<c:set value="${resultMap.bbscttInfo.qesitmAnswList}" var="qesitmAnswList"/>
<c:set value="${resultMap.bbscttInfo.fileInfoGson}" var="fileInfoGson"/>
<c:set value="${resultMap.bbscttInfo.goods}" var="goods"/>
<c:set value="${resultMap.bbscttInfo.wrter}" var="wrter"/>
<c:set value="${resultMap.bbsInfo}" var="bbsInfo"/>
<c:set value="${resultMap.qesitmList.qesitmList}" var="qesitmList"/>
<c:set value="${resultMap.qesitmList.itmCnList}" var="itmCnList"/>
<c:set value="${resultMap.itmList}" var="itmList"/>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<c:choose>
<c:when test = "${bbscttVO.reqUrl eq 'subPage'}"><%--서브페이지 등록 폼 분기 처리--%>
<div class="page-title center">
<h2 class="page-title__title" id = "bbsNm"><c:out value="${bbsInfo.bbsNm}"/></h2>
</div>
</c:when>
<c:otherwise><%--고객센터 등록 폼 분기 처리--%>
<div class="sub-rl">
<jsp:include page="/WEB-INF/views/comm/csc/CscLeft.jsp"/>
<div class="sub-right-content">
<h3 class="sub-right-content__title"><c:out value="${bbsInfo.bbsNm}"/></h3>
</c:otherwise>
</c:choose>
<div class="table-wrapper">
<form id="bbsUpdtForm">
<%--게시판 설정--%>
<input type="hidden" name="filAtch" value="${bbsInfo.filAtch }"/>
<input type="hidden" name="slangFlterUseAt" value="${bbsInfo.slangFlterUseAt}"/>
<input type="hidden" id = "bbsId" name="bbsId" value="${bbsInfo.bbsId }"/>
<input type="hidden" id = "bbsTyCd" name="bbsTyCd" value="${bbsInfo.bbsTyCd }"/>
<input type="hidden" id="pgeVtcCnt" name="pgeVtcCnt" value="${ bbsInfo.pgeVtcCnt }"/>
<input type="hidden" id="pgeWthCnt" name="pgeWthCnt" value="${ bbsInfo.pgeWthCnt }"/>
<input type="hidden" id="prevNext" name="prevNext" value="${ bbsInfo.prevNext }"/>
<input type="hidden" id="sknTyCd" name="sknTyCd" value="${ bbsInfo.sknTyCd }"/>
<%--vo 관련(요청 구분 등)--%>
<input type="hidden" id="reqDv" value="<c:out value = '${bbsctt.reqDv}'/>" name="reqDv"/>
<input type="hidden" id="reqUrl" value="<c:out value = '${bbsctt.reqUrl}'/>" name="reqUrl"/>
<input type="hidden" id="listAt" name="listAt" value="${ bbscttVO.listAt }"/>
<input type="hidden" id="sopmalCd" name="sopmalCd" value="${bbscttVO.sopmalCd}"/>
<%--게시글 관련--%>
<input type="hidden" id="bbscttInnb" name="bbscttInnb" value="${ bbscttInfo.bbscttInnb }"/>
<%--파일 관련--%>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.extensions.images')" var="acceptFileExtensions"/>
<input type="hidden" id="acceptFileExtensions" name="acceptFileExtensions" value="${ acceptFileExtensions}"/>
<%--존재 파일 여부 체크--%>
<c:choose>
<c:when test = "${not empty fileInfo}"><c:set var="filExtAt" value="Y"/></c:when>
<c:otherwise><c:set var="filExtAt" value="N"/></c:otherwise>
</c:choose>
<input type="hidden" id="filExtAt" name="filExtAt" value="${filExtAt}"/>
<input type="hidden" id="extFiles" name="extFiles" value=""/>
<input type="hidden" id="filesInfo" name="filesInfo"/>
<input type="hidden" id="extFilChangeAt" name="extFilChangeAt" value="N"/>
<table class="table write">
<caption>게시글 수정</caption>
<colgroup>
<col style="width: 200px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>작성자</th>
<td>
<div class="td-inner">
<c:out value="${bbscttInfo.regusrNm}"/>
</div>
</td>
</tr>
<c:if test="${not empty itmList}">
<tr>
<th>분류<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<div class="select-box">
<%--문항답변필수여부 --%>
<input type="hidden" name="qesitmEssntlAtArr[]" value="Y">
<%--문항명 --%>
<input type="hidden" name="qesitmNmArr[]" id="qesitmNm" value="분류"/>
<%--문항고유번호 --%>
<input type="hidden" name="qesitmInnbArr[]" id="qesitmInnb"
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
value = <c:out value="${itmAnswList.qesitmInnb}"/>
</c:if>
</c:forEach>/>
<%--답변내용 --%>
<input type="hidden" name="answCnArr[]" id="answCn"<c:forEach
var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
value = <c:out value="${itmAnswList.answCn}"/>
</c:if>
</c:forEach>/>
<%--답변여부 --%>
<input type="hidden" name="qesitmAtArr[]" id="qesitmAt"
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
<c:choose>
<c:when test="${empty itmAnswList.answCn}">value="N"</c:when>
<c:otherwise>value="Y"</c:otherwise>
</c:choose>
</c:if>
</c:forEach>>
<select class="md" id="qesitmNmC" name="itmInnbArr[]">
<option value="">분류 선택</option>
<c:forEach var="itm" items="${itmList}" varStatus="status">
<option value="<c:out value="${itm.itmInnb}"/>"
qesitm-innb="${itm.qesitmInnb}" answ-Cn="${itm.itmCn}"
qesitm-nm="${itm.qesitmNm}"
<%--분류 답변 값 유지--%>
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
<c:if test="${itm.itmInnb eq itmAnswList.itmInnb }">selected</c:if>
</c:if>
</c:forEach>>
<c:out value="${itm.itmCn}"/>
</option>
</c:forEach>
</select>
</div>
</div>
</td>
</tr>
</c:if>
<c:if test="${not empty qesitmList}">
<c:forEach var="qesitmList" items="${qesitmList}">
<tr>
<c:if test="${ qesitmList.itmTyCd eq '01'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt}"
class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm}">
<input type="hidden" name="qesitmAtArr[]"
class="answRadioAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]"
class="answRadio"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answRadio"
disabled>
<input type="hidden" name="itmInnbArr[]" class="answRadio"
disabled>
<c:forEach items="${itmCnList}" var="itmCnList1" varStatus="status">
<c:if test="${itmCnList1.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="custom-radio is-medium">
<input type="radio" id="answCn${ status.index }"
class="answRadioC"
qesitm-innb='${itmCnList1.qesitmInnb}'
name="itmInnbArr${ qesitmList.qesitmInnb}[]"
value="${ itmCnList1.itmInnb}"
itm-cn="${ itmCnList1.itmCn }"
<c:forEach var="qesitmAnswList1" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList1.itmTyCd eq '01'}">
<c:if test="${qesitmAnswList1.itmInnb eq itmCnList1.itmInnb}">checked</c:if>
</c:if>
</c:forEach>>
<label for="answCn${ status.index }">${ itmCnList1.itmCn }</label>
</div>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '02'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answSelectAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]" class="answSelect"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answSelect" disabled>
<div class="select-box">
<select class="md answSelectC" name="itmInnbArr[]">
<option value="">전체</option>
<c:forEach items="${itmCnList}" var="itmCnList2">
<c:if test="${itmCnList2.qesitmInnb eq qesitmList.qesitmInnb}">
<c:set var="selected" value=""/>
<c:forEach var="qesitmAnswList2" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList2.itmInnb eq itmCnList2.itmInnb}">
<c:set var="selected" value="selected"/>
</c:if>
</c:forEach>
<option value="${itmCnList2.itmInnb}"
itm-cn="${itmCnList2.itmCn}"
qesitm-innb="${itmCnList2.qesitmInnb}" ${selected}>
${itmCnList2.itmCn}
</option>
</c:if>
</c:forEach>
</select>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '03'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answChkAt qesitmAtChk"
value="N">
<c:forEach items="${itmCnList}" var="itmCnList3">
<c:if test="${itmCnList3.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<label class="b-checkbox checkbox">
<input type="hidden" class="answChk" name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" class="answChk" name="answCnArr[]"
value="${ itmCnList3.itmCn }" disabled>
<input type="checkbox" class="answChkC" name="itmInnbArr[]"
value="${ itmCnList3.itmInnb }"
itm-cn="${ itmCnList3.itmCn }"
qesitm-innb="${itmCnList3.qesitmInnb}"
<c:forEach var="qesitmAnswList3" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList3.itmInnb eq itmCnList3.itmInnb}">checked</c:if>
</c:forEach>>
<span class="check"></span>
<span class="control-label">${ itmCnList3.itmCn }</span>
</label>
</div>
</c:if>
</c:forEach>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '04'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<c:forEach items="${itmCnList}" var="itmCnList4">
<c:if test="${itmCnList4.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answTxtAt" value="N">
<input type="hidden" class="answTxt"
name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="text" class="input-text mm answTxtC"
name="answCnArr[]" title="추가문항답변"
placeholder="${ itmCnList4.itmCn }"
maxlength="666"
itm-cn="${ itmCnList4.itmCn }"
qesitm-innb="${itmCnList4.qesitmInnb}"
itm-innb="${itmCnList4.itmInnb}"
<c:forEach var="qesitmAnswList4"
items="${qesitmAnswList}">
<c:if test="${qesitmAnswList4.itmInnb eq itmCnList4.itmInnb}">
value="<c:out value = '${qesitmAnswList4.answCn}'/>"
</c:if>
</c:forEach>>
<input type="hidden" class="answTxt" name="itmInnbArr[]"
value="${ itmCnList4.itmInnb }" disabled>
</div>
<br>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
</tr>
</c:forEach>
</c:if>
<c:if test="${bbsInfo.answRegist eq 'Y'&& bbsInfo.bbscttSndngMthCd ne '03'}"><%--답변사용여부와 게시글 문자사용여부 체크--%>
<tr>
<th>답변받기</th>
<td>
<div class="td-inner">
<input class="input-text" type="text" title="해당 인풋에 대한 설명"
name="answMbtlnb"
id="answMbtlnb" maxlength="13"
value="<c:out value = '${bbscttInfo.answMbtlnb}'/>"
placeholder="'-'없이 입력">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="answSmsRecptn"
class="chkAt"
<c:if test="${bbscttInfo.answSmsRecptn eq 'Y'}">checked</c:if>>
<span class="check"></span>
<span class="control-label">SMS 알림요청</span>
</label>
</div>
</div>
</td>
</tr>
</c:if>
<tr>
<th>제목</th>
<td>
<div class="td-inner">
<input class="input-text xl" type="text" title="해당 인풋에 대한 설명" name="sj"
placeholder="제목을 입력하세요." maxlength="100"
value="<c:out value = "${bbscttInfo.sj}"/>">
<c:if test="${bbsInfo.secretBbsctt eq 'Y'}">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="secretBbscttAt"
<c:if test="${bbscttInfo.secretBbscttAt eq 'Y'}">checked</c:if>
<c:if test="${bbsInfo.bbsTyCd eq '05'}"> onclick="fn_prevent_click(event);"</c:if>>
<span class="check"></span>
<span class="control-label">비밀글</span>
</label>
</div>
</c:if>
</div>
</td>
</tr>
<tr>
<th>내용</th>
<td>
<textarea class="textarea" rows="12" title="내용 입력란" id="cnBbsUpdt" name = "cn">
<c:out value="${bbscttInfo.cn}"/>
</textarea>
</td>
</tr>
<%--게시판설정(파일첨부사용여부)--%>
<c:if test="${bbsInfo.filAtch eq 'Y'}">
<tr>
<th>이미지 등록</th>
<td>
<div class="dropzone-wrapper">
<div class="dropzone" id="contact-dropzone">
</div>
</div>
<ul class="contact-upload-info">
<li>사진 첨부는 최대 10MB 이하이며 3개까지 등록할 수 있습니다.</li>
<li>등록 가능 파일은 ${acceptFileExtensions} 파일만 가능합니다.</li>
<li>상품과 무관한 내용이거나 음란 불법적인 내용은 통보없이 삭제할 수 있습니다.</li>
</ul>
</td>
</tr>
</c:if>
</tbody>
</table>
</form>
</div>
<div class="sub-bottom-btn-container">
<button class="btn xl outline" id="cancelBtn" value="<c:out value = '${bbsInfo.bbsId}'/>">
<c:choose>
<c:when test="${bbscttVO.listAt eq 'list'}"><spring:message code="button.catalog"/></c:when>
<c:otherwise><spring:message code="button.cancel"/></c:otherwise>
</c:choose></button>
<button class="btn xl theme" id="updtBtn"><spring:message code="button.update"/></button>
</div>
<c:choose>
<c:when test="${bbscttVO.reqUrl eq 'subpage'}"> <%--서브페이지 등록 폼 분기 처리--%>
</div>
</c:when>
<c:otherwise> <%--고객센터 등록 폼 분기 처리--%>
</div>
</div>
</c:otherwise>
</c:choose>
<!-- 수정/등록 알림 -->
<div id="result-alert" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
<spring:message code="success.common.update"/>
</p>
</div>
<div class="alert-btn-container">
<button class="alert-btn alert-btn--confirm" id = "alertBtn"><spring:message code="button.ok"/></button>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<script>
// Dropzone 파일업로드
if ($("#contact-dropzone").length > 0) {
const maxFiles = 3;
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#contact-dropzone", {
url: "/file-upload",
maxFilesize: 10,
maxFiles: maxFiles,
acceptedFiles: "${acceptFileExtensions}",
autoProcessQueue: false,
addRemoveLinks: true,
dictDefaultMessage: "",
dictRemoveFile: "삭제",
dictCancelUpload: "취소",
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
dictResponseError: "서버에서 응답을 받지 못했습니다.",
init: function () {
let dropzoneInstance = this;
let imageData = ${fileInfoGson};
// 각 이미지를 Dropzone에 추가
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
$.each(imageData, function (index, image) {
// Dropzone 파일 객체 생성
let mockFile = {name: image.orginlFilNm, size: image.filMg};
dropzoneInstance.emit("addedfile", mockFile);
const imagePath = '${cdnurl}' + image.filCours + image.sysFilNm;
dropzoneInstance.emit("thumbnail", mockFile, imagePath);
// 이미지 오류 처리
$(mockFile.previewElement).find("img").on("error", function () {
this.src = '/pc/images/image_placeholder.png'; // 대체 이미지 경로로 설정
});
// Dropzone에 파일 추가
mockFile.customId = image.bbscttAtchmnfilInnb;
dropzoneInstance.files.push(mockFile);
});
// 파일이 삭제될 때마다 호출되는 이벤트 핸들러
this.on("removedfile", function (file) {
const result = dropzoneDeleteFiles("" + file.customId + "", '<c:out value="${bbscttVO.sopmalCd}"/>', "BDFL", 1);
if (result === "N") {//파일 삭제 안할 시 복원
file.customData = {restored: true, customId: file.customId}; //삭제 취소에 의한 구분자 부여
myDropzone.emit("addedfile", file); // 파일을 다시 추가하여 삭제 취소
myDropzone.emit("thumbnail", file, file.dataURL); // 파일의 썸네일을 복원
}
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
}
});
//파일 추가
this.on("addedfile", function (file) {
let restoreAt = '';
if (file.customData) { //파일 삭제 복구시
restoreAt = true;
} else {//새파일 추가시
restoreAt = false;
}
if (restoreAt) {// 파일 삭제 복구시 해당 id 재부여
file.customId = file.customData.customId;
} else {//새파일 추가시 임시 id 부여
let fileLength = myDropzone.files.length;
file.customId = "temp" + fileLength;
if (fileLength > maxFiles) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
this.removeFile(file);
$(file.previewElement).find(".dz-remove").attr("disabled", true);
}
// 파일 크기가 최대 파일 크기보다 큰 경우
if (file.size > this.options.maxFilesize * 1024 * 1024) {
this.removeFile(file);
alert("파일 크기가 너무 큽니다. 최대 " + this.options.maxFilesize + "MB까지 허용됩니다.");
}
}
});
// maxFiles 제한 관련 이벤트 핸들러
this.on("maxfilesexceeded", function (file) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
this.removeFile(file);
});
}
});
var inputElement = $('input[type="file"].dz-hidden-input');
// name 부여
inputElement.attr('name', 'file');
// id 부여
inputElement.attr('id', 'fileUpload');
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
} else {
$(".dz-message").hide();
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,353 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CmListR.jsp
Description : 댓글 조회
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-25 김혜인 최초 생성
--%>
<!DOCTYPE html>
<script>
$(".cmCn").each(function (){
if(!$(this).hasClass("secret")){
$(this).text($(this).text().trim());
}
});
$(".cmcmCn").each(function (){
if(!$(this).hasClass("secret")){
$(this).text($(this).text().trim());
}
});
</script>
<html lang="ko">
<%--(DEPTH0)댓글 목록--%>
<c:set value = "${resultMap.cmList.cmList}" var = "cmList"/>
<%--작성자 정보 추출(댓글 목록)--%>
<c:set value = "${resultMap.cmList.wrterList}" var = "wrterList"/>
<%--작성자 정보 (답글 등록자 정보)--%>
<c:set value = "${resultMap.regusrInfo}" var = "regusrInfo"/>
<%--게시글 정보 --%>
<c:set value = "${resultMap.cmVO}" var = "cmVO"/>
<%--게시판 설정 --%>
<c:set value="${resultMap.bbsInfo}" var="bbsInfo"/>
<input type = "hidden" id = "cmCntInfo" value = "<c:out value = "${ resultMap.paginationInfo.totalRecordCount }"/>">
<p id="comment_container"></p>
<c:choose>
<c:when test="${not empty cmList}">
<c:forEach var="cmList" items="${cmList}" varStatus="status">
<div class="comment-body__item mainCmContent">
<div class="comment-body__info">
<div class="comment-body__info-left">
<i class="icon icon_comment-user"></i>
<span class="comment-body__user">
<c:choose>
<c:when test="${cmList.regusrDvCd eq '99'}">
<c:out value="${cmList.maskingRegusrNm}"/>[비회원]
</c:when>
<c:when test="${cmList.regusrDvCd eq '02'}">
<c:out value="${cmList.mngrNm}"/>
</c:when>
<c:when test="${cmList.wrterIndictTyCd eq '01' && cmList.regusrDvCd eq '01'}">
<c:out value="${ cmList.maskingRegusrId}"/>(<c:out value="${ cmList.mbrGradNm}"/>)
</c:when>
<c:when test="${cmList.wrterIndictTyCd eq '02' && cmList.regusrDvCd eq '01'}">
<c:out value="${ cmList.maskingRegusrId}"/>
</c:when>
<c:when test="${cmList.wrterIndictTyCd eq '03' && cmList.regusrDvCd eq '01'}">
<c:out value="${ cmList.maskingRegusrNm}"/>(<c:out value="${ cmList.mbrGradNm}"/>)
</c:when>
<c:when test="${cmList.wrterIndictTyCd eq '04' && cmList.regusrDvCd eq '01'}">
<c:out value="${ cmList.maskingRegusrNm}"/>
</c:when>
<c:when test="${cmList.wrterIndictTyCd eq '05' && cmList.regusrDvCd eq '01'}">
<c:out value="${ cmList.maskingRegusrNm}"/><br>
(<c:out value="${ cmList.maskingRegusrId}"/>,<c:out value="${ cmList.mbrGradNm}"/>)
</c:when>
<c:when test="${cmList.wrterIndictTyCd eq '06' && cmList.regusrDvCd eq '01'}">
<c:out value="${ cmList.maskingRegusrNm}"/>(<c:out value="${ cmList.maskingRegusrId}"/>)
</c:when>
</c:choose>
</span>
<span class="comment-body__date"><c:out value="${cmList.registDt}"/></span>
<c:if test="${cmList.newAt eq 'Y'}">
<i class="icon icon_new-post"></i>
</c:if>
</div>
<div class="comment-body__info-right">
<c:if test = "${cmList.useAt eq 'Y'}">
<button type="button" class="comment-body__button cmUpdtBtn" value="<c:out value="${cmList.cmInnb}"/>">
<spring:message code="button.update"/>
</button>
<button type="button" class="comment-body__button cmDelBtn" value="<c:out value="${cmList.cmInnb}"/>">
<spring:message code="button.delete"/>
</button>
</c:if>
</div>
</div>
<div class="comment-body__content">
<div class="comment-edit">
<%--1. 삭제된 글은 비밀 댓글이여도 삭제됐다고 보여준다--%>
<choose>
<c:choose>
<c:when test = "${cmList.useAt eq 'Y'}">
<%--2. 삭제 안된 글 중 비밀 댓글인지 확인한다.--%>
<c:choose>
<c:when test="${cmList.secretBbscttAt eq 'Y'}"><%--비밀댓글 적용 시--%>
<c:choose>
<c:when test="${cmList.regusr eq cmVO.mbrInnb}"><%--본인 꺼는 비밀 댓글 내용 보임--%>
<p class = "cmCn" style="white-space: pre-wrap;">
<i class="icon icon_lock"></i>
<c:out value="${cmList.cn}"/>
</p>
</c:when>
<c:otherwise><%--비회원 댓글 조회--%>
<p class = "cmCn secret">
<i class="icon icon_lock"></i>
<button class="comment-body__privateComment comment-body__button secretCm"
value="<c:out value="${cmList.cmInnb}"/>">비밀 댓글입니다.</button>
</p>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<p class = "cmCn" style="white-space: pre-wrap;">
<c:out value="${cmList.cn}"/>
</p>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
삭제된 댓글 입니다.
</c:otherwise>
</c:choose>
</choose>
</div>
<div class = dtlCmDiv>
<input type="hidden" name = 'secretBbscttAt' value = '<c:out value="${cmList.secretBbscttAt}"/>'/>
</div>
</div>
<div class="comment-body__reply-container">
<button class="comment-body__reply-button">
답글<em class="commentCnt">0</em>
</button>
<%--게시판설정(댓글평가사용여부)--%>
<c:if test="${bbsInfo.cmEvlUseAt eq 'Y'}">
<div class="comment-like">
<button class="comment-like__btn comment-like__btn--like" value = "<c:out value ='${cmList.cmInnb}'/>">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"></path>
</svg>
<span class="comment-like__number recomendCnt"><c:out value="${cmList.recomendCnt}"/></span>
</button>
<%--게시판설정(댓글평가추천단계-비추천사용)--%>
<c:if test="${bbsInfo.cmEvlRecomendStep eq '02'}">
<button class="comment-like__btn comment-like__btn--dislike" value = "<c:out value ='${cmList.cmInnb}'/>">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"></path>
</svg>
<span class="comment-like__number nonrecomendCnt"><c:out value="${cmList.nonrecomendCnt}"/></span>
</button>
</c:if>
</div>
</c:if>
</div>
<c:if test="${cmList.depth eq 0}">
<div class="comment-body__nested-container">
</c:if>
<c:if test = "${not empty resultMap.cmList.cmAnswList}">
<c:forEach var="item" items="${resultMap.cmList.cmAnswList}" varStatus="status1">
<c:if test="${cmList.cmInnb eq item.parntsCmInnb}">
<div class="comment-body__item commentDiv">
<div class="comment-body__info">
<div class="comment-body__info-left">
<i class="icon icon_comment-user"></i>
<span class="comment-body__user">
<c:choose>
<c:when test="${item.regusrDvCd eq '99'}">
<c:out value="${item.maskingRegusrNm}"/>[비회원]
</c:when>
<c:when test="${item.regusrDvCd eq '02'}">
<c:out value="${item.mngrNm}"/>
</c:when>
<c:when test="${item.wrterIndictTyCd eq '01' && item.regusrDvCd eq '01'}">
<c:out value="${ item.maskingRegusrId}"/>(<c:out value="${ item.mbrGradNm}"/>)
</c:when>
<c:when test="${item.wrterIndictTyCd eq '02' && item.regusrDvCd eq '01'}">
<c:out value="${ item.maskingRegusrId}"/>
</c:when>
<c:when test="${item.wrterIndictTyCd eq '03' && item.regusrDvCd eq '01'}">
<c:out value="${ item.maskingRegusrNm}"/>(<c:out value="${ item.mbrGradNm}"/>)
</c:when>
<c:when test="${item.wrterIndictTyCd eq '04' && item.regusrDvCd eq '01'}">
<c:out value="${ item.maskingRegusrNm}"/>
</c:when>
<c:when test="${item.wrterIndictTyCd eq '05' && item.regusrDvCd eq '01'}">
<c:out value="${ item.maskingRegusrNm}"/><br>
(<c:out value="${ item.maskingRegusrId}"/>,<c:out value="${ item.mbrGradNm}"/>)
</c:when>
<c:when test="${item.wrterIndictTyCd eq '06' && item.regusrDvCd eq '01'}">
<c:out value="${ item.maskingRegusrNm}"/>(<c:out value="${ item.maskingRegusrId}"/>)
</c:when>
</c:choose>
</span>
<span class="comment-body__date">${item.registDt}</span>
<c:if test="${item.newAt eq 'Y'}">
<i class="icon icon_new-post"></i>
</c:if>
</div>
<div class="comment-body__info-right">
<button class="comment-body__button cmcmUpdtBtn" value="${item.cmInnb}" re-at="Y">수정
</button>
<button class="comment-body__button cmDelBtn" value="${item.cmInnb}" re-at="Y">삭제
</button>
</div>
</div>
<div class="comment-body__content commentCnDiv">
<c:choose>
<c:when test="${item.secretBbscttAt eq 'Y'}">
<c:choose>
<c:when test="${item.regusr eq cmVO.mbrInnb}"><%--본인 꺼는 비밀 댓글 내용 보임--%>
<p class = "cmcmCn" style="white-space: pre-wrap;">
<i class="icon icon_lock"></i>
<c:out value="${item.cn}"/>
</p>
</c:when>
<c:otherwise>
<p class = "cmcmCn secret">
<i class="icon icon_lock"></i>
<button class="comment-body__privateComment secretCmCm"
value = "<c:out value = '${item.cmInnb}'/>">비밀 댓글입니다.</button>
<input type="hidden" value="<c:out value="${item.cn}"/>">
</p>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<p class = "cmcmCn" style="white-space: pre-wrap;">
<c:out value="${item.cn}"/>
</p>
</c:otherwise>
</c:choose>
</div>
<%--게시판설정(댓글평가사용여부)--%>
<c:if test="${bbsInfo.cmEvlUseAt eq 'Y'}">
<div class="comment-like">
<button class="comment-like__btn comment-like__btn--like" value = "<c:out value ='${item.cmInnb}'/>">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"></path>
</svg>
<span class="comment-like__number recomendCnt"><c:out value="${item.recomendCnt}"/></span>
</button>
<%--게시판설정(댓글평가추천단계-비추천사용)--%>
<c:if test="${bbsInfo.cmEvlRecomendStep eq '02'}">
<button class="comment-like__btn comment-like__btn--dislike" value = "<c:out value ='${item.cmInnb}'/>">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"></path>
</svg>
<span class="comment-like__number nonrecomendCnt"><c:out value="${item.nonrecomendCnt}"/></span>
</button>
</c:if>
</div>
</c:if>
</div>
<div class="dtlCmDiv">
<input type="hidden" name="secretBbscttAt" value="${item.secretBbscttAt}">
</div>
</c:if>
</c:forEach>
</c:if>
<c:if test="${cmList.depth eq 0}">
<div class="comment-body__item">
<div class="comment-write">
<c:choose>
<c:when test = "${cmVO.authResult eq 'Y'}">
<div class="comment-write__textarea-container">
<textarea class="comment-write__textarea" placeholder="댓글을 입력하세요." title="댓글 입력"
name="cn"></textarea>
</div>
<button class="comment-write__button reCreBtn" value="<c:out value = '${cmList.cmInnb}'/>">
<spring:message code="button.insert"/>
</button>
<div class="comment-write__bottom">
<div class="comment-write__info">
<div class="comment-write__info-inner">
<div class="comment-write__info-item">
<input type="text" class="comment-write__info-input" maxlength="25"
placeholder="이름을 입력하세요." title="이름 입력" name="regusrNm"
value= "<c:out value="${cmVO.regusrNm}"/>">
</div>
<c:if test = "${cmVO.regusrDvCd eq '99'}">
<div class="comment-write__info-item password">
<input type="password" class="comment-write__info-input" maxlength="25"
placeholder="비밀번호를 입력하세요." title="비밀번호 입력" name="password">
</div>
</c:if>
</div>
</div>
<div class="b-checkbox-container">
<label class="b-checkbox checkbox is-medium">
<input type="checkbox" value="Y" name="secretBbscttAt">
<span class="check"></span>
<span class="control-label">비밀 댓글</span>
</label>
</div>
</div>
</c:when>
<c:otherwise>
<div class="comment-write__textarea-container">
<textarea class="comment-write__textarea" rows="5"
placeholder="로그인 또는 댓글권한이 있을 경우 등록하실 수 있습니다." readonly></textarea>
</div>
<button class="comment-write__button" id = "rejectAuthCmBtn"><spring:message code="button.insert"/></button>
</c:otherwise>
</c:choose>
</div>
<input type="hidden" name="bbscttInnb" value="<c:out value ='${cmList.bbscttInnb}'/>"/>
<input type="hidden" name="bbsId" value="<c:out value ='${cmList.bbsId}'/>"/>
<input type="hidden" name="cmInnb" value="<c:out value ='${cmList.cmInnb}'/>"
class="cmInnb"/>
</div>
<div class="comment-body__item close" tabindex="0">
답글접기
</div>
</div>
</c:if>
</div>
</c:forEach>
<input type="hidden" name = "pageIndex" value = "<c:out value = "${cmVO.pageIndex}"/>" id = "pageIndex" />
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_make_cm" />
</div>
</c:when>
<c:otherwise>
<div class="comment-body__content">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="댓글 없음">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</div>
</c:otherwise>
</c:choose>
</html>

View File

@@ -0,0 +1,274 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : CscAcordionTyR.jsp
Description : 공지사항 목록.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-18 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<c:set var="bbsInfo" value="${resultMap.bbsInfo}"/>
<c:set var="bbscttVO" value="${resultMap.bbsctt}"/>
<form class="contentForm">
<div class="form-control-container">
<div class="left">
<div class="search-number">
<span class="search-number__text">총 <strong><c:out value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
</div>
</div>
<div class="center">
</div>
<div class="right">
</div>
</div>
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<c:if test="${bbsInfo.innbYn eq 'Y'}">
<col style="width: 80px;">
</c:if>
<c:if test="${bbsInfo.sjYn eq 'Y'}">
<col style="width: auto;">
</c:if>
<c:if test="${bbsInfo.ntcDeYn eq 'Y'}">
<col style="width: 10%;">
</c:if>
<c:if test="${bbsInfo.regusrNmYn eq 'Y'}">
<col style="width: 10%">
</c:if>
<c:if test="${bbsInfo.inqireCntYn eq 'Y'}">
<col style="width: 10%">
</c:if>
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
<col style="width: 10%">
</c:if>
</colgroup>
<thead>
<tr>
<c:if test="${bbsInfo.innbYn eq 'Y'}">
<th>번호</th>
</c:if>
<c:if test="${bbsInfo.sjYn eq 'Y'}">
<th>제목</th>
</c:if>
<c:if test="${bbsInfo.ntcDeYn eq 'Y'}">
<th>공지기간</th>
</c:if>
<c:if test="${bbsInfo.regusrNmYn eq 'Y'}">
<th>작성자</th>
</c:if>
<c:if test="${bbsInfo.inqireCntYn eq 'Y'}">
<th>조회수</th>
</c:if>
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
<th>등록일</th>
</c:if>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test = "${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${ resultMap.resultList.resultList}" varStatus = "status">
<tr class="tr-foldable-trigger"
password-at="<c:if test = "${resultList.secretBbscttAt eq 'Y'}">Y</c:if>"
regusr="<c:out value="${ resultList.regusr}"/>"
bbsctt="<c:out value="${ resultList.bbscttInnb }"/>"
regusr-dv-cd="<c:out value="${ resultList.regusrDvCd }"/>">
<c:if test="${bbsInfo.innbYn eq 'Y'}">
<td>
<c:choose>
<c:when test="${resultList.ntcAt eq 'Y'}">
<i class="icon icon_notice-fixed"></i>
</c:when>
<c:otherwise>
<c:out value="${resultList.rnum}"/>
</c:otherwise>
</c:choose>
</td>
</c:if>
<c:if test="${bbsInfo.sjYn eq 'Y'}">
<td class="text-left">
<button type="button" class="ellipsis">
<c:choose>
<c:when test="${resultList.secretBbscttAt eq 'Y'}">
<c:choose>
<c:when test = "${resultList.regusrDvCd ne '02'}">
<c:if test="${not empty resultList.answCn}">
<span class="customer-name">
[<c:out value="${ resultList.answCn }"/>]
</span>
</c:if>
<span>${ resultList.maskingRegusrNm}</span>님의 ${bbsInfo.bbsNm}
</c:when>
<c:otherwise>
비밀글입니다.
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:if test="${not empty resultList.answCn}">
<span class="customer-name">
[<c:out value="${ resultList.answCn }"/>]
</span>
</c:if>
<c:out value ="${resultList.sj}"/>
</c:otherwise>
</c:choose>
</button>
</td>
</c:if>
<c:if test="${bbsInfo.ntcDeYn eq 'Y'}">
<td>
<c:choose>
<c:when test="${resultList.ntcAt eq 'Y' && resultList.ntcPdSetupAt eq 'Y'}">
<span class="board-date"><c:out value="${ resultList.ntcBgnDe }"/> ~ <c:out
value="${ resultList.ntcEndDe }"/></span>
</c:when>
<c:when test="${ resultList.ntcAt eq 'Y' && resultList.ntcPdSetupAt eq 'N'}">
<p class="eventList__date">상시공지</p>
</c:when>
</c:choose>
</td>
</c:if>
<c:if test="${bbsInfo.regusrNmYn eq 'Y'}">
<td>
<span class="customer-name">
<c:choose>
<c:when test="${resultList.regusrDvCd eq '99'}">
<c:out value="${ resultList.maskingRegusrNm}"/>[비회원]
</c:when>
<c:when test="${resultList.regusrDvCd eq '03'&& not empty resultList.npayBbscttSnb}">
naverpay
</c:when>
<c:when test="${resultList.regusrDvCd eq '02'}">
<c:out value="${ resultList.mngrNm}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '01' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.regusrId}"/>
(<c:out value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '02' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.regusrId}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '03' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>(<c:out
value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '04' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '05' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>
(<c:out value="${ resultList.regusrId}"/>,<c:out
value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '06' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>(<c:out
value="${ resultList.regusrId}"/>)
</c:when>
</c:choose>
</span>
</td>
</c:if>
<c:if test="${bbsInfo.inqireCntYn eq 'Y'}">
<td><span class="customer-name"><c:out value="${ resultList.inqireCnt}"/></span></td>
</c:if>
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
<td><span class="customer-name"><c:out value="${ resultList.sumRegistDt }"/></span></td>
</c:if>
</tr>
<tr class="tr-foldable">
<td colspan="100%">
<div class="tr-foldable__content">
<div class="tr-foldable__qna">
<c:if test = "${bbsInfo.answRegist eq 'Y'}"><i class="icon icon_qna-q"></i></c:if>
<div class="tr-foldable__qna-content">
<p class="tr-foldable__qna-title sj"><c:out value="${resultList.sj}" escapeXml="false"/></p>
<div class = "cn"><c:out value="${resultList.cn}" escapeXml="false"/></div>
</div>
</div>
<c:if test = "${bbsInfo.answRegist eq 'Y'}">
<div class="tr-foldable__qna">
<i class="icon icon_qna-a"></i>
<div class="tr-foldable__qna-content">
<c:choose>
<c:when test = "${not empty resultList.answBbscttInnb}">
<p class="tr-foldable__qna-title"><c:out value="${resultList.answSj}" escapeXml="false"/></p>
<div><c:out value="${resultList.answBbscttCn}" escapeXml="false"/></div>
</c:when>
<c:otherwise>
<p class="tr-foldable__qna-title answSj">답변 등록 중입니다.</p>
</c:otherwise>
</c:choose>
</div>
</div>
<div class="tr-foldable__btn-container">
<input type = "hidden" name = "answAt"
value = <c:choose>
<c:when test = "${not empty resultList.answBbscttInnb}">
'Y'
</c:when>
<c:otherwise>
'N'
</c:otherwise>
</c:choose>>
<input type = "hidden" name = "bbscttInnb" value = <c:out value="${resultList.bbscttInnb}"/>>
<c:if test = "${resultList.regusr eq bbscttVO.regusr || resultList.regusrDvCd eq '99'}">
<button type = "button" class="btn theme outline updateBtn"
answ-at ="<c:if test = "${not empty resultList.answBbscttInnb}">Y</c:if>"
password-at="<c:if test = "${not empty resultList.secretBbscttAt}">Y</c:if>"
regusr="<c:out value="${ resultList.regusr}"/>"
regusr-dv-cd = "<c:out value="${ resultList.regusrDvCd }"/>"
value="<c:out value="${ resultList.bbscttInnb }"/>">수정</button>
<button type = "button" class="btn outline deleteBtn"
answ-at ="<c:if test = "${not empty resultList.answBbscttInnb}">Y</c:if>"
password-at="<c:if test = "${not empty resultList.secretBbscttAt}">Y</c:if>"
regusr="<c:out value="${ resultList.regusr}"/>"
regusr-dv-cd = "<c:out value="${ resultList.regusrDvCd }"/>"
value="<c:out value="${ resultList.bbscttInnb }"/>">삭제</button>
</c:if>
</div>
</c:if>
</div>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="4">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="조회 내역 없음">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
<c:if test = "${bbsInfo.bbscttRegist eq 'Y'}">
<div class="sub-board__top-btn-container">
<button type = "button" class="btn outline theme" id = "regBtn"><spring:message code="button.insert"/></button>
</div>
</c:if>
</div>
<input type="hidden" name="pageIndex" id="pageIndex" value="<c:out value = "${bbscttVO.pageIndex}"/>">
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_List"/>
</div>
</form>
</html>

View File

@@ -0,0 +1,148 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : EvtListR.jsp
Description : 이벤트 목록
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-30 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<c:set var="bbscttVO" value="${resultMap.bbsctt}"/>
<div class="eventList col-<c:out value ='${bbscttVO.pgeWthCnt}'/>">
<c:choose>
<c:when test="${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${ resultMap.resultList.resultList}" varStatus="status">
<div class="eventList__item">
<a class="dtlBtn" style="cursor:pointer;">
<input type = "hidden" class ="passwordAt" value="<c:if test = "${resultList.secretBbscttAt eq 'Y'}">Y</c:if>">
<input type = "hidden" class ="regusr" value="<c:out value="${ resultList.regusr}"/>">
<input type = "hidden" class ="bbscttInnb" value="<c:out value="${ resultList.bbscttInnb }"/>">
<div class="eventList__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value ="${cdnurl}${resultList.reprsntImgSysFilNm}"/>"
onerror="this.src='/pc/images/image_placeholder.png'"
alt="해당 이미지에 대한 설명">
</div>
<div class="eventList__text">
<c:if test = "${resultMap.bbsInfo.sjYn eq 'Y'}">
<h4 class="eventList__title"> <%--댓글 수--%>
<c:choose>
<c:when test = "${resultList.secretBbscttAt eq 'Y'}">
비밀글입니다.
</c:when>
<c:otherwise>
<c:out value ="${resultList.sj}"/>
</c:otherwise>
</c:choose>
<c:if test="${resultList.isfiles eq 1}"><%--첨부파일여부--%>
<i class="icon icon_image-badge"></i>
</c:if>
<c:if test="${resultList.newAt eq 'Y'}"><%--새로운게시글여부--%>
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${resultList.popularAt eq 'Y'}"><%--인기게시글여부--%>
<i class="icon icon_hot-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<i class="icon icon_lock"></i>
</c:if>
<c:if test="${resultList.cmtCnt > 0}"><%--댓글개수--%>
(<c:out value="${resultList.cmtCnt}"/>)
</c:if>
</h4>
</c:if>
<div class="eventList__bottom">
<c:if test = "${resultMap.bbsInfo.NtcDeYn eq 'Y'}">
<c:choose>
<c:when test="${resultList.ntcAt eq 'Y' && resultList.ntcPdSetupAt eq 'Y'}">
<p class="eventList__date"><c:out value="${ resultList.ntcBgnDe }"/>~<c:out value="${ resultList.ntcEndDe }"/></p>
</c:when>
<c:when test="${ resultList.ntcAt eq 'Y' && resultList.ntcPdSetupAt eq 'N'}">
<p class="eventList__date">상시공지</p>
</c:when>
</c:choose>
</c:if>
</div>
<ul class="eventList__list">
<c:if test = "${resultMap.bbsInfo.registDtYn eq 'Y'}">
<li><c:out value = '${resultList.sumRegistDt}'/></li>
</c:if>
<c:if test = "${resultMap.bbsInfo.inqireCntYn eq 'Y'}">
<li>조회 <c:out value = '${resultList.inqireCnt}'/></li>
</c:if>
<c:if test="${resultMap.bbsInfo.bbscttEvlUseAt eq 'Y'}"><%--게시글 설정 중 게시글 평가 여부에 따라 노출--%>
<c:choose>
<c:when test="${resultMap.bbsInfo.bbscttEvlRecomendStep eq '01'}"><%--게시글 평가 단계가 추천만 사용할 경우--%>
<li>추천 <c:out value="${resultList.recomendCnt}"/></li>
</c:when>
<c:otherwise><%--게시글 평가 단계가 추천,비추천으로 사용할 경우--%>
<li>추천/비추천 <c:out value="${resultList.recomendCnt}"/>/ <c:out value="${resultList.nonrecomendCnt}"/></li>
</c:otherwise>
</c:choose>
</c:if>
<c:if test="${resultMap.bbsInfo.regusrNmYn eq 'Y'}">
<li>
<c:choose>
<c:when test="${resultList.regusrDvCd eq '99'}">
<c:out value="${ resultList.maskingRegusrNm}"/>[비회원]
</c:when>
<c:when test="${resultList.regusrDvCd eq '03' && not empty resultList.npayBbscttSnb}">
naverpay
</c:when>
<c:when test="${resultList.regusrDvCd eq '02'}">
<c:out value="${ resultList.mngrNm}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '01' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.regusrId}"/>
(<c:out value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '02' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.regusrId}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '03' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>(<c:out
value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '04' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '05' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>
(<c:out value="${ resultList.regusrId}"/>,<c:out
value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '06' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>(<c:out
value="${ resultList.regusrId}"/>)
</c:when>
</c:choose>
</li>
</c:if>
</ul>
</div>
</a>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="eventList__no-result">
<img src="/pc/images/icon__no-result.png"
alt="내역 없음">
<p class="eventList__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</c:otherwise>
</c:choose>
</div>
<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value = '${bbscttVO.pageIndex}'/>"/>
</html>

View File

@@ -0,0 +1,443 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : MyRvwR.jsp
Description : 마이페이지 나의리뷰
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-11 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function () {
// 'sub-tab__trigger' 클래스를 가진 요소가 있는지 확인
$(".sub-tab__btn").eq(0).click(); //클래스 부여 로직 필요
fn_collect_event();
/*사이드바 current 부여*/
$(".cscMenu").each(function(){
if($(this).attr("id") === $("#bbsId").val()){
$(this).addClass("current");
}
});
});
/****************************************************************
이벤트 함수
*****************************************************************/
const fn_collect_event = () => {
//분류 선택
$(".sub-tab__btn").on("click", function () {
let idx = $(this).index();
$(".sub-tab__btn").not($(this)).removeClass("current");
$(this).addClass("current");
fn_select_List(1, idx);
});
//상세 조회
$(document).on("click", ".dtlBtn", function () {
const bbscttInnb = $(this).val();
fn_select_crud_posbl_at(bbscttInnb, '', '', 'R');
});
//검색
$(document).on("click", "#srchBtn", function () {
fn_select_List(1);
});
$(document).on('keydown', '#srchKeyword', function (event) {
if (event.keyCode === 13) {
event.preventDefault();
fn_select_List(1);
}
});
// 페이지가 로드될 때 초기 값을 설정
let initialValue = 0;
$('#valueDisplay').val(initialValue);
// 새로고침 이벤트 감지
$(window).on('beforeunload', function () {
$("#srchKeyword").val("");
});
// F5 키(새로고침) 이벤트 감지
$(document).keydown(function (event) {
if (event.keyCode == 116) {
$("#srchKeyword").val("");
}
});
//비밀번호 확인
$("#pwChkBtn").on("click", function () {
const password = $("#modalPw").val();
const bbscttInnb = $("#modalBbscttInnb").val();
const idx = $("#modalIdx").val();
const answAt = $("modalAnswAt").val();
fn_check_password(bbscttInnb, password, idx, answAt);
});
//초기 세팅
let pageIndex = '<c:out value="${ resultMap.bbsctt.pageIndex }"/>';
fn_select_List(pageIndex, 0);
}
//crud 가능 판단
const fn_select_crud_posbl_at = (bbsctt, idx, pwCnfirmAt, crudDv) => {
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/csc/selectBbscttDtlMovePosblAt"/>',
data: {
"bbscttInnb": bbsctt,
"bbsId": $("#bbsId").val(),
"sknTyCd": $("#sknTyCd").val(),
"pwCnfirmAt": pwCnfirmAt,
"crudDv": crudDv
},
success: function (data) {
data = JSON.parse(data.resBody.result);
fn_branch_bbsctt_posble(data, idx);
}
});
}
//상세보기 가능 판단 여부에 따른 분기 처리
const fn_branch_bbsctt_posble = (data, idx) => {
const moveAt = data.result.moveAt;
const vo = data.vo;
if (moveAt === 'YES' || vo.pwCnfirmAt === 'Y') {//본인 o
if (vo.crudDv === 'R') {
if ($("#sknTyCd").val() === '03') {
fn_select_cn(vo.bbscttInnb, idx);
} else {
fn_move_dtl(vo.bbscttInnb);
}
}
} else if (moveAt === 'OTHER') {//다른이용자 o
$("#comment-update-pop").modal();
} else if (moveAt === 'LOGIN') {//로그인 o
$("#rejectLogin").modal();
} else {//비밀번호
$("#confirm_bbsctt_pw").modal();
$("#modalBbscttInnb").val(vo.bbscttInnb);
$("#modalIdx").val(idx);
$("#modalCrudDv").val(vo.crudDv);
}
}
//리스트 조회
const fn_select_List = (pageIndex, idx) => {
const sknTyCd = $("#sknTyCd").val();
const bbsTyCd = $("#bbsTyCd").val();
let url;
if (!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if (bbsTyCd === '01') {
//일반게시글 스킨타입
if (sknTyCd === '01') {
url = '/sopmal/csc/selectCscListTy';//리스트
} else if (sknTyCd === '02') {
url = '/sopmal/csc/selectCscGalaryTy';//갤러리
} else {
url = '/sopmal/csc/selectCscAcordionTy';//아코디언
}
} else if (bbsTyCd === '02') {
url = '/sopmal/csc/selectNoticeListInqire'//공지사항
} else if (bbsTyCd === '04') {
url = '/sopmal/csc/selectFaqListInqire'//FAQ
}
let srchForm = $("#srchForm").serialize()+"&pageIndex="+pageIndex+"&useAt=Y&expsrAt=Y";
let itmInnb;
//분류 조회
if (idx !== 0 && idx !== undefined) { //분류 클릭
itmInnb = $(".sub-tab__btn").eq(idx).val();
srchForm = srchForm + "&srchitmInnb=" + itmInnb ;
} else {
if ($(".sub-tab__btn.current").index() > 0) { //검색어
srchForm = srchForm+"&srchitmInnb="+$(".sub-tab__btn.current").val();
}
}
$.ajax({
type: "post",
data: srchForm,
url: url,
success: function (data) {
if ($(".contentDiv").html()) {
$(".contentDiv").empty();
}
if($(".sub-tab__trigger").length>0){
$(".sub-tab__content.current").find(".contentDiv").html(data);
}else{
$(".contentDiv").html(data);
}
if (sknTyCd === '03') {
fn_arccodian_event();
}
}
});
}
//상세조회
const fn_move_dtl = (bbscttInnb) => {
const hiddenForm = $("#hiddenForm");
if (hiddenForm.length > 0) {
hiddenForm.remove();
}
const form = document.createElement("form");
form.id = "dtlForm";
form.action = "/sopmal/csc/selectBbscttAuth";
form.method = "GET";
let pageIndex = $("#pageIndex").val();
if (pageIndex === '') {
pageIndex = "1";
}
fn_create_input("pageIndex", pageIndex, form);
fn_create_input("bbscttInnb", bbscttInnb, form);
fn_create_input("bbsTyCd", $("#bbsTyCd").val(), form);
fn_create_input("bbsId", $("#bbsId").val(), form);
fn_create_input("srchKeyword", $("#srchKeyword").val(), form);
fn_create_input("srchDv", $("#srchDv").val(), form);
fn_create_input("useAt", "Y", form);
fn_create_input("expsrAt", "Y", form);
fn_create_input("reqUrl", "csc", form);
fn_create_input("prevNext",$("#prevNext").val(), form);
fn_create_input("recomendGoodsExpsrAt",$("#recomendGoodsExpsrAt").val(), form);
fn_create_input("authDv", "CM", form);
let pageUnit = '';
//페이지 유닛 계산
const pgeVtcCnt = $("#pgeVtcCnt").val();//ROW
const pgeWthCnt = $("#pgeWthCnt").val();//COL
pageUnit = pgeVtcCnt * pgeWthCnt;
if (pgeWthCnt === '') {
pageUnit = 10;
}
//현재 항목고유번호
const itmInnbIdx = $(".sub-tab__btn.current").index();
const itmVal = $(".sub-tab__btn").eq(itmInnbIdx).val();
if (itmVal !== undefined) {
fn_create_input("itmInnb", itmVal, form);
}
fn_create_input("pageUnit", pageUnit, form);
document.body.appendChild(form);
form.submit();
}
//input 생성 함수
const fn_create_input = (name, value, tgtForm) => {
const input = document.createElement('input');
input.setAttribute("type", "hidden");
input.setAttribute("name", name);
input.setAttribute("value", value);
tgtForm.appendChild(input);
}
//아코디언형 이벤트
const fn_arccodian_event = () => {
// 테이블 행 열기/닫기
var trFoldableTrigger = $(".tr-foldable-trigger");
var trFoldable = $(".tr-foldable");
trFoldableTrigger.on("click", function () {
trFoldable.not($(this).next()).removeClass("active");
$(this).next().toggleClass("active");
});
trFoldableTrigger.on("click", function () {
let idx = $(".tr-foldable-trigger").index(this);
let bbscttInnb = $(this).find("[name='bbscttInnb']").val();
//닫혀 있을 때만
if($(this).next().hasClass("active")){
fn_select_cn(bbscttInnb, idx);
}
});
}
//아코디언형 내용 조회
const fn_select_cn = (bbscttInnb, idx) => {
const bbsId = $("#bbsId").val();
$.ajax({
type: "post",
data: {
bbscttInnb: bbscttInnb
,bbsId: bbsId
},
url: '/sopmal/csc/selectBbscttCn',
success: function (data) {
const result = JSON.parse(data.resBody.result);
var trFoldableCntent = $(".tr-foldable__content");
trFoldableCntent.eq(idx).html(result.cn);
}
});
}
/********************************************************************
* 비밀번호 확인 (조회)
* success시
* 갤러리형,리스트형 : 상세 이동
* 아코디언형 : 해당 내용 노출
********************************************************************/
const fn_check_password = (bbscttInnb, password, idx, answAt) => {
if (password === '') {
alert("비밀번호를 입력해주세요");
} else {
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/csc/selectBbscttComparPassword"/>',
data: {
"bbscttInnb": bbscttInnb,
"password": password
},
success: function (data) {
const result = JSON.parse(data.resBody.result);
const sknTyCd = $("#sknTyCd").val();
/*비밀번호 확인 결과*/
const resultVal = result["pw"];
if (resultVal > 0) {
if (sknTyCd == '01' || sknTyCd == '02') {
fn_move_dtl(bbscttInnb, answAt);
} else {
const trFoldableTrigger = $(".tr-foldable-trigger").eq(idx);
$(".tr-foldable").not(trFoldableTrigger.next()).removeClass("active");
trFoldableTrigger.next().toggleClass("active");
const cnHtml = trFoldableTrigger.next(".tr-foldable").find(".hiddenCn").val();
trFoldableTrigger.next(".tr-foldable").find(".cn").html(cnHtml);
}
} else {
openModal("failPwMatch");
}
/*모달 내 값 초기화*/
$("#modalPw").val("");
$("#modalBbscttInnb").val("");
$("#closeBtn").click();
}
});
}
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<%--게시판 정보--%>
<c:set var="bbsInfo" value="${resultMap.bbsInfo}"/>
<%--분류 목록--%>
<c:set var="itmList" value="${resultMap.itmList}"/>
<%--vo--%>
<c:set var="bbscttVO" value="${resultMap.bbsctt}"/>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<jsp:include page="/WEB-INF/views/comm/csc/CscLeft.jsp"/>
<div class="sub-right-content">
<h3 class="sub-right-content__title" id = "bbsNm"><c:out value="${bbsInfo.bbsNm}"/></h3>
<form id="srchForm">
<%--게시판 정보--%>
<input type="hidden" name="bbsId" id = "bbsId" value = "<c:out value="${bbsInfo.bbsId}"/>">
<input type="hidden" name="sknTyCd" id = "sknTyCd" value = "<c:out value="${bbsInfo.sknTyCd}"/>">
<input type="hidden" name="bbsTyCd" id = "bbsTyCd" value = "<c:out value="${bbsInfo.bbsTyCd}"/>">
<input type="hidden" name="srchDv" id = "srchDv" value="any" >
<input type="hidden" name="pgeVtcCnt" id = "pgeVtcCnt" value = "<c:out value="${bbsInfo.pgeVtcCnt}"/>">
<input type="hidden" name="pgeWthCnt" id = "pgeWthCnt" value = "<c:out value="${bbsInfo.pgeWthCnt}"/>">
<input type="hidden" name="prevNext" id = "prevNext" value = "<c:out value="${bbsInfo.prevNext}"/>">
<input type="hidden" name="regusrDvCd" id = "regusrDvCd" value = "<c:out value="${bbscttVO.regusrDvCd}"/>">
<input type="hidden" name="slangFlterUseAt" id = "slangFlterUseAt" value = "<c:out value="${bbsInfo.slangFlterUseAt}"/>">
<input type="hidden" id = "valueDisplay">
<div class="customer-search">
<div class="customer-search__row">
<input class="input-text customer-search__search" type="search" title="검색어 입력"
id ="srchKeyword" name="srchKeyword" placeholder="궁금하신 내용을 입력해 주세요" value="${bbscttVO.srchKeyword}">
<button type="button" class="btn md dark" id = "srchBtn">검색</button>
</div>
</div>
</form>
<c:choose>
<c:when test="${not empty itmList}">
<div class="sub-tab">
<div class="sub-tab__trigger">
<button class="sub-tab__btn current">전체</button>
<c:forEach var="item" items="${itmList}">
<button class="sub-tab__btn" value="<c:out value="${item.itmInnb}"/>"><c:out value="${item.itmCn}"/></button>
</c:forEach>
</div>
<c:forEach var="i" begin="0" end="${fn:length(itmList)}">
<div class="sub-tab__content">
<div class="contentDiv"></div>
</div>
</c:forEach>
</div>
</c:when>
<c:otherwise>
<div class="contentDiv"></div>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
</div>
<div id = "moveForm"></div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
<%--비밀번호 확인 모달--%>
<div id="confirm_bbsctt_pw" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
등록시에 입력했던 비밀번호를 입력해 주세요
</p>
<input class="input-text alert-content__pwInput" type="password" title="비밀번호 입력" placeholder="비밀번호 입력" name="password" id = "modalPw">
<input type="hidden" name="bbscttInnb" id = "modalBbscttInnb">
<input type="hidden" id = "modalIdx">
<input type="hidden" id = "modalAnswAt">
<input type="hidden" id = "reqAction">
<input type="hidden" id="modalcrudDv">
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--cancel" id = "closeBtn">취소</a>
<button type = "button" class="alert-btn alert-btn--confirm" id="pwChkBtn">확인</button>
</div>
</div>
<%--이용자가 회원인데 작성자와 다를 시--%>
<div id="comment-update-pop" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
글작성자만 이용가능합니다.
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--confirm">확인</a>
</div>
</div>
<%--이용자가 로그인 상태가 아닐 때--%>
<div id="rejectLogin" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
이용하시려면 로그인이 필요합니다!
<br>
로그인하시겠습니까?
</p>
</div>
<div class="alert-btn-container">
<a class="alert-btn alert-btn--confirm" onclick = "fn_move_login()"><spring:message code="button.yes"/></a>
<a href="#" rel="modal:close" class="alert-btn"><spring:message code="button.no"/></a>
</div>
</div>
</html>

View File

@@ -0,0 +1,306 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : CscListTyR.jsp
Description : 리스트형 목록.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-18 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<c:set var="bbsInfo" value="${resultMap.bbsInfo}"/>
<c:set var="bbscttVO" value="${resultMap.bbsctt}"/>
<form class="contentForm">
<div class="form-control-container">
<div class="left">
<div class="search-number">
<span class="search-number__text">총 <strong><c:out
value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
</div>
</div>
<div class="center">
</div>
<div class="right">
</div>
</div>
<div class="table-wrapper">
<table class="table vertical">
<caption>게시글 목록</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<c:if test="${bbsInfo.innbYn eq 'Y'}">
<col style="width: 80px;">
</c:if>
<c:if test="${bbsInfo.sjYn eq 'Y'}">
<col style="width: auto;">
</c:if>
<c:if test="${bbsInfo.cnYn eq 'Y'}">
<col style="width: 23%;">
</c:if>
<c:if test="${bbsInfo.ntcDeYn eq 'Y'}">
<col style="width: 10%;">
</c:if>
<c:if test="${bbsInfo.regusrNmYn eq 'Y'}">
<col style="width: 10%">
</c:if>
<c:if test="${bbsInfo.inqireCntYn eq 'Y'}">
<col style="width: 10%">
</c:if>
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
<col style="width: 10%">
</c:if>
</colgroup>
<thead>
<tr>
<c:if test="${bbsInfo.innbYn eq 'Y'}">
<th>번호</th>
</c:if>
<c:if test="${bbsInfo.sjYn eq 'Y'}">
<th>제목</th>
</c:if>
<c:if test="${bbsInfo.cnYn eq 'Y'}">
<th>내용</th>
</c:if>
<c:if test="${bbsInfo.ntcDeYn eq 'Y'}">
<th>공지기간</th>
</c:if>
<c:if test="${bbsInfo.regusrNmYn eq 'Y'}">
<th>작성자</th>
</c:if>
<c:if test="${bbsInfo.inqireCntYn eq 'Y'}">
<th>조회수</th>
</c:if>
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
<th>등록일</th>
</c:if>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${resultMap.resultList.resultList}" varStatus="status">
<tr>
<input type="hidden" name="bbscttInnb" value="${resultList.bbscttInnb}">
<c:if test="${bbsInfo.innbYn eq 'Y'}">
<td>
<c:choose>
<c:when test="${resultList.ntcAt eq 'Y'}">
<i class="icon icon_notice-fixed"></i>
</c:when>
<c:otherwise>
<c:out value="${resultList.rnum}"/>
</c:otherwise>
</c:choose>
</td>
</c:if>
<c:if test="${bbsInfo.sjYn eq 'Y'}">
<td class="text-left">
<a class="eclipsis dtlBtn" style="cursor:pointer;">
<input type="hidden" class="passwordAt" value="<c:if test = "${resultList.secretBbscttAt eq 'Y'}">Y</c:if>">
<input type="hidden" class="regusr" value="<c:out value="${ resultList.regusr}"/>">
<input type="hidden" class="bbscttInnb" value="<c:out value="${ resultList.bbscttInnb }"/>">
<input type="hidden" class="regusrDvCd" value="<c:out value="${ resultList.regusrDvCd }"/>">
<c:choose>
<c:when test="${resultList.secretBbscttAt eq 'Y'}">
<c:choose>
<c:when test = "${resultList.regusrDvCd ne '02'}">
<c:if test="${not empty resultList.answCn}">
<span class="customer-name">
[<c:out value="${ resultList.answCn }"/>]
</span>
</c:if>
<span>${ resultList.maskingRegusrNm}</span>님의 ${bbsInfo.bbsNm}
</c:when>
<c:otherwise>
비밀글입니다.
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<c:if test="${not empty resultList.answCn}">
<span class="customer-name">
[<c:out value="${ resultList.answCn }"/>]
</span>
</c:if>
<c:out value ="${resultList.sj}"/>
</c:otherwise>
</c:choose>
<c:if test="${resultList.isfiles eq 1}"><%--첨부파일여부--%>
<i class="icon icon_image-badge"></i>
</c:if>
<c:if test="${resultList.newAt eq 'Y'}"><%--새로운게시글여부--%>
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${resultList.popularAt eq 'Y'}"><%--인기게시글여부--%>
<i class="icon icon_hot-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<i class="icon icon_lock"></i>
</c:if>
<c:if test="${resultList.cmtCnt > 0}"><%--댓글개수--%>
(<c:out value="${resultList.cmtCnt}"/>)
</c:if>
</a>
</td>
</c:if>
<c:if test="${bbsInfo.cnYn eq 'Y'}">
<td class="text-left">
<span>
<c:choose><%--내용이 리스트 항목 일 때 비밀글 여부에 따른 분기 처리--%>
<c:when test="${resultList.secretBbscttAt eq 'Y'}">
비밀글 입니다.
</c:when>
<c:otherwise>
<c:set var="cn" value="${resultList.cn}" />
<c:choose><%--내용이 20자 이상일 때 내용 추림--%>
<c:when test="${fn:length(cn) > 20}">
${fn:substring(cn, 0, 20)}...
</c:when>
<c:otherwise>
<c:out value="${cn}"/>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
</span>
</td>
</c:if>
<c:if test="${bbsInfo.ntcDeYn eq 'Y'}">
<td>
<c:choose>
<c:when test="${resultList.expsrAt eq 'Y' && resultList.ntcePdSetupAt eq 'Y'}">
<span class="board-date"><c:out value="${ resultList.ntcBgnDe }"/> ~ <c:out value="${ resultList.ntcEndDe }"/></span>
</c:when>
<c:when test="${ resultList.expsrAt eq 'Y' && resultList.ntcePdSetupAt eq 'N'}">
<p class="eventList__date">상시공지</p>
</c:when>
</c:choose>
</td>
</c:if>
<c:if test="${bbsInfo.regusrNmYn eq 'Y'}">
<td>
<span class="customer-name">
<c:choose>
<c:when test="${resultList.regusrDvCd eq '99'}">
<c:out value="${ resultList.maskingRegusrNm}"/>[비회원]
</c:when>
<c:when test="${resultList.regusrDvCd eq '03'&& not empty resultList.npayBbscttSnb}">
naverpay
</c:when>
<c:when test="${resultList.regusrDvCd eq '02'}">
<c:out value="${ resultList.mngrNm}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '01' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.regusrId}"/>
(<c:out value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '02' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.regusrId}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '03' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>(<c:out
value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '04' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '05' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>
(<c:out value="${ resultList.regusrId}"/>,<c:out
value="${ resultList.mbrGradNm}"/>)
</c:when>
<c:when test="${bbsInfo.wrterIndictTyCd eq '06' && resultList.regusrDvCd eq '01'}">
<c:out value="${ resultList.maskingRegusrNm}"/>(<c:out
value="${ resultList.regusrId}"/>)
</c:when>
</c:choose>
</span>
</td>
</c:if>
<c:if test="${bbsInfo.inqireCntYn eq 'Y'}">
<td><span class="customer-name"><c:out value="${ resultList.inqireCnt}"/></span></td>
</c:if>
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
<td><span class="customer-name"><c:out value="${ resultList.sumRegistDt }"/></span></td>
</c:if>
</tr>
<c:if test="${bbsInfo.answRegist eq 'Y'}">
<c:if test="${not empty resultList.answBbscttInnb}">
<tr>
<c:if test="${bbsInfo.innbYn eq 'Y'}">
<td></td>
</c:if>
<c:if test="${bbsInfo.sjYn eq 'Y'}">
<td class="text-left">
<a type="button" class="ellipsis dtlBtn" style="cursor:pointer;">
<input type="hidden" class="passwordAt" value="<c:if test = "${resultList.secretBbscttAt eq 'Y'}">Y</c:if>">
<input type="hidden" class="regusr" value="<c:out value="${ resultList.regusr}"/>">
<input type="hidden" class="bbscttInnb" value="<c:out value="${ resultList.bbscttInnb }"/>">
<input type="hidden" class="regusrDvCd" value="<c:out value="${ resultList.regusrDvCd }"/>">
<i class="icon icon_reply"></i> <c:out value="${ resultList.maskingRegusrNm}"/>님의 소중한 문의입니다.
<c:if test="${resultList.newAt eq 'Y'}">
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }">
<i class="icon icon_lock"></i>
</c:if>
</a>
</td>
</c:if>
<c:if test="${bbsInfo.cnYn eq 'Y'}">
<td></td>
</c:if>
<c:if test="${bbsInfo.ntcDeYn eq 'Y'}">
<td></td>
</c:if>
<c:if test="${bbsInfo.regusrNmYn eq 'Y'}">
<td><span class="board-date"><c:out
value="${resultList.mngrNm}"/></span></td>
</c:if>
<c:if test="${bbsInfo.inqireCntYn eq 'Y'}">
<td></td>
</c:if>
<c:if test="${bbsInfo.registDtYn eq 'Y'}">
<td><span class="board-date"><c:out value="${ resultList.sumAnswRegistDt}"/></span></td>
</c:if>
</tr>
</c:if>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="100%">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="조회 내역 없음">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
<c:if test = "${bbsInfo.bbscttRegist eq 'Y'}">
<div class="sub-board__top-btn-container">
<button type = "button" class="btn outline theme" id = "regBtn"><spring:message code="button.insert"/></button>
</div>
</c:if>
</div>
<input type="hidden" name="pageIndex" id="pageIndex" value="<c:out value = "${bbscttVO.pageIndex}"/>">
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_List"/>
</div>
</form>
</html>

View File

@@ -0,0 +1,112 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : EvtListR.jsp
Description : 이벤트 목록
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-30 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<c:set var = "bbscttVO" value = "${resultMap.bbsctt}"/>
<div class="eventList col-<c:out value ='${bbscttVO.pgeWthCnt}'/>">
<c:choose>
<c:when test="${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${ resultMap.resultList.resultList}">
<div class="eventList__item">
<a class="dtlBtn" style="cursor:pointer;">
<input type = "hidden" class ="bbscttInnb" value="<c:out value="${ resultList.bbscttInnb }"/>">
<div class="eventList__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="${cdnurl}<c:out value ="${resultList.reprsntImgSysFilNm}"/>"
onerror = "javascript:img=new Image();img.src='/pc/images/image_placeholder.png';if(img.complete){this.src='/pc/images/image_placeholder.png'} else{this.style.display='none';}"
alt="해당 이미지에 대한 설명">
</div>
<div class="eventList__text">
<h4 class="eventList__title">
<c:out value ="${resultList.sj}" escapeXml="false"/>
<c:if test="${resultList.isfiles eq 1}"><%--첨부파일여부--%>
<i class="icon icon_image-badge"></i>
</c:if>
<c:if test="${resultList.newAt eq 'Y'}"><%--새로운게시글여부--%>
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${resultList.popularAt eq 'Y'}"><%--인기게시글여부--%>
<i class="icon icon_hot-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<i class="icon icon_lock"></i>
</c:if>
<c:if test="${resultList.cmtCnt > 0}"><%--댓글개수--%>
(<fmt:formatNumber value="${resultList.cmtCnt}" pattern="#,###"/>)
</c:if>
</h4>
<div class="eventList__bottom">
<%--디데이 표시--%>
<span class="eventList__dDay">
<c:choose>
<c:when test="${resultList.expsrAt eq 'Y' && resultList.ntcePdSetupAt eq 'Y'}">
<c:choose>
<c:when test="${ resultList.dDay < 0}">종료</c:when>
<c:otherwise>D-<c:out value="${ resultList.dDay }"/></c:otherwise>
</c:choose>
</c:when>
<c:when test="${ resultList.expsrAt eq 'Y' && resultList.ntcePdSetupAt eq 'N'}">
상시
</c:when>
</c:choose>
</span>
<c:choose>
<c:when test="${resultList.expsrAt eq 'Y' && resultList.ntcePdSetupAt eq 'Y'}"><%--노출기간이 있는경우--%>
<p class="eventList__date">
<c:out value="${ resultList.ntceBgnDe }"/>~<c:out value="${ resultList.ntceEndDe }"/>
</p>
</c:when>
<c:when test="${ resultList.expsrAt eq 'Y' && resultList.ntcePdSetupAt eq 'N'}">
<p class="eventList__date"><c:out value="${ resultList.sumRegistDt }"/>~상시진행</p>
</c:when>
</c:choose>
</div>
<ul class="eventList__list">
<li><c:out value="${resultList.sumRegistDt}"/></li><%--등록일--%>
<li>조회 <fmt:formatNumber value="${resultList.inqireCnt}" pattern="#,###"/></li><%--조회수--%>
<c:if test="${bbsInfo.bbscttEvlUseAt eq 'Y'}"><%--게시글 설정 중 게시글 평가 여부에 따라 노출--%>
<c:choose>
<c:when test="${bbsInfo.bbscttEvlRecomendStep eq '01'}"><%--게시글 평가 단계가 추천만 사용할 경우--%>
<li>추천 <fmt:formatNumber value="${resultList.recomendCnt}" pattern="#,###"/></li>
</c:when>
<c:otherwise><%--게시글 평가 단계가 추천,비추천으로 사용할 경우--%>
<li>추천/비추천 <fmt:formatNumber value="${resultList.recomendCnt}" pattern="#,###"/>/<fmt:formatNumber value="${resultList.nonrecomendCnt}" pattern="#,###"/></li>
</c:otherwise>
</c:choose>
</c:if>
<li><c:out value="${resultList.mngrNm}"/></li><%--관리자명--%>
</ul>
</div>
</a>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="eventList__no-result">
<img src="/pc/images/icon__no-result.png" alt="내역 없음">
<p class="eventList__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</c:otherwise>
</c:choose>
</div>
<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value = '${bbscttVO.pageIndex}'/>"/>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_List"/>
</div>
</html>

View File

@@ -0,0 +1,100 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : EvtListR.jsp
Description : 이벤트 목록
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-30 김혜인 최초 생성
--%>
<!DOCTYPE html>
<c:set var = "bbscttVO" value = "${resultMap.bbsctt}"/>
<html lang="ko">
<div class="eventWinnerList">
<div class="customer-search">
<div class="customer-search__row justify-start">
<div class="customer-search__controls">
<input class="input-text customer-search__search" type="search" title="검색어 입력"
name="srchKeyword" id="srchKeyword"
placeholder="제목, 내용" value="${bbscttVO.srchKeyword}">
<input type="hidden" name="srchDv" value="any" id="srchDv">
</div>
<button class="btn md dark" id="srchBtn">검색</button>
</div>
</div>
<div class="table-wrapper">
<table class="table vertical">
<caption>당첨자발표리스트</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: auto;">
<col style="width: 15%;">
</colgroup>
<thead>
<tr>
<th>제목</th>
<th>등록일</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${ resultMap.resultList.resultList}">
<tr>
<td class="text-left">
<a class="table__board-title dtlBtn" style="cursor:pointer;">
<input type="hidden" class="bbscttInnb" value="<c:out value="${ resultList.bbscttInnb }"/>">
<span class="table__badge table__badge--event">이벤트</span>
<c:out value ="${resultList.sj}" escapeXml="false"/>
<c:if test="${resultList.isfiles eq 1}"><%--첨부파일여부--%>
<i class="icon icon_image-badge"></i>
</c:if>
<c:if test="${resultList.newAt eq 'Y'}"><%--새로운게시글여부--%>
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${resultList.popularAt eq 'Y'}"><%--인기게시글여부--%>
<i class="icon icon_hot-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<i class="icon icon_lock"></i>
</c:if>
<c:if test="${resultList.cmtCnt > 0}"><%--댓글개수--%>
(<c:out value="${resultList.cmtCnt}"/>)
</c:if>
</a>
</td>
<td><span class="board-date"><c:out value="${resultList.sumRegistDt}"/></span></td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="2">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<input type="hidden" id="pageIndex" name="pageIndex"
value="<c:out value = '${bbscttVO.pageIndex}'/>"/>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image"
jsFunction="fn_select_List"/>
</div>
</div>
</html>

View File

@@ -0,0 +1,91 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : FaqListR.jsp
Description : 자주묻는질문 목록.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-18 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<div class="form-control-container">
<div class="left">
<div class="search-number">
<span class="search-number__text">총 <strong><c:out value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
</div>
</div>
<div class="center">
</div>
<div class="right">
</div>
</div>
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 120px;">
<col style="width: auto;">
</colgroup>
<thead>
<tr>
<th>구분</th>
<th><c:out value = "${resultMap.bbsInfo.questionSj}"/></th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test = "${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${ resultMap.resultList.resultList}">
<tr class="tr-foldable-trigger">
<td>
<span class="board-number">
<c:out value="${resultList.answCn}" />
</span>
<input type = "hidden" name = "bbscttInnb" value = "${resultList.bbscttInnb}"/>
</td>
<td class="text-left">
<div class="table__board-title">
<p class="ellipsis">
<c:out value="${resultList.sj}" escapeXml="false"/>
</p>
</div>
</td>
</tr>
<tr class="tr-foldable">
<td colspan="2">
<div class="tr-foldable__content ck-content">
</div>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="2">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<input type="hidden" id="pageIndex" name="pageIndex" value="1" />
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_List" />
</div>
</html>

View File

@@ -0,0 +1,87 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : EvtListR.jsp
Description : 이벤트 목록
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-30 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<c:set var="bbscttVO" value="${resultMap.bbsctt}"/>
<div class="eventList col-<c:out value ='${bbscttVO.pgeWthCnt}'/>">
<c:choose>
<c:when test="${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${ resultMap.resultList.resultList}">
<div class="eventList__item">
<a class="dtlBtn" style="cursor:pointer;">
<input type = "hidden" class ="bbscttInnb" value="<c:out value="${ resultList.bbscttInnb }"/>">
<div class="eventList__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value ="${cdnurl}${resultList.reprsntImgSysFilNm}"/>"
onerror = "javascript:img=new Image();img.src='/pc/images/image_placeholder.png';if(img.complete){this.src='/pc/images/image_placeholder.png'} else{this.style.display='none';}"
alt="해당 이미지에 대한 설명">
</div>
<div class="eventList__text">
<h4 class="eventList__title">
<c:out value="${resultList.sj}" escapeXml="false"/>
<c:if test="${resultList.isfiles eq 1}"><%--첨부파일여부--%>
<i class="icon icon_image-badge"></i>
</c:if>
<c:if test="${resultList.newAt eq 'Y'}"><%--새로운게시글여부--%>
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${resultList.popularAt eq 'Y'}"><%--인기게시글여부--%>
<i class="icon icon_hot-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<i class="icon icon_lock"></i>
</c:if>
<c:if test="${resultList.cmtCnt > 0}"><%--댓글개수--%>
(<fmt:formatNumber value="${resultList.cmtCnt}" pattern="#,###"/>)
</c:if>
</h4>
<ul class="eventList__list">
<li><c:out value="${resultList.sumRegistDt}"/></li><%--등록일--%>
<li>조회 <fmt:formatNumber value="${resultList.inqireCnt}" pattern="#,###"/></li><%--조회수--%>
<c:if test = "${bbsInfo.bbscttEvlUseAt eq 'Y'}"><%--게시글 설정 중 게시글 평가 여부에 따라 노출--%>
<c:choose>
<c:when test = "${bbsInfo.bbscttEvlRecomendStep eq '01'}"><%--게시글 평가 단계가 추천만 사용할 경우--%>
<li>추천 <fmt:formatNumber value="${resultList.recomendCnt}" pattern="#,###"/></li>
</c:when>
<c:otherwise><%--게시글 평가 단계가 추천,비추천으로 사용할 경우--%>
<li>추천/비추천 <fmt:formatNumber value="${resultList.recomendCnt}" pattern="#,###"/>/<fmt:formatNumber value="${resultList.nonrecomendCnt}" pattern="#,###"/></li>
</c:otherwise>
</c:choose>
</c:if>
</ul>
</div>
</a>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="eventList">
<div class="eventList__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="eventList__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</div>
</c:otherwise>
</c:choose>
</div>
<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value = '${bbscttVO.pageIndex}'/>"/>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_List"/>
</div>
</html>

View File

@@ -0,0 +1,111 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : NoticeListR.jsp
Description :공지사항 목록.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-18 김혜인 최초 생성
--%>
<c:set var="bbscttVO" value="${resultMap.bbsctt}"/>
<form class="contentForm">
<div class="form-control-container">
<div class="left">
<div class="search-number">
<span class="search-number__text">총 <strong><c:out
value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
</div>
</div>
<div class="center">
</div>
<div class="right">
</div>
</div>
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 80px;">
<col style="width: auto;">
<col style="width: 12%;">
</colgroup>
<thead>
<tr>
<th>번호</th>
<th>제목</th>
<th>등록일</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${resultMap.resultList.resultList}">
<tr>
<input type="hidden" name="bbscttInnb" value="${resultList.bbscttInnb}">
<td>
<c:choose>
<c:when test="${resultList.rnum eq 0}">
<i class="icon icon_notice-fixed"></i>
</c:when>
<c:otherwise>
<c:out value="${resultList.rnum}"/>
</c:otherwise>
</c:choose>
</td>
<td class="text-left">
<div class="table__board-title">
<button type="button" class="eclipse dtlBtn sj"
password-at="<c:if test = "${resultList.secretBbscttAt eq 'Y'}">Y</c:if>"
regusr="<c:out value="${ resultList.regusr}"/>"
value="<c:out value="${ resultList.bbscttInnb }"/>">
<c:out value="${resultList.sj}" escapeXml="false"/>
</button>
<c:if test="${resultList.isfiles eq 1}"><%--첨부파일여부--%>
<i class="icon icon_image-badge"></i>
</c:if>
<c:if test="${resultList.newAt eq 'Y'}"><%--새로운게시글여부--%>
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${resultList.popularAt eq 'Y'}"><%--인기게시글여부--%>
<i class="icon icon_hot-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<i class="icon icon_lock"></i>
</c:if>
</div>
</td>
<c:set var="dateString" value="${resultList.registDt}" />
<fmt:parseDate var="parsedDate" value="${dateString}" pattern="yyyy-MM-dd HH:mm:ss" />
<td><span class="board-date"><fmt:formatDate value="${parsedDate}" pattern="yyyy-MM-dd" /></span></td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="3">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<input type="hidden" name="pageIndex" id="pageIndex" value="<c:out value = "${bbscttVO.pageIndex}"/>">
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_List"/>
</div>
</form>

View File

@@ -0,0 +1,73 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : RejectAuthR.jsp
Description : 게시글 사용 권한 없을 시 권한 거부 페이지
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05-29 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
const authDv = $("#authDv").val();
const authResult = $("#authResult").val();
const bbsNm = $("#bbsNm").val();
if (authResult === 'N') { //권한 없음
if (authDv === "REDNG") {
alert(bbsNm + "을(를) 읽을 권한이 없습니다.\n고객센터에 문의해주세요.");
} else if (authDv === "REGIST") {
alert(bbsNm + "을(를) 등록할 권한이 없습니다.\n고객센터에 문의해주세요.");
}
} else if (authResult === 'NN') { //사용 여부 N
if (authDv === "REDNG") {
if(bbsNm.length > 0){
alert(bbsNm + "은(는) 현재 사용하지 않는 게시판입니다.");
} else {
alert("현재 사용하지 않는 게시판입니다.");
}
} else if (authDv === "REGIST") {
alert(bbsNm + "등록 기능은 현재 사용하지 않습니다.");
}
}
history.back();
});
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<input type = "hidden" id = "authDv" value = "<c:out value="${bbscttVO.authDv}"/>">
<input type = "hidden" id = "bbsNm" value = "<c:out value="${bbscttVO.bbsNm}"/>">
<input type = "hidden" id = "authResult" value = "<c:out value="${bbscttVO.authResult}"/>">
</div>
<div class="boxTab__content contentDiv">
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,716 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : SubPageListRForm.jsp
Description : 서브페이지
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-30 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function () {
fn_collect_event();
});
/****************************************************************
이벤트 함수
*****************************************************************/
const fn_collect_event = () => {
fn_remove_tag();
let boxTabTabBtn = $(".boxTab__tabBtn");
let boxTabContent = $(".boxTab__content");
/*초기세팅*/
/*요청 이벤트 아이디와 같은 box_tab과 content 'current' class 부여*/
const bbsId = $("#bbsId").val(); //게시판아이디 값
let index = 0;
boxTabTabBtn.each(function (idx) {
if ($(this).val() === bbsId) { // 현재 버튼의 값과 bbsId가 같은지 확인 후 종료
index = idx;
return false;
}
});
boxTabTabBtn.eq(index).addClass("current");
boxTabContent.eq(index).addClass("current");
let pageIndex = '<c:out value="${ resultMap.bbsctt.pageIndex }"/>';
if(!fn_is_empty($(".sub-rl"))){
$(".sub-tab__btn").eq(0).click(); //클래스 부여 로직 필요
//분류 선택
$(".sub-tab__btn").on("click", function () {
let idx = $(this).index();
$(".sub-tab__btn").not($(this)).removeClass("current");
$(this).addClass("current");
$("#srchitmInnb").val($(this).val());
fn_select_List(1, idx);
});
/*사이드바 current 부여*/
$(".cscMenu").each(function(){
if($(this).attr("id") === $("#bbsId").val()){
$(this).addClass("current");
}
});
}
fn_select_List(pageIndex, index);
/*box_tab 클릭 이벤트*/
$(".boxTab__tabBtn").on("click", function () {
const bbsId = $(this).val();
const idx = $(this).index();
const pgeVtcCnt = $(this).attr("pge-vtc-cnt");
const pgeWthCnt = $(this).attr("pge-wth-cnt");
const bbsTyCd = $(this).attr("bbs-ty-cd");
const sknTyCd = $(this).attr("skn-ty-cd");
$("#bbsId").val(bbsId);
$("#bbsTyCd").val(bbsTyCd);
$("#pgeVtcCnt").val(pgeVtcCnt);
$("#pgeWthCnt").val(pgeWthCnt);
$("#sknTyCd").val(sknTyCd);
$("#srchKeyword2").val("");
fn_select_List(1, idx);
});
/*'당첨자 발표'게시판 검색 클릭 시 검색 조건 같이 전송*/
$(document).on("click", "#srchBtn", function () {
if($("#bbsTyCd").val() === '03'){
fn_select_List(1, '', 'evtResult');
}else{
fn_select_List(1, '');
}
});
$(document).on('keydown', '#srchKeyword', function (event) {
if (event.keyCode === 13) {
event.preventDefault();
if ($("#bbsTyCd").val() === '03') {
fn_select_List(1, '', 'evtResult');
} else {
fn_select_List(1, '');
}
}
});
// 새로고침 이벤트 감지
$(window).on('beforeunload', function () {
$("#srchKeyword2").val("");
});
// F5 키(새로고침) 이벤트 감지
$(document).keydown(function (event) {
if (event.keyCode == 116) {
$("#srchKeyword2").val("");
}
});
//상세 조회(리스트형,갤러리형)
$(document).on("click", ".dtlBtn", function () {
const target = $(this).closest("a");
const bbscttInnb = target.find(".bbscttInnb").val();
fn_select_crud_posbl_at(bbscttInnb,'','','R');
});
//상세 조회(당첨자 발표)
$(document).on("click", ".eventResultDtl", function () {
const bbscttInnb = $(this).find(".bbscttInnb").val();
fn_select_crud_posbl_at(bbscttInnb,'','','R');
});
//상세 조회(아코디언형)
$(document).on("click", ".tr-foldable-trigger", function () {
const idx = $(this).index(".tr-foldable-trigger");
const bbsctt = $(this).attr("bbsctt");
const bbsId = $("#bbsId").val();
if (!$(this).next(".tr-foldable").hasClass("active")) {
fn_select_crud_posbl_at(bbsctt, idx,'','R');
} else {
$(this).next(".tr-foldable").removeClass("active");
}
});
//비밀번호 확인
$("#pwChkBtn").on("click", function () {
fn_check_password();
});
//등록페이지 이동
$(document).on("click", "#regBtn", function () {
const bbsId = $("#bbsId").val();
fn_move_regist(bbsId);
});
//수정 폼 이동 버튼
$(document).on('click','.updateBtn',function(){
const bbscttInnb = $(this).val();
fn_select_crud_posbl_at(bbscttInnb, '', '','U');
});
//삭제 모달 버튼
$(document).on('click','.deleteBtn',function(){
const bbscttInnb = $(this).val();
/*답변 유무에 따라 수정 여부 판단*/
fn_select_crud_posbl_at(bbscttInnb, '', '', 'D');
});
//삭제 버튼
$(document).on('click','#alertDelBtn',function(){
const bbscttInnb = $(this).val();
const bbsId = $("#bbsId").val();
fn_delete_bbsctt(bbscttInnb,bbsId);
});
}
//crud 가능 판단
const fn_select_crud_posbl_at = (bbsctt, idx, pwCnfirmAt,crudDv) => {
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/csc/selectBbscttDtlMovePosblAt"/>',
data: {
"bbscttInnb": bbsctt,
"bbsId": $("#bbsId").val(),
"sknTyCd": $("#sknTyCd").val(),
"pwCnfirmAt": pwCnfirmAt,
"crudDv" : crudDv
},
success: function (data) {
data = JSON.parse(data.resBody.result);
fn_branch_bbsctt_posble(data, idx);
}
});
}
//상세보기 가능 판단 여부에 따른 분기 처리
const fn_branch_bbsctt_posble = (data, idx) => {
const moveAt = data.result.moveAt;
const vo = data.vo;
if (moveAt === 'YES' || vo.pwCnfirmAt === 'Y') {//본인 o
if(vo.crudDv === 'R') {
if ($("#sknTyCd").val() === '03') {
fn_make_bbsctt_dtl_cn(data, idx);
} else {
fn_move_dtl(vo.bbscttInnb);
}
} else if (vo.crudDv === 'U') {
fn_move_qaUpdt(vo.bbscttInnb);
} else if (vo.crudDv === 'D') {
fn_delete_bbsctt(vo.bbscttInnb, vo.bbsId);
}
} else if (moveAt === 'OTHER') {//다른이용자 o
$("#comment-update-pop").modal();
} else if (moveAt === 'LOGIN') {//로그인 o
$("#rejectLogin").modal();
} else {//비밀번호
$("#confirm_bbsctt_pw").modal();
$("#modalBbscttInnb").val(vo.bbscttInnb);
$("#modalIdx").val(idx);
$("#modalCrudDv").val(vo.crudDv);
}
}
/*아코디언형 내용, 답변 펼침*/
const fn_make_bbsctt_dtl_cn = (data,idx) => {
if(data.dtl){
const dtl = data.dtl.dataMap;
const answ = data.answ;
const dtlSj = dtl.regusrDvCd == '02' ? dtl.sj : escapeHTML(dtl.sj);
const dtlCn = dtl.regusrDvCd == '02' ? dtl.sj : escapeHTML(dtl.cn);
let cn = `<td colspan="100%">
<div class="tr-foldable__content">
<div class="tr-foldable__qna">
<i class="icon icon_qna-q"></i>
<div class="tr-foldable__qna-content">
<p class="tr-foldable__qna-title">\${dtlSj}</p>
<div class="cn">\${dtlCn}</div>
<div class="file">`;
const cdnurl = '${cdnurl}';
if(data.dtl.fileInfo != null){
data.dtl.fileInfo.forEach(function(file){
cn += `<img src = '\${cdnurl}\${file.filCours}\${file.sysFilNm}' onerror ="this.src='/pc/images/image_placeholder.png'" alt="">`;
});
}
cn += ` </div>
</div>
</div>
<div class="tr-foldable__qna">
<i class="icon icon_qna-a"></i>
<div class="tr-foldable__qna-content">`;
let answAt;
if(answ != null){
cn += `<p class="tr-foldable__qna-title answSj">
\${answ.sj}
</p>
<div class="cn ck-content">
\${answ.cn}
</div>`;
answAt = 'Y';
}else{
cn += `답변 등록 중 입니다.`;
answAt = 'N';
}
cn += ` </div>
</div>
<div class="tr-foldable__btn-container">
<input type="hidden" name="answAt" value='\${answAt}'>
<input type="hidden" name="bbscttInnb" value='\${dtl.bbscttInnb}'>
<button type='button' class='btn theme outline updateBtn' answ-at='\${answAt}'>수정</button>
<button type='button' class='btn outline deleteBtn' value='\${dtl.bbscttInnb}'>삭제</button>
</div>
</div>
</td>`;
var trFoldable = $(".tr-foldable");
trFoldable.eq(idx).html(cn);
trFoldable.not(trFoldable.eq(idx)).removeClass("active");
trFoldable.eq(idx).toggleClass("active");
}
}
/********************************************************************
* 비밀번호 확인 (조회)
* success시
* 아코디언형 : 해당 내용 노출
********************************************************************/
const fn_check_password = () => {
const password = $("#modalPw").val();
if (password === '') {
alert("비밀번호를 입력해주세요");
} else {
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/csc/selectBbscttComparPassword"/>',
data: {
"bbscttInnb": $("#modalBbscttInnb").val(),
"password": password
},
success: function (data) {
const result = JSON.parse(data.resBody.result);
/*비밀번호 확인 결과*/
const resultVal = result["pw"];
if (resultVal > 0) {
$("#closeBtn").click();
fn_select_crud_posbl_at($("#modalBbscttInnb").val(), $("#modalIdx").val(), 'Y',$("#modalCrudDv").val());
} else {
alert("비밀번호가 일치하지 않습니다.");
}
$("#modalPw").val("");
}
});
}
}
//리스트 내 내용 보일시 html 제거
const fn_remove_tag = () => {
let htmlTag = '';
let text = '';
const targetEle = $(".cn");
if (targetEle.length > 0) {
targetEle.each(function () {
htmlTag = $(this).val();
text = $(htmlTag).text();
if (text.length > 20) {
text = text.substring(0, 20) + "...";
}
$(this).closest("span").text(text);
});
}
}
//input 생성 함수
const fn_create_input = (name, value, tgtForm) => {
const input = document.createElement('input');
input.setAttribute("type", "hidden");
input.setAttribute("name", name);
input.setAttribute("value", value);
tgtForm.appendChild(input);
}
//등록페이지 이동 (c)
const fn_move_regist = (bbsId) => {
const form = document.createElement("form");
form.id = "registForm";
form.action = "/sopmal/csc/selectBbscttRegistForm";
form.method = "POST";
fn_create_input("bbsId", bbsId, form);
//요청페이지가 게시글 리스트 일 때
fn_create_input("listAt", 'list', form);
fn_create_input("authDv", 'REGIST', form);
fn_create_input("reqUrl", "subPage", form);
document.body.appendChild(form);
form.submit();
}
//상세조회 (R)
const fn_move_dtl = (bbscttInnb) => {
const hiddenForm = $("#hiddenForm");
if (hiddenForm.length > 0) {
hiddenForm.remove();
}
const form = document.createElement("form");
form.id = "hiddenForm";
//form.action = "/sopmal/csc/selectBbscttAuth";
form.action = "/sopmal/csc/selectBbscttAuth";
form.method = "GET";
let pageIndex = $("#pageIndex").val();
if (pageIndex === '') {
pageIndex = "1";
}
//fn_create_input("pageIndex", pageIndex, form);
if(!fn_is_empty($("#srchKeyword").val())){
fn_create_input("srchKeyword", $("#srchKeyword").val(), form);
fn_create_input("srchDv", $("#srchDv").val(), form);
}
//fn_create_input("useAt", "Y", form);
//fn_create_input("expsrAt", "Y", form);
//fn_create_input("prevNext",$("#prevNext").val(), form);
//fn_create_input("recomendGoodsExpsrAt",$("#recomendGoodsExpsrAt").val(), form);
fn_create_input("authDv", "CM", form); //권한체크
fn_create_input("bbsTyCd", $("#bbsTyCd").val(), form);
fn_create_input("bbscttInnb", bbscttInnb, form);
fn_create_input("reqUrl","subPage", form);
fn_create_input("bbsId", $("#bbsId").val(), form);
fn_create_input("cscAt", $("#cscAt").val(), form);
/*let pageUnit = '';
//페이지 유닛 계산
const pgeVtcCnt = $("#pgeVtcCnt").val();//ROW
const pgeWthCnt = $("#pgeWthCnt").val();//COL
pageUnit = pgeVtcCnt * pgeWthCnt;
if (pgeWthCnt === '') {
pageUnit = 10;
}
fn_create_input("pageUnit", pageUnit, form);*/
document.body.appendChild(form);
form.submit();
}
//리스트 조회(R)
const fn_select_List = (pageIndex, idx, reqDv) => {
//이벤트 게시판, 일반게시판 구분
if (idx === undefined || idx === '') {
const bbsId = $("#bbsId").val(); //게시판아이디 값
//이벤트 게시판
if ($(".boxTab__tabBtn").length > 0) {
$(".boxTab__tabBtn").each(function (index) {
if ($(this).val() === bbsId) {
idx = index;
return false;
}
});
} else { //일반 게시판
idx = 0;
}
}
//게시판 스킨 타입
const sknTyCd = $("#sknTyCd").val();
//게시판 타입
const bbsTyCd = $("#bbsTyCd").val();
//페이지 인덱스
if (!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
let url;
//페이지 유닛 구하기
let pageUnit = '';
let pgeVtcCnt = $("#pgeVtcCnt").val()
let pgeWthCnt = $("#pgeWthCnt").val();//열 개수
//갤러리 페이지 유닛 계산
if (sknTyCd === '02') {
pageUnit = pgeVtcCnt * pgeWthCnt;
} else {
if (pgeVtcCnt.length > 0) {
pageUnit = $("#pgeVtcCnt").val();
} else {
pageUnit = 10;
}
}
//게시판 타입, 스킨 타입에 따른 url 분기
if (bbsTyCd === '01' || bbsTyCd === '08') {
//일반게시글 스킨타입
if (sknTyCd === '01') {
url = '/sopmal/csc/selectCscListTy';//리스트
} else if (sknTyCd === '02') {
url = '/sopmal/csc/selectCscGalaryTy';//갤러리
} else {
url = '/sopmal/csc/selectCscAcordionTy';//아코디언
}
} else if (bbsTyCd === '03') {
url = '/sopmal/csc/selectEvtListInqire'//이벤트
} else if (bbsTyCd === '09') {
url = '/sopmal/csc/selectMgznListInqire'//매거진
} else if (bbsTyCd === '11') {
url = '/sopmal/csc/selectEvtResultListInqire'//이벤트결과
}
$("#srchKeyword2").val($("#srchKeyword").val());
//검색폼
let srchForm = $("#srchForm").serialize();
srchForm = srchForm + "&pageIndex=" + pageIndex + "&pageUnit=" + pageUnit;
$.ajax({
type: "post",
data: srchForm,
url: url,
success: function (data) {
$(".contentDiv").empty();
if(fn_is_empty($(".sub-rl"))){
if ($(".sub-tab__trigger").length > 0) {
$(".contentDiv").eq($(".sub-tab__content.current").index()).html(data);
} else {
$(".contentDiv").eq(idx).html(data);
}
}else{
$(".contentDiv").eq(idx).html(data);
}
if(sknTyCd === '03'){ /*아코디언 타입 내용 html로 변환 */
$(".cn").each(function(idx2){
$(".cn").eq(idx2).html(escapeHTML($(this).text()));
});
}
}
});
}
//게시글 수정폼 (U)
const fn_move_qaUpdt = (bbscttInnb) => {
const hiddenForm = $("#hiddenForm");
if (hiddenForm.length > 0) {
hiddenForm.remove();
}
const form = document.createElement("form");
form.id = "hiddenForm";
form.action = "/sopmal/csc/selectBbscttUpdtForm";
form.method = "POST";
fn_create_input("bbscttInnb", bbscttInnb, form);
fn_create_input("bbsId", $("#bbsId").val(), form);
fn_create_input("pageIndex", $("#pageIndex").val(), form);
fn_create_input("listAt", "list", form);
fn_create_input("reqUrl", "subpage", form);
document.body.appendChild(form);
form.submit();
}
//게시글 삭제
const fn_delete_bbsctt = (bbscttInnb, bbsId) => {
if(confirm('<spring:message code="confirm.common.delete"/>')){
$.ajax({
type: "post",
url: "/sopmal/csc/deleteBbscttDel",
data: {
"delBbscttInnbArr": bbscttInnb,
"bbsId": bbsId
},
success: function () {
alert('<spring:message code="success.common.delete"/>');
fn_select_List(1);
}
});
}
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<%--게시판 정보--%>
<c:set var="bbsInfo" value="${resultMap.bbsInfo}"/>
<%--분류 목록--%>
<c:set var="itmList" value="${resultMap.itmList}"/>
<%--vo--%>
<c:set var="bbscttVO" value="${resultMap.bbsctt}"/>
<div class="sub-wrapper">
<div class="sub-content">
<form id="srchForm">
<%--게시판 정보--%>
<input type="hidden" name="bbsId" id = "bbsId" value = "<c:out value="${bbsInfo.bbsId}"/>">
<input type="hidden" name="sknTyCd" id = "sknTyCd" value = "<c:out value="${bbsInfo.sknTyCd}"/>">
<input type="hidden" name="bbsTyCd" id = "bbsTyCd" value = "<c:out value="${bbsInfo.bbsTyCd}"/>">
<%--갤러리 열,행 개수--%>
<input type="hidden" name="pgeVtcCnt" id = "pgeVtcCnt" value = "<c:out value="${bbsInfo.pgeVtcCnt}"/>">
<input type="hidden" name="pgeWthCnt" id = "pgeWthCnt" value = "<c:out value="${bbsInfo.pgeWthCnt}"/>">
<input type="hidden" name="recomendGoodsExpsrAt" id = "recomendGoodsExpsrAt" value = "<c:out value="${bbsInfo.recomendGoodsExpsrAt}"/>">
<input type="hidden" name="slangFlterUseAt" id = "slangFlterUseAt" value = "<c:out value="${bbsInfo.slangFlterUseAt}"/>">
<input type="hidden" name="useAt" id = "useAt" value = "Y">
<input type="hidden" name="ntcAt" id = "ntcAt" value = "Y">
<input type="hidden" name="expsrAt" id = "expsrAt" value = "Y">
<input type="hidden" name="srchDv" id = "srchDv2" value = "any">
<input type="hidden" name="srchitmInnb" id = "srchitmInnb" value = "">
<input type="hidden" name="prevNext" id = "prevNext" value = "<c:out value="${bbsInfo.prevNext}"/>">
<input type="hidden" name="srchKeyword" id = "srchKeyword2" value = "<c:out value="${bbscttVO.srchKeyword}"/>">
<input type="hidden" name="cscAt" id = "cscAt" value = "<c:out value="${bbscttVO.cscAt}"/>">
</form>
<c:choose>
<c:when test = "${bbscttVO.cscAt eq 'Y'}">
<div class="sub-rl">
<jsp:include page="/WEB-INF/views/comm/csc/CscLeft.jsp"/>
<div class="sub-right-content">
<h3 class="sub-right-content__title" id = "bbsNm"><c:out value="${bbsInfo.bbsNm}"/></h3>
<form id="srchForm">
<div class="customer-search">
<div class="customer-search__row">
<input class="input-text customer-search__search" type="search" title="검색어 입력"
id ="srchKeyword" name="srchKeyword" placeholder="궁금하신 내용을 입력해 주세요" value="${bbscttVO.srchKeyword}">
<button type="button" class="btn md dark" id = "srchBtn">검색</button>
</div>
</div>
</form>
<c:choose>
<c:when test="${not empty itmList}">
<div class="sub-tab">
<div class="sub-tab__trigger">
<button class="sub-tab__btn current">전체</button>
<c:forEach var="item" items="${itmList}">
<button class="sub-tab__btn" value="<c:out value="${item.itmInnb}"/>"><c:out value="${item.itmCn}"/></button>
</c:forEach>
</div>
<c:forEach var="i" begin="0" end="${fn:length(itmList)}">
<div class="sub-tab__content">
<div class="contentDiv"></div>
</div>
</c:forEach>
</div>
</c:when>
<c:otherwise>
<div class="contentDiv"></div>
</c:otherwise>
</c:choose>
</div>
</div>
</c:when>
<c:otherwise>
<div class="page-title center">
<c:choose>
<c:when test = "${bbsInfo.evt eq 'Y'}">
<h2 class="page-title__title">이벤트</h2>
</c:when>
<c:otherwise>
<h2 class="page-title__title" id = "bbsNm"><c:out value="${bbsInfo.bbsNm}"/></h2>
</c:otherwise>
</c:choose>
</div>
<%--이벤트게시판--%>
<c:if test = "${bbsInfo.bbsTyCd eq '03' || bbsInfo.bbsTyCd eq '11'}">
<c:set value="N" var="resultUsAt"/><%--당첨자발표 게시판이 있는 지 확인--%>
<c:forEach var = "evtBbsList" items="${resultMap.evtBbsList}">
<c:if test = "${evtBbsList.resultUsAt eq 'Y'}">
<c:set value="Y" var="resultUsAt"/>
</c:if>
</c:forEach>
<c:if test = "${resultUsAt eq 'Y'}">
<div class="boxTab">
<c:if test = "${not empty resultMap.evtBbsList}">
<c:forEach var = "evtBbsList" items="${resultMap.evtBbsList}">
<button type = "button" class="boxTab__tabBtn"
value="<c:out value="${evtBbsList.bbsId}"/>"
pge-vtc-cnt = "<c:out value="${evtBbsList.pgeVtcCnt}"/>"
pge-wth-cnt="<c:out value="${evtBbsList.pgeWthCnt}"/>"
bbs-ty-cd="<c:out value="${evtBbsList.bbsTyCd}"/>"
skn-ty-cd="<c:out value="${evtBbsList.sknTyCd}"/>">
<c:out value="${evtBbsList.bbsNm}"/>
</button>
</c:forEach>
</c:if>
</div>
</c:if>
</c:if>
<c:choose>
<c:when test = "${bbsInfo.bbsTyCd eq '03'||bbsInfo.bbsTyCd eq '11'}">
<c:if test = "${not empty resultMap.evtBbsList}">
<c:forEach var = "evtBbsList" items="${resultMap.evtBbsList}">
<div class="boxTab__content contentDiv">
</div>
</c:forEach>
</c:if>
</c:when>
<c:otherwise>
<div class="contentDiv">
</div>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<%--비밀번호 확인 모달--%>
<div id="confirm_bbsctt_pw" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
등록시에 입력했던 비밀번호를 입력해 주세요
</p>
<input class="input-text alert-content__pwInput" type="password" title="비밀번호 입력" placeholder="비밀번호 입력" name="password" id = "modalPw">
<input type="hidden" name="bbscttInnb" id = "modalBbscttInnb">
<input type="hidden" id = "modalIdx">
<input type="hidden" id = "modalAnswAt">
<input type="hidden" id = "reqAction">
<input type="hidden" id = "modalCrudDv">
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--cancel" id = "closeBtn">취소</a>
<button type = "button" class="alert-btn alert-btn--confirm" id="pwChkBtn">확인</button>
</div>
</div>
<%--<!-- 질문 수정 모달 -->--%>
<div id="qna-edit" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
답변이 등록된 상태입니다.
<br>
수정하실 수 없습니다.
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--confirm">확인</a>
</div>
</div>
<%--이용자가 회원인데 작성자와 다를 시--%>
<div id="comment-update-pop" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
글작성자만 이용가능합니다.
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--confirm">확인</a>
</div>
</div>
<%--이용자가 로그인 상태가 아닐 때--%>
<div id="rejectLogin" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
이용하시려면 로그인이 필요합니다!
<br>
로그인하시겠습니까?
</p>
</div>
<div class="alert-btn-container">
<a class="alert-btn alert-btn--confirm" onclick = "fn_move_login()"><spring:message code="button.yes"/></a>
<a href="#" rel="modal:close" class="alert-btn"><spring:message code="button.no"/></a>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,137 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : UseGuidanceR.jsp
Description : 이용안내 목록 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-11 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
let subTabBtn = $(".sub-tab__btn");
subTabBtn.on("click",function (){
let idx = $(this).index();
let itmInnb = $(this).val();
fn_select_cn(idx,itmInnb);
});
subTabBtn.eq(0).click();
/*사이드바 current 부여*/
$(".cscMenu").each(function () {
if ($(this).attr("id") === $("#bbsId").val()) {
$(this).addClass("current");
}
});
});
//내용 조회
const fn_select_cn = (idx,itmInnb) => {
$.ajax({
type: "post",
data: {
itmInnb : itmInnb,
bbsId : $("#bbsId").val(),
slangFlterUseAt : $("#slangFlterUseAt").val()
},
url: "/sopmal/csc/selectUseGuidanceInqire",
success: function (data) {
fn_set_cn(idx,data);
}
});
}
// 내용 set
const fn_set_cn = (idx, data) => {
let cn = '';
data = JSON.parse(data.resBody.result);
if (data.resultList.length > 0) {
data.resultList.forEach(function(item) {
if (item!== null && item.cn !== null) {
cn += `\${item.cn}\<br>`;
}
});
} else { /*분류는 있으나 해당 분류의 게시글이 없을 때*/
cn = `<div class="addressManage__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="addressManage__no-result-text">
이용안내가 없습니다.
</p>
</div>
`;
}
const targetHtml = $(".sub-tab__content").eq(idx).find(".use-guide");
targetHtml.html(cn);
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<%--게시판 정보--%>
<c:set var="bbsInfo" value="${resultMap.bbsInfo}"/>
<%--분류 목록--%>
<c:set var="itmList" value="${resultMap.itmList}"/>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<jsp:include page="/WEB-INF/views/comm/csc/CscLeft.jsp"/>
<div class="sub-right-content">
<h3 class="sub-right-content__title">이용안내</h3>
<input type="hidden" id = "bbsId" name="bbsId" value="<c:out value='${bbsInfo.bbsId}'/>">
<input type="hidden" id = "slangFlterUseAt" name="slangFlterUseAt" value="<c:out value='${bbsInfo.slangFlterUseAt}'/>">
<div class="sub-tab">
<c:choose>
<c:when test = "${not empty itmList}">
<div class="sub-tab__trigger type02">
<c:forEach var="itm" items="${itmList}">
<button class="sub-tab__btn" value="<c:out value='${itm.itmInnb}'/>"><c:out value="${itm.itmCn}"/></button>
</c:forEach>
</div>
<c:forEach var="i" begin="0" end="${fn:length(itmList)}">
<div class="sub-tab__content">
<div class="use-guide">
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise><%--분류조차 없을 때 --%>
<div class="sub-tab__trigger type02">
<button class="sub-tab__btn" style="display:none;"></button>
</div>
<div class="sub-tab__content">
<div class="addressManage__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="addressManage__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</div>
</c:otherwise>
</c:choose>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,273 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
<%--
Class Name : temp.jsp
Description : 반품 환불 상품q&a 모달
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-25 김혜인 최초 생성
--%>
<%--
** 필요값 goodsInnb 상품고유번호
id = pop의 onclick 함수 적용하기
모달 div 영역 잡아주기
등록 스크립트 함수 부모jsp에 붙히기
--%>
<!DOCTYPE html>
<html lang="ko">
<script>
$(document).ready(function () {
fn_collect_event();
});
const fn_pop_regist = (goodsInnb) =>{
if(!goodsInnb){ /*나중에 지울거 (등록 대상 상품고유번호 연결시 삭제)*/
goodsInnb = '1023';
}
$.ajax({
type: "post",
data: {
authDv : "REGIST",
reqUrl : "refnd",
reqDv : "refnd",
bbsId : "goods_qna",
goodsInnb : goodsInnb,
regusr : "1325382", /*나중에 지울거*/
mbrDvCd : "GC" /*나중에 지울거*/
},
url: "/sopmal/csc/selectBbscttAuth",
success: function (data) {
/*파일중복제거*/
$(document).find("input[type=file]").remove();
/*모달중복제거*/
fn_close_modal("qna-pop");
$("#modalDv").html(data);
//내용 텍스트 <br>태그 엔터값으로 replace
const textarea = $("textarea[name=cn]");
let cn = textarea.attr("placeholder");
cn = fn_remove_tag(cn);
textarea.attr("placeholder", cn);
$("#qna-pop").modal();
fn_set_niceSelect_datePicker("#qna-pop");
}
});
}
/*textarea내 태그 제거 함수*/
const fn_remove_tag = (cn) => {
cn = cn.replaceAll(/<br>/ig, '\n');
cn = cn.replaceAll(/<\/br>/ig, '\n');
cn = cn.replaceAll(/<br \/>/ig, '\n');
//내용 내 태그 없애기
cn = cn.replace(/<\/?[^>]+(>|$)/g, "");
return cn;
}
/*********************************************************
* 게시글 등록
*********************************************************/
const fn_regist_bbsctt = function () {
let url = '<c:url value="/sopmal/csc/insertBbscttRegist"/>';
let saveForm = $('#bbsRegForm');
let formData = new FormData();
//파일 업로드
if($("#contact-dropzone").length > 0){
let myDropzone = Dropzone.forElement("#contact-dropzone");
myDropzone.files.forEach(function (file) {
formData.append("files", file);
});
}
$('.checkbox input[type="checkbox"]').each(function () {
if (!$(this).prop('checked')) {
fn_ctrl_disable([".checkbox"],);
}
});
//폼 내 input값 append
saveForm.serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
//사용자 등록 시 노출 여부 Y
formData.append("expsrAt", "Y");
if($("#slangFlterUseAt").val() === 'Y'){
let mskgSlang = "<c:out value = "${resultMap.bbsInfo.maskSlang}"/>";
formData.append("mskgSlang", mskgSlang);
}
if (confirm('게시글을 <spring:message code="confirm.common.insert"/>')) {
$.ajax({
type: 'post',
url: url,
enctype:"multipart/form-data",
data: formData,
processData: false,
contentType: false,
success: function (result) {
$("#result-alert").modal();
},
error:function(){
fn_ctrl_disable("",[".checkbox"]);
}
});
}
}
/*************************************************************
이벤트 함수
*************************************************************/
const fn_collect_event = () => {
//분류 change시 hidden value값 set
$(document).on('change', '#qesitmNmC', function () {
$("#qesitmInnb").val("");
$("#qesitmNm").val("");
$("#answCn").val("");
const option = $('option:selected', this);
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if ($(this).val() !== "") {
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmNm").val(qesitmNm);
$("#qesitmAt").val("Y");
} else {
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmNm").val("");
$("#qesitmAt").val("N");
}
});
//추가입력 항목 라디오 'click' 이벤트
$(document).on('click', '.answRadioC', function () {
const radio = $(this);
//추가입력 항목 내용 요소 get
const answ = radio.closest(".custom-radio-container").find('[name="answCnArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest(".custom-radio-container").find('[name="qesitmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest(".custom-radio-container").find('.answRadio');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest(".custom-radio-container").find('[name="itmInnbArr[]"]');
//라디오 클릭 시 disabled 비활성
if (radio.is(":checked")) {
//답변 내용 초기화
answ.val("");
const radioVal = $(radio).attr('itm-cn');
answ.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
radio.closest(".custom-radio-container").find(".answRadioAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
radio.closest(".custom-radio-container").find(".answRadioAt").val("N");
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
$(document).on('change', '.answSelectC', function () {
const select = $(this);
const answ = select.closest("td").find('[name="answCnArr[]"]');
const qesitmInnb = select.closest("td").find('[name="qesitmInnbArr[]"]');
const contrlTarget = select.closest("td").find('.answSelect');
const option = $('option:selected', this);
if (select.val() != "") {
//답변 내용 초기화
answ.val("");
const selectVal = $(option).attr('itm-cn');
answ.val(selectVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(option).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//셀렉트 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
select.closest("td").find(".answSelectAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
select.closest("td").find(".answSelectAt").val("N");
});
}
});
//추가입력 항목 체크박스 'click'이벤트
$(document).on('click', '.answChkC', function () {
const check = $(this);
const contrlTarget = check.closest("div").find('.answChk');
var isChecked = $(this).is(":checked");
//클릭한 체크박스 주위 input값 disable false처리
contrlTarget.each(function () {
if (isChecked) {
$(this).prop("disabled", false);
} else {
$(this).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = $('.answChkC:checked').length > 0;
contrlTarget.each(function () {
if (anyChecked) {
check.closest("td").find(".answChkAt").val("Y");
} else {
check.closest("td").find(".answChkAt").val("N");
}
});
});
//추가입력 항목 텍스트 'input'이벤트
$(document).on('input', '.answTxtC', function () {
const txt = $(this);
const contrlTarget = txt.closest(".input-grow-container").find('.answTxt');
const contrlAt = txt.closest(".input-grow-container").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
//파일 업로드
$(document).on("change", "#fileUpload", function () {
addFiles(event, 0);
});
//등록 버튼 이벤트
$(document).on("click", "#regBtn", function () {
fn_regist_bbsctt();
});
//등록 완료 모달 > 확인 버튼 이벤트 (새로고침)
$(document).on("click","#alertBtn",function(){
$(".close").each(function (){
$(this).click();
});
});
}
</script>
<button id = "pop" onclick="fn_pop_regist()">pop</button>
<%--상품q&a등록팝업--%>
<div id = "modalDv"></div>
</html>

View File

@@ -0,0 +1,478 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : RelateGoodsPopupR.jsp
Description : 장바구니 선택 팝업
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-07-23 유재현 최초 생성
--%>
<script defer>
//상품 타이틀, 수량, 가격 저장하는 배열
// 배열 순서 -> [상품명, 수량, 1개당 가격, 상품 총가격(=수량x개당가격), 추가정보(색상, 사이즈등)]
// $(document).ready(function () {
fn_set_niceSelect_datePicker('.select-box-addCart')
// });
//
// /*************************************************************
// 함께하면 좋은상품 이벤트 (모달)
// **************************************************************/
//
$('#addCart-product-popUp').on('modal:open', function (event, modal) {
//
// $('.select-box-addCart').niceSelect();
//
// // false로 설정시 라디오만 선택해도 상품 추가 가능
//
// //일반옵션
// // 라디오 버튼 클릭시, 상품 정보 배열에 추가 및 화면에 추가
$(".modal .productDetailInfo__option__item").each(function () {
$(this).find("input[type=radio]").on("change", function () { // 라디오 버튼 클릭 시
if ($(this).prop('checked') == false) return; // 체크 해제시 리턴
const $title = $(this).closest(".productDetailInfo__option__item").find("label").text();
const $price = $(this).closest(".productDetailInfo__option__item").find(".productDetailInfo__option__price").text();
const $goodsOptnInnb = $(this).closest(".productDetailInfo__option__item").find('input[name="goodsOptnInnb"]').val()
const $goodsOptnTy = $(this).closest(".productDetailInfo__option__item").find('input[name="goodsOptnTy"]').val()
const $optnInfo = $(this).closest(".productDetailInfo__option__item").find('.productDetailInfo__option__monthly-payment').text();
const $priceNum = parseInt($price.replace(/,/g, ""));
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = productArr.some(function (item) {
return item[4] === $goodsOptnInnb;
});
if (isItemAlreadyAdded){
fn_goods_duplicate_select_modal()
return;
}
productArr.push([$title, 1, $priceNum, $priceNum * 1, $goodsOptnInnb, $goodsOptnTy]); // 배열에 상품 정보 추가
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">'+$optnInfo+'</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $price +
'</div>' +
'</div>' +
'</div>'
);
updateCartCounters(); // 화면에 상품 정보 업데이트
});
});
// 총 상품금액
var $cartTotalPrice = $(".modal .product-total__price__totalPriceNum");
// 수량 "-", "+" 버튼 클릭 시, 수량 증감 및 가격 변경 및 총 상품금액 변경
$("#cartCountContainer").on("click", ".productDetailInfo__count__amountBtn", function () { // 수량 버튼 클릭 시
var $counter = $(this);
var $index = $counter.closest(".productDetailInfo__count").index(); // 해당 상품의 인덱스
if ($(this).hasClass("minus")) { // "-" 버튼 클릭 시
if (productArr[$index][1] <= 1) return;
productArr[$index][1]--; // 배열에서 해당 상품의 수량 감소
productArr[$index][3] = productArr[$index][1] * productArr[$index][2]; // 배열에서 해당 상품의 총 가격 변경
} else { // "+" 버튼 클릭 시
productArr[$index][1]++; // 배열에서 해당 상품의 수량 증가
productArr[$index][3] = productArr[$index][1] * productArr[$index][2]; // 배열에서 해당 상품의 총 가격 변경
}
updateCartCounters(); // 화면에 상품 정보 업데이트
})
//
// //배열 내용을 바탕으로 각 아이템 텍스트 변경
function updateCartCounters() {
$(".modal .productDetailInfo__count").each(function () {
var $counter = $(this);
var $index = $counter.index();
var $number = $counter.find(".productDetailInfo__count__amountNumber");
var $price = $counter.find(".productDetailInfo__count__priceNum");
$number.text(productArr[$index][1]);
$price.text(addComma(productArr[$index][3]) + "원");
});
updateCartTotalPrice(); // 총 상품금액 업데이트
}
// 3자리마다 "," 추가
function addComma(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
// 총 상품금액 업데이트
function updateCartTotalPrice() {
var totalPrice = 0; // 총 상품금액
for (var i = 0; i < productArr.length; i++) {
totalPrice += productArr[i][3]; // 배열의 총 가격을 더함
}
$cartTotalPrice.text(addComma(totalPrice)); // 총 상품금액 텍스트 변경
}
// x버튼 클릭 시 삭제
$("#cartCountContainer").on("click", ".productDetailInfo__count__amountDelete", function () { // x 버튼 클릭 시
var $index = $(this).closest(".productDetailInfo__count").index();
productArr.splice($index, 1); // 배열에서 해당 상품 삭제
$(this).closest(".productDetailInfo__count").remove(); // 화면에서 해당 상품 삭제
updateCartCounters(); // 화면에 상품 정보 업데이트
//일반옵션이 하나일 경우 라디오 체크 해제(품절상품 제외) || 필수옵션 01이 상품 배열에 하나도 없을 경우
if($('#productDetail .custom-radio:not(:has(span))').length ===1
|| productArr.filter(item => item[5] === '01').length === 0){
$("input[name='r-group01']").prop('checked', false)
}
});
// // // 마지막으로 생성된 상품에 각인 정보 추가
// // $('#cartAddTextBtn').on('click', function () {
// // var $index = $(".modal .productDetailInfo__count").length - 1;
// // var $text = $('#cartAddTextInput').val();
// // $(".modal .productDetailInfo__count").eq($index).find(".productDetailInfo__count__amountTop").append('<div class="productDetailInfo__count__additionalSelect">각인문구 : ' + $text + '</div>');
// //
// // });
//
//재고옵션
$('#cartAdditionalSelect').on("change", "select", function () { // 셀렉트 선택 시
if ($('#cartAdditionalSelect').find('.option.selected.disabled').length > 0) return;
if ($('#cartAdditionalSelect').find('.option.selected').length == $('#cartAdditionalSelect').find('.nice-select').length) { // 모든 셀렉트가 선택되면
var $title = $('#addCartGoodsNm').val();
var $optInfo = $(this).closest(".productDetailInfo__additionalSelect__item").find(".option.selected").attr("data-value").split('|');
var $priceNum = $optInfo[0];
var $goodsOptnInnb = $optInfo[1];
var $goodsOptnInfo = $optInfo[2];
var $goodsOptnTy = $optInfo[3];
var arr = [];
for (var i = 0; i < $('#cartAdditionalSelect').find('.nice-select').length; i++) {
arr.push($('#cartAdditionalSelect').find('.nice-select').eq(i).find('.option.selected').text());
}
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = productArr.some(function (item) {
return item[4] === $goodsOptnInnb;
});
if (isItemAlreadyAdded) {
fn_goods_duplicate_select_modal()
return;
}
productArr.push([$title, 1, $priceNum, $priceNum * 1, $goodsOptnInnb, $goodsOptnTy, arr]); // 배열에 상품 정보 추가
let cartAdditionalSelectText = '옵션 : ' + arr.join(' / ').replace(/\(\+.*?\)/g, ''); // 추가정보 텍스트로 변환
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<div class="productDetailInfo__count__additionalSelect">' + cartAdditionalSelectText + '</div>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">' + $goodsOptnInfo + '</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $priceNum +
'</div>' +
'</div>' +
'</div>'
);
}
updateCartCounters(); // 화면에 상품 정보 업데이트
});
// 추가구성옵션
$("#cartMoreItemsSelect").on("change",'select', function () {
var $moreItems = $('#cartMoreItemsSelect').find(".productDetailInfo__additionalSelect__item");
const $optInfoOptn3 = $(this).closest(".productDetailInfo__additionalSelect__item").find(".option.selected").attr("data-value").split('|');
const $priceNumOptn3 = $optInfoOptn3[0];
const $goodsOptnInnbOptn3 = $optInfoOptn3[1];
const $goodsOptnInfoOptn3 = $optInfoOptn3[2];
const $goodsOptnTyOptn3 = $optInfoOptn3[3];
const $optnEssnlAtOptn3 = $(this).closest(".productDetailInfo__additionalSelect__item").find('input[name="productDetailInfo__additionalSelect__otpnEssntlAt__relate__added"]').val();
// $moreItems.each(function () {
// if ($(this).find('.option.selected.disabled').length > 0) return;
var $title = $moreItems.find(".option.selected").text().replace(' ','').trim().replace('선택', ' ').replace(/\(\+.*?\)/g, '');
var $priceNum = $(this).find(".option.selected").attr("data-value");
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = productArr.some(function (item) {
return item[4] === $goodsOptnInnbOptn3;
});
if (isItemAlreadyAdded){
fn_goods_duplicate_select_modal()
return;
}
productArr.push([$title, 1, $priceNumOptn3, $priceNumOptn3 * 1, $goodsOptnInnbOptn3, $goodsOptnTyOptn3, $optnEssnlAtOptn3]); // 배열에 상품 정보 추가
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">'+$goodsOptnInfoOptn3+'</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $priceNum +
'</div>' +
'</div>' +
'</div>'
);
$(this).val('').niceSelect('update')
updateCartCounters(); // 화면에 상품 정보 업데이트
// });
});
});
// })
// })
</script>
<div id="addCart-product-popUp" class="modal option">
<div class="option-header">
<div class="option-header__title">옵션 선택</div>
<input type="hidden" id="addCartGoodsInnb" value="${addCartResultMap.goodsDtl.goodsInnb}"/>
<input type="hidden" id="sopmalCd" value="${addCartResultMap.goodsDtl.sopmalCd}"/>
<input type="hidden" id="addCartGoodsNm" value="${addCartResultMap.goodsDtl.goodsNm}"/>
<input type="hidden" id="slepricDscntAmt" value="${addCartResultMap.goodsDtl.slepric }"/>
<c:forEach var="cardDv" items="${addCartResultMap.cartDvList}">
<input type="hidden" value="${cardDv.cd}" id="cartDv-${cardDv.cdNm}"/>
</c:forEach>
</div>
<div class="option-content">
<div class="product-unit product-unit--relatedProduct">
<div class="product-unit-image">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${addCartResultMap.goodsDtl.goodsInnb}"/>');">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${cdnurl}${fn:split(addCartResultMap.goodsDtl.img, '|')[0]}"/> " onerror="this.src='/pc/images/image_placeholder.png'" alt="상품 이미지">
</a>
</div>
<div class="product-unit-info">
<div class="product-unit-info__inner">
<div class="product-unit-title">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${addCartResultMap.goodsDtl.goodsInnb}"/>');"><c:out value="${addCartResultMap.goodsDtl.goodsNm}"/></a>
</div>
<div class="product-unit-price">
<div class="product-unit-price__price">
<span class="product-unit-price__original">
<span class="comma">
<fmt:formatNumber value="${addCartResultMap.goodsDtl.cnsmrpric}"/></span>
<span class="priceUnit"></span>
</span>
<span class="product-unit-price__current">
<span class="comma"> <fmt:formatNumber value="${addCartResultMap.goodsDtl.dcSlepric}"/></span>
<span class="priceUnit">원</span></span>
</div>
<div class="product-unit-price__sale">
<span class="percent">
<c:out value="${addCartResultMap.goodsDtl.dcPercent}"/>
%
</span>
</div>
</div>
</div>
</div>
</div>
<c:if test="${addCartResultMap.goodsDtl.goodsSttusCd ne '02' or addCartResultMap.goodsDtl.goodsSttusCd ne '03'}">
<c:choose>
<c:when test="${not empty addCartResultMap.optnList}">
<c:if test="${not empty addCartResultMap.optnList.normalOptnList}">
<div class="productDetailInfo__option">
<div class="productDetailInfo__option__box">
<c:forEach var="goodsOpt01" items="${addCartResultMap.optnList.normalOptnList}" varStatus="optList01">
<c:if test="${goodsOpt01.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOpt01.invntrySldoutExpsrAt eq 'Y'}">
<div class="productDetailInfo__option__item">
<c:if test="${not empty goodsOpt01.optnVal1}">
<div class="custom-radio is-medium">
<input type="radio" id="r-${goodsOpt01.optnOrdr}" value="${goodsOpt01.optnVal1}" name="r-group01" <c:if test="${goodsOpt01.disableAt eq 'Y'}"> disabled</c:if>>
<label for="r-${goodsOpt01.optnOrdr}">${goodsOpt01.optnVal1}</label>
<input type="hidden" name="optnCd" value="${goodsOpt01.optnCd1}">
<input type="hidden" name="goodsOptnInnb" value="${goodsOpt01.goodsOptnInnb}"/>
<input type="hidden" name="goodsOptnTy" value="${goodsOpt01.optnTy}"/>
<input type="hidden" name="goodsSopmalCd" value="${goodsOpt01.sopmalCd}"/>
<c:if test="${goodsOpt01.disableAt eq 'Y'}"> <span>(품절)</span></c:if>
</div>
<div class="productDetailInfo__option__right">
<span class="productDetailInfo__option__price"><span class="comma"><fmt:formatNumber value="${goodsOpt01.slepric}"/></span> <span class="priceUnit"> 원</span></span>
<span class="productDetailInfo__option__monthly-payment"><c:out value="${goodsOpt01.optnInfo}"/></span>
</div>
</c:if>
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
<c:if test="${not empty addCartResultMap.optnList.invntryOptnList}">
<div class="productDetailInfo__additionalSelect" id="cartAdditionalSelect">
<span class="productDetailInfo__option__title">옵션선택(필수)</span>
<div class="productDetailInfo__additionalSelect__inner">
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty addCartResultMap.optnList.invntryOptnList[0].optnNm1}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${addCartResultMap.optnList.invntryOptnList[0].optnNm1}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn1" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
<c:forEach var="goodsOpt02" items="${addCartResultMap.optnList.invntryOptnList}" varStatus="optList02">
<c:if test="${goodsOpt02.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOpt02.invntrySldoutExpsrAt eq 'Y'}">
<c:if test="${goodsOpt02.optnVal1 ne addCartResultMap.optnList.invntryOptnList[optList02.index-1].optnVal1}">
<option value="${goodsOpt02.slepric}|${goodsOpt02.goodsOptnInnb}|${goodsOpt02.optnInfo}|${goodsOpt02.optnTy}" <c:if test="${goodsOpt02.disableAt eq 'Y'}"> disabled </c:if> >
<c:out value="${goodsOpt02.optnVal1}"/>
</option>
</c:if>
</c:if>
</c:if>
</c:forEach>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty addCartResultMap.optnList.invntryOptnList[0].optnNm2}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${addCartResultMap.optnList.invntryOptnList[0].optnNm2}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn2" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty addCartResultMap.optnList.invntryOptnList[0].optnNm3}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${addCartResultMap.optnList.invntryOptnList[0].optnNm3}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn3" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty addCartResultMap.optnList.invntryOptnList[0].optnNm4}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${addCartResultMap.optnList.invntryOptnList[0].optnNm4}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn4" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
</div>
</div>
</c:if>
<c:if test="${not empty addCartResultMap.optnList.addedOptnList}">
<div class="productDetailInfo__additionalSelect" id="cartMoreItemsSelect">
<span class="productDetailInfo__additionalSelect__title">추가구성</span>
<div class="productDetailInfo__additionalSelect__inner">
<c:forEach var="goodsOpt03" items="${addCartResultMap.optnList.addedOptnList}" varStatus="optList03">
<c:if test="${not empty goodsOpt03.optnNm1}">
<c:if test="${addCartResultMap.optnList.addedOptnList[optList03.index-1].optnNm1 ne goodsOpt03.optnNm1}">
<div class="productDetailInfo__additionalSelect__item">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${goodsOpt03.optnNm1}"/> </span>
<input type="hidden" name="productDetailInfo__additionalSelect__otpnEssntlAt__relate__added" <c:if test="${goodsOpt03.optnEssntlAt eq 'Y'}"> value="Y"</c:if>/>
</c:if>
<c:if test="${addCartResultMap.optnList.addedOptnList[optList03.index-1].optnNm1 ne goodsOpt03.optnNm1}">
<div class="select-box-addCart">
<select title="${goodsOpt03.OptnInfo}" name="selectRelateAddedOptn">
<option value="" disabled selected><c:out value="선택"/></option>
<c:forEach var="goodsOptVal03" items="${addCartResultMap.optnList.addedOptnList}" varStatus="optVal03">
<c:if test="${goodsOptVal03.optnNm1 eq goodsOpt03.optnNm1}">
<c:if test="${goodsOptVal03.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOptVal03.invntrySldoutExpsrAt eq 'Y'}">
<option value="${goodsOptVal03.slepric}|${goodsOptVal03.goodsOptnInnb}|${goodsOptVal03.optnInfo}|${goodsOptVal03.optnTy} " <c:if test="${goodsOptVal03.disableAt eq 'Y'}"> disabled</c:if> ><c:out value="${goodsOptVal03.optnVal1}"/> (+ <fmt:formatNumber value="${goodsOptVal03.slepric}"/>) <c:if test="${goodsOptVal03.disableAt eq 'Y'}"> <c:out value="(품절)"/> </c:if> </option>
</c:if>
</c:if>
</c:if>
</c:forEach>
</select>
</div>
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
<%-- <div class="productDetailInfo__confirmOption">--%>
<%-- <button class="btn md outline" id="cartMoreItemsButton">입력한 정보 선택</button>--%>
<%-- </div>--%>
<%--TODO :: 입력옵션 --%>
<%-- <div class="productDetailInfo__option">--%>
<%-- <span class="productDetailInfo__option__title">상품정보 입력</span>--%>
<%-- <div class="productDetailInfo__additionalSelect__inner">--%>
<%-- <div class="productDetailInfo__additionalSelect__item">--%>
<%-- <span class="productDetailInfo__additionalSelect__category">각인 옵션</span>--%>
<%-- <input id="cartAddTextInput" class="input-text full" type="text" title="해당 인풋에 대한 설명"--%>
<%-- placeholder="각인 문구를 입력해주세요" value="">--%>
<%-- <button id="cartAddTextBtn" class="btn outline">저장</button>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- </div>--%>
<div id="cartCountContainer">
</div>
</div>
</c:when>
<c:otherwise>
<%--옵션 없을 경우 빈값--%>
</c:otherwise>
</c:choose>
</c:if>
<div class="product-total__container">
<span class="product-total__text">총 상품금액</span>
<span class="product-total__price">
<span class="product-total__price__totalPriceNum">0</span>
<span class="won">원</span>
</span>
</div>
<c:choose>
<c:when test="${addCartResultMap.goodsDtl.buttonRplcWordsUseAt ne 'Y'}">
<div class="product-btn-container">
<button type="button" class="btn theme large addCart">장바구니 담기</button>
<button type="button" class="btn theme large purchsOrdr">구매하기</button>
</div>
</c:when>
<c:otherwise>
<div class="product-btn-container">
<a href="${addCartResultMap.goodsDtl.pcButtonRplcLink}"
<c:if test="${addCartResultMap.goodsDtl.buttonRplcLinkBrwsrDvCd eq '01'}"> target="_blank" </c:if> >
<button class="btn theme large"><c:out value="${addCartResultMap.goodsDtl.buttonRplcWords}"/></button>
</a>
</div>
</c:otherwise>
</c:choose>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,168 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : GoodsListR.jsp
Description : 상품 목록 리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 리브가
--%>
<div class="left">
<div class="search-number">
<span class="search-number__text">총 <strong><c:out
value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
</div>
</div>
<c:choose>
<c:when test="${ not empty resultMap.list }">
<div class="subList__content">
<div class="product-list-type1">
<div class="product-list-type1__list">
<c:forEach items="${ resultMap.list }" var="list" varStatus="status">
<div class="product-unit">
<div class="product-unit-image">
<c:if test="${(list.evtTmeExpsrAt eq 'Y' and list.remainTime ne 'N')
or (list.rltmQyBannerExpsrAt eq 'Y' and list.remainQy > 0) }">
<div class="time-sale__top">
<c:if test="${list.evtTmeExpsrAt eq 'Y' and list.remainTime ne 'N'}">
<span class="time" id="remainTime${status.index}" name="remainTime"><c:out
value="${list.remainTime}"/> </span>
<input type="hidden" id="evtTmeExpsrAt${status.index}" name="evtTmeExpsrAt"
value="${list.evtTmeExpsrAt}">
</c:if>
<c:if test="${list.rltmQyBannerExpsrAt eq 'Y' and list.remainQy > 0 }">
<span class="left">남은수량 <fmt:formatNumber value="${list.remainQy}"/> 개</span>
</c:if>
</div>
</c:if>
<%-- 상품 상태에 따른 분기--%>
<c:choose>
<c:when test="${list.goodsSttusCd eq '02'}">
<div class="sold-out">
<span>SOLD OUT</span>
</div>
</c:when>
<c:when test="${list.goodsSttusCd eq '03'}">
<div class="sold-out">
<span>${list.goodsSttusNm}</span>
</div>
</c:when>
</c:choose>
<form id="detailForm">
<a class="product-detail" href="javascript:void(0);"
onclick="fn_move_goods_dtl('<c:out value="${list.goodsInnb}"/>'); ">
<spring:eval
expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')"
var="cdnurl"/>
<img src="<c:out value="${cdnurl}${list.goodsImgCours}"/>"
onerror="this.src='/pc/images/image_placeholder.png'"
alt="${list.goodsNm}"/>
</a>
</form>
<c:if test="${not empty list.pricRplcWordsUseAt and list.pricRplcWordsUseAt ne 'Y'}">
<button type="button" class="product-unit-addToCart" onclick="fn_open_addCart_modal
('#addGoodsCartDiv', '#addCart-product-popUp', '/sopmal/goods/selectAddCartGoodsPopup',
JSON.stringify({'goodsInnb' : `${list.goodsInnb}`}))">
<i class="icon icon_product-unit-addToCart"></i>
<span class="visually-hidden">장바구니에 담기</span>
</button>
</c:if>
</div>
<div class="product-unit-info d-flex flex-column" style="flex-direction:column">
<c:if test="${not empty list.iconCdNmList}">
<c:if test="${list.iconExpsrAt eq 'Y'}">
<div class="product-badge-container col order-${list.iconExpsrOrdr-1}" style="order: ${list.iconExpsrOrdr-1} ">
<c:forEach items="${fn:split(list.iconCdNmList, ',')}" var="iconCdNm" varStatus="iconStatus">
<c:choose>
<c:when test="${fn:contains(iconCdNm, '-')}">
<span class="product-badge ${fn:toLowerCase(iconCdNm)}">${fn:replace(fn:toUpperCase(iconCdNm), '-', ' ')}</span>
</c:when>
<c:otherwise>
<span class="product-badge ${fn:toLowerCase(iconCdNm)}">${fn:toUpperCase(iconCdNm)}</span>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</c:if>
</c:if>
<%-- <div class="product-unit-info__inner">--%>
<c:if test="${list.goodsNmExpsrAt eq 'Y'}">
<div class="product-unit-title col order-${list.goodsNmExpsrOrdr-1}" style="order:${list.goodsNmExpsrOrdr-1} ">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${list.goodsInnb}"/>');"><c:out value="${list.goodsNm}"/></a>
</div>
</c:if>
<c:if test="${list.pricExpsrAt eq 'Y'}">
<c:choose>
<c:when test="${not empty list.pricRplcWordsUseAt and list.pricRplcWordsUseAt ne 'Y'}">
<div class="product-unit-price col order-${list.pricExpsrOrdr-1}" style="order: ${list.pricExpsrOrdr-1}">
<div class="product-unit-price__price">
<span class="product-unit-price__original"><fmt:formatNumber
value="${list.cnsmrpric}"/> 원</span>
<span class="product-unit-price__current"><fmt:formatNumber
value="${list.slepric}"/> 원</span>
</div>
<div class="product-unit-price__sale">
<span class="percent"> <c:out value="${list.slePercent}"/> %</span>
</div>
</div>
</c:when>
<c:otherwise>
<div class="productDetailInfo__price">
<a href="${list.pcPricRplcLink}" <c:if test="${list.pricRplcLinkBrwsrDvCd eq'01'}"> target="_blank" </c:if> >
<span class="" style="font-size: 1rem;"> <c:out value="${list.pricRplcWords}"/></span>
</a>
</div>
</c:otherwise>
</c:choose>
</c:if>
<c:if test="${list.reprsntDcExpsrAt eq 'Y'}">
<div class="product-unit-price__monthly-payment col order-${list.reprsntDcExpsrOrdr-1}" style="order: ${list.reprsntDcExpsrOrdr-1}"><c:out value="${list.reprsntDc}"/></div>
</c:if>
<c:if test="${list.rvwEvlScreExpsrAt eq 'Y'}">
<div class="product-unit-rating col order-${list.rvwEvlScreExpsrOrdr-1}" style="order: ${list.rvwEvlScreExpsrOrdr-1}">
<i class="icon icon_rating-star"></i>
<span class="product-unit-rating__score"><c:out value="${list.avgEvlScore}" default="0.0"/> </span>
<span class="product-unit-rating__count">(<fmt:formatNumber value="${list.cntEvlScor}" />) </span>
</div>
</c:if>
<c:if test="${list.dlvyExpsrAt eq 'Y'}">
<div class="product-unit-price__monthly-payment col order-${list.dlvyExpsrOrdr-1}" style="order: ${list.dlvyExpsrOrdr-1}"><c:out value="${list.dlvyGroupNm}"/></div>
</c:if>
</div>
</div>
</c:forEach>
</div>
</div>
</div>
</c:when>
<c:otherwise>
<div class="subList__content">
<div class="subList__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="subList__no-result-text">
등록된 상품이 없습니다.
</p>
</div>
</div>
</c:otherwise>
</c:choose>
<%--장바구니 목록과 선택한 상품 중복 모달 --%>
<div id="modal-error-confirm-add-cart-duplicate-div"></div>
<%--장바구니 버튼 선택 모달--%>
<div id="addGoodsCartDiv"></div>
<%--장바구니 담기 후 모달--%>
<div id="addCartDiv"></div>
<%--상품 중복선택 모달--%>
<div id="goodsDuplicateDiv"></div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_list"/>
</div>
<%--<script src="/admin/js/script.js" defer></script>--%>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,197 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : GoodsSrchR.jsp
Description : 상품 검색 리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 리브가
--%>
<div class="left">
<div class="search-number">
<span class="search-number__text">총 <strong><c:out
value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
</div>
</div>
<c:choose>
<c:when test="${ not empty resultMap.list }">
<div class="subList__content">
<div class="product-list-type1">
<div class="product-list-type1__list">
<c:forEach items="${ resultMap.list }" var="list" varStatus="status">
<div class="product-unit">
<div class="product-unit-image">
<c:if test="${(list.evtTmeExpsrAt eq 'Y' and list.remainTime ne 'N')
or (list.rltmQyBannerExpsrAt eq 'Y' and list.remainQy > 0) }">
<div class="time-sale__top">
<c:if test="${list.evtTmeExpsrAt eq 'Y' and list.remainTime ne 'N'}">
<span class="time" id="remainTime${status.index}" name="remainTime"><c:out value="${list.remainTime}"/> </span>
<input type="hidden" id="evtTmeExpsrAt${status.index}" name="evtTmeExpsrAt" value="${list.evtTmeExpsrAt}">
</c:if>
<c:if test="${list.rltmQyBannerExpsrAt eq 'Y' and list.remainQy > 0 }">
<span class="left">남은수량 <fmt:formatNumber value="${list.remainQy}"/> 개</span>
</c:if>
</div>
</c:if>
<%-- 상품 상태에 따른 분기--%>
<c:choose>
<c:when test="${list.goodsSttusCd eq '02'}">
<div class="sold-out">
<span>SOLD OUT</span>
</div>
</c:when>
<c:when test="${list.goodsSttusCd eq '03'}">
<div class="sold-out">
<span>${list.goodsSttusNm}</span>
</div>
</c:when>
</c:choose>
<form id="detailForm">
<a class="product-detail" href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${list.goodsInnb}"/>'); ">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${cdnurl}${list.goodsImgCours}"/>"
onerror="this.src='/pc/images/image_placeholder.png'"
alt="${list.goodsNm}"/>
</a>
</form>
<c:if test="${not empty list.pricRplcWordsUseAt and list.pricRplcWordsUseAt ne 'Y'}">
<button type="button" class="product-unit-addToCart" onclick="fn_open_addCart_modal
('#addGoodsCartDiv', '#addCart-product-popUp', '/sopmal/goods/selectAddCartGoodsPopup',
JSON.stringify({'goodsInnb' : `${list.goodsInnb}`}))">
<i class="icon icon_product-unit-addToCart"></i>
<span class="visually-hidden">장바구니에 담기</span>
</button>
</c:if>
</div>
<div class="product-unit-info d-flex flex-column" style="flex-direction:column">
<c:if test="${not empty list.iconCdNmList}">
<c:if test="${list.iconExpsrAt eq 'Y'}">
<div class="product-badge-container col order-${list.iconExpsrOrdr-1}" style="order: ${list.iconExpsrOrdr-1} ">
<c:forEach items="${fn:split(list.iconCdNmList, ',')}" var="iconCdNm" varStatus="iconStatus">
<c:choose>
<c:when test="${fn:contains(iconCdNm, '-')}">
<span class="product-badge ${fn:toLowerCase(iconCdNm)}">${fn:replace(fn:toUpperCase(iconCdNm), '-', ' ')}</span>
</c:when>
<c:otherwise>
<span class="product-badge ${fn:toLowerCase(iconCdNm)}">${fn:toUpperCase(iconCdNm)}</span>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</c:if>
</c:if>
<%-- <div class="product-unit-info__inner">--%>
<c:if test="${list.goodsNmExpsrAt eq 'Y'}">
<div class="product-unit-title col order-${list.goodsNmExpsrOrdr-1}" style="order:${list.goodsNmExpsrOrdr-1} ">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${list.goodsInnb}"/>');"><c:out value="${list.goodsNm}"/></a>
</div>
</c:if>
<c:if test="${list.pricExpsrAt eq 'Y'}">
<c:choose>
<c:when test="${not empty list.pricRplcWordsUseAt and list.pricRplcWordsUseAt ne 'Y'}">
<div class="product-unit-price col order-${list.pricExpsrOrdr-1}" style="order: ${list.pricExpsrOrdr-1}">
<div class="product-unit-price__price">
<span class="product-unit-price__original"><fmt:formatNumber
value="${list.cnsmrpric}"/> 원</span>
<span class="product-unit-price__current"><fmt:formatNumber
value="${list.slepric}"/> 원</span>
</div>
<div class="product-unit-price__sale">
<span class="percent"> <c:out value="${list.slePercent}"/> %</span>
</div>
</div>
</c:when>
<c:otherwise>
<div class="productDetailInfo__price">
<a href="${list.pcPricRplcLink}" <c:if test="${list.pricRplcLinkBrwsrDvCd eq'01'}"> target="_blank" </c:if> >
<span> <c:out value="${list.pricRplcWords}"/></span>
</a>
</div>
</c:otherwise>
</c:choose>
</c:if>
<c:if test="${list.reprsntDcExpsrAt eq 'Y'}">
<div class="product-unit-price__monthly-payment col order-${list.reprsntDcExpsrOrdr-1}" style="order: ${list.reprsntDcExpsrOrdr-1}"><c:out value="${list.reprsntDc}" /> </div>
</c:if>
<c:if test="${list.rvwEvlScreExpsrAt eq 'Y'}">
<div class="product-unit-rating col order-${list.rvwEvlScreExpsrOrdr-1}" style="order: ${list.rvwEvlScreExpsrOrdr-1}">
<i class="icon icon_rating-star"></i>
<span class="product-unit-rating__score"><c:out value="${list.avgEvlScore}" default="0.0"/> </span>
<span class="product-unit-rating__count">(<fmt:formatNumber value="${list.cntEvlScor}"/>) </span>
</div>
</c:if>
<c:if test="${list.dlvyExpsrAt eq 'Y'}">
<div class="product-unit-price__monthly-payment col order-${list.dlvyExpsrOrdr-1}" style="order: ${list.dlvyExpsrOrdr-1}"><c:out value="${list.dlvyGroupNm}"/></div>
</c:if>
</div>
</div>
</c:forEach>
</div>
</div>
</div>
</c:when>
<c:otherwise>
<div class="subList__content">
<div class="subList__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="subList__no-result-text">
일치하는 검색결과가 없습니다.
</p>
</div>
</div>
<%-- <div class="resultTrend">--%>
<%-- <h5 class="resultTrend__title">인기검색어 //TODO?</h5>--%>
<%-- <ul class="resultTrend__list">--%>
<%-- <li><a href=""><span class="resultTrend__num">1.</span>비타민비타민비타민비타민비타민비타민비타민비타민비타민</a>--%>
<%-- <i class="icon icon_search-up"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">2.</span>글루타치온</a>--%>
<%-- <i class="icon icon_search-down"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">3.</span>비타민</a>--%>
<%-- <i class="icon icon_search-up"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">4.</span>글루타치온</a>--%>
<%-- <i class="icon icon_search-up"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">5.</span>비타민</a>--%>
<%-- <i class="icon icon_search-down"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">6.</span>글루타치온</a>--%>
<%-- <i class="icon icon_search-default"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">7.</span>비타민</a>--%>
<%-- <i class="icon icon_search-default"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">8.</span>글루타치온</a>--%>
<%-- <i class="icon icon_search-down"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">9.</span>비타민</a>--%>
<%-- <i class="icon icon_search-up"></i>--%>
<%-- </li>--%>
<%-- <li><a href=""><span class="resultTrend__num">10.</span>글루타치온</a>--%>
<%-- <i class="icon icon_search-up"></i>--%>
<%-- </li>--%>
<%-- </ul>--%>
<%-- </div>--%>
</c:otherwise>
</c:choose>
<%--장바구니 목록과 선택한 상품 중복 모달 --%>
<div id="modal-error-confirm-add-cart-duplicate-div"></div>
<%--장바구니 버튼 선택 모달--%>
<div id="addGoodsCartDiv"></div>
<%--장바구니 담기 후 모달--%>
<div id="addCartDiv"></div>
<%--상품 중복선택 모달--%>
<div id="goodsDuplicateDiv"></div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_list"/>
</div>
<%--<script src="/admin/js/script.js" defer=""></script>--%>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,139 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : QnaListR.jsp
Description : 상품qna 목록
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 김혜인
--%>
<!DOCTYPE html>
<html lang="ko">
<script>
$(document).ready(function(){
let goodsQnaCnt = '<c:out value="${resultMap.paginationInfo.totalRecordCount}"/>';
goodsQnaCnt = fn_format_comma(goodsQnaCnt);
$("#goodsQnaCnt").text(goodsQnaCnt);
});
</script>
<div class="userQnA">
<h5 class="userQnA__title">상품문의</h5>
<div class="userQnA__controls">
<div class="select-box">
<select class="lg" id = "srchitmInnb" title="문의유형" name="srchitmInnb">
<option value="">문의 유형을 선택해 주세요.</option>
<c:forEach var="itm" items="${resultMap.itmList}">
<option value="<c:out value = '${itm.itmInnb}'/>"
<c:if test="${resultMap.bbscttVO.srchitmInnb eq itm.itmInnb}">selected</c:if>>
<c:out value='${itm.itmCn}'/>
</option>
</c:forEach>
</select>
</div>
<div class="userQnA__controls__btnContainer">
<button type="button" class="btn md theme" id="registBtn">상품 Q&A 쓰기</button>
</div>
</div>
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 80px;">
<col style="width: 120px;">
<col style="width: auto;">
<col style="width: 140px;">
<col style="width: 140px">
</colgroup>
<thead>
<tr>
<th>번호</th>
<th>답변상태</th>
<th>문의내용</th>
<th>작성자</th>
<th>등록일</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${ not empty resultMap.resultList.qnaList }">
<c:forEach var="resultList" items="${ resultMap.resultList.qnaList}">
<tr class="tr-foldable-trigger" bbsctt="<c:out value="${resultList.bbscttInnb}"/>" bbs-id = "<c:out value="${resultList.bbsId}"/>">
<td><span class="board-number"><c:out value="${resultList.rnum}"/></span></td>
<td>
<c:choose>
<c:when test="${not empty resultList.answBbscttInnb}">
<span class="text-complete">답변완료</span>
</c:when>
<c:otherwise>
<span class="text-waiting">답변대기</span>
</c:otherwise>
</c:choose>
</td>
<td class="text-left">
<div class="board-inner-product">
<div class="board-inner-product__right">
<p class="board-inner-product__title">
<span class="category"><c:if test="${not empty resultList.answCn}">
[<c:out value="${resultList.answCn}"/>]</c:if></span>
<c:out value="${ resultList.regusrNm}"/>님의 소중한 질문입니다.
<c:if test="${resultList.isfiles eq 1}"><%--첨부파일여부--%>
<i class="icon icon_image-badge"></i>
</c:if>
<c:if test="${resultList.newAt eq 'Y'}"><%--새로운게시글여부--%>
<i class="icon icon_new-post"></i>
</c:if>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<i class="icon icon_lock"></i>
</c:if>
</p>
<c:if test="${ resultList.secretBbscttAt eq 'Y' }"><%--비밀글여부--%>
<p class="board-inner-product__title">
비밀글입니다.
</p>
</c:if>
</div>
</div>
</td>
<td>
<span class="customer-name">
<c:out value="${ resultList.regusrNm}"/>
</span>
</td>
<td><span class="board-date"><c:out value="${resultList.registDt}"/></span></td>
</tr>
<tr class="tr-foldable qnaCn">
<%--내용,답변--%>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="100%">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="조회 내역 없음">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<input type="hidden" id="qnaPageIndex" name="pageIndex" value="<c:out value = '${resultMap.bbscttVO.pageIndex}'/>"/>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_qna"/>
</div>
</div>
</html>

View File

@@ -0,0 +1,481 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : RelateGoodsPopupR.jsp
Description : 함께하면 좋은 상품(관련 상품) 팝업
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-07-23 유재현 최초 생성
--%>
<<!DOCTYPE html>
<html lang="ko">
<script defer>
fn_set_niceSelect_datePicker('.select-box-relate')
//
// /*************************************************************
// 함께하면 좋은상품 이벤트 (모달)
// **************************************************************/
//
$('#related-product-popUp').on('modal:open', function (event, modal) {
//
// $('.select-box-relate').niceSelect();
//
// // false로 설정시 라디오만 선택해도 상품 추가 가능
//
// //일반옵션
// // 라디오 버튼 클릭시, 상품 정보 배열에 추가 및 화면에 추가
$(".modal .productDetailInfo__option__item").each(function () {
$(this).find("input[type=radio]").on("change", function () { // 라디오 버튼 클릭 시
if ($(this).prop('checked') == false) return; // 체크 해제시 리턴
const $title = $(this).closest(".productDetailInfo__option__item").find("label").text();
const $price = $(this).closest(".productDetailInfo__option__item").find(".productDetailInfo__option__price").text();
const $goodsOptnInnb = $(this).closest(".productDetailInfo__option__item").find('input[name="goodsOptnInnb"]').val()
const $goodsOptnTy = $(this).closest(".productDetailInfo__option__item").find('input[name="goodsOptnTy"]').val()
const $optnInfo = $(this).closest(".productDetailInfo__option__item").find('.productDetailInfo__option__monthly-payment').text();
const $priceNum = parseInt($price.replace(/,/g, ""));
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = cartProductArr.some(function (item) {
return item[4] === $goodsOptnInnb;
});
if (isItemAlreadyAdded){
fn_goods_duplicate_select_modal()
return;
}
//이미 선택한 상품이 포함되었을 경우 alert
let dupliChk = false;
productArr.forEach(function(item) {
if (item[4] === $goodsOptnInnb) {
dupliChk = true;
}
});
if(dupliChk){
$(this).prop('checked', false)
alert('이미 선택하신 상품입니다.');
return false;
}
const $relateGoodsInnb = $('#relateGoodsInnb').val()
cartProductArr.push([$title, 1, $priceNum, $priceNum * 1, $goodsOptnInnb, $goodsOptnTy, $relateGoodsInnb]); // 배열에 상품 정보 추가
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">'+$optnInfo+'</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $price +
'</div>' +
'</div>' +
'</div>'
);
updateCartCounters(); // 화면에 상품 정보 업데이트
});
});
// 총 상품금액
var $cartTotalPrice = $(".modal .product-total__price__totalPriceNum");
// 수량 "-", "+" 버튼 클릭 시, 수량 증감 및 가격 변경 및 총 상품금액 변경
$("#cartCountContainer").on("click", ".productDetailInfo__count__amountBtn", function () { // 수량 버튼 클릭 시
var $counter = $(this);
var $index = $counter.closest(".productDetailInfo__count").index(); // 해당 상품의 인덱스
if ($(this).hasClass("minus")) { // "-" 버튼 클릭 시
if (cartProductArr[$index][1] <= 1) return;
cartProductArr[$index][1]--; // 배열에서 해당 상품의 수량 감소
cartProductArr[$index][3] = cartProductArr[$index][1] * cartProductArr[$index][2]; // 배열에서 해당 상품의 총 가격 변경
} else { // "+" 버튼 클릭 시
cartProductArr[$index][1]++; // 배열에서 해당 상품의 수량 증가
cartProductArr[$index][3] = cartProductArr[$index][1] * cartProductArr[$index][2]; // 배열에서 해당 상품의 총 가격 변경
}
updateCartCounters(); // 화면에 상품 정보 업데이트
})
//
// //배열 내용을 바탕으로 각 아이템 텍스트 변경
function updateCartCounters() {
$(".modal .productDetailInfo__count").each(function () {
var $counter = $(this);
var $index = $counter.index();
var $number = $counter.find(".productDetailInfo__count__amountNumber");
var $price = $counter.find(".productDetailInfo__count__priceNum");
$number.text(cartProductArr[$index][1]);
$price.text(addComma(cartProductArr[$index][3]) + "원");
});
updateCartTotalPrice(); // 총 상품금액 업데이트
}
// 3자리마다 "," 추가
function addComma(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
// 총 상품금액 업데이트
function updateCartTotalPrice() {
var totalPrice = 0; // 총 상품금액
for (var i = 0; i < cartProductArr.length; i++) {
totalPrice += cartProductArr[i][3]; // 배열의 총 가격을 더함
}
$cartTotalPrice.text(addComma(totalPrice)); // 총 상품금액 텍스트 변경
}
// x버튼 클릭 시 삭제
$("#cartCountContainer").on("click", ".productDetailInfo__count__amountDelete", function () { // x 버튼 클릭 시
var $index = $(this).closest(".productDetailInfo__count").index();
cartProductArr.splice($index, 1); // 배열에서 해당 상품 삭제
$(this).closest(".productDetailInfo__count").remove(); // 화면에서 해당 상품 삭제
updateCartCounters(); // 화면에 상품 정보 업데이트
//일반옵션이 하나일 경우 라디오 체크 해제(품절상품 제외) || 필수옵션 01이 상품 배열에 하나도 없을 경우
if($('#related-product-popUp .custom-radio:not(:has(span))').length ===1
|| cartProductArr.filter(item => item[5] === '01'&& $('#goodsInnb').val() ===item[6]).length === 0){
$("input[name='r-group01']").prop('checked', false)
}
});
//TODO :: 입력옵션
// // // 마지막으로 생성된 상품에 각인 정보 추가
// // $('#cartAddTextBtn').on('click', function () {
// // var $index = $(".modal .productDetailInfo__count").length - 1;
// // var $text = $('#cartAddTextInput').val();
// // $(".modal .productDetailInfo__count").eq($index).find(".productDetailInfo__count__amountTop").append('<div class="productDetailInfo__count__additionalSelect">각인문구 : ' + $text + '</div>');
// //
// // });
//
//재고옵션
$('#cartAdditionalSelect').on("change", "select", function () { // 셀렉트 선택 시
if ($('#cartAdditionalSelect').find('.option.selected.disabled').length > 0) return;
if ($('#cartAdditionalSelect').find('.option.selected').length == $('#cartAdditionalSelect').find('.nice-select').length) { // 모든 셀렉트가 선택되면
var $title = $('#relateGoodsNm').val();
var $optInfo = $(this).closest(".productDetailInfo__additionalSelect__item").find(".option.selected").attr("data-value").split('|');
var $priceNum = $optInfo[0];
var $goodsOptnInnb = $optInfo[1];
var $goodsOptnInfo = $optInfo[2];
var $goodsOptnTy = $optInfo[3];
var arr = [];
for (var i = 0; i < $('#cartAdditionalSelect').find('.nice-select').length; i++) {
arr.push($('#cartAdditionalSelect').find('.nice-select').eq(i).find('.option.selected').text());
}
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = cartProductArr.some(function (item) {
return item[4] === $goodsOptnInnb;
});
if (isItemAlreadyAdded) {
fn_goods_duplicate_select_modal()
return;
}
const $relateGoodsInnb = $('#relateGoodsInnb').val()
cartProductArr.push([$title, 1, $priceNum, $priceNum * 1, $goodsOptnInnb, $goodsOptnTy, $relateGoodsInnb, arr]); // 배열에 상품 정보 추가
let cartAdditionalSelectText = '옵션 : ' + arr.join(' / ').replace(/\(\+.*?\)/g, ''); // 추가정보 텍스트로 변환
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<div class="productDetailInfo__count__additionalSelect">' + cartAdditionalSelectText + '</div>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">' + $goodsOptnInfo + '</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $priceNum +
'</div>' +
'</div>' +
'</div>'
);
}
updateCartCounters(); // 화면에 상품 정보 업데이트
});
// // 추가구성옵션
$("#cartMoreItemsSelect").on("change",'select', function () {
var $moreItems = $('#cartMoreItemsSelect').find(".productDetailInfo__additionalSelect__item");
const $optInfoOptn3 = $(this).closest(".productDetailInfo__additionalSelect__item").find(".option.selected").attr("data-value").split('|');
const $priceNumOptn3 = $optInfoOptn3[0];
const $goodsOptnInnbOptn3 = $optInfoOptn3[1];
const $goodsOptnInfoOptn3 = $optInfoOptn3[2];
const $goodsOptnTyOptn3 = $optInfoOptn3[3];
const $optnEssnlAtOptn3 = $(this).closest(".productDetailInfo__additionalSelect__item").children('.productDetailInfo__additionalSelect__otpnEssntlAt__relate').val();
// $moreItems.each(function () {
// if ($(this).find('.option.selected.disabled').length > 0) return;
var $title = $(this).closest(".productDetailInfo__additionalSelect__item").find(".option.selected").text().replace(' ', '').trim().replace('선택', ' ').replace(/\(\+.*?\)/g, '');
var $priceNum = $(this).find(".option.selected").attr("data-value");
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = cartProductArr.some(function (item) {
return item[4] === $goodsOptnInnbOptn3;
});
if (isItemAlreadyAdded){
fn_goods_duplicate_select_modal()
return;
}
const $relateGoodsInnb = $('#relateGoodsInnb').val()
cartProductArr.push([$title, 1, $priceNumOptn3, $priceNumOptn3 * 1, $goodsOptnInnbOptn3, $goodsOptnTyOptn3,$relateGoodsInnb ,$optnEssnlAtOptn3 ]); // 배열에 상품 정보 추가
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">'+$goodsOptnInfoOptn3+'</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $priceNum +
'</div>' +
'</div>' +
'</div>'
);
$(this).val('').niceSelect('update')
updateCartCounters(); // 화면에 상품 정보 업데이트
// });
});
});
// })
// })
</script>
<body>
<div id="related-product-popUp" class="modal option">
<div class="option-header">
<div class="option-header__title">옵션 선택</div>
<input type="hidden" id="relateGoodsInnb" value="${relateResultMap.goodsDtl.goodsInnb}"/>
<input type="hidden" id="relateGoodsNm" value="${relateResultMap.goodsDtl.goodsNm}"/>
<input type="hidden" id="relateSlepricDscntAmt" value="${relateResultMap.goodsDtl.slepric }"/>
</div>
<div class="option-content">
<div class="product-unit product-unit--relatedProduct">
<div class="product-unit-image">
<a href="javascript:void(0);">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${cdnurl}${fn:split(relateResultMap.goodsDtl.img, '|')[0]}"/> " onerror="this.src='/pc/images/image_placeholder.png'" alt="상품 이미지">
</a>
</div>
<div class="product-unit-info">
<div class="product-unit-info__inner">
<div class="product-unit-title">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${relateResultMap.goodsDtl.goodsInnb}"/>');"><c:out value="${relateResultMap.goodsDtl.goodsNm}"/></a>
</div>
<div class="product-unit-price">
<div class="product-unit-price__price">
<span class="product-unit-price__original">
<span class="comma">
<fmt:formatNumber value="${relateResultMap.goodsDtl.cnsmrpric}"/></span>
<span class="priceUnit"></span>
</span>
<span class="product-unit-price__current">
<span class="comma"> <fmt:formatNumber value="${relateResultMap.goodsDtl.dcSlepric}"/></span>
<span class="priceUnit">원</span></span>
</div>
<div class="product-unit-price__sale">
<span class="percent"><c:out value="${relateResultMap.goodsDtl.dcPercent}"/>%</span>
</div>
</div>
</div>
</div>
</div>
<c:if test="${relateResultMap.goodsDtl.goodsSttusCd eq '01'}">
<c:choose>
<c:when test="${not empty relateResultMap.optnList}">
<c:if test="${not empty relateResultMap.optnList.normalOptnList}">
<div class="productDetailInfo__option">
<div class="productDetailInfo__option__box">
<c:forEach var="goodsOpt01" items="${relateResultMap.optnList.normalOptnList}" varStatus="optList01">
<c:if test="${goodsOpt01.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOpt01.invntrySldoutExpsrAt eq 'Y'}">
<div class="productDetailInfo__option__item">
<c:if test="${not empty goodsOpt01.optnVal1}">
<div class="custom-radio is-medium">
<input type="radio" id="r-2${goodsOpt01.optnOrdr}" value="${goodsOpt01.optnVal1}" name="r-group01" <c:if test="${goodsOpt01.disableAt eq 'Y'}"> disabled</c:if>>
<label for="r-2${goodsOpt01.optnOrdr}">${goodsOpt01.optnVal1}</label>
<input type="hidden" name="optnCd" value="${goodsOpt01.optnCd1}">
<input type="hidden" name="goodsOptnInnb" value="${goodsOpt01.goodsOptnInnb}"/>
<input type="hidden" name="goodsOptnTy" value="${goodsOpt01.optnTy}"/>
<input type="hidden" name="goodsSopmalCd" value="${goodsOpt01.sopmalCd}"/>
<c:if test="${goodsOpt01.disableAt eq 'Y'}"> <span>(품절)</span></c:if>
</div>
<div class="productDetailInfo__option__right">
<span class="productDetailInfo__option__price"><span class="comma"><fmt:formatNumber value="${goodsOpt01.slepric}"/></span> <span class="priceUnit"> 원</span></span>
<span class="productDetailInfo__option__monthly-payment"><c:out value="${goodsOpt01.optnInfo}"/></span>
</div>
</c:if>
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
<c:if test="${not empty relateResultMap.optnList.invntryOptnList}">
<div class="productDetailInfo__additionalSelect" id="cartAdditionalSelect">
<span class="productDetailInfo__option__title">옵션선택(필수)</span>
<div class="productDetailInfo__additionalSelect__inner">
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty relateResultMap.optnList.invntryOptnList[0].optnNm1}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${relateResultMap.optnList.invntryOptnList[0].optnNm1}"/> </span>
<div class="select-box-relate">
<select id="selectRelateInvntryOptn1" name="selectRelateInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
<c:forEach var="goodsOpt02" items="${relateResultMap.optnList.invntryOptnList}" varStatus="optList02">
<c:if test="${goodsOpt02.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOpt02.invntrySldoutExpsrAt eq 'Y'}">
<c:if test="${goodsOpt02.optnVal1 ne relateResultMap.optnList.invntryOptnList[optList02.index-1].optnVal1}">
<option value="${goodsOpt02.slepric}|${goodsOpt02.goodsOptnInnb}|${goodsOpt02.optnInfo}|${goodsOpt02.optnTy}" <c:if test="${goodsOpt02.disableAt eq 'Y'}"> disabled </c:if> >
<c:out value="${goodsOpt02.optnVal1}"/>
</option>
</c:if>
</c:if>
</c:if>
</c:forEach>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty relateResultMap.optnList.invntryOptnList[0].optnNm2}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${relateResultMap.optnList.invntryOptnList[0].optnNm2}"/> </span>
<div class="select-box-relate">
<select id="selectRelateInvntryOptn2" name="selectRelateInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty relateResultMap.optnList.invntryOptnList[0].optnNm3}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${relateResultMap.optnList.invntryOptnList[0].optnNm3}"/> </span>
<div class="select-box-relate">
<select id="selectRelateInvntryOptn3" name="selectRelateInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty relateResultMap.optnList.invntryOptnList[0].optnNm4}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${relateResultMap.optnList.invntryOptnList[0].optnNm4}"/> </span>
<div class="select-box-relate">
<select id="selectRelateInvntryOptn4" name="selectRelateInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
</div>
</div>
</c:if>
<c:if test="${not empty relateResultMap.optnList.addedOptnList}">
<div class="productDetailInfo__additionalSelect" id="cartMoreItemsSelect">
<span class="productDetailInfo__additionalSelect__title">추가구성</span>
<div class="productDetailInfo__additionalSelect__inner">
<c:forEach var="goodsOpt03" items="${relateResultMap.optnList.addedOptnList}" varStatus="optList03">
<c:if test="${not empty goodsOpt03.optnNm1}">
<c:if test="${relateResultMap.optnList.addedOptnList[optList03.index-1].optnNm1 ne goodsOpt03.optnNm1}">
<div class="productDetailInfo__additionalSelect__item">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${goodsOpt03.optnNm1}"/> </span>
<input type="hidden" name="productDetailInfo__additionalSelect__otpnEssntlAt__relate__added" <c:if test="${goodsOpt03.optnEssntlAt eq 'Y'}"> value="Y"</c:if>/>
</c:if>
<c:if test="${relateResultMap.optnList.addedOptnList[optList03.index-1].optnNm1 ne goodsOpt03.optnNm1}">
<div class="select-box-relate">
<select title="${goodsOpt03.OptnInfo}" name="selectRelateAddedOptn">
<option value="" disabled selected><c:out value="선택"/></option>
<c:forEach var="goodsOptVal03" items="${relateResultMap.optnList.addedOptnList}" varStatus="optVal03">
<c:if test="${goodsOptVal03.optnNm1 eq goodsOpt03.optnNm1}">
<c:if test="${goodsOptVal03.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOptVal03.invntrySldoutExpsrAt eq 'Y'}">
<option value="${goodsOptVal03.slepric}|${goodsOptVal03.goodsOptnInnb}|${goodsOptVal03.optnInfo}|${goodsOptVal03.optnTy} " <c:if test="${goodsOptVal03.disableAt eq 'Y'}"> disabled</c:if> ><c:out value="${goodsOptVal03.optnVal1}"/> (+ <fmt:formatNumber value="${goodsOptVal03.slepric}"/>) <c:if test="${goodsOptVal03.disableAt eq 'Y'}"> <c:out value="(품절)"/> </c:if> </option>
</c:if>
</c:if>
</c:if>
</c:forEach>
</select>
</div>
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
<%-- <div class="productDetailInfo__confirmOption">--%>
<%-- <button class="btn md outline" id="cartMoreItemsButton">입력한 정보 선택</button>--%>
<%-- </div>--%>
<%--TODO :: 입력옵션 --%>
<%-- <div class="productDetailInfo__option">--%>
<%-- <span class="productDetailInfo__option__title">상품정보 입력</span>--%>
<%-- <div class="productDetailInfo__additionalSelect__inner">--%>
<%-- <div class="productDetailInfo__additionalSelect__item">--%>
<%-- <span class="productDetailInfo__additionalSelect__category">각인 옵션</span>--%>
<%-- <input id="cartAddTextInput" class="input-text full" type="text" title="해당 인풋에 대한 설명"--%>
<%-- placeholder="각인 문구를 입력해주세요" value="">--%>
<%-- <button id="cartAddTextBtn" class="btn outline">저장</button>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- </div>--%>
<div id="cartCountContainer">
</div>
</div>
</c:when>
<c:otherwise>
<%--옵션 없을 경우 빈값--%>
</c:otherwise>
</c:choose>
</c:if>
<div class="product-total__container">
<span class="product-total__text">총 상품금액</span>
<span class="product-total__price">
<span class="product-total__price__totalPriceNum">0</span>
<span class="won">원</span>
</span>
</div>
<div class="product-btn-container">
<button class="btn theme large" id="addGoodsDtl">함께 구매하기</button>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,32 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : QnaListR.jsp
Description : 상품qna 목록
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 김혜인
--%>
<!DOCTYPE html>
<html lang="ko">
<div class="userRefund">
<h5 class="userRefund__title">반품/교환정보</h5>
<div class="userRefund__inner" id="infoCn">
<c:choose>
<c:when test="${not empty resultMap.infoCn}">
<c:out value = "${resultMap.infoCn}" escapeXml="false"/>
</c:when>
<c:otherwise>
<span><c:out value="반품/교환 정보가 없습니다."/></span>
</c:otherwise>
</c:choose>
</div>
</div>
</html>

View File

@@ -0,0 +1,155 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : RvwListR.jsp
Description : 리뷰 리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 김혜인
--%>
<!DOCTYPE html>
<html lang="ko">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<div class="productReview__subTitle">
<span class="productReview__subTitle__title">리뷰</span>
<span class="productReview__subTitle__num">
<span class="comma"></span>
<span id = "totCnt"></span>
<span class="unit">건</span>
</span>
<ul class="userReview__sort">
<li>
<button type="button" class="sortDv" value="rank">랭킹순</button>
</li>
<li>
<button type="button" class="sortDv" value="recent">최신순</button>
</li>
<li>
<button type="button" class="sortDv" value="evl">평점 높은순</button>
</li>
</ul>
</div>
<%--리뷰 목록 ajax 호출 시 탭 명 + 건수 set 함--%>
<div class="userReview__tab">
<button type="button" class="userReview__tab__btn" value = "all">전체 <span id = "allCnt"></span></button>
<button type="button" class="userReview__tab__btn" value = "photo">포토리뷰 <span id = "photoCnt"></span></button>
<button type="button" class="userReview__tab__btn" value = "month" id = "mtBtn">한달리뷰 <span id = "mtCnt"></span></button>
</div>
<%--검색키워드 -> 문항명--%>
<div class="userReview__hashtag">
<c:forEach var = "srchKeyword" items="${resultMap.resultList.srchKewordList}">
<button type="button" class="userReview__hashtag__btn" value = "<c:out value = "${srchKeyword.qesitmNm}"/>">#<c:out value = "${srchKeyword.qesitmNm}"/></button>
</c:forEach>
<input type = "hidden" id = "hiddenSrch" value = "<c:out value = '${resultMap.bbscttVO.srchKeywordArr}'/>"/>
</div>
<%--리뷰 리스트--%>
<c:choose>
<c:when test="${not empty resultMap.resultList.rvwList}">
<c:forEach var="resultList" items="${resultMap.resultList.rvwList}">
<div class="userReviewItem">
<div class="userReviewItem__top">
<div class="userReviewItem__userImage">
<img src="/pc/images/icon_user-info.png" alt="">
</div>
<div class="userReviewItem__top__info">
<c:if test = "${not empty resultList.evlScore}">
<div class="reviewStars__wrapper--sm">
<fmt:formatNumber value="${resultList.evlScore}" pattern="##" var="evlScore"/>
<div class="reviewStars star-<c:out value="${evlScore}"/>"></div>
<span class="reviewStars__num"><c:out value="${evlScore}"/></span>
</div>
</c:if>
<div class="userReviewItem__misc">
<span class="userReviewItem__misc__id"><c:out value = "${resultList.regusrId}"/></span>
<span class="userReviewItem__misc__date"><c:out value = "${resultList.registDt}"/></span>
<c:if test = "${resultList.bstAt eq 'Y'}">
<span class="reviewBadge reviewBadge--red">BEST</span>
</c:if>
<c:if test = "${resultList.bbsTyCd eq '07'}">
<span class="reviewBadge">한달사용기</span>
</c:if>
<c:if test = "${resultList.reOrderAt eq 'Y'}">
<span class="reviewBadge">재구매</span>
</c:if>
</div>
</div>
</div>
<div class="userReviewItem__body listPage">
<div class="userReviewItem__reviewText listCn" style="white-space: pre-wrap;">
<c:out value="${resultList.cn}" escapeXml="false"/>
</div>
<c:forEach var="photoByBbsctt" items="${resultMap.resultList.photoByBbsctt}">
<c:if test="${resultList.bbscttInnb eq photoByBbsctt.bbscttInnb}">
<div class="userReviewItem__reviewImage listImage">
<c:if test="${not empty resultList.filCours}">
<img src="<c:out value = "${cdnurl}${resultList.filCours}"/><c:out value = "${resultList.sysFilNm}"/>"
onerror='this.src = "/pc/images/image_placeholder.png"'
alt="">
</c:if>
<c:if test="${resultList.fileCnt > 0}">
<span class="userReviewItem__reviewImage__num listPageImg">
<c:out value="${resultList.fileCnt}"/>
</span>
</c:if>
</div>
</c:if>
</c:forEach>
<c:if test="${resultList.bbscttEvlUseAt eq 'Y'}">
<div class="userReviewItem__likeContainer">
<button class="userReviewItem__like" onclick = "fn_update_bbsctt_recomend('recommend', '<c:out value = '${resultList.bbscttInnb}'/>', this);">
도움이 돼요
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"/>
</svg>
<em class="recommendCnt">
<c:out value="${resultList.recomendCnt}"/>
</em>
</button>
<c:if test="${resultList.bbscttEvlRecomendStep eq '02'}">
<button class="userReviewItem__like userReviewItem__like--dislike"
onclick = "fn_update_bbsctt_recomend('nonrecommend', '<c:out value = '${resultList.bbscttInnb}'/>', this);">
도움이 안돼요
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"/>
</svg>
<em class="nonrecommendCnt">
<c:out value="${resultList.nonrecomendCnt}"/>
</em>
</button>
</c:if>
</div>
</c:if>
<input type = "hidden" value = "<c:out value="${resultList.bbscttInnb}"/>"/>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="userReviewItem">
<div class="orderList__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="orderList__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</div>
</c:otherwise>
</c:choose>
<input type="hidden" name="pageIndex" id="pageIndex" value="<c:out value = "${resultMap.bbscttVO.pageIndex}"/>">
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_rvw"/>
</div>
</html>

View File

@@ -0,0 +1,340 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : RvwListRForm.jsp
Description : 리뷰 목록 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04 김혜인
--%>
<!DOCTYPE html>
<html lang="ko">
<%--데이터 set--%>
<%--상품 리뷰 평가 정보--%>
<c:set value = "${resultMap.rvwInfo.evlInfo}" var = "evlInfo"/>
<%--상품 리뷰 추가 평가 통계--%>
<c:set value = "${resultMap.rvwInfo.itmStats}" var = "itmStats"/>
<%--상품 포토 리뷰 이미지 건수--%>
<c:set value = "${resultMap.rvwInfo.photoTot}" var = "photoTot"/>
<%--상품 포토 리뷰 이미지 리스트--%>
<c:set value = "${resultMap.rvwInfo.photoList}" var = "photoList"/>
<%--베스트 후기 건수--%>
<c:set value = "${resultMap.rvwInfo.bstTotCnt}" var = "bstTotCnt"/>
<%--베스트 후기 목록--%>
<c:set value = "${resultMap.rvwInfo.bstRvwList}" var = "bstRvwList"/>
<%--마일리지 적립 금액 조회--%>
<c:set value = "${resultMap.rvwBnefInfo}" var = "rvwBnefInfo"/>
<%--상품 평가 정보--%>
<div class="productReview">
<h5 class="productReview__title">상품리뷰</h5>
<div class="productReview__subBox">
<p class="productReview__text">
상품을 구매하신 분들이 작성하신 리뷰입니다. 리뷰 작성시 아래 금액만큼 포인트가 적립됩니다.
</p>
<div class="productReview__mileage">
<dl>
<dt>일반 리뷰 : </dt>
<dd>
<c:if test = "${rvwBnefInfo.writngChrCnt > 0}">(<fmt:formatNumber value="${rvwBnefInfo.writngChrCnt}" pattern="##"/>자이상)</c:if>
<fmt:formatNumber value="${rvwBnefInfo.gnrlRvwMlgAccmlmnyAmt}" pattern="#,###"/>마일리지
</dd>
</dl>
<dl>
<dt>포토 리뷰 :</dt>
<dd>
<c:if test = "${rvwBnefInfo.writngChrCnt > 0}">(<fmt:formatNumber value="${rvwBnefInfo.writngChrCnt}" pattern="##"/>자이상)</c:if>
<fmt:formatNumber value="${rvwBnefInfo.photoRvwMlgAccmlmnyAmt}" pattern="#,###"/>마일리지
</dd>
</dl>
<dl id = "mtDl"><%--한달리뷰 사용 안할 시 hide--%>
<dt>한달 리뷰 :</dt>
<dd>
<c:if test = "${rvwBnefInfo.monthWritngChrCnt > 0}">(<fmt:formatNumber value="${rvwBnefInfo.monthWritngChrCnt}" pattern="#"/>자이상)</c:if>
<fmt:formatNumber value="${rvwBnefInfo.monthPhotoRvwMlgAccmlmnyAmt}" pattern="#,###"/>마일리지
</dd>
</dl>
</div>
</div>
<div class="productReview__status">
<div class="productReview__rating">
<span class="productReview__status__title">사용자 총 평점</span>
<div class="allReviewStars__wrapper">
<div class="allReviewStars">
<!-- width 설정한 만큼 별에 노란색 생김 -->
<div style="width: <c:out value = "${evlInfo.starWidth}"/>%;" class="allReviewStars__fill"></div>
</div>
<span>
<span class="allReviewStars__num"><c:out value = "${evlInfo.avgEvlScore}"/></span>
<span class="allReviewStars__allNum">/ 5.0</span>
</span>
</div>
</div>
<div class="productReview__reviewNum">
<span class="productReview__status__title">전체 리뷰 수</span>
<div class="productReview__reviewNum__inner">
<i class="icon icon_review"></i>
<span class="productReview__reviewNum__num">
<span class="comma"><fmt:formatNumber value="${evlInfo.cntBbsctt}" pattern="#,###"/></span>
</span>
</div>
</div>
<div class="productReview__ratingStats">
<span class="productReview__status__title">평점 비율</span>
<div class="productReview__ratingStats__inner">
<div class="productReview__ratingStats__item productReview__ratingStats__topRating">
<span class="productReview__ratingStats__star">5점</span>
<div class="productReview__ratingStats__bar">
<div style="width: <c:out value = "${evlInfo.fiveRate}"/>%;"
class="productReview__ratingStats__fill"></div>
</div>
<span class="productReview__ratingStats__num"><fmt:formatNumber value="${evlInfo.fiveTot}" pattern="#,###"/></span>
</div>
<div class="productReview__ratingStats__item">
<span class="productReview__ratingStats__star">4점</span>
<div class="productReview__ratingStats__bar">
<div style="width: <c:out value = "${evlInfo.fourRate}"/>%;"
class="productReview__ratingStats__fill"></div>
</div>
</div>
<div class="productReview__ratingStats__item">
<span class="productReview__ratingStats__star">3점</span>
<div class="productReview__ratingStats__bar">
<div style="width: <c:out value = "${evlInfo.threeRate}"/>%;"
class="productReview__ratingStats__fill"></div>
</div>
</div>
<div class="productReview__ratingStats__item">
<span class="productReview__ratingStats__star">2점</span>
<div class="productReview__ratingStats__bar">
<div style="width: <c:out value = "${evlInfo.twoRate}"/>%;"
class="productReview__ratingStats__fill"></div>
</div>
</div>
<div class="productReview__ratingStats__item">
<span class="productReview__ratingStats__star">1점</span>
<div class="productReview__ratingStats__bar">
<div style="width: <c:out value = "${evlInfo.oneRate}"/>%;"
class="productReview__ratingStats__fill"></div>
</div>
</div>
</div>
</div>
<c:if test = "${not empty itmStats}">
<div class="productReview__reviewStats">
<div class="productReview__reviewStats__item">
<span class="productReview__status__title">다른 구매자들은 이렇게 평가했어요</span>
<div class="otherReviews">
<c:forEach var = "itmStat" items="${itmStats}">
<div class="otherReviews__item">
<span class="otherReviews__category"><c:out value = "${itmStat.key}"/></span>
<span class="otherReviews__title"><c:out value = "${itmStat.value[0].itmCn}"/></span>
<div class="otherReviews__line"></div>
<span class="otherReviews__percent"><fmt:formatNumber value="${itmStat.value[0].rateAnsw}" pattern="#,###"/>%</span>
</div>
</c:forEach>
</div>
</div>
<%--문항 별 항목 --%>
<c:if test="${not empty itmStats}">
<c:forEach var = "itmStat" items="${itmStats}">
<div class="productReview__reviewStats__item">
<span class="productReview__status__title"><c:out value = "${itmStat.key}"/> — "<c:out value = "${itmStat.value[0].itmCn}"/>"</span>
<div class="otherReviewsDetail">
<c:forEach var = "itm" items="${itmStat.value}">
<div class="otherReviewsDetail__item">
<span class="otherReviewsDetail__title"><c:out value = "${itm.itmCn}"/></span>
<div class="otherReviewsDetail__bar">
<div style="width: <fmt:formatNumber value="${itm.rateAnsw}" pattern="##"/>%;" class="otherReviewsDetail__fill">
</div>
</div>
<span class="otherReviewsDetail__num"><fmt:formatNumber value="${itm.rateAnsw}" pattern="##"/>%</span>
</div>
</c:forEach>
</div>
</div>
</c:forEach>
</c:if>
</div>
</c:if>
</div>
</div>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<%--스토어 PICK 베스트 후기--%>
<c:if test = "${not empty bstRvwList}">
<div class="storePick">
<div class="productReview__subTitle">
<span class="productReview__subTitle__title">스토어 PICK</span>
<span class="productReview__subTitle__subText">판매자가 직접 선정한 베스트리뷰입니다</span>
</div>
<div class="storePick__slick">
<c:forEach var="bstRvwList" items="${resultMap.rvwInfo.bstRvwList}" varStatus="status">
<c:if test="${status.index % 2 == 0}">
<div class="storePick__item">
<a class="storePick__box">
<div class="storePick__top">
<input type="hidden" value ="<c:out value="${bstRvwList.bbscttInnb}"/>" class="bbscttInnb"/>
<div class="storePick__top__info">
<c:if test = "${not empty bstRvwList.evlScore}">
<div class="reviewStars__wrapper--sm">
<div class="reviewStars star-<fmt:formatNumber value="${bstRvwList.evlScore}" pattern="##"/>"></div>
<span class="reviewStars__num"><fmt:formatNumber value="${bstRvwList.evlScore}" pattern="##"/></span>
</div>
</c:if>
<div class="storePick__misc">
<span class="storePick__misc__id"><c:out value="${bstRvwList.regusrId}"/></span>
<%--리뷰왕 여부--%>
<c:if test="${bstRvwList.rvwKingAt eq 'Y'}">
<span class="storePick__misc__badge">리뷰왕</span>
</c:if>
<span class="storePick__misc__date"><c:out value="${bstRvwList.registDt}"/></span>
</div>
</div>
</div>
<div class="storePick__body">
<%--포토 여부 판단 및 포토 건수--%>
<c:if test="${not empty bstRvwList.filCours}">
<div class="storePick__reviewImage storePickPageImg">
<img src="<c:out value="${cdnurl}${bstRvwList.filCours}${bstRvwList.sysFilNm}"/>" alt="" style = "width:80px; height: 80px;"/>
<span class="storePick__reviewImage__num"><c:out value="${bstRvwList.fileCnt}"/></span>
</div>
</c:if>
<div class="storePick__reviewText storePickPage">
<input type="hidden" value = "<c:out value="${bstRvwList.npayBbscttSnb}"/>" class="npayBbscttSnb"/>
<c:if test="${bstRvwList.bstAt eq 'Y'}">
<span class="reviewBadge reviewBadge--red">BEST</span>
</c:if>
<c:if test="${bstRvwList.bbsTyCd eq '07'}">
<span class="reviewBadge">한달사용기</span>
</c:if>
<span class="bbscttCn">
<c:out value="${bstRvwList.cn}"/>
</span>
</div>
</div>
</a>
<c:choose>
<c:when test="${status.index + 1 < resultMap.rvwInfo.bstRvwList.size()}">
<a class="storePick__box">
<input type="hidden" value ="<c:out value='${resultMap.rvwInfo.bstRvwList[status.index + 1].bbscttInnb}'/>" class="bbscttInnb"/>
<div class="storePick__top">
<div class="storePick__top__info">
<c:if test = "${not empty resultMap.rvwInfo.bstRvwList[status.index + 1].evlScore}">
<div class="reviewStars__wrapper--sm">
<c:set value="${resultMap.rvwInfo.bstRvwList[status.index + 1].evlScore}" var="evlScore1"/>
<div class="reviewStars star-<fmt:formatNumber value="${evlScore1}" pattern="##"/>"></div>
<span class="reviewStars__num"><fmt:formatNumber value="${evlScore1}" pattern="##"/></span>
</div>
</c:if>
<div class="storePick__misc">
<span class="storePick__misc__id"><c:out value="${resultMap.rvwInfo.bstRvwList[status.index + 1].regusrId}"/></span>
<%--리뷰왕 여부--%>
<c:if test="${resultMap.rvwInfo.bstRvwList[status.index + 1].rvwKingAt eq 'Y'}">
<span class="storePick__misc__badge">리뷰왕</span>
</c:if>
<span class="storePick__misc__date"><c:out value="${resultMap.rvwInfo.bstRvwList[status.index + 1].registDt}"/></span>
</div>
</div>
</div>
<div class="storePick__body">
<%--포토 여부 판단 및 포토 건수--%>
<c:if test = "${not empty bstRvwList[status.index + 1].filCours}}">
<div class="storePick__reviewImage storePickPageImg">
<img src="<c:out value="${cdnurl}${resultMap.rvwInfo.bstRvwList[status.index + 1].filCours}${resultMap.rvwInfo.bstRvwList[status.index + 1].sysFilNm}"/>">
<span class="storePick__reviewImage__num">
<c:out value="${resultMap.rvwInfo.bstRvwList[status.index + 1].fileCnt}"/>
</span>
</div>
</c:if>
<div class="storePick__reviewText storePickPage">
<input type="hidden" value = "<c:out value="${resultMap.rvwInfo.bstRvwList[status.index + 1].npayBbscttSnb}"/>" class="npayBbscttSnb"/>
<c:if test="${resultMap.rvwInfo.bstRvwList[status.index + 1].bstAt eq 'Y'}">
<span class="reviewBadge reviewBadge--red">BEST</span>
</c:if>
<c:if test="${resultMap.rvwInfo.bstRvwList[status.index + 1].bbsTyCd eq '07'}">
<span class="reviewBadge">한달사용기</span>
</c:if>
<span class="bbscttCn">
<c:out value="${resultMap.rvwInfo.bstRvwList[status.index + 1].cn}"/>
</span>
</div>
</div>
</a>
</c:when>
<c:otherwise>
<a class="storePick__box" style="visibility: hidden;"></a>
</c:otherwise>
</c:choose>
</div>
</c:if>
</c:forEach>
</div>
<div class="storePick__controls">
<div class="storePick__controls__btnContainer">
<button class="storePick__controls__btn prev">
<span class="visually-hidden">이전</span>
</button>
<button class="storePick__controls__btn next">
<span class="visually-hidden">다음</span>
</button>
</div>
<span class="storePick__counter"></span>
</div>
</div>
</c:if>
<c:if test = "${not empty photoList}">
<div class="photoReview">
<div class="productReview__subTitle">
<span class="productReview__subTitle__title">포토리뷰</span>
<span class="productReview__subTitle__num"><span class="comma"><fmt:formatNumber value="${photoTot}" pattern="#,###"/></span><span class="unit">건</span></span>
</div>
<div class="photoReview__thumbs">
<c:forEach var="photo" items="${photoList}" varStatus="status">
<c:choose>
<c:when test="${!status.last}">
<button type="button" class="photoReview__thumbs__image" value="<c:out value='${photo.bbscttInnb}'/>">
<c:if test = "${not empty photo.filCours}">
<img src="<c:out value='${cdnurl}${photo.filCours}${photo.sysFilNm}'/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="" >
</c:if>
<span class="photoReview__thumbs__num photoPageImg"><c:out value='${photo.fileCnt}'/></span>
<div class = "photoPage" style = "display:none">
<input type="hidden" value = "<c:out value="${photo.npayBbscttSnb}"/>" class = "npayBbscttSnb"/>
<span class="bbscttCn">
<c:out value="${photo.cn}"/>
</span>
</div>
</button>
</c:when>
<c:otherwise>
<button type="button" class="photoReview__thumbs__moreImage">
<c:if test="${not empty photo.filCours}">
<img src="<c:out value='${cdnurl}${photo.filCours}${photo.sysFilNm}'/>" onerror="this.src='/pc/images/image_placeholder.png'"/>
</c:if>
<div class="photoPage" style="display:none">
<input type="hidden" value="<c:out value='${photo.npayBbscttSnb}'/>" class="npayBbscttSnb"/>
<span class="bbscttCn">
<c:out value="${photo.cn}"/>
</span>
</div>
<span class="photoReview__thumbs__more">더보기</span>
</button>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</c:if>
<%--전체 리뷰수, 포토 리뷰수, 한달 리뷰수 리뷰 jsp 삽입 시 값 set--%>
<input type = "hidden" value = "<fmt:formatNumber value="${evlInfo.cntBbsctt}" pattern="#,###"/>" id = cntBbsctt>
<input type = "hidden" value = "<fmt:formatNumber value="${photoTot}" pattern="#,###"/>" id = photoRvwCnt>
<input type = "hidden" value = "<fmt:formatNumber value="${evlInfo.mtRvwCnt}" pattern="#,###"/>" id = mtRvwCnt>
<div id="userReviewTarget" class="userReview">
</div>
</html>

View File

@@ -0,0 +1,133 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : RvwPhotoListR.jsp
Description : 포토 리뷰 리스트 모달
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 김혜인
--%>
<!DOCTYPE html>
<html lang="ko">
<div id="photoReview-pop" class="modal modal--photoReview" style="max-width: 1200px;">
<input type = "hidden" id = "photoPageIndex" value = "<c:out value = "${resultMap.bbscttVO.pageIndex}"/>">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<div class="modal-content">
<div class="photoReviewDetail">
<div class="photoReviewDetail__top">
<span class="photoReviewDetail__top__text">
포토/동영상 리뷰
</span>
<span class="photoReviewDetail__top__num">
<span class="photoReviewDetail__currentIndex"></span>/<span
class="photoReviewDetail__totalNum"><c:out value = "${ resultMap.paginationInfo.totalRecordCount }"/></span>
</span>
<button class="photoReviewDetail__top__seeAll">전체보기</button>
</div>
<%--상세보기--%>
<div class="photoReviewDetail__slide">
<c:forEach var = "photoList" items= "${resultMap.resultList.photoList}">
<div class="photoReviewDetail__item">
<div class="photoReviewDetail__mainImage">
<img src="<c:out value = "${cdnurl}${photoList.filCours}${photoList.sysFilNm}"/>"
onerror = "javascript:img=new Image();img.src='/pc/images/image_placeholder.png';
if(img.complete){this.src='/pc/images/image_placeholder.png'}
else{this.style.display='none';}" alt="">
</div>
<div class="photoReviewDetail__right">
<div class="photoReviewDetail__rightTop">
<div class="photoReviewDetail__userImage">
<img src="/pc/images/icon_user-info.png" alt="">
</div>
<div class="photoReviewDetail__top__info">
<c:if test = "${not empty photoList.evlScore}">
<div class="reviewStars__wrapper--sm">
<div class="reviewStars star-<fmt:formatNumber value="${photoList.evlScore}" pattern="##"/>"></div>
<span class="reviewStars__num"><fmt:formatNumber value="${photoList.evlScore}" pattern="##"/></span>
</div>
</c:if>
<div class="photoReviewDetail__misc">
<span class="photoReviewDetail__misc__id"><c:out value = "${photoList.regusrId}"/></span>
<span class="photoReviewDetail__misc__date"><c:out value = "${photoList.registDt}"/></span>
</div>
</div>
</div>
<div class="photoReviewDetail__reviewText" style="white-space: pre-wrap;">
<c:out value="${photoList.cn}"/>
</div>
<div class="photoReviewDetail__thumbs">
<c:forEach var = "photoByBbsctt" items = "${resultMap.resultList.photoByBbsctt}">
<c:if test = "${photoList.bbscttInnb eq photoByBbsctt.bbscttInnb}">
<div class="photoReviewDetail__thumbs__item ">
<img src="<c:out value = "${cdnurl}${photoByBbsctt.filCours}${photoByBbsctt.sysFilNm}"/>"
onerror = "javascript:img=new Image();img.src='/pc/images/image_placeholder.png';
if(img.complete){this.src='/pc/images/image_placeholder.png'}
else{this.style.display='none';}" alt="">
</div>
</c:if>
</c:forEach>
</div>
<c:if test = "${photoList.bbscttEvlUseAt eq 'Y'}">
<div class="photoReviewDetail__rightBottom">
<span class="photoReviewDetail__reviewAsk">리뷰가 도움이 되었나요?</span>
<button class="userReviewItem__like"
onclick="fn_update_bbsctt_recomend('recommend', '<c:out value="${photoList.bbscttInnb}"/>', this);">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"
fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"></path>
</svg>
<em class="recommendCnt">
<c:out value = "${photoList.recomendCnt}"/>
</em>
</button>
<c:if test = "${photoList.bbscttEvlRecomendStep eq '02'}">
<button class="userReviewItem__like userReviewItem__like--dislike"
onclick="fn_update_bbsctt_recomend('nonrecommend', '<c:out value="${photoList.bbscttInnb}"/>', this);" tabindex="0">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"></path>
</svg>
<em class="nonrecommendCnt">
<c:out value = "${photoList.nonrecomendCnt}"/>
</em>
</button>
</c:if>
</div>
</c:if>
</div>
</div>
</c:forEach>
</div>
<%--전체보기--%>
<div class="photoReviewGallery">
<ul class="photoReviewGallery__list">
<c:if test="${not empty resultMap.resultList.photoList}">
<c:forEach var = "photoList1" items= "${resultMap.resultList.photoList}">
<li class="photoReviewGallery__item">
<button type="button" class="photoReviewGallery__image">
<img src="<c:out value = "${cdnurl}${photoList1.filCours}${photoList1.sysFilNm}"/>"
onerror = "javascript:img=new Image();img.src='/pc/images/image_placeholder.png';
if(img.complete){this.src='/pc/images/image_placeholder.png'}
else{this.style.display='none';}" alt="">
<span class="photoReviewGallery__num"><c:out value = "${photoList1.fileCnt}"/></span>
</button>
</li>
</c:forEach>
</c:if>
<li id = "last"></li>
</ul>
</div>
</div>
</div>
</div>
</html>

View File

@@ -0,0 +1,124 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : StorePickDtlR.jsp
Description : 리뷰 상세 모달
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 김혜인
--%>
<!DOCTYPE html>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<html lang="ko">
<div id="storePick-pop" class="modal modal--photoReview" style="max-width: 1200px;">
<div class="modal-content">
<div class="storePickDetail">
<div class="storePickDetail__top">
<span class="storePickDetail__top__text">
스토어 PICK 리뷰
</span>
<span class="storePickDetail__top__num">
<span class="storePickDetail__currentIndex"></span>
/<span class="storePickDetail__totalNum"><c:out value = "${resultMap.paginationInfo.totalRecordCount}"/></span>
</span>
</div>
<div class="storePickDetail__slide">
<c:forEach var="photoList" items="${resultMap.resultList.photoList}" varStatus="status">
<c:set value="${photoList.sysFilNm}" var="sysFilNm"/>
<div class="storePickDetail__item">
<input type = "hidden" class= "bbscttInnb" value = "<c:out value="${photoList.bbscttInnb}"/>"/>
<div class="storePickDetail__mainImage storePickMainImg">
<c:if test = "${not empty photoList.filCours}">
<img src="<c:out value="${cdnurl}${photoList.filCours}${photoList.sysFilNm}"/>"
onerror = "javascript:img=new Image();img.src='/pc/images/image_placeholder.png';
if(img.complete){this.src='/pc/images/image_placeholder.png'}
else{this.style.display='none';}"/>
</c:if>
</div>
<div class="storePickDetail__right storePickModal">
<div class="storePickDetail__rightTop">
<div class="storePickDetail__userImage">
<img src="/pc/images/icon_user-info.png" alt="">
</div>
<div class="storePickDetail__top__info">
<div class="reviewStars__wrapper--sm">
<div class="reviewStars star-<fmt:formatNumber value="${photoList.evlScore}" pattern="##"/>"></div>
<span class="reviewStars__num"><fmt:formatNumber value="${photoList.evlScore}" pattern="##"/></span>
</div>
<div class="storePickDetail__misc">
<span class="storePick__misc__id"><c:out value="${photoList.regusrId}"/></span>
<%--리뷰왕 여부--%>
<c:if test="${photoList.rvwKingAt eq 'Y'}">
<span class="storePick__misc__badge">리뷰왕</span>
</c:if>
<span class="storePick__misc__date"><c:out value="${photoList.registDt}"/></span>
</div>
</div>
</div>
<div class="storePickDetail__reviewText storePickCn">
<c:if test="${photoList.bstAt eq 'Y'}">
<span class="reviewBadge reviewBadge--red">BEST</span>
</c:if>
<c:if test="${photoList.bbsTyCd eq '07'}">
<span class="reviewBadge">한달사용기</span>
</c:if>
<c:out value="${photoList.cn}" escapeXml="false"/>
</div>
<div class="storePickDetail__thumbs storePickImage">
<c:forEach var = "photoByBbsctt" items = "${resultMap.resultList.photoByBbsctt}">
<c:if test = "${photoList.bbscttInnb eq photoByBbsctt.bbscttInnb}">
<div class="storePickDetail__thumbs__item listImage <c:if test = "${sysFilNm eq photoByBbsctt.sysFilNm}">current</c:if>">
<img src="<c:out value = "${cdnurl}${photoByBbsctt.filCours}"/><c:out value = "${photoByBbsctt.sysFilNm}"/>"
onerror = "javascript:img=new Image();img.src='/pc/images/image_placeholder.png';if(img.complete){this.src='/pc/images/image_placeholder.png'} else{this.style.display='none';}"
alt="">
</div>
</c:if>
</c:forEach>
</div>
<div class="storePickDetail__rightBottom">
<c:if test = "${photoList.bbscttEvlUseAt eq 'Y'}">
<span class="storePickDetail__reviewAsk">리뷰가 도움이 되었나요?</span>
<button class="userReviewItem__like"
onclick="fn_update_bbsctt_recomend('recommend', '<c:out value="${photoList.bbscttInnb}"/>', this);">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20" fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"/>
</svg>
<em class="recommendCnt">
<c:out value="${photoList.recomendCnt}"/>
</em>
</button>
<c:if test = "${photoList.bbscttEvlRecomendStep eq '02'}">
<button class="userReviewItem__like userReviewItem__like--dislike"
onclick="fn_update_bbsctt_recomend('nonrecommend', '<c:out value="${photoList.bbscttInnb}"/>', this);">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
viewBox="0 0 20 20"
fill="none">
<path
d="M14.7749 16.583H5.6756V7.41637L11.3711 1.75293L11.7012 1.8747C11.9266 2.03069 12.0992 2.22513 12.2188 2.45803C12.3385 2.69094 12.3705 2.93292 12.315 3.18399L12.2941 3.20803L11.5345 7.41637H17.2429C17.6115 7.41637 17.9269 7.54751 18.1892 7.8098C18.4515 8.07208 18.5826 8.38752 18.5826 8.75612V9.62308C18.5826 9.72351 18.5749 9.81351 18.5594 9.8931C18.5439 9.97269 18.5153 10.0558 18.4736 10.1423L16.1052 15.7185C15.9865 15.9829 15.8075 16.193 15.5682 16.349C15.3289 16.505 15.0645 16.583 14.7749 16.583ZM6.75891 15.4997H14.7749C14.8337 15.4997 14.8938 15.4837 14.9552 15.4516C15.0167 15.4195 15.0634 15.3661 15.0955 15.2913L17.4993 9.68718V8.75612C17.4993 8.68133 17.4753 8.61989 17.4272 8.5718C17.3791 8.52372 17.3177 8.49968 17.2429 8.49968H10.2461L11.1868 3.4532L6.75891 7.86508V15.4997ZM5.6756 7.41637V8.49968H2.49931V15.4997H5.6756V16.583H1.41602V7.41637H5.6756Z"
fill="black"></path>
</svg>
<em class="nonrecommendCnt">
<c:out value="${photoList.nonrecomendCnt}"/>
</em>
</button>
</c:if>
</c:if>
</div>
</div>
</div>
</c:forEach>
</div>
</div>
</div>
</div>
</html>

View File

@@ -0,0 +1,160 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<script defer>
//쿠폰받기 가능한 쿠폰이 없을경우 버튼, 전체선택버튼 비활성화
$(document).ready(function () {
let couponUsedChk = 0;
$('div .couponSelect__item.used').each(() => {
couponUsedChk++;
});
if ($('div .couponSelect__item.coupon__used__chk').length === couponUsedChk) {
$('#couponCheckAll').prop('disabled', true)
$('#selectCouponBtn').prop('disabled', true)
}
});
//쿠폰 선택 우측 텍스트 영역 클릭해도, 체크박스 체크되도록 2. 전체선택 클릭 시, 전체 체크박스 체크/해제
$('.couponSelect__item__right').click(function () {
var checkbox = $(this).prev().find('input[type="checkbox"]');
checkbox.trigger('click');
});
$('#couponCheckAll').click(function () {
if ($('#couponCheckAll').is(':checked')) {
$('.couponCheck').prop('checked', true);
} else {
$('.couponCheck').prop('checked', false);
}
if ($('.couponCheck').closest('.couponSelect__item').hasClass('used')) {
$('.couponCheck:checked').prop('checked', false);
}
});
$('.couponCheck').click(function () {
if ($('.couponCheck').length == $('.couponCheck:checked').length) {
$('#couponCheckAll').prop('checked', true);
} else {
$('#couponCheckAll').prop('checked', false);
}
});
$('')
</script>
<!-- 쿠폰 받기 모달 -->
<div id="coupon-select-popUp" class="modal default" style="max-width: 520px;">
<div class="modal-header">
<div class="modal-header__title">다운로드 가능한 쿠폰</div>
</div>
<div class="modal-content">
<div class="couponSelect" id="dwldCouponDiv">
<div class="couponSelect__item couponSelect__item--checkAll">
<div class="couponSelect__item__left">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input id="couponCheckAll" type="checkbox" value="">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
</div>
<div class="couponSelect__item__right">
<span class="couponSelect__item__checkAll">전체선택</span>
</div>
</div>
<c:choose>
<c:when test="${not empty resultMap.couponList}">
<c:forEach var="couponInfo" items="${resultMap.couponList}">
<c:choose>
<c:when test="${couponInfo.couponTrgetAt eq '1'}">
<div class="couponSelect__item coupon__used__chk <c:if test="${couponInfo.couponDownAt eq 'Y' }"> used</c:if>"> <%--사용한 쿠폰이거나 이미 다운로드 하였을 경우 used 클래스 적용--%>
<div class="couponSelect__item__left">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox is-medium">
<input class="couponCheck dwldCheckBox" type="checkbox" value="">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
</div>
<div class="couponSelect__item__right">
<span class="couponSelect__item__price"><fmt:formatNumber value="${couponInfo.aditDscntAmt}" />원
<c:if test="${couponInfo.couponDownAt eq 'Y'}"><span class="couponSelect__item__usedText">(이미 다운로드 한 쿠폰)</span></c:if>
</span>
<p class="couponSelect__item__detail"><c:out value="${couponInfo.couponSndngNm}"/> </p>
<c:choose>
<c:when test="${couponInfo.cvalidpdKndCd eq '01'}">
<p class="couponSelect__item__date">~<c:out value="${couponInfo.validpdEndDt}"/> (<c:out value="${couponInfo.validpdDeCnt}"/> 일 남음)</p>
<input type="hidden" name="couponInnb" value="<c:out value="${ couponInfo.couponInnb }"/>"/>
<input type="hidden" name="couponSopmalCd" value="<c:out value="${ couponInfo.sopmalCd }"/>"/>
<input type="hidden" name="couponSndngInnb" value="<c:out value="${ couponInfo.couponSndngInnb }"/>"/>
</c:when>
<c:otherwise>
<p class="couponSelect__item__date">~<c:out value="${couponInfo.dwldEndDt}"/> (발급(다운로드)일로 부터 <c:out value="${couponInfo.validpdDeCnt}"/> 일)</p>
<input type="hidden" name="couponInnb" value="<c:out value="${ couponInfo.couponInnb }"/>"/>
<input type="hidden" name="couponSopmalCd" value="<c:out value="${ couponInfo.sopmalCd }"/>"/>
<input type="hidden" name="couponSndngInnb" value="<c:out value="${ couponInfo.couponSndngInnb }"/>"/>
</c:otherwise>
</c:choose>
</div>
</div>
</c:when>
<c:otherwise>
<div class="couponSelect__item used">
<div class="couponSelect__item__left">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox is-medium">
<input class="couponCheck dwldCheckBox" type="checkbox" value="">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
</div>
<div class="couponSelect__item__right">
<span class="couponSelect__item__price"><fmt:formatNumber value="${couponInfo.aditDscntAmt}" />원
<span class="couponSelect__item__usedText">쿠폰 대상이 아닙니다</span>
</span>
<p class="couponSelect__item__detail"><c:out value="${couponInfo.couponSndngNm}"/> </p>
<c:choose>
<c:when test="${couponInfo.cvalidpdKndCd eq '01'}">
<p class="couponSelect__item__date">~<c:out value="${couponInfo.validpdEndDt}"/> (<c:out value="${couponInfo.validpdDeCnt}"/> 일 남음)</p>
<input type="hidden" name="couponInnb" value="<c:out value="${ couponInfo.couponInnb }"/>"/>
<input type="hidden" name="couponSopmalCd" value="<c:out value="${ couponInfo.sopmalCd }"/>"/>
<input type="hidden" name="couponSndngInnb" value="<c:out value="${ couponInfo.couponSndngInnb }"/>"/>
</c:when>
<c:otherwise>
<p class="couponSelect__item__date">~<c:out value="${couponInfo.dwldEndDt}"/> (발급(다운로드)일로 부터 <c:out value="${couponInfo.validpdDeCnt}"/> 일)</p>
<input type="hidden" name="couponInnb" value="<c:out value="${ couponInfo.couponInnb }"/>"/>
<input type="hidden" name="couponSopmalCd" value="<c:out value="${ couponInfo.sopmalCd }"/>"/>
<input type="hidden" name="couponSndngInnb" value="<c:out value="${ couponInfo.couponSndngInnb }"/>"/>
</c:otherwise>
</c:choose>
</div>
</div>
</c:otherwise>
</c:choose>
</c:forEach>
</c:when>
<c:otherwise>
<c:out value="다운로드 가능한 쿠폰이 없습니다."/>
</c:otherwise>
</c:choose>
</div>
</div>
<div class="modal-footer">
<a href="#" rel="modal:close" class="btn large outline">닫기</a>
<button class="btn theme large" id="selectCouponBtn" type="button" onclick="fn_coupon_dwld_regist();">선택한 쿠폰 받기</button>
</div>
</div>

View File

@@ -0,0 +1,33 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : StorePickDtlR.jsp
Description : 리뷰 상세 모달
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-05 김혜인
--%>
<!DOCTYPE html>
<html lang="ko">
<!--권한 reject-->
<div id="qna-pop-regist" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
이용하시려면 로그인이 필요합니다!
<br>
로그인하시겠습니까?
</p>
</div>
<div class="alert-btn-container">
<a class="alert-btn alert-btn--confirm" onclick = "fn_move_login()" style="cursor:pointer"><spring:message code="button.yes"/></a>
<a href="#" rel="modal:close" class="alert-btn"><spring:message code="button.no"/></a>
</div>
</div>
</html>

View File

@@ -0,0 +1,165 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : BrandStoryR.jsp
Description : 브랜드스토리
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-10-25 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<c:choose>
<c:when test = "${sopmalCd ne 'DT'}">
<c:choose>
<c:when test = "${sopmalCd eq 'TZ' || sopmalCd eq 'CH'}">
<c:set var = "url" value = "/sopmal/main/selectiframeBrandStroyForm?dv=${dv}"/>
</c:when>
<c:otherwise>
<c:set var = "url" value = "/sopmal/main/selectiframeBrandStroyForm"/>
</c:otherwise>
</c:choose>
<iframe src="${url}" style="width: 100%;" id = "myiframe" scrolling="no"></iframe>
</c:when>
<c:otherwise>
<div class="sub-wrapper">
<jsp:include page="/WEB-INF/views/html/pc/DT/brandStory.jsp"/>
</div>
</c:otherwise>
</c:choose>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
<script>
$(document).ready(function (){
$("#myiframe").on('load', function() {
var iframe = $(this);
const sopmalCd = '<c:out value="${sopmalCd}"/>';
let height = '';
//아이프레임 높이값 고정
if(sopmalCd === 'JM' || sopmalCd === 'AF' || sopmalCd === 'DT'){
height = '3293';
}else if ( sopmalCd === 'BD') {
height = '3000';
}else if (sopmalCd === 'DL' ){
height = '1200';
}else if (sopmalCd === 'NB'){
url = document.getElementById("myiframe").contentWindow.location.href;
if(url.indexOf('selectNbPromiseHtml') > 0){
height = '1800';
}else if (url.indexOf('selectNbIngredientHtml') > 0){
height = '1600';
}else {
height = '4600';
}
}else if (sopmalCd === 'PL'){
height = '1800';
}else if (sopmalCd === 'TZ'){
height = '2600';
const dv = '<c:out value="${dv}"/>';
if(dv === 'production'){
height = '2200';
}else if (dv === 'way'){
height = '1800';
}
}else if (sopmalCd === 'CH'){
const dv = $("#myiframe").attr("chDv");
if(dv ==='company'){
$("#myiframe").css('height', '2000px');
} else if (dv === 'ceo') {
$("#myiframe").css('height', '800px');
} else if (dv === 'technology') {
$("#myiframe").css('height', '21285px');
} else if (dv === 'history') {
$("#myiframe").css('height', '2180px');
} else if (dv === 'map') {
$("#myiframe").css('height', '1000px');
} else if (dv === 'way') {
$("#myiframe").css('height', '1300px');
} else if (dv === 'script') {
$("#myiframe").css('height', '4300px');
}
}
if(!fn_is_empty(height)){
iframe.css('height', height+ 'px');
}
});
// iframe 메시지 수신 핸들러(iframe 높이 맞추기)
window.addEventListener('message', (event) => {
const msg = event.data;
const sopmalCd = '<c:out value="${sopmalCd}"/>';
if(sopmalCd === 'PL'){
if(msg == '01'){
$("#myiframe").css('height', '1860px');
}else if(msg == '02'){
$("#myiframe").css('height', '1560px');
} else if (msg == '03') {
$("#myiframe").css('height', '1560px');
} else if (msg == '04') {
$("#myiframe").css('height', '1060px');
} else if (msg == '05') {
$("#myiframe").css('height', '2160px');
} else if (msg == '06') {
$("#myiframe").css('height', '2460px');
}
}else if(sopmalCd === 'TZ'){
if (msg == '01') {
$("#myiframe").css('height', '1860px');
} else if (msg == '02') {
$("#myiframe").css('height', '1560px');
} else if (msg == '03') {
$("#myiframe").css('height', '1560px');
} else if (msg == '04') {
$("#myiframe").css('height', '1060px');
} else if (msg == '05') {
$("#myiframe").css('height', '2160px');
} else if (msg == '06') {
$("#myiframe").css('height', '2460px');
}
}else if (sopmalCd === 'CH'){
if (msg === 'company') {
$("#myiframe").css('height', '2000px');
} else if (msg === 'ceo') {
$("#myiframe").css('height', '800px');
} else if (msg === 'technology') {
$("#myiframe").css('height', '21285px');
} else if (msg === 'history') {
$("#myiframe").css('height', '2180px');
} else if (msg === 'map') {
$("#myiframe").css('height', '1000px');
} else if (msg === 'way') {
$("#myiframe").css('height', '1300px');
} else if (msg === 'script') {
$("#myiframe").css('height', '4300px');
} else if (msg === 'tech_1') { //참다한기술
$("#myiframe").css('height', '2000px');
} else if (msg === 'tech_2') { // 첨단 생산설비
$("#myiframe").css('height', '1847px');
} else if (msg === 'tech_3') { // 3무4무의진실
$("#myiframe").css('height', '7953px');
}
$("#myiframe").attr("chDv",msg);
}
});
});
</script>
</html>

View File

@@ -0,0 +1,51 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : StrListForm.jsp
Description : 매장안내 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<iframe src="/sopmal/main/selectiframeBrandValueForm" style="width: 100%; " id = "myiframe"></iframe>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
<script>
$("#myiframe").on('load', function() {
var iframe = $(this);
const sopmalCd = '<c:out value="${sopmalCd}"/>';
let height = '';
if (sopmalCd === 'JM') { //저마데 아이프레임 높이값 고정
height = '6000';
} else if (sopmalCd === 'AF') {
height = '2403';
}
if (!fn_is_empty(height)) {
iframe.css('height', height + 'px');
}
});
</script>
</html>

View File

@@ -0,0 +1,56 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : StrListForm.jsp
Description : 매장안내 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<h2 class="page-title__title">
<c:forEach var = "stplat" items = "${resultMap.stplat}">
<c:if test = "${stplat.cd eq maSopmalVO.stplatDvCd}"><c:out value="${stplat.cdNm}"/></c:if>
</c:forEach>
</h2>
</div>
<div class="ck-content">
<c:forEach var = "clauseList" items = "${resultMap.clauseList}">
<c:out value="${clauseList.stplatCn}" escapeXml="false"/>
</c:forEach>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>

View File

@@ -0,0 +1,353 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : StrListForm.jsp
Description : 매장안내 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
});
/******************************************************
* 매장 목록 이동
* ****************************************************/
const fn_store_list = function() {
$('#listForm').attr('action', '<c:url value="/sopmal/main/selectStrListForm"/>');
$('#listForm').attr('method', 'post');
$('#listForm').submit();
}
</script>
<style>
.wrap_map { position:relative; width:100%; }
.overlay_label {margin-bottom: 96px; display: inline-block;vertical-align: top; font-size: 13px; font-weight:bold; line-height: 24px; padding:0 5px; background-color:#fff; border:solid 1px gray; border-radius:0.3em; }
.map_btn_comm {float:left;display:block;width:70px;height:27px;background:url('http://t1.daumcdn.net/localimg/localimages/07/mapapidoc/sample_button_control.png') no-repeat}
.wrap_button {position:absolute;left:15px;top:12px;z-index:2}
.btn_linkMap {background-position:0 0;}
.btn_resetMap {background-position:-69px 0;}
.screen_out {display:block;overflow:hidden;position:absolute;left:-9999px;width:1px;height:1px;font-size:0;line-height:0;text-indent:-9999px}
</style>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<div class="page-title center">
<h2 class="page-title__title">매장 안내</h2>
</div>
<div class="storeDetail">
<div class="storeDetail__top">
<h3 class="storeDetail__storeName"><c:out value="${ resultMap.result.strNm }"/></h3>
<p class="storeDetail__text">
<c:if test="${ resultMap.result.reprsntBrand ne resultMap.paramVO.sopmalCd }">
${ resultMap.result.sopmalNm }가 ${ resultMap.result.reprsntBrandNm }에 입점되었습니다.
</c:if>
</p>
</div>
<div class="storeDetail__body">
<div class="productDetailTop__left">
<div class="productDetailGallery">
<!-- 상품 메인 이미지 -->
<div class="productDetailGallery__current">
<img id="featured" src="${ cdnurl }${ fn:split(resultMap.result.strImg, '|')[0] }" onerror="this.src='/pc/images/image_placeholder.png'" alt="매장상세이미지">
</div>
<!-- 상품 썸네일 이미지 -->
<div class="productDetailGallery__thumbs">
<button id="thumbsLeft"
class="productDetailGallery__arrow productDetailGallery__arrow--left">
</button>
<div class="productDetailGallery__slider">
<c:forEach var="image" items="${fn:split(resultMap.result.strImg, '|')}" varStatus="status">
<div class="productDetailGallery__item <c:if test="${status.first}"> active </c:if>" >
<img src="${ cdnurl }${image}" onerror="this.src='/pc/images/image_placeholder.png'" alt="매장상세이미지">
</div>
</c:forEach>
</div>
<button id="thumbsRight"
class="productDetailGallery__arrow productDetailGallery__arrow--right">
</button>
</div>
</div>
</div>
<div class="table-wrapper">
<table class="table write">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 140px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
매장주소
</th>
<td>
<div class="td-inner">
<c:choose>
<c:when test="${ not empty resultMap.result.strRnmAdres && not empty resultMap.result.strAdres}">
<c:out value="${ resultMap.result.strRnmAdres }"/><c:out value="${ resultMap.result.strDtlAdres }"/>
</c:when>
<c:when test="${ not empty resultMap.result.strRnmAdres && empty resultMap.result.strAdres }">
<c:out value="${ resultMap.result.strRnmAdres }"/><c:out value="${ resultMap.result.strDtlAdres }"/>
</c:when>
<c:when test="${ empty resultMap.result.strRnmAdres && not empty resultMap.result.strAdres }">
<c:out value="${ resultMap.result.strAdres }"/><c:out value="${ resultMap.result.strDtlAdres }"/>
</c:when>
</c:choose>
</div>
</td>
</tr>
<tr>
<th>영업시간</th>
<td>
<div class="td-inner">
<c:out value="${ resultMap.result.bsnTme }"/>
</div>
</td>
</tr>
<tr>
<th>휴무안내</th>
<td>
<div class="td-inner">
<c:choose>
<c:when test="${ not empty resultMap.result.hvofDe && not empty resultMap.result.hvofDeAdit }">
<c:out value="${ resultMap.result.hvofDe }"/>
<br>
<c:out value="${ resultMap.result.hvofDeAdit }"/>
</c:when>
<c:when test="${ not empty resultMap.result.hvofDe && empty resultMap.result.hvofDeAdit }">
<c:out value="${ resultMap.result.hvofDe }"/>
</c:when>
<c:when test="${ empty resultMap.result.hvofDe && not empty resultMap.result.hvofDeAdit }">
<c:out value="${ resultMap.result.hvofDeAdit }"/>
</c:when>
</c:choose>
</div>
</td>
</tr>
<tr>
<th>전화번호</th>
<td>
<div class="td-inner">
<c:out value="${ resultMap.result.strTelnb }"/>
</div>
</td>
</tr>
<tr>
<th>개점일</th>
<td>
<div class="td-inner">
<c:out value="${ resultMap.result.opbizDe }"/>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="storeDetail__top">
<h3 class="storeDetail__storeName">위치안내</h3>
</div>
<div class="wrap_map storeDetail__map">
<div id="map" style="display: flex; justify-content: center; align-items: center; background-color: #f5f5f5; height: 400px;" title="카카오지도 영역">
</div>
<div class="wrap_button">
<a href="javascript:void(0);" class="map_btn_comm btn_linkMap" target="_blank" onclick="moveKakaoMap(this)"><span class="screen_out">지도 크게보기</span></a> <!-- 지도 크게보기 버튼입니다 -->
<a href="javascript:void(0);" class="map_btn_comm btn_resetMap" onclick="resetKakaoMap()"><span class="screen_out">지도 초기화</span></a> <!-- 지도 설정 초기화 버튼입니다 -->
</div>
</div>
</div>
<div class="sub-bottom-btn-container">
<button type="button" class=" btn xl outline" onclick="fn_store_list();">목록</button>
</div>
</div>
<form id="listForm">
<input type="hidden" id="strInnb" name ="strInnb" value="<c:out value="${ resultMap.paramVO.strInnb }"/>"/>
<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value="${ strVO.pageIndex }"/>"/>
<input type="hidden" id="recordCountPerPage" name="recordCountPerPage" value="<c:out value="${ strVO.recordCountPerPage }"/>"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="<c:out value="${ strVO.pageUnit }"/>"/>
<input type="hidden" id="sopmalCd" name="sopmalCd" value=""/>
</form>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
<script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=${kakaoKey}"></script>
<script type="text/javascript">
var map_y = '<c:out value="${ resultMap.result.la }"/>';
var map_x = '<c:out value="${ resultMap.result.lo }"/>';
var map_overlay = '<c:out value="${ resultMap.result.strNm }"/>';
var container = document.getElementById('map'); //지도를 담을 영역의 DOM 레퍼런스
var options = { //지도를 생성할 때 필요한 기본 옵션
center: new kakao.maps.LatLng(map_y, map_x), //지도의 중심좌표.
level: 4 //지도의 레벨(확대, 축소 정도)
};
var map = new kakao.maps.Map(container, options); //지도 생성 및 객체 리턴
// 마커가 표시될 위치입니다
var markerPosition = new kakao.maps.LatLng(map_y, map_x);
// 마커를 생성합니다
var marker = new kakao.maps.Marker({
position: markerPosition
});
// 마커가 지도 위에 표시되도록 설정합니다
marker.setMap(map);
// 아래 코드는 지도 위의 마커를 제거하는 코드입니다
// marker.setMap(null);
// 일반 지도와 스카이뷰로 지도 타입을 전환할 수 있는 지도타입 컨트롤을 생성합니다
var mapTypeControl = new kakao.maps.MapTypeControl();
// 지도에 컨트롤을 추가해야 지도위에 표시됩니다
// kakao.maps.ControlPosition은 컨트롤이 표시될 위치를 정의하는데 TOPRIGHT는 오른쪽 위를 의미합니다
map.addControl(mapTypeControl, kakao.maps.ControlPosition.TOPRIGHT);
// 지도 확대 축소를 제어할 수 있는 줌 컨트롤을 생성합니다
var zoomControl = new kakao.maps.ZoomControl();
map.addControl(zoomControl, kakao.maps.ControlPosition.RIGHT);
// 커스텀 오버레이에 표시할 내용입니다
// HTML 문자열 또는 Dom Element 입니다
var map_content = '<div class ="overlay_label">'+map_overlay+'</div>';
// 커스텀 오버레이가 표시될 위치입니다
var map_position = new kakao.maps.LatLng(map_y, map_x);
// 커스텀 오버레이를 생성합니다
var customOverlay = new kakao.maps.CustomOverlay({
position: map_position,
content: map_content
});
// 커스텀 오버레이를 지도에 표시합니다
customOverlay.setMap(map);
//지도 이동 이벤트 핸들러
function moveKakaoMap(self){
var center = map.getCenter(),
lat = center.getLat(),
lng = center.getLng();
self.href = 'https://map.kakao.com/link/map/' + encodeURIComponent(map_overlay) + ',' + lat + ',' + lng; //Kakao 지도로 보내는 링크
}
//지도 초기화 이벤트 핸들러
function resetKakaoMap(){
map.setCenter(options.center); //지도를 초기화 했던 값으로 다시 셋팅합니다.
map.setLevel(options.level);
}
</script>
<script>
// 상품 썸네일 이미지 호버 시, 메인 이미지 변경
$('.productDetailGallery__item').on('mouseover', function () {
var $activeImage = $('.productDetailGallery__item.active');
if ($activeImage.length) {
$activeImage.removeClass('active');
}
$(this).addClass('active');
var imgSrc = $(this).find('img').attr('src');
$('#featured').attr('src', imgSrc);
});
$('#thumbsLeft').on('click', function () {
var $slider = $('.productDetailGallery__slider');
$slider.scrollLeft($slider.scrollLeft() - 500);
});
$('#thumbsRight').on('click', function () {
var $slider = $('.productDetailGallery__slider');
$slider.scrollLeft($slider.scrollLeft() + 500);
});
// 상품 썸네일 이미지 스크롤 이벤트
var $slider = $('.productDetailGallery__slider');
var $thumbs = $('.productDetailGallery__item');
var $thumbsLeft = $('#thumbsLeft');
var $thumbsRight = $('#thumbsRight');
if ($slider.scrollLeft() == 0) {
$thumbsLeft.addClass('hidden');
}
if ($thumbs.length <= 5) {
$thumbsLeft.addClass('hidden');
$thumbsRight.addClass('hidden');
}
$slider.scroll(function () {
if ($slider.scrollLeft() == 0) {
$thumbsLeft.addClass('hidden');
} else {
$thumbsLeft.removeClass('hidden');
}
if ($slider.scrollLeft() + $slider.width() == $slider[0].scrollWidth) {
$thumbsRight.addClass('hidden');
} else {
$thumbsRight.removeClass('hidden');
}
});
</script>
</html>

View File

@@ -0,0 +1,175 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : StrListForm.jsp
Description : 매장안내 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<script>
$(document).ready(function() {
});
</script>
<!-- 메인 컨텐츠 영역 -->
<form id="listForm">
<input type="hidden" id="strInnb" name="strInnb" value=""/>
<div class="boxTab__content current">
<div class="storeList__inner">
<div class="storeList__top">
<div class="storeList__topImage">
<img src="/pc/images/매장안내이미지.png" alt="">
</div>
<div class="storeList__topText">
<p class="storeList__title">전국 <c:out value="${ resultMap.resultCnt }"/>개</p>
<p class="storeList__subTitle">매장 한 눈에 보기</p>
</div>
</div>
<div class="storeList__tab__wrapper">
<button class="storeList__tab__btn previous" type="button"><span
class="visually-hidden">이전으로</span></button>
<div class="storeList__tab">
<button class="storeList__tabBtn current" type="button">
<span class="storeList__tabText">전체</span>
</button>
<c:forEach var="groupList" items="${ resultMap.resultGroupList }" varStatus="status">
<button class="storeList__tabBtn" type="button">
<span class="storeList__tabText">
<c:choose>
<c:when test="${ fn:substring(groupList.ctyDo, 0, 2) eq '충청'}">
<c:out value="${fn:substring(groupList.ctyDo, 0, 1)}"/><c:out value="${fn:substring(groupList.ctyDo, 2, 3)}"/>
</c:when>
<c:otherwise>
<c:out value="${fn:substring(groupList.ctyDo, 0, 2)}"/>
</c:otherwise>
</c:choose>
</span>
</button>
</c:forEach>
</div>
<button class="storeList__tab__btn next" type="button"><span
class="visually-hidden">다음으로</span></button>
</div>
<div class="storeList__content">
<div class="storeList__section current">
<c:choose>
<c:when test="${ not empty resultMap.resultGroupList && fn:length(resultMap.resultGroupList) > 0 }">
<c:forEach var="groupList" items="${ resultMap.resultGroupList }" varStatus="status">
<div class="storeList__subList">
<div class="storeList__subList__top">
<span class="storeList__subList__title"><c:out value="${ groupList.ctyDo }"/></span>
<span class="storeList__subList__subTitle">(<c:out value="${ groupList.strCount}"/>개점)</span>
</div>
<div class="storeList__subList__bottom">
<ul class="storeList__subList__list">
<c:forEach var="list" items="${ resultMap.resultList }" varStatus="status">
<c:if test="${ groupList.ctyDo eq list.ctyDo }">
<li>
<a type="button" onclick="fn_move_store_dtl('<c:out value="${ list.strInnb }"/>');">
<span class="storeList__subList__name"><c:out value="${ list.ctyGunGu }"/></span>
<span class="storeList__subList__store"><c:out value="${ list.strNm }"/></span>
</a>
</li>
</c:if>
</c:forEach>
</ul>
</div>
</div>
</c:forEach>
</c:when>
</c:choose>
</div>
<c:choose>
<c:when test="${ not empty resultMap.resultGroupList && fn:length(resultMap.resultGroupList) > 0 }">
<c:forEach var="groupList" items="${ resultMap.resultGroupList }" varStatus="status">
<div class="storeList__section">
<div class="storeList__subList">
<div class="storeList__subList__top">
<span class="storeList__subList__title"><c:out value="${ groupList.ctyDo }"/></span>
<span class="storeList__subList__subTitle">(<c:out value="${ groupList.strCount}"/>개점)</span>
</div>
<div class="storeList__subList__bottom">
<ul class="storeList__subList__list">
<c:forEach var="list" items="${ resultMap.resultList }" varStatus="status">
<c:if test="${ groupList.ctyDo eq list.ctyDo }">
<li>
<a type="button" onclick="fn_move_store_dtl('<c:out value="${ list.strInnb }"/>');">
<span class="storeList__subList__name"><c:out value="${ list.ctyGunGu }"/></span>
<span class="storeList__subList__store"><c:out value="${ list.strNm }"/></span>
</a>
</li>
</c:if>
</c:forEach>
</ul>
</div>
</div>
</div>
</c:forEach>
</c:when>
</c:choose>
</div>
</div>
</div>
</form>
<script>
$(document).ready(function () {
// 매장 지역 탭 스크롤
var $tabContainer = $('.storeList__tab');
var $prevButton = $('.storeList__tab__btn.previous');
var $nextButton = $('.storeList__tab__btn.next');
function updateButtonStates() {
var maxScrollLeft = $tabContainer[0].scrollWidth - $tabContainer.innerWidth();
$prevButton.prop('disabled', $tabContainer.scrollLeft() <= 0);
$nextButton.prop('disabled', $tabContainer.scrollLeft() >= maxScrollLeft);
}
updateButtonStates();
var scrollAmount = 1116;
$prevButton.on('click', function () {
$tabContainer.scrollLeft($tabContainer.scrollLeft() - scrollAmount);
setTimeout(updateButtonStates, 100);
});
$nextButton.on('click', function () {
$tabContainer.scrollLeft($tabContainer.scrollLeft() + scrollAmount);
setTimeout(updateButtonStates, 100);
});
$tabContainer.on('scroll', updateButtonStates);
// 매장 지역 탭
$('.storeList__tabBtn').on('click', function () {
var $this = $(this);
var index = $this.index();
var $tabContent = $('.storeList__section').eq(index);
$this.addClass('current').siblings().removeClass('current');
$tabContent.addClass('current').siblings().removeClass('current');
});
});
</script>

View File

@@ -0,0 +1,206 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : StrListForm.jsp
Description : 매장안내 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
let strInnb = '<c:out value="${ paramVO.strInnb }"/>';
if (strInnb) {
$('#srchListBtn').click();
} else {
$('#guidBtn').click();
}
});
let pageIndexMain = '<c:out value="${ paramVO.pageIndex }"/>';
/******************************************************
* 매장안내 목록 조회
* ****************************************************/
const fn_store_guidance = function() {
$.ajax({
type: "post",
url : '<c:url value="/sopmal/main/selectStrGuidance"/>',
success:function(resultHtml) {
$('#storeListDiv').empty();
$('#storeListDiv').html(resultHtml);
}
});
}
/******************************************************
* 매장검색 목록 조회
* ****************************************************/
const fn_srch_store = function() {
$.ajax({
type: "post",
url : '<c:url value="/sopmal/main/selectStrListSrchForm"/>',
success:function(resultHtml) {
$('#storeListDiv').empty();
$('#storeListDiv').html(resultHtml);
}
});
}
/******************************************************
* 매장검색 목록 조회
* ****************************************************/
const fn_select_store = function(pageIndex, pageUnit) {
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/main/selectStrListInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
/******************************************************
* 매장 상세 이동
* ****************************************************/
const fn_move_store_dtl = function(strInnb) {
$('#listForm').attr('action', '<c:url value="/sopmal/main/selectStrDtlInqire"/>');
$('#listForm').attr('method', 'post');
$('#strInnb').val(strInnb);
$('#listForm').submit();
}
/* ********************************************************
* 대분류 선태값에 따른 중분류 생성
******************************************************** */
const fn_select_lrgeClCd = function(cdValue, target) {
let dataStr;
$.ajax({
type: "post",
url : "<c:url value="/sopmal/main/selecSidoGunguCmmnCdArray"/>",
data : dataStr,
success:function(data) {
let jsonData;
jsonData = JSON.parse(data.resBody.result).gunguCdList;
let filteredData = jsonData.filter(item => item.cd.startsWith(cdValue));
filteredData.forEach(item => {
let option = new Option(item.cdNm, item.cd);
target.add(option);
});
fn_create_selectBox(filteredData, target);
}
});
}
/* ********************************************************
* 중분류 셀렉트 생성
******************************************************** */
function fn_create_selectBox(jsonData, tartget) {
$('#middlClCdDiv').empty();
let trClone = '';
trClone = '<select name="srchCtyGunGu" title="군/구">'
+ '<option value="" selected disabled>군/구</option>'
+ '<option value="">전체</option>'
for (let i = 0; i < jsonData.length; i++) {
trClone +=' <option value="' + jsonData[i].cdNm + '">' + jsonData[i].cdNm + '</option>';
}
trClone += '</select>';
$('#middlClCdDiv').append(trClone);
$('#middlClCdDiv > select').niceSelect();
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<h2 class="page-title__title">매장 안내</h2>
</div>
<div class="storeList">
<div class="boxTab">
<button class="boxTab__tabBtn current" id="guidBtn" type="button" onclick="fn_store_guidance();">매장안내</button>
<button class="boxTab__tabBtn" id="srchListBtn" type="button" onclick="fn_srch_store();">매장검색</button>
</div>
<div id="storeListDiv">
</div>
<div class="boxTab__content">
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,83 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : StrListForm.jsp
Description : 매장안내 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<script>
$(document).ready(function() {
$('select').niceSelect();
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
fn_select_store(pageIndexMain, pageUnit);
$('#listForm').on('keydown', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
$('#searchBtn').trigger("click");
}
});
});
</script>
<body>
<!-- 메인 컨텐츠 영역 -->
<div class="boxTab__content current">
<div class="storeList__searchInner">
<form id="listForm">
<input type="hidden" id="strInnb" name="strInnb" value=""/>
<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value="${ resultMap.paramVO.pageIndex }"/>"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="<c:out value="${ resultMap.paramVO.pageUnit }"/>"/>
<input type="hidden" id="recordCountPerPage" name="recordCountPerPage" value="<c:out value="${ resultMap.paramVO.recordCountPerPage }"/> "/>
<input type="hidden" id="sopmalCd" name="sopmalCd" value="NC"/>
<div class="customer-search">
<div class="customer-search__row justify-start">
<div class="customer-search__controls">
<div class="select-box">
<select title="시도" name="srchCtyDo" onchange="fn_select_lrgeClCd($(this).val(), this);">
<option value="" selected disabled>시/도</option>
<c:forEach var="sidoList" items="${ resultMap.sidoCdList }">
<option value="<c:out value="${ sidoList.cd }"/>"><c:out value="${ sidoList.cdNm }"/></option>
</c:forEach>
</select>
</div>
<div class="select-box" id="middlClCdDiv">
<select disabled id="crm-right-category-2" name="srchCtyGunGu" title="해당 셀렉트에 대한 설명">
<option value="" selected disabled>군/구</option>
</select>
</div>
<input class="input-text customer-search__search" type="text" title="검색어 입력"
placeholder="매장명 검색" name="srchKeyword" value="<c:out value="${ resultMap.paramVO.srchKeyword }"/>" maxlength="98">
</div>
<button id="searchBtn" type="button" class="btn md dark" onclick="fn_select_store(1); return false;" >검색</button>
</div>
</div>
<div id="pageDiv">
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,105 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : StrListForm.jsp
Description : 매장안내 폼
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<script>
$(document).ready(function() {
});
</script>
<body>
<!-- 메인 컨텐츠 영역 -->
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 15%;">
<col style="width: 15%;">
<col style="width: auto;">
<col style="width: 10%;">
<col style="width: 10%;">
</colgroup>
<thead>
<tr>
<th>지역명</th>
<th>매장명</th>
<th>주소</th>
<th>전화번호</th>
<th>매장가기</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${ not empty resultMap.resultList && fn:length(resultMap.resultList) > 0 }">
<c:forEach var="list" items="${ resultMap.resultList }" varStatus="status">
<tr>
<td>
<c:out value="${ list.ctyDo }"/>
</td>
<td>
<a class="storeList__storeLink" type="button" onclick="fn_move_store_dtl('<c:out value="${ list.strInnb }"/>');">
<c:choose>
<c:when test="${ list.reprsntBrand eq 'CH' }">
<img src="/pc/images/brand_cham.png" alt="">
</c:when>
<c:when test="${ list.reprsntBrand eq 'NC' }">
<img src="/pc/images/brand_nutri.png" alt="">
</c:when>
</c:choose>
<c:out value="${ list.strNm }"/>
</a>
</td>
<td>
<c:choose>
<c:when test="${ list.strAdresDv eq '01' }">
<c:out value="${ list.strRnmAdres}"/>
</c:when>
<c:when test="${ list.strAdresDv eq '02' }">
<c:out value="${ list.strAdres}"/>
</c:when>
</c:choose>
<c:out value="${ list.strDtlAdres }"/>
</td>
<td>
<c:out value="${ list.strTelnb }"/>
</td>
<td>
<button type="button" class="btn theme outline sm" onclick="fn_move_store_dtl('<c:out value="${ list.strInnb }"/>');">매장가기</button>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="100%" ><spring:message code="common.nodata"/></td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_store" />
</div>

View File

@@ -0,0 +1,34 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : JoinC.jsp
Description : 회원가입
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-05 최범식 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<body>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,533 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : IdPasswordSearchR.jsp
Description : 아이디 패스워드 조회
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-05 최범식 최초 생성
2024-09-09 이대환 내용수정
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script type="text/javascript">
$(document).ready(function() {
fn_select_tap('id');
fn_show_phoneAuth();
first = 0;
$(".login__inputBox__alertText").hide();
fn_alert_hide($("#srchIdMbrNm"), $("#srchIdMbrNmAlert"));
fn_alert_hide($("#srchIdPhoneNb"), $("#srchIdPhoneNbAlert"));
fn_alert_hide($("#srchIdSendungNb"), $("#srchIdSendungNbAlert"));
fn_alert_hide($("#srchPsMbrNm"), $("#srchPsMbrNmAlert"));
fn_alert_hide($("#srchPsMbrId"), $("#srchPsMbrIdAlert"));
fn_alert_hide($("#srchPsPhoneNb"), $("#srchPsPhoneNbAlert"));
fn_alert_hide($("#srchPsSendungNb"), $("#srchPsSendungNbAlert"));
$('.certInp').on('keydown', function(e) {
if (e.keyCode == 13) {
$('.phoneAuthBtn').first().click();
}
});
$('.certNb').on('keydown', function(e) {
if (e.keyCode == 13) {
fn_confim_own();
}
});
});
/* ********************************************************
* 아이디 패스워드 찾기 탭 변경
******************************************************** */
findType = '';
const fn_select_tap = function(_target) {
if (_target === 'id') {
$('#findId').addClass('current');
$('#findPswd').removeClass('current');
$('#reqIdForm').show();
$('#reqPswdForm').hide();
} else {
$('#findId').removeClass('current');
$('#findPswd').addClass('current');
$('#reqIdForm').hide();
$('#reqPswdForm').show();
}
findType = _target;
//입력값 초기화
first = 0;
certNb = '';
fn_stop_timer();
$('.input-text').val('');
if(isChkd_own){
$('.input-text').attr("readonly", false);
$('.phoneAuthBtn').show();
$('.phoneAuthOkBtn').hide();
$('#resIdForm').hide();
$('#resPswdForm').hide();
isChkd_own = false;
}
}
/* ********************************************************
* 아이디 찾기 탭이동
******************************************************** */
const fn_move_tapFindId = function (){
$('#findId').click();
}
/* ********************************************************
* 패스워드 찾기 탭이동
******************************************************** */
const fn_move_tapFindPwsd = function (){
$('#findPswd').click();
}
/* ********************************************************
* 휴대폰 인증 버튼 클릭시, 휴대폰 인증 박스 노출
******************************************************** */
const fn_show_phoneAuth = function() {
let phoneAuthBtn = $('.phoneAuthBtn');
let phoneAuthContent = $('.phoneAuthContent');
phoneAuthContent.hide();
phoneAuthBtn.click(function () {
if (findType === 'id') {
if(!$('#srchIdMbrNm').val()){
alert('이름을 입력해 주세요.');
$('#srchIdMbrNm').focus();
return;
}else if(!$('#srchIdPhoneNb').val()){
alert('휴대폰 번호를 입력해 주세요.');
$('#srchIdPhoneNb').focus();
return;
}
$('#reqIdForm .phoneAuthContent').show();
$('#srchIdSendungNb').focus();
}else {
if(!$('#srchPsMbrNm').val()){
alert('이름을 입력해 주세요.');
$('#srchPsMbrNm').focus();
return;
}else if(!$('#srchPsMbrId').val()){
alert('아이디를 입력해 주세요.');
$('#srchPsMbrId').focus();
return;
}else if(!$('#srchPsPhoneNb').val()){
alert('휴대폰 번호를 입력해 주세요.');
$('#srchPsPhoneNb').focus();
return;
}
$('#reqPswdForm .phoneAuthContent').show();
$('#srchPsSendungNb').focus();
}
fn_sending_number();
});
}
/* ********************************************************
* 휴대폰 인증 카운터
******************************************************** */
let seconds;
let countdown;
let timerRunning = false;
const fn_set_timeOut = function() {
if (seconds >= 0) {
const minutes = Math.floor(seconds / 60).toString().padStart(2, '0');
const remainingSeconds = (seconds % 60).toString().padStart(2, '0');
$('.timer').text(minutes+":"+remainingSeconds);
seconds--;
} else {
fn_stop_timer();
alert('인증번호 유효시간이 만료되었습니다.');
}
}
/* ********************************************************
* 휴대폰 인증 번호 발송
******************************************************** */
first = 0;
certNb = '';
const fn_sending_number = function() {
if(timerRunning){
return;
}
let phoneNb;
let mbrNm;
let mbtlnb;
if (findType === 'id') {
phoneNb = $('#srchIdPhoneNb').val();
mbrNm = $('#srchIdMbrNm').val();
mbtlnb = $('#srchIdPhoneNb').val();
} else {
phoneNb = $('#srchPsPhoneNb').val();
mbrNm = $('#srchPsMbrNm').val();
mbtlnb = $('#srchPsPhoneNb').val();
}
if(certNb === phoneNb){
first++;
}else{
first = 0;
}
certNb = phoneNb;
mbtlnb = mbtlnb.trim().replace(/-/g, '');
let params = {
'mbrNm' : mbrNm,
'mbtlnb': mbtlnb
};
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/insertPhoneAuth"/>',
data : params,
success : function (Data) {
let result = JSON.parse(Data.resBody.result);
if(result.result == "success"){
if (first > 0) {
alert('인증번호가 재발송되었습니다.');
} else if (first === 0) {
alert('인증번호가 발송되었습니다.');
first++;
} else {
return;
}
let sndngInnb = (findType === 'id') ? $('#srchIdForm .sndngInnb') : $('#srchPswdForm .sndngInnb');
sndngInnb.val(result.sndngInnb);
}else {
alert('인증번호 발송에 실패했습니다.');
fn_stop_timer();
return;
}
}
});
$('.input-text').attr("readonly", true);
$('.certNb').attr("readonly", false);
clearInterval(countdown);
seconds = 180;
fn_set_timeOut();
countdown = setInterval(fn_set_timeOut, 1000);
timerRunning = true;
}
/* ********************************************************
* 타이머 정지 함수
******************************************************** */
const fn_stop_timer = function() {
if (timerRunning) {
clearInterval(countdown);
$('.timer').text('03:00');
$('.certNb').val('');
$('.phoneAuthContent').hide();
$('.input-text').attr("readonly", false);
timerRunning = false;
}
}
/* ********************************************************
* 휴대폰 인증 확인
******************************************************** */
isChkd_own = false;
const fn_confim_own = function() {
if (first <= 0) return;
let sndngInnb;
let mbtlnb;
let crtnb;
if (findType === 'id') {
sndngInnb = $('#srchIdForm .sndngInnb').val();
mbtlnb = $('#srchIdPhoneNb').val();
crtnb = $('#srchIdSendungNb').val();
} else {
sndngInnb = $('#srchPswdForm .sndngInnb').val();
mbtlnb = $('#srchPsPhoneNb').val();
crtnb = $('#srchPsSendungNb').val();
}
fn_stop_timer();
mbtlnb = mbtlnb.trim().replace(/-/g, '');
let params = {
'sndngInnb': sndngInnb,
'mbtlnb': mbtlnb,
'crtnb' : crtnb
};
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/selectPhoneAuth"/>',
data : params,
success : function (Data) {
let result = JSON.parse(Data.resBody.result);
if(result.result == "success"){
alert('인증되었습니다.');
$('.phoneAuthOkBtn').show();
$('.phoneAuthBtn').hide();
isChkd_own = true;
fn_select_infor();
$('.input-text').attr("readonly", true);
}else {
alert('인증번호가 일치하지 않습니다.');
return;
}
}
});
}
/* ********************************************************
* 아이디 패스워드 조회
******************************************************** */
const fn_select_infor = function() {
let mbrId = '';
let mbtlnb = '';
let mbrNm = '';
let url = '';
if (findType === 'id') {
url = '<c:url value="/sopmal/mbr/selectIdSearch"/>';
mbrNm = $('#srchIdMbrNm').val().trim();
mbtlnb = $('#srchIdPhoneNb').val().trim().replace(/-/g, '');
} else {
url = '<c:url value="/sopmal/mbr/selectPasswordSearch"/>';
mbrNm = $('#srchPsMbrNm').val().trim();
mbrId = $('#srchPsMbrId').val().trim();
mbtlnb = $('#srchPsPhoneNb').val().trim().replace(/-/g, '');
}
let params = {
'mbrId' : mbrId,
'mbtlnb': mbtlnb,
'mbrNm' : mbrNm
};
$.ajax({
type : 'post',
url : url,
data : params,
success : function(data) {
let result = JSON.parse(data.resBody.result);
if (findType === 'id') {
$('#reqIdForm').hide();
$('#resIdForm').show();
if(result.result == "success"){
$('#resIdForm').find('.userId').text(result.selectId);
$('.findSuccess').show();
$('.findFail').hide();
}else {
$('.findSuccess').hide();
$('.findFail').show();
}
} else if (findType === 'pswd') {
$('#reqPswdForm').hide();
$('#resPswdForm').show();
if(result.result == "success"){
let message = '회원님의 휴대폰(' + fn_hide_numbers(mbtlnb)+ ')';
$('#resPswdForm').find('.mbph').text(message);
$('.findSuccess').show();
$('.findFail').hide();
}
else {
$('.findSuccess').hide();
$('.findFail').show();
}
}
}
});
}
/* ********************************************************
* 핸드폰번호 가리기
******************************************************** */
const fn_hide_numbers = function (_arg){
let mbph = "";
for(var i = 0; i < _arg.length; i++){
if (i === 3) mbph += '-';
mbph += i > _arg.length - 8 ? "*" : _arg.charAt(i);
}
return mbph;
}
/* ********************************************************
* 사용자 입력값이 입력될 때 alertText 숨기기
******************************************************** */
const fn_alert_hide = (inputId, alertId) => {
inputId.on('input', function () {
alertId.hide();
if (!$(this).val()) {
alertId.show();
}
})
};
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 헤더 영역(Type3) -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<h2 class="page-title__title">아이디/비밀번호 찾기</h2>
<p class="page-title__subTitle">아이디, 비밀번호가 생각나지 않으세요?</p>
</div>
<div class="login">
<div class="boxTab">
<button type="button" class="boxTab__tabBtn current" id="findId" onclick="fn_select_tap('id');"><spring:message code="button.findId"/></button>
<button type="button" class="boxTab__tabBtn" id="findPswd" onclick="fn_select_tap('pswd');"><spring:message code="button.findPswd"/></button>
</div>
<div class="boxTab__content login-content current" id="reqIdForm">
<form id="srchIdForm">
<div class="login__inputBox">
<input type="text" class="input-text full certInp" id="srchIdMbrNm" name="mbrNm" title="이름" placeholder="이름">
<p class="login__inputBox__alertText" id="srchIdMbrNmAlert">이름을 입력해 주세요.</p>
<div class="inputWithBtn">
<input type="text" class="input-text full number certInp" id="srchIdPhoneNb" name="mbtlnb" title="휴대폰" placeholder="휴대폰번호 입력 (’-’ 없이)" oninput="fn_set_event(this, 'keyup', fn_fmt_telno)" maxlength="13">
<button type="button" class="btn md theme outline phoneAuthBtn"><spring:message code="button.certification"/></button>
<!-- 인증완료시 버튼 -->
<button type="button" class="btn md outline phoneAuthOkBtn" style="display:none;"><spring:message code="button.certificationDone"/></button>
</div>
<p class="login__inputBox__alertText" id="srchIdPhoneNbAlert">휴대폰번호를 입력해 주세요.</p>
<div class="inputWithBtn phoneAuthContent">
<input type="hidden" class="sndngInnb">
<div class="inputTimer">
<input type="text" class="input-text full number certNb" id="srchIdSendungNb" title="인증번호" placeholder="인증번호 입력" maxlength="6">
<span class="inputTimer__time timer">03:00</span>
</div>
<button type="button" class="btn md gray" onclick="fn_confim_own();"><spring:message code="button.ok"/></button>
</div>
<p class="login__inputBox__alertText" id="srchIdSendungNbAlert">인증번호를 입력해 주세요.</p>
</div>
</form>
</div>
<div class="boxTab__content login-content current" id="resIdForm" style="display: none;">
<div class="login__findResult">
<p class="findSuccess">
고객님의 아이디는 <em class="userId"></em> 입니다.
</p>
<p class="findFail">
<span style="color:red;">일치하는 정보가 없습니다.</span><br>아이디 찾기 방법을 변경하거나 회원가입을 해주세요.
</p>
</div>
<div class="login__btnContainer-half">
<button type="button" class="btn xl full outline login__loginBtn findSuccess" onclick="fn_move_tapFindPwsd();">비밀번호 찾기</button>
<a href="<c:url value='/sopmal/mbr/selectUsrLoginForm'/>" class="btn xl full dark login__loginBtn findSuccess">로그인</a>
<button type="button" class="btn xl full outline login__loginBtn findFail" onclick="fn_move_tapFindId();">아이디 찾기</button>
<a href="<c:url value='/sopmal/mbr/selectJoinGuidance'/>" class="btn xl full dark login__loginBtn findFail">회원가입</a>
</div>
</div>
<div class="boxTab__content login-content" id="reqPswdForm">
<form id="srchPswdForm">
<div class="login__inputBox">
<input type="text" class="input-text full certInp" id="srchPsMbrNm" name="mbrNm" title="이름" placeholder="이름">
<p class="login__inputBox__alertText" id="srchPsMbrNmAlert">이름을 입력해 주세요.</p>
<input type="text" class="input-text full certInp" id="srchPsMbrId" name="mbrId" title="아이디" placeholder="아이디">
<p class="login__inputBox__alertText" id="srchPsMbrIdAlert">아이디를 입력해 주세요.</p>
<div class="inputWithBtn">
<input type="text" class="input-text full number certInp" id="srchPsPhoneNb" name="mbtlnb" title="휴대폰" placeholder="휴대폰번호 입력 (’-’ 없이)" oninput="fn_set_event(this, 'keyup', fn_fmt_telno)" maxlength="13">
<button type="button" class="btn md theme outline phoneAuthBtn"><spring:message code="button.certification"/></button>
<!-- 인증완료시 버튼 -->
<button type="button" class="btn md outline phoneAuthOkBtn" style="display:none;"><spring:message code="button.certificationDone"/></button>
</div>
<p class="login__inputBox__alertText" id="srchPsPhoneNbAlert">휴대폰번호를 입력해 주세요.</p>
<div class="inputWithBtn phoneAuthContent">
<input type="hidden" class="sndngInnb">
<div class="inputTimer">
<input type="text" class="input-text full number certNb" id="srchPsSendungNb" title="인증번호" placeholder="인증번호 입력" maxlength="6">
<span class="inputTimer__time timer">03:00</span>
</div>
<button type="button" class="btn md gray" onclick="fn_confim_own();"><spring:message code="button.ok"/></button>
</div>
<p class="login__inputBox__alertText" id="srchPsSendungNbAlert">인증번호를 입력해 주세요.</p>
</div>
</form>
</div>
<div class="boxTab__content login-content" id="resPswdForm" style="display: none;">
<div class="login__findResult">
<p class="findSuccess">
<em class="mbph"></em>으로<br>임시 비밀번호가
발송되었습니다.
<br>
SMS를 확인 부탁 드립니다.
</p>
<p class="findFail">
<span style="color:red;">일치하는 정보가 없습니다.</span><br>아이디 찾기 방법을 변경하거나 회원가입을 해주세요.
</p>
</div>
<a href="<c:url value='/login'/>" class="btn xl full dark login__loginBtn findSuccess">로그인</a>
<div class="login__btnContainer-half findFail">
<button type="button" class="btn xl full outline login__loginBtn" onclick="fn_move_tapFindPwsd();">비밀번호 찾기</button>
<a href="<c:url value='/sopmal/mbr/selectJoinGuidance'/>" class="btn xl full dark login__loginBtn">회원가입</a>
</div>
<p class="textInfo findSuccess"><i class="icon icon_textInfo--sm"></i>SNS 계정으로 가입한 회원의 비밀번호는 저장하지 있지 않으며, 해당
SNS
서비스 제공시에 문의하시길 바랍니다.
</p>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,330 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : JoinAgreeTermsR.jsp
Description : 회원가입 약관
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-05 최범식 최초 생성
2024-08-17 이대환 독립몰/통합몰 구분
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script type="text/javascript">
$(document).ready(function() {
$('#termCheckAll').prop('checked', false);
/* ********************************************************
* 약관 전체동의
******************************************************** */
$('#termCheckAll').click(function () {
if ($('#termCheckAll').is(':checked')) {
$('.termCheck').prop('checked', true);
$('[name=stplatDvCdAts]').val('Y');
} else {
$('.termCheck').prop('checked', false);
$('[name=stplatDvCdAts]').val('N');
}
});
$('.termCheck').click(function () {
if($('.termCheck:not(:checked)').length == 0) {
$('#termCheckAll').prop('checked', true);
} else {
$('#termCheckAll').prop('checked', false);
}
});
});
/* ********************************************************
* 회원가입 안내화면으로 이동(뒤로 가기)
******************************************************** */
const fn_move_joinGuidance = function() {
history.back();
if(history.length <= 1){
window.close();
}
}
/* ********************************************************
* 회원가입 화면으로 이동
******************************************************** */
const fn_move_joinC = function() {
if ($('[name="essntl"]:not(:checked)').length > 0) {
alert('[필수]항목을 체크해 주세요.');
return;
}
if ($('input[name="joinMthCd"]').length) {
disableButton('#submit');
if(!confirm('회원가입을 <spring:message code="confirm.common.predicate"/>')){
fn_regist_fail();
return;
}
let params = $('#termsForm').serialize();
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/selectMbrwithdrawalSearch"/>',
data : params,
success : function(result) {
let mbrWithDrawalList = JSON.parse(result.resBody.result).mbrWithDrawalList;
if(mbrWithDrawalList.length > 0) {
params = params + '&' + $.param({'extMember': mbrWithDrawalList[0].mbrInnb});
}
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/insertUsrJoinRegist"/>',
data : params,
success : function (result) {
const response = JSON.parse(result.resBody.result);
const errStatus = response.status;
if(errStatus === 500){
alert('회원가입에 실패하였습니다. 회원가입 안내 화면으로 돌아갑니다.');
location.replace('/sopmal/mbr/selectJoinGuidance');
fn_regist_fail();
return;
}
const mbrInnb = response.mbrInnb;
const marketingAgree = response.marketingAgree;
if (mbrInnb !== null) {
openSocialLoginPopup($('input[name="joinMthCd"]').val(), marketingAgree);
// location.replace('/sopmal/mbr/selectJoinCompleteR'+(marketingAgree=='Y'?'?stplatDvCdAts=Y':''));
}
}
});
}
});
}else{
$('#termsForm').attr('method', 'post');
$('#termsForm').attr('action', '<c:url value="/sopmal/mbr/selectJoinForm"/>');
$('#termsForm').submit();
}
}
/* ********************************************************
* 회원 가입 실패
******************************************************** */
const fn_regist_fail = function() {
enableButton('#submit');
}
/* ********************************************************
* 체크박스 값변경
******************************************************** */
const fn_set_checkbox = function(_target) {
if ($(_target).is(':checked')) {
$(_target).parent().find('.termBoolean').val('Y');
$(_target).parent().find('.termDisable').prop('disabled', false);
} else {
$(_target).parent().find('.termBoolean').val('N');
$(_target).parent().find('.termDisable').prop('disabled', true);
}
}
/* ********************************************************
* 약관 팝업 값 설정
******************************************************** */
const fn_set_termPop = function(termNm, index) {
$('#termNm').html('<c:if test="${integrated}">GC ONE </c:if>'+termNm);
$('#termCn').html($('#stplatCn'+index).html());
}
/* ********************************************************
* SNS 소셜 로그인
******************************************************** */
const openSocialLoginPopup = (provider, marketingAgree) => {
var accessUrl = '${accessUrl}';
var redirectUri = '/sopmal/mbr/selectJoinCompleteR'
+ '?joinMthCd='+(provider.length>5?provider.slice(3).toLowerCase():provider.toLowerCase())
+ (marketingAgree=='Y'?'&stplatDvCdAts=Y':'');
var width = 600;
var height = 600;
var left = (screen.width / 2) - (width / 2);
var top = (screen.height / 2) - (height / 2);
var url = '${ssoUrl}/oauth2/authorization/' + provider
+ '?redirect_uri=' + encodeURIComponent(redirectUri) + '&oauth2_type=login&access_url='+ encodeURIComponent(accessUrl);
window.open(url, 'SocialLoginPopup', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
}
const receiveMessage = (event) => {
if(event.origin !== "${ssoUrl}") {
return;
}
if(event.data.type === 'LOGIN_SUCCESS') {
window.location.href = event.data.redirectUrl;
}
}
window.addEventListener('message', receiveMessage, false);
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 헤더 영역(Type3) -->
<main>
<c:set var="terms" value="${resultMap.joinAgreeTerms}" />
<c:set var="sopmalInfo" value="${resultMap.sopmalInfo}" />
<c:set var="integrated" value="${sopmalInfo.sopmalTyCd == '01'}" />
<!-- 약관 세팅 -->
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<c:choose>
<c:when test="${integrated}">
<h2 class="page-title__title">GC ONE(통합회원) 가입</h2>
</c:when>
<c:otherwise>
<h2 class="page-title__title">회원가입</h2>
</c:otherwise>
</c:choose>
<div class="ck-content">
<c:out value="${sopmalInfo.joinGuidanceSj}" escapeXml="false"/>
</div>
</div>
<div class="signUpTerms">
<c:choose>
<c:when test="${integrated}">
<p class="signUpTerms__agreeText">GC ONE 회원 서비스 이용약관에 동의해 주세요.</p>
<div class="signUpTerms__all">
<div class="b-checkbox-container">
<label class="b-checkbox is-large checkbox">
<input type="checkbox" value="" id="termCheckAll">
<span class="check"></span>
<span class="control-label">GC ONE 통합회원 전체 동의</span>
</label>
</div>
<div class="signUpTerms__all__description">
<p>통합 회원과 제휴 브랜드의 가입 및 혜택 정보 수신 동의 내용을 확인하고 전체 동의합니다.</p>
<p class="important">※ 선택 항목에 대한 동의를 거부하더라도 통합 회원가입에는 영향을 미치지 않습니다.</p>
<p>단, 미동의 해당 제휴 브랜드는 이용 제한이 있거나 혜택을 받으실 수 없습니다</p>
</div>
</div>
<div class="signUpTerms__gcone">
<a class="signUpTerms__gcone__link" href="">
<p><em>GC ONE</em> 마일리지/ 혜택 통합 멤버십 서비스</p>
<svg viewBox="0 0 306 306" xml:space="preserve">
<path d="M0,277.7L28.3,306L266,68.3v131.7h40V0H106.1v40h131.7L0,277.7z"></path>
</svg>
</a>
<p class="signUpTerms__gcone__text">GC ONE은 친환경 제품, 안전성이 검증된 원료로 최고의 품질을 갖춘 브랜드만 제휴합니다.</p>
</div>
</c:when>
<c:otherwise>
<p class="signUpTerms__agreeText">서비스 이용약관에 동의해 주세요.</p>
<div class="signUpTerms__all">
<div class="b-checkbox-container">
<label class="b-checkbox is-large checkbox">
<input type="checkbox" value="" id="termCheckAll">
<span class="check"></span>
<span class="control-label">전체 동의</span>
</label>
</div>
<div class="signUpTerms__all__description">
<p>모두 확인하였으며 동의합니다.</p>
<p>전체 동의에는 필수 및 선택 정보에 대한 동의가 포함되어 있으며, 개별적으로 동의를 선택 하실 수 있습니다.</p>
<p class="important">※ 선택 항목에 대한 동의를 거부하시는 경우에도 서비스 이용이 가능합니다.</p>
</div>
</div>
</c:otherwise>
</c:choose>
<form id="termsForm">
<div class="signUpTerms__misc">
<c:if test="${not empty vo.joinMthCd}">
<input type="hidden" name="joinMthCd" value='<c:out value="${vo.joinMthCd}"/>'>
<input type="hidden" name="extrlIntrlckId" value='<c:out value="${vo.extrlIntrlckId}"/>'>
<input type="hidden" name="mbtlnb" value='<c:out value="${vo.mbtlnb}"/>'>
<input type="hidden" name="mbrNm" value='<c:out value="${vo.mbrNm}"/>'>
<input type="hidden" name="email" value='<c:out value="${vo.email}"/>'>
<input type="hidden" name="sex" value='<c:out value="${vo.sex}"/>'>
<input type="hidden" name="brthDe" value='<c:out value="${vo.brthDe}"/>'>
</c:if>
<c:choose>
<c:when test="${ not empty terms}">
<c:forEach items="${ terms }" var="term" varStatus="status">
<div class="signUpTerms__misc__item">
<div class="b-checkbox-container">
<label class="b-checkbox is-medium checkbox">
<input type="hidden" class="termDisable" name="sopmalStplatInnb" value='<c:out value="${term.sopmalStplatInnb}"/>'>
<input type="hidden" class="termDisable" name="stplatDvCds" value='<c:out value="${term.stplatDvCd}"/>'>
<input type="hidden" class="termDisable termBoolean" name="stplatDvCdAts" value="N">
<input class="termCheck" type="checkbox" <c:if test="${term.essntlAt == 'Y'}">name="essntl"</c:if> onchange="fn_set_checkbox(this);">
<span class="check"></span>
<span class="control-label">
[<c:if test="${term.essntlAt == 'Y'}">필수</c:if><c:if test="${term.essntlAt == 'N'}">선택</c:if>]
${term.cdNm}
</span>
</label>
</div>
<c:if test="${term.cnWritngAt == 'Y'}">
<a class="signUpTerms__misc__detail" href="#terms-pop" rel="modal:open" onclick="fn_set_termPop('${term.cdNm}', ${status.count}); return false;">보기</a>
<div id="stplatCn${status.count}" style="display:none"><c:out value="${term.stplatCn}" escapeXml="false"/></div>
</c:if>
</div>
</c:forEach>
</c:when>
</c:choose>
</div>
</form>
<div class="signUp__btnContainer-half">
<button type="button" class="btn xl full outline signUp__signUpBtn" onclick="fn_move_joinGuidance();">취소</button>
<button type="button" id="submit" class="btn xl full theme signUp__signUpBtn" onclick="fn_move_joinC();">동의하기</button>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 이용약관 팝업 -->
<div id="terms-pop" class="modal default" style="max-width: 620px;">
<div class="modal-header">
<div class="modal-header__title" id="termNm"><c:if test="${integrated}">GC ONE </c:if></div>
</div>
<div class="modal-content">
<div class="terms_wrap ck-content" id="termCn"></div>
</div>
<div class="modal-footer">
<!-- <a href="#" rel="modal:close" class="btn large outline">닫기</a> -->
<a href="#" rel="modal:close" class="btn theme large">확인</a>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,940 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : JoinC.jsp
Description : 회원가입
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-05 최범식 최초 생성
2024-08-19 이대환 독립몰/통합몰 구분
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script type="text/javascript">
$(document).ready(function() {
fn_set_birthYears();
fn_set_birthMonths();
fn_show_phoneAuth();
fn_check_stplat();
first = 0;
$(".signUp__inputBox__alertText").hide();
fn_alert_hide($("#mbrNm"), $("#mbrNmAlert"));
fn_alert_hide($("#mbtlnb"), $("#mbtlnbAlert"));
fn_alert_hide($("#mbtlCert"), $("#mbtlCertAlert"));
fn_alert_hide($("#mbrId"), $("#mbrIdAlert"), 'id');
fn_alert_hide($("#mbrPassword"), $("#mbrPasswordAlert"), 'pw');
fn_alert_hide($("#mbrPasswordChk"), $("#mbrPasswordChkAlert"), 'pw');
fn_alert_hide($("#id"), $("#emailAlert"));
fn_alert_hide($('input[name="sex"]'), $("#sexAlert"));
fn_alert_hide($("#dtlAdres"), $("#postcodeAlert"));
fn_alert_hide_selected();
$('#regForm').on('keydown', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
}
});
$('#mbrNm').on('keydown', function(e) {
if (e.keyCode == 13) {
$('#phoneAuthBtn').click();
}
});
$('#mbtlnb').on('keydown', function(e) {
if (e.keyCode == 13) {
$('#phoneAuthBtn').click();
}
});
$('#mbtlCert').on('keydown', function(e) {
if (e.keyCode == 13) {
fn_confim_own();
}
});
$('#mbrId').on('keydown', function(e) {
if (e.keyCode == 13) {
fn_check_mbrid();
}
});
});
/* ********************************************************
* 약관동의 체크
******************************************************** */
const fn_check_stplat = function() {
if(!$('input[name="sopmalStplatInnb"]').val()){
alert('약관 동의 처리에 문제가 발생했습니다. 다시 시도해 주세요.');
window.location.href = '/sopmal/mbr/selectJoinAgreeTermsForm';
return true;
}
}
/* ********************************************************
* domain 넣기
******************************************************** */
const fn_set_domain = function(_value) {
if (_value === '직접입력') {
$('#domain').attr('readonly', false);
$('#domain').val('');
} else {
$('#domain').attr('readonly', true);
$('#domain').val(_value);
}
}
/* ********************************************************
* email 합치기
******************************************************** */
const fn_make_email = function() {
let domain = $('#domain').val();
let id = $('#id').val().trim();
$('[name=email]').val(id + '@' + domain);
return $('[name=email]').val();
}
/* ********************************************************
* 생년월일 합치기
******************************************************** */
const fn_make_brthDe = function() {
var year = $('#select-brthYear').val();
var month = ($('#select-Month').val()< 10 ? '0' : '') + $('#select-Month').val();
$('[name=brthDe]').val(year + month + '01');
}
/* ********************************************************
* 전화번호 하이픈 제거
******************************************************** */
const fn_make_mbtlnb = function() {
var mbtlnb = $('#mbtlnb').val();
$('[name=mbtlnb]').val(mbtlnb.trim().replace(/-/g, ''));
}
/* ********************************************************
* password check
******************************************************** */
const fn_check_password = function() {
var regular = /^((?=.*[a-zA-Z])(?=.*\d|.*\W)|(?=.*\d)(?=.*\W))[a-zA-Z\d\W]{6,20}$/;
let mbrPassword = $('#mbrPassword');
let mbrPasswordChk = $('#mbrPasswordChk');
let mbrId = $('#mbrId');
if(!regular.test(mbrPassword.val())){
alert('비밀번호는 영문 대소문자/숫자/특수문자 중 2가지 이상 조합한 6~20자로 입력해주세요.');
mbrPassword.focus();
return;
}
if(!regular.test(mbrPasswordChk.val())){
alert('비밀번호는 영문 대소문자/숫자/특수문자 중 2가지 이상 조합한 6~20자로 입력해주세요.');
mbrPasswordChk.focus();
return;
}
if (mbrPassword.val() !== mbrPasswordChk.val()) {
alert('비밀번호가 일치하지 않습니다.');
mbrPassword.focus();
return;
}
if (mbrPassword.val() == mbrId.val()) {
mbrPassword.focus();
alert('비밀번호는 아이디와 동일할 수 없습니다.');
return;
}
return true;
}
/**********************************************
* 이메일 형식 유효성 체크 (올바른 이메일 형식일 때 True)
***********************************************/
const fn_check_email = function() {
let mbrEmail = fn_make_email();
var regular = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i;
if(regular.test(mbrEmail)){
return true;
}else{
return false;
}
}
/* ********************************************************
* 우편번호 찾기
******************************************************** */
const fn_set_postcode = function(_data) {
$('#adresDv').val(_data.addressType)
$('#postcode').val(_data.postcode);
$('#address').val(_data.addressType == '01' ? _data.roadAddress : _data.jibunAddress);
}
/* ********************************************************
* 생년 콤보박스
******************************************************** */
const fn_set_birthYears = function() {
let date = new Date();
let year = date.getFullYear();
let combo = '';
combo ='<select class="md" name="brthYear" id="select-brthYear" title="생년">';
combo +=' <option value="" selected disabled>년</option>';
for (let y = year - 14; y >= year - 101; y--) {
combo +=' <option value="' + y + '">' + y + ' 년' + '</option>';
}
combo +='</select>';
$('#birthYear').html(combo);
$('#select-brthYear').niceSelect();
}
/* ********************************************************
* 생월 콤보박스
******************************************************** */
const fn_set_birthMonths = function() {
let combo = '';
combo ='<select class="md" name="brthMonth" id="select-Month" title="생월">';
combo +=' <option value="" selected disabled>월</option>';
for (let m = 1; m < 13; m++) {
combo +=' <option value="' + m + '">' + m + ' 월' + '</option>';
}
combo +='</select>';
$('#birthMonth').html(combo);
$('#select-Month').niceSelect();
}
/* ********************************************************
* 휴대폰 인증 카운터
******************************************************** */
let seconds;
let countdown;
let timerRunning = false;
const fn_set_timeOut = function() {
if (seconds >= 0) {
const minutes = Math.floor(seconds / 60).toString().padStart(2, '0');
const remainingSeconds = (seconds % 60).toString().padStart(2, '0');
$('#timer').text(minutes+":"+remainingSeconds);
seconds--;
} else {
fn_stop_timer();
alert('인증번호 유효시간이 만료되었습니다.');
}
}
/* ********************************************************
* 휴대폰 인증 번호 발송
******************************************************** */
first = 0;
mbtlCert = '';
const fn_sending_number = function() {
if(timerRunning){
return;
}
if(mbtlCert === $('#mbtlnb').val()){
first++;
}else{
first = 0;
}
mbtlCert = $('#mbtlnb').val();
let mbrNm = $('#mbrNm').val();
let mbtlnb = $('#mbtlnb').val().trim().replace(/-/g, '');
let params = {
'mbrNm' : mbrNm,
'mbtlnb': mbtlnb
};
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/insertPhoneAuth"/>',
data : params,
dataType: 'json',
success : function (Data) {
let result = Data.resBody.result;
if(result.result == "success"){
if (first > 0) {
alert('인증번호가 재발송되었습니다.');
} else if (first === 0) {
alert('인증번호가 발송되었습니다.');
first++;
} else {
return;
}
$('#sndngInnb').val(result.sndngInnb);
}else {
alert('인증번호 발송에 실패했습니다.');
fn_stop_timer();
return;
}
}
});
$('#mbrNm').attr("readonly", true);
$('#mbtlnb').attr("readonly", true);
clearInterval(countdown);
seconds = 180;
fn_set_timeOut();
countdown = setInterval(fn_set_timeOut, 1000);
timerRunning = true;
}
/* ********************************************************
* 타이머 정지 함수
******************************************************** */
const fn_stop_timer = function() {
if (timerRunning) {
clearInterval(countdown);
$('#timer').text('03:00');
$('#mbtlCert').val('');
$('#phoneAuthContent').hide();
$('#mbrNm').attr("readonly", false);
$('#mbtlnb').attr("readonly", false);
timerRunning = false;
}
}
/* ********************************************************
* 휴대폰 인증 확인
******************************************************** */
isChkd_own = false;
const fn_confim_own = function() {
if (first <= 0) return;
let sndngInnb = $('#sndngInnb').val();
let mbtlnb = $('#mbtlnb').val().trim().replace(/-/g, '');
let crtnb = $('#mbtlCert').val();
fn_stop_timer();
let params = {
'sndngInnb': sndngInnb,
'mbtlnb': mbtlnb,
'crtnb' : crtnb
};
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/selectPhoneAuth"/>',
data : params,
dataType: 'json',
success : function (Data) {
let result = Data.resBody.result;
if(result.result == "success"){
alert('인증되었습니다.');
$('#phoneAuthOkBtn').show();
$('#phoneAuthBtn').hide();
isChkd_own = true;
//TODO : 메서드명 변경 필요 탈퇴회원 → 기존가입여부
fn_check_mbrwithdrawal();
$('#mbrNm').attr("readonly", true);
$('#mbtlnb').attr("readonly", true);
}else {
alert('인증번호가 일치하지 않습니다.');
return;
}
}
});
}
/* ********************************************************
* 기존 가입 여부 조회
******************************************************** */
const fn_check_mbrwithdrawal = function() {
let mbrNm = $('#mbrNm').val().trim();
$('#mbrNm').val(mbrNm);
let mbtlnb = $('#mbtlnb').val().trim().replace(/-/g, '');
let params = {
'mbrNm' : mbrNm,
'mbtlnb': mbtlnb
};
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/selectMbrwithdrawalSearch"/>',
data : params,
dataType: 'json',
success : function(result) {
let mbrWithDrawalList = result.resBody.result.mbrWithDrawalList;
fn_make_rejoinInforList(mbrWithDrawalList);
}
});
}
/* ********************************************************
* 기존 가입 내역
******************************************************** */
const fn_make_rejoinInforList = function(_data) {
let tbodyClone;
let isExtMember = false;
let snsMemberCnt = 0;
if (_data.length > 0) {
let extMember = _data[0].mbrInnb;
$('#rejoinContainer').show();
for (let i = 0; i < _data.length; i++) {
if (_data[i].dev >= 3) {
snsMemberCnt++;
isExtMember = true;
tbodyClone +='<tr>';
tbodyClone +=' <td style="display : none;">' + _data[i].mbrInnb + '</td>';
tbodyClone +=' <td>' + _data[i].brand + '</td>';
tbodyClone +=' <td>' + _data[i].extrlIntrlckDv + '</td>';
tbodyClone +=' <td>' + _data[i].emailAdres + '</td>';
tbodyClone +='</tr>';
} else {
$('#rejoinContainer').hide();
alert('이미 가입된 정보입니다. 로그인해 주세요.');
snsMemberCnt = 0;
isExtMember = false;
// window.location.href = '<c:out value="${issuerUri}"/>/index';
window.location.href = '/sopmal/login';
break;
}
}
tbodyClone +='<tr style="display:none;"><td><input type="text" name="extMember" value="'+extMember+'"/></td></tr>';
$('#rejoinSelect').html(tbodyClone);
if(snsMemberCnt > 1){
$('#rejoinSelect tr').each(function() {
if (!($(this).find('input[name="extMember"]').length) && $(this).find('td').eq(0).text().trim() !== String(extMember)) {
$(this).remove();
}
});
}
if (isExtMember) {
alert('인증되었습니다. 인증하신 정보로 가입된 계정 정보가 있습니다. 계정정보 연동을 진행합니다.');
}
}
}
/* ********************************************************
* 회원 가입
******************************************************** */
const fn_regist_member = function() {
disableButton('#registBtn');
if(fn_check_stplat()) {
fn_regist_fail();
return;
};
if (!isChkd_own) {
alert('휴대폰 인증을 해주세요.');
$('#mbtlnb').focus();
fn_regist_fail();
return;
}
if (!isChkd_Dup) {
alert('아이디 중복 확인을 해주세요.');
$('#mbrId').focus();
fn_regist_fail();
return;
}
if(!fn_check_password()) {
fn_regist_fail();
return;
}
if(!fn_check_email()) {
alert('올바른 이메일 형식이 아닙니다.');
$('#id').focus();
fn_regist_fail();
return;
}
if ($('#select-brthYear').val() == null || $('#select-Month').val() == null) {
alert('생년월을 선택해 주세요.');
$("#brthDeAlert").show();
document.getElementById('birthYear').scrollIntoView();
fn_regist_fail();
return;
}
if ($('input[name="sex"]:checked').val() == null) {
alert('성별을 선택해 주세요.');
$("#sexAlert").show();
$('#men').focus();
fn_regist_fail();
return;
}
if ($('#postcode').val().trim() == '' || $('#address').val().trim() == '') {
alert('우편번호를 선택해 주세요.');
$("#postcodeAlert").show();
document.getElementById('postcodeBtn').scrollIntoView();
fn_regist_fail();
return;
}
if ($('#dtlAdres').val().trim() == '') {
alert('상세주소를 입력해 주세요.');
$('#dtlAdres').focus();
fn_regist_fail();
return;
}
if(!confirm('회원가입을 <spring:message code="confirm.common.predicate"/>')){
fn_regist_fail();
return;
}
fn_make_brthDe();
fn_make_mbtlnb();
let params = $('#regForm').serialize();
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/insertUsrJoinRegist"/>',
data : params,
dataType: 'json',
success : function (result) {
const response = result.resBody.result;
const errStatus = response.status;
if(errStatus === 500){
alert('회원가입에 실패하였습니다. 회원가입 안내 화면으로 돌아갑니다.');
location.replace('/sopmal/mbr/selectJoinGuidance');
fn_regist_fail();
return;
}
const mbrInnb = response.mbrInnb;
const marketingAgree = response.marketingAgree;
if (mbrInnb !== null) {
// alert($('#registType').val()+'에 가입되었습니다.');
location.replace('/sopmal/mbr/selectJoinCompleteR'+(marketingAgree=='Y'?'?stplatDvCdAts=Y':''));
}
}
});
}
/* ********************************************************
* 회원 가입 실패
******************************************************** */
const fn_regist_fail = function() {
enableButton('#registBtn');
}
/* ********************************************************
* 아이디 중복 확인
******************************************************** */
dupList = [];
isChkd_Dup = false;
const fn_check_mbrid = function() {
var regular = /^(?=.*[a-zA-Z])[a-zA-Z\d_]{6,20}$/;
let mbrid = $('#mbrId').val().trim();
$('#mbrId').val(mbrid);
if(!regular.test(mbrid)) {
alert('아이디는 영문 소문자, 숫자, 밑줄만 사용 가능하며, 6~20자 이내로 입력해주세요.');
return
}
if(!isChkd_Dup) {
let params = {
'mbrId' : mbrid
};
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mbr/selectIdDplctCnfirm"/>',
data : params,
dataType: 'json',
success : function(Data) {
if (Data.resBody.result.message === 'impossible'){
alert('\"' + mbrid + '\" 은 이용중인 아이디 입니다.');
dupList.push(mbrid);
$("#mbrIdAlert").html('이미 사용중인 아이디입니다.');
$("#mbrIdAlert").show();
}
if (Data.resBody.result.message === 'possible'){
isChkd_Dup = true;
alert('\"' + mbrid + '\" 은 사용 가능합니다.');
}
}
});
}
}
/* ********************************************************
* 휴대폰 인증 버튼 클릭시, 휴대폰 인증 박스 노출
******************************************************** */
const fn_show_phoneAuth = function() {
let phoneAuthBtn = $('#phoneAuthBtn');
let phoneAuthContent = $('#phoneAuthContent');
phoneAuthContent.hide();
phoneAuthBtn.click(function () {
if(!$('#mbrNm').val()){
alert('이름을 입력해 주세요.');
$('#mbrNm').focus();
return;
}else if(!$('#mbtlnb').val()){
alert('휴대폰 번호를 입력해 주세요.');
$('#mbtlnb').focus();
return;
}
$('#phoneAuthContent').show();
$('#mbtlCert').focus();
fn_sending_number();
});
}
/* ********************************************************
* 메인화면 이동(뒤로 가기))
******************************************************** */
const fn_move_mainPage = function() {
history.back();
if(history.length <= 1){
window.close();
}
}
/* ********************************************************
* 사용자 입력값이 입력될 때 alertText 숨기기
******************************************************** */
const fn_alert_hide = (inputId, alertId, type) => {
inputId.on('input', function () {
switch(type){
case 'id':
var regular = /^(?=.*[a-zA-Z])[a-zA-Z\d_]{6,20}$/;
if (!$(this).val()) {
alertId.html('아이디를 입력해 주세요.');
}else if(dupList.includes(inputId.val())){
alertId.html('이미 사용중인 아이디입니다.');
alertId.show();
return;
}else if(!regular.test(inputId.val())){
alertId.html('아이디는 영문 소문자, 숫자, 밑줄만 사용 가능하며, 6~20자 이내로 입력해주세요.');
alertId.show();
return;
}
break;
case 'pw':
var regular = /^((?=.*[a-zA-Z])(?=.*\d|.*\W)|(?=.*\d)(?=.*\W))[a-zA-Z\d\W]{6,20}$/;
if (!$(this).val()) {
alertId.html('비밀번호를 입력해 주세요.');
}else if(!regular.test(inputId.val())){
alertId.html('비밀번호는 영문 대소문자/숫자/특수문자 중 2가지 이상 조합한 6~20자로 입력해주세요.');
alertId.show();
return;
}
break;
default:
break;
}
alertId.hide();
if (!$(this).val()) {
alertId.show();
}
})
};
/* ********************************************************
* 사용자 입력값이 입력될 때 alertText 숨기기
******************************************************** */
const fn_alert_hide_selected = () => {
let birthSelected = false;
$("#birthYear").on('change', function() {
if(birthSelected){
$("#brthDeAlert").hide();
}
birthSelected = true;
})
$("#birthMonth").on('change', function() {
if(birthSelected){
$("#brthDeAlert").hide();
}
birthSelected = true;
})
}
/*******************************************************
* 앱 환경을 검증하고 우편번호 버튼 함수를 변경하는 함수
*******************************************************/
function initPostcodeInterface() {
// 앱 환경에서 사용할 모바일용 함수명 정의
const MOBILE_POSTCODE_FUNCTION = "fn_select_postcode_app";
// 앱 인터페이스 초기화 확인
if (window.app) {
console.log("앱 환경 감지됨, 우편번호 함수 변경");
changePostcodeFunction(MOBILE_POSTCODE_FUNCTION);
} else {
console.log("앱 인터페이스를 기다리는 중...");
let checkCount = 0;
const maxChecks = 10; // 최대 5초(500ms * 10)까지 시도
const checkInterval = setInterval(function() {
checkCount++;
if (window.app) {
clearInterval(checkInterval);
console.log("앱 인터페이스 초기화 완료, 우편번호 함수 변경");
changePostcodeFunction(MOBILE_POSTCODE_FUNCTION);
} else if (checkCount >= maxChecks) {
clearInterval(checkInterval);
console.warn("앱 인터페이스를 찾을 수 없습니다. 최대 시도 횟수 초과.");
}
}, 500);
}
}
/*******************************************************
* 우편번호 버튼의 onclick 함수를 변경하는 함수
*******************************************************/
function changePostcodeFunction(newFunctionName) {
console.log("changePostcodeFunction 호출");
console.log("newFunctionName: " + newFunctionName);
const postcodeBtn = document.getElementById('postcodeBtn');
if (postcodeBtn) {
postcodeBtn.setAttribute('onclick', newFunctionName + '(fn_set_postcode);');
console.log('우편번호 버튼 함수가' + newFunctionName + '으로 변경되었습니다.');
} else {
console.warn('우편번호 버튼을 찾을 수 없습니다.');
}
}
// 페이지 로드 시 함수 실행
document.addEventListener('DOMContentLoaded', initPostcodeInterface);
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<c:set var="sopmalInfo" value="${resultMap.sopmalInfo}" />
<c:set var="integrated" value="${sopmalInfo.sopmalTyCd == '01'}" />
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<c:choose>
<c:when test="${integrated}">
<h2 class="page-title__title">GC ONE(통합회원) 가입</h2>
</c:when>
<c:otherwise>
<h2 class="page-title__title">회원가입</h2>
</c:otherwise>
</c:choose>
<div class="ck-content">
<c:out value='${sopmalInfo.joinGuidanceSj}' escapeXml="false"/>
</div>
</div>
<div class="signUp">
<div class="signUp__required"><span class="required-asterisk">*</span> 필수입력사항</div>
<form id="regForm">
<input type="hidden" name="sopmalStplatInnb" value="<c:out value='${resultMap.sopmalStplatInnb}'/>"/>
<input type="hidden" name="stplatDvCds" value="<c:out value='${resultMap.stplatDvCds}'/>"/>
<input type="hidden" name="stplatDvCdAts" value="<c:out value='${resultMap.stplatDvCdAts}'/>"/>
<c:choose>
<c:when test="${integrated}">
<input type="hidden" id="registType" value='GC ONE(통합회원)'>
</c:when>
<c:otherwise>
<input type="hidden" id="registType" value='<c:out value="${sopmalInfo.sopmalNm}"/>'>
</c:otherwise>
</c:choose>
<div class="signUp__inputBox">
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">이름<span class="required-asterisk">*</span></div>
<input type="text" class="input-text full" name="mbrNm" id="mbrNm" title="이름" placeholder="이름을 입력해 주세요.">
<p class="signUp__inputBox__alertText" id="mbrNmAlert">이름을 입력해 주세요.</p>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">휴대전화<span class="required-asterisk">*</span></div>
<div class="inputWithBtn">
<input type="text" class="input-text full number" id="mbtlnb" title="휴대폰" placeholder="휴대폰번호 입력 (’-’ 없이)" oninput="fn_set_event(this, 'keyup', fn_fmt_telno)" maxlength="13">
<input type="hidden" name="mbtlnb">
<button type="button" class="btn md theme outline" id="phoneAuthBtn"><spring:message code="button.certification"/></button>
<!-- 인증완료시 버튼 -->
<button type="button" class="btn md outline" id="phoneAuthOkBtn" style="display:none;"><spring:message code="button.certificationDone"/></button>
</div>
<p class="signUp__inputBox__alertText" id="mbtlnbAlert">휴대폰 번호를 입력해 주세요.</p>
<div class="phoneAuth" id="phoneAuthContent">
<input type="hidden" id="sndngInnb">
<div>
<div class="inputWithBtn">
<div class="inputTimer">
<input type="text" class="input-text full number" id="mbtlCert" title="인증번호" placeholder="인증번호 입력" maxlength="6">
<span class="inputTimer__time" id="timer">03:00</span>
</div>
<button type="button" class="btn md gray" onclick="fn_confim_own();"><spring:message code="button.ok"/></button>
</div>
<p class="signUp__inputBox__alertText" id="mbtlCertAlert">인증번호를 입력해 주세요.</p>
</div>
</div>
</div>
<div class="signUp__inputBox__item" id="rejoinContainer" style="display: none;">
<div class="signUp__inputBox__itemTitle">가입 계정 정보<span
class="required-asterisk">*</span>
</div>
<p class="textInfo"><i class="icon icon_textInfo--sm"></i> 인증하신 정보로 가입된 계정 정보입니다. 해당
정보로 연동되어 간편 가입이 진행됩니다.
</p>
<table class="table vertical tight">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 30%;">
<col style="width: auto;">
</colgroup>
<thead>
<tr>
<th style="display:none;">회원 고유번호</th>
<th>가입사이트</th>
<th>가입방식</th>
<th>이메일</th>
</tr>
</thead>
<tbody id="rejoinSelect"></tbody>
</table>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">아이디<span class="required-asterisk">*</span></div>
<div class="inputWithBtn">
<input type="text" class="input-text full" name="mbrId" id="mbrId" title="아이디" placeholder="영문 소문자, 숫자, 밑줄(만) 사용 가능, 6~20자" oninput="this.value = this.value.toLowerCase();" onchange="isChkd_Dup = false;" maxlength="20">
<button type="button" class="btn md outline" onclick="fn_check_mbrid();">중복 확인</button>
</div>
<p class="signUp__inputBox__alertText" id="mbrIdAlert">아이디를 입력해 주세요.</p>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">비밀번호<span class="required-asterisk">*</span></div>
<input type="password" class="input-text full" name="mbrPassword" id="mbrPassword" title="비밀번호" placeholder="영문 대소문자/숫자/특수문자 중 2가지 이상 포함 6~20자" maxlength="20">
<p class="signUp__inputBox__alertText" id="mbrPasswordAlert">비밀번호를 입력해 주세요.</p>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">비밀번호 확인<span class="required-asterisk">*</span></div>
<input type="password" class="input-text full" name="mbrPasswordChk" id="mbrPasswordChk" title="비밀번호 확인" placeholder="비밀번호를 한번 더 입력해주세요." maxlength="20">
<p class="signUp__inputBox__alertText" id="mbrPasswordChkAlert">비밀번호를 입력해 주세요.</p>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">이메일<span class="required-asterisk">*</span>
<input type="hidden" name="email" value=""/>
</div>
<div class="inputEmail">
<input class="input-text full" type="email" id="id" title="이메일 id" placeholder="이메일" maxlength="25">
<span class="inputEmail__at">@</span>
<input class="input-text full" type="text" id="domain" title="이메일 domain" maxlength="25">
<div class="select-box">
<select name="domain" title="이메일 자동발송 발신주소" onchange="fn_set_domain(this.value);">
<c:forEach var="cgn001" items="${resultMap.cgn001}" varStatus="status">
<option value="${cgn001.cdNm}" ${f:setSelected(cgn001.cd, '99')}><c:out value="${cgn001.cdNm}"/></option>
</c:forEach>
</select>
</div>
</div>
<p class="signUp__inputBox__alertText" id="emailAlert">이메일을 입력해 주세요.</p>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">생년월<span class="required-asterisk">*</span></div>
<div class="inputHalf">
<input type="hidden" name="brthDe">
<div class="select-box" id="birthYear"></div>
<div class="select-box" id="birthMonth"></div>
</div>
<p class="signUp__inputBox__alertText" id="brthDeAlert">생년월을 선택해 주세요.</p>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">성별<span class="required-asterisk">*</span></div>
<div class="custom-radio-container">
<div class="custom-radio is-medium">
<input type="radio" id="men" name="sex" value="M">
<label for="men">남자</label>
</div>
<div class="custom-radio is-medium">
<input type="radio" id="women" name="sex" value="F">
<label for="women">여자</label>
</div>
</div>
<p class="signUp__inputBox__alertText" id="sexAlert">성별을 선택해 주세요.</p>
</div>
<div class="signUp__inputBox__item">
<div class="signUp__inputBox__itemTitle">주소<span class="required-asterisk">*</span></div>
<div class="inputAddress">
<div class="inputAddress__postalCode">
<input type="text" class="input-text" id="postcode" name="zip" title="우편번호" placeholder="우편번호" readonly>
<button type="button" id="postcodeBtn" class="btn md theme outline" onclick="fn_select_postcode(fn_set_postcode);"><spring:message code="button.zipcode"/></button>
</div>
<input type="text" class="input-text full" id="address" name="lnbAdres" title="주소" placeholder="주소" readonly>
<input type="text" class="input-text full" id="dtlAdres" name="dtlAdres" title="상세주소" placeholder="나머지 주소를 입력해 주세요.">
<input type="hidden" id="adresDv" name="adresDv">
</div>
<p class="signUp__inputBox__alertText" id="postcodeAlert">주소를 입력해 주세요.</p>
</div>
</div>
<div class="signUp__btnContainer-half">
<button type="button" class="btn xl full outline signUp__signUpBtn" onclick="fn_move_mainPage();"><spring:message code="button.cancel"/></button>
<button type="button" id="registBtn" class="btn xl full theme signUp__signUpBtn" onclick="fn_regist_member();"><spring:message code="button.insert"/></button>
</div>
</form>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,89 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : JoinCompleteR.jsp
Description : 회원가입 완료
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-05 최범식 최초 생성
2024-08-19 이대환 독립몰/통합몰 구분
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script type="text/javascript">
$(document).ready(function() {
var urlParams = new URLSearchParams(window.location.search);
urlParams.has('joinMthCd') && $('#joinMthCd').val(urlParams.get('joinMthCd'));
});
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 헤더 영역(Type3) -->
<main>
<c:set var="sopmalInfo" value="${resultMap.sopmalInfo}" />
<c:set var="integrated" value="${sopmalInfo.sopmalTyCd == '01'}" />
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<c:choose>
<c:when test="${integrated}">
<h2 class="page-title__title">GC ONE(통합회원) 가입</h2>
</c:when>
<c:otherwise>
<h2 class="page-title__title">회원가입</h2>
</c:otherwise>
</c:choose>
<!-- <div class="ck-content"> -->
<%-- <c:out value='${sopmalInfo.joinGuidanceSj}' escapeXml="false"/> --%>
<!-- </div> -->
</div>
<div class="signUpComplete">
<div class="signUpComplete__inner">
<img src="/pc/images/image_signUpComplete.png" alt="">
<div class="signUpComplete__box">
<c:out value='${sopmalInfo.joinComptWords}' escapeXml='false'/>
</div>
<c:choose>
<c:when test="${StplatDvCdAt == 'Y'}">
<p class="textInfo">회원님은 <fmt:formatDate value="<%= new java.util.Date()%>" pattern="yyyy-MM-dd"/>에 <c:out value='${sopmalInfo.sopmalNm}'/>의 마케팅 정보 수신을 동의하셨습니다.</p>
</c:when>
<c:otherwise>
<p class="textInfo">회원님은 <fmt:formatDate value="<%= new java.util.Date()%>" pattern="yyyy-MM-dd"/>에 <c:out value='${sopmalInfo.sopmalNm}'/>의 마케팅 정보 수신을 거부하셨습니다.</p><br>
<p class="textInfo"><i class="icon icon_textInfo--sm"></i>다양한 혜택 및 서비스를 받으시려면 마케팅 수신 활용에 동의해주시기 바랍니다.</p>
</c:otherwise>
</c:choose>
<input type="hidden" id="joinMthCd" value="general">
</div>
<div class="signUp__btnContainer-half">
<a href="<c:url value='/index'/>" class="btn xl full theme">쇼핑하러 가기</a>
<c:if test="${!isAuthenticated}">
<a href="<c:url value='/login'/>" class="btn xl full theme">로그인</a>
</c:if>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,128 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : JoinGuidanceR.jsp
Description : 회원가입 안내
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-05 최범식 최초 생성
2024-08-17 이대환 독립몰/통합몰 구분
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 헤더 영역(Type3) -->
<main>
<c:set var="sopmalInfo" value="${resultMap.sopmalInfo}" />
<c:set var="integrated" value="${sopmalInfo.sopmalTyCd == '01'}" />
<input type="hidden" id="sopmalCd" value="<c:out value="${sopmalInfo.sopmalCd}"/>">
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<c:choose>
<c:when test="${integrated}">
<h2 class="page-title__title">GC ONE(통합회원) 가입</h2>
</c:when>
<c:otherwise>
<h2 class="page-title__title">회원가입</h2>
</c:otherwise>
</c:choose>
<div class="ck-content">
<c:out value='${sopmalInfo.joinGuidanceSj}' escapeXml="false"/>
</div>
</div>
<div class="signUp-promotion">
<div class="signUp-promotion__introBox first ck-content">
<c:out value='${sopmalInfo.joinGuidanceWords}' escapeXml='false'/>
</div>
<c:if test="${!isAuthenticated}">
<div class="signUp-promotion__col-2 signUpLink" style="margin-bottom: 40px;">
<a href="<c:url value='/sopmal/mbr/selectJoinAgreeTermsForm'/>" class="btn lg theme">바로 가입 할래요</a>
<%--<a class="btn lg outline" onclick="$('html, body').animate({scrollTop: $('.signUp-promotion__section').offset().top}, 0);return false;" style="cursor: pointer;">가입시 혜택부터 볼래요</a>--%>
<div class="login__sns">
<c:if test="${sopmalInfo.kakaoIntrlckAt == 'Y'}"><button type="button" class="login__sns__btn kakao" onclick="openSocialLoginPopup('KAKAO');"><i class="icon icon_kakaoLogin"></i>카카오로 회원가입</button></c:if>
<c:if test="${sopmalInfo.naverIntrlckAt == 'Y'}"><button type="button" class="login__sns__btn naver" onclick="openSocialLoginPopup('NAVER');"><i class="icon icon_naverLogin"></i>네이버로 회원가입</button></c:if>
</div>
</div>
</c:if>
<div class="signUp-promotion__section">
<h5 class="signUp-promotion__section__title"><c:if test="${integrated}">GC ONE (통합 회원) </c:if>주요 혜택</h5>
<div class="signUp-promotion__col-3 ck-content">
<c:out value='${sopmalInfo.joinBnef}' escapeXml='false'/>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<script type="text/javascript">
$(document).ready(function() {
let signUpPromo = $('.signUp-promotion__col-3.ck-content');
let figureTable = signUpPromo.find('figure.table');
if(figureTable.length == 4){
signUpPromo.removeClass('signUp-promotion__col-3').addClass('signUp-promotion__col-2');
}
});
/* ********************************************************
* SNS 소셜 로그인
******************************************************** */
const openSocialLoginPopup = (provider) => {
var accessUrl = '${accessUrl}';
var redirectUri = accessUrl + '/sopmal/mbr/selectJoinAgreeTermsForm';
var width = 600;
var height = 600;
var left = (screen.width / 2) - (width / 2);
var top = (screen.height / 2) - (height / 2);
var url = '${ssoUrl}/oauth2/authorization/' + $('#sopmalCd').val() + "-" + provider
+ '?redirect_uri=' + encodeURIComponent(redirectUri) + '&oauth2_type=join&access_url='+ encodeURIComponent(accessUrl);
window.open(url, 'SocialLoginPopup', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
}
const receiveMessage = (event) => {
if(event.origin !== "${ssoUrl}") {
return;
}
if(event.data.type === 'LOGIN_SUCCESS') {
var tempForm = $('<form>', {
method: 'post',
action: event.data.redirectUrl
});
$.each(event.data, function(key, value) {
$('<input>', {
type: 'hidden',
name: key,
value: value
}).appendTo(tempForm);
});
tempForm.appendTo('body');
tempForm.submit();
tempForm.remove();
}
}
window.addEventListener('message', receiveMessage, false);
</script>
</body>
</html>

View File

@@ -0,0 +1,40 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : MbrMarktAgreePopupR.jsp
Description : 마케팅 수신동의 팝업
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2025-02-08 유재현 최초 생성
--%>
<div id="mbrMarktClauseAgreePopup" class="modal default" style="max-width: 620px;">
<div class="modal-header">
<%-- ${resultMap}--%>
<div class="modal-header__title" id = "mbrMarktClauseAgree-sj">
<c:forEach var="stplat" items="${resultMap.stplat}">
<c:if test="${stplat.cd eq '05'}">
<c:out value="${stplat.cdNm}"/>
</c:if>
</c:forEach>
</div>
</div>
<div class="modal-content ck-content" id = "mbrMarktClauseAgree-content">
<c:forEach var="clauseList" items="${resultMap.clauseList}" varStatus="staus">
<c:if test="${staus.first}">
${clauseList.stplatCn}
</c:if>
</c:forEach>
</div>
<div class="modal-footer">
<a href="#" rel="modal:close" class="btn theme large" onclick="fn_global_mbr_markt_agree_at('Y');">동의</a>
<a href="#" rel="modal:close" class="btn large outline" onclick="fn_global_mbr_markt_agree_at('N');">비동의</a>
</div>
</div>

View File

@@ -0,0 +1,21 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="ko">
<script>
var fullUrl = '${accessUrl}';
var currentUrl = '${currentUrl}';
// fullUrl이 없으면 currentUrl로 설정
if (!fullUrl || fullUrl.trim() === "") {
fullUrl = currentUrl;
}
var hashIndex = fullUrl.indexOf('#');
// # 기호가 있는 경우 URL에서 # 기호와 그 이후를 제거
var cleanUrl = hashIndex !== -1 ? fullUrl.substring(0, hashIndex) : fullUrl;
var encodedRedirectUri = encodeURIComponent(cleanUrl);
location.href = "/login?redirect_uri=" + encodedRedirectUri;
</script>
</html>
<%--권한 접근이 안되어 튕겨냄--%>

View File

@@ -0,0 +1,92 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : JoinC.jsp
Description : 회원가입
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-05 최범식 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="page-title center">
<h2 class="page-title__title">로그인</h2>
<p class="page-title__subTitle">회원 로그인을 하시면 각종 혜택 및 정보를 제공 받으실 수 있습니다.</p>
</div>
<div class="login">
<div class="boxTab">
<button class="boxTab__tabBtn current">회원</button>
<button class="boxTab__tabBtn">비회원(주문조회)</button>
</div>
<div class="boxTab__content login-content current">
<form action="">
<div class="login__inputBox">
<input class="input-text full" type="text" title="해당 인풋에 대한 설명" placeholder="아이디">
<p class="login__inputBox__alertText">아이디를 입력해 주세요.</p>
<input class="input-text full" type="password" title="해당 인풋에 대한 설명"
placeholder="비밀번호 (숫자,영문,특수문자 조합 8~20자리)">
<p class="login__inputBox__alertText">비밀번호를 입력해 주세요.</p>
</div>
<button class="btn xl full dark login__loginBtn">로그인</button>
<div class="login__misc">
<div class="b-checkbox-container">
<label class="b-checkbox is-medium checkbox">
<input type="checkbox" value="">
<span class="check"></span>
<span class="control-label">아이디 저장</span>
</label>
</div>
<a class="login__misc__link" href="">아이디/비밀번호 찾기</a>
</div>
</form>
<div class="login__signIn">
<p class="login__signIn__text">아직 GC ONE 회원이 아니세요?</p>
<a class="login__signIn__link" href="">회원가입</a>
</div>
<div class="login__sns">
<button class="login__sns__btn kakao"><i class="icon icon_kakaoLogin"></i>카카오 로그인</button>
<button class="login__sns__btn naver"><i class="icon icon_naverLogin"></i>네이버 로그인</button>
</div>
</div>
<div class="boxTab__content login-content">
<form action="">
<div class="login__inputBox">
<input class="input-text full" type="search" title="해당 인풋에 대한 설명" placeholder="주문번호">
<p class="login__inputBox__alertText">주문번호를 입력해 주세요.</p>
<input class="input-text full number" type="search" title="해당 인풋에 대한 설명"
placeholder="주문 시 입력한 휴대폰번호">
<p class="login__inputBox__alertText">휴대폰번호를 입력해 주세요.</p>
</div>
<button class="btn xl full dark login__loginBtn">조회알라리</button>
</form>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,59 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%--
Class Name : passwordChngPopupR.jsp
Description : 비밀번호 변경 팝업 조회
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-10-21 유재현 최초 생성
--%>
<script>
$(document).ready(function() {
$(".signUp__inputBox__alertText").hide();
fn_alert_hide($("#mbrPassword"), $("#mbrPasswordAlert"), 'pw');
fn_alert_hide($("#newPassword"), $("#newPasswordAlert"), 'pw');
fn_alert_hide($("#checkPassword"), $("#checkPasswordAlert"), 'pw');
});
</script>
<div id="passwordChngPopup" class="modal default" style="max-width: 600px;">
<div class="modal-header">
<div class="modal-header__title">비밀번호 수정</div>
</div>
<div class="modal-content">
<table class="table-address table-wrapper">
<caption>비밀번호 변경</caption>
<colgroup>
<col style="width:30%;">
<col style="width:auto;">
</colgroup>
<tbody>
<tr>
<th>기존 비밀번호</th>
<td>
<input type="password" class="input-text full" name="mbrPassword" id="mbrPassword" title="기존 비밀번호" placeholder="기존 비밀번호 입력" maxlength="20" style="margin-top:0px; margin-bottom:0px;">
<p class="signUp__inputBox__alertText" id="mbrPasswordAlert">비밀번호를 입력해 주세요.</p>
</td>
</tr>
<tr>
<th>변경할 비밀번호</th>
<td>
<input type="password" class="input-text full" name="newPassword" id="newPassword" title="변경할 비밀번호" placeholder="영문 대소문자/숫자/특수문자 중 2가지 이상 포함 6~20자" maxlength="20">
<p class="signUp__inputBox__alertText" id="newPasswordAlert">비밀번호를 입력해 주세요.</p>
</td>
</tr>
<tr>
<th>변경할 비밀번호 확인</th>
<td>
<input type="password" class="input-text full" name="checkPassword" id="checkPassword" title="변경할 비밀번호 확인" placeholder="비밀번호를 한번 더 입력해주세요." maxlength="20">
<p class="signUp__inputBox__alertText" id="checkPasswordAlert">비밀번호를 입력해 주세요.</p>
</td>
</tr>
</tbody>
</table>
<div class="shipping-btn-container">
<button class="btn large outline" onclick="fn_close_modal('passwordChngPopup')">취소</button>
<button class="btn theme large" onclick="fn_change_now();">수정하기</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,207 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : passwordChngR.jsp
Description : 비밀번호 변경 안내 조회
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-10-21 유재현 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<title>비밀번호 변경 캠페인</title>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
});
/* ********************************************************
* 나중에 변경하기
******************************************************** */
const fn_change_later = function() {
$.ajax({
type: 'post',
url : '<c:url value="/sopmal/mbr/updatePasswordChngLater"/>',
success: function (data) {
const result = JSON.parse(data.resBody.result).message;
if(result === "success"){
alert('<spring:message code="success.common.update"/>')
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('originalUrl')) {
window.location.href = decodeURIComponent(urlParams.get('originalUrl'));
return false;
}
window.location.href = '/index';
return false;
}
}
});
};
/* ********************************************************
* 비밀번호 변경
******************************************************** */
const fn_change_now = function() {
if(!fn_check_password()) {
return;
}
if (confirm('비밀번호를 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/mbr/updatePasswordChng"/>',
data : {
'mbrPassword' : $("#mbrPassword").val(),
'newPassword' : $("#newPassword").val(),
'checkPassword' : $("#checkPassword").val()
},
success: function (data) {
const result = JSON.parse(data.resBody.result).message;
if(result === "success"){
alert('<spring:message code="success.common.update"/>')
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('originalUrl')) {
window.location.href = decodeURIComponent(urlParams.get('originalUrl'));
return false;
}
window.location.href = '/index';
return false;
}
}
});
}
}
/* ********************************************************
* password check
******************************************************** */
const fn_check_password = function() {
var regular = /^(?=.*[a-zA-Z])(?=.*\d|.*\W)|(?=.*[a-zA-Z])(?=.*\W)|(?=.*\d)(?=.*\W)[a-zA-Z\d\W]{6,20}$/;
let mbrPassword = $('#mbrPassword');
let newPassword = $('#newPassword');
let newPasswordChk = $('#checkPassword');
if(!regular.test(mbrPassword.val())){
alert('비밀번호는 영문 대소문자/숫자/특수문자 중 2가지 이상 조합한 6~20자로 입력해주세요.');
mbrPassword.focus();
return;
}
if(!regular.test(newPassword.val())){
alert('비밀번호는 영문 대소문자/숫자/특수문자 중 2가지 이상 조합한 6~20자로 입력해주세요.');
newPassword.focus();
return;
}
if(!regular.test(newPasswordChk.val())){
alert('비밀번호는 영문 대소문자/숫자/특수문자 중 2가지 이상 조합한 6~20자로 입력해주세요.');
newPasswordChk.focus();
return;
}
if (newPassword.val() !== newPasswordChk.val()) {
alert('변경 비밀번호가 일치하지 않습니다.');
newPassword.focus();
return;
}
return true;
}
/* ********************************************************
* 사용자 입력값이 입력될 때 alertText 숨기기
******************************************************** */
const fn_alert_hide = (inputId, alertId, type) => {
inputId.on('input', function () {
switch(type){
case 'id':
var regular = /^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d_]{6,20}$/;
if (!$(this).val()) {
alertId.html('아이디를 입력해 주세요.');
}else if(dupList.includes(inputId.val())){
alertId.html('이미 사용중인 아이디입니다.');
alertId.show();
return;
}else if(!regular.test(inputId.val())){
alertId.html('아이디는 공백없는 영문, 숫자, 밑줄 포함 6~20자 조합만 사용 가능합니다.');
alertId.show();
return;
}
break;
case 'pw':
var regular = /^(?=.*[a-zA-Z])(?=.*\d|.*\W)|(?=.*[a-zA-Z])(?=.*\W)|(?=.*\d)(?=.*\W)[a-zA-Z\d\W]{6,20}$/;
if (!$(this).val()) {
alertId.html('비밀번호를 입력해 주세요.');
}else if(!regular.test(inputId.val())){
alertId.html('비밀번호는 영문 대소문자/숫자/특수문자 중 2가지 이상 조합한 6~20자로 입력해주세요.');
alertId.show();
return;
}
break;
default:
break;
}
alertId.hide();
if (!$(this).val()) {
alertId.show();
}
})
};
</script>
<body>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<main>
<div class="pwChange__wrapper">
<div class="pwChange">
<div class="pwChange__tit">
<div class="pwChange__img">
<img src="/pc/images/icon_pw-change.png" alt="">
</div>
<div class="pwChange__txt">
<p class="pwChange__txt__top">비밀번호 변경 캠페인</p>
<p class="pwChange__txt__title">회원님의 소중한<br>개인정보를 지켜주세요.</p>
<p class="pwChange__txt__text">
회원님의 아이디 <em>${passwordResultMap.mbrId}</em>은(는) 비밀번호 변경 대상입니다.<br>
${passwordResultMap.sopmalNm}에서는 회원님의 개인정보보호를 위해 ${passwordResultMap.passwordChngDe}개월 이상<br>
비밀번호를 변경하지 않은 경우 비밀번호 변경을 안내하고 있습니다.
</p>
</div>
</div>
<div class="pwChange__btn">
<a href="javascript:void(0);" class="btn xl outline" onclick="fn_change_later();">
<span>
나중에 변경하기
<br>
<em>${passwordResultMap.passwordCnfirmDe}개월 후에 변경</em>
</span>
</a>
<a href="javascript:void(0);" class="btn xl dark" onclick="fn_open_modal('#passwordChngDiv', '#passwordChngPopup', '<c:url value="/sopmal/mbr/selectPasswordChngPopup"/>')">
지금 변경하기
</a>
</div>
</div>
</div>
</main>
</body>
<%--비밀번호 변경 팝업--%>
<div id="passwordChngDiv"></div>
</html>

View File

@@ -0,0 +1,338 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : MyGoodsQaR.jsp
Description : 마이페이지 상품Q&A
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-11 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<script>
$(document).ready(function() {
//아코디언 클릭 시 폼 제출 방지
$(".tr-foldable-trigger").click(function(event) {
if($(this).next().hasClass("active")){
const bbscttInnb = $(this).attr("bbsctt-innb");
const idx = $(this).index();
fn_select_fileInfo(bbscttInnb,idx);
}
event.preventDefault(); // 폼 제출 방지
});
//삭제 모달 버튼
$(document).on('click','.deleteBtn',function(){
const bbscttInnb = $(this).closest('div').find("[name='bbscttInnb']").val();
const goodsInnb = $(this).closest('div').find("[name='goodsInnb']").val();
$('#qna-delete').modal();
$('#alertDelBtn').attr('bbscttInnb', bbscttInnb);
$('#alertDelBtn').attr('goodsInnb', goodsInnb);
});
//삭제 버튼
$(document).on('click','#alertDelBtn',function(){
const bbscttInnb = $(this).attr("bbscttInnb");
const goodsInnb = $(this).attr("goodsInnb");
const bbsId = $("#bbsId").val();
const bbsTyCd = $("#bbsTyCd").val();
fn_delete_bbsctt(bbscttInnb,bbsId,bbsTyCd,goodsInnb);
});
//수정 폼 이동 버튼
$(document).on('click','.updateBtn',function(){
const answAt = $(this).closest('div').find("[name='answAt']").val();
const bbscttInnb = $(this).closest('div').find("[name='bbscttInnb']").val();
const bbsId = $("#bbsId").val();
fn_move_qaUpdt(bbscttInnb,answAt,bbsId);
});
});
//해당 게시물 파일정보 get
const fn_select_fileInfo = (bbscttInnb, idx) => {
$.ajax({
type: "post",
url: "/sopmal/mpage/act/selectFileInfo",
data: {"bbscttInnb": bbscttInnb},
success: function (data) {
const resultData = JSON.parse(data.resBody.result);
const fileInfo = resultData.fileInfo;
let img = '';
fileInfo.forEach(function (file) {
img += `<img src="${cdnurl}\${file.filCours}\${file.sysFilNm}\" alt="\${file.orginlFilNm}\"
onerror="this.src='/pc/images/image_placeholder.png'; this.style.width='150px'; this.style.height='150px';"/>`;
});
$(".tr-foldable").eq(idx).find(".file").html(img);
}
});
}
//게시글 삭제
const fn_delete_bbsctt =(bbscttInnb,bbsId,bbsTyCd,goodsInnb)=>{
$.ajax({
type: "post",
url: "/sopmal/csc/deleteBbscttDel",
data: {
"delBbscttInnbArr": bbscttInnb,
"bbsId": bbsId,
"bbsTyCd": bbsTyCd,
"goodsInnbArr": goodsInnb
},
success: function () {
alert('<spring:message code="success.common.delete"/>');
fn_close_modal('qna-delete');
location.reload();
}
});
}
//페이징 목록 조회
const fn_select_List = (pageIndex) => {
const form = $('<form>', {
'action': '/sopmal/mpage/act/selectGoodsQnaInqire',
'method': 'post'
}).append(
$('<input>', {
'type': 'hidden',
'name': 'bbsId',
'value': $("#bbsId").val()
})
).append(
$('<input>', {
'type': 'hidden',
'name': 'pageIndex',
'value': pageIndex
})
);
$('body').append(form);
form.submit();
}
//게시글 수정
const fn_move_qaUpdt =(bbscttInnb,answAt,bbsId)=>{
/* if(answAt == 'Y'){
//1.1 답변이 있는지 확인 있으면 수정 불가 모달 호출
$('#qna-edit').modal();
}else{*/
//1.2답변이 없는 경우 폼을 생성하고 전송
const form = $('<form>', {
'action': '/sopmal/mpage/act/selectGoodsQnaDtlUpdtForm',
'method': 'post'
}).append(
$('<input>', {
'type': 'hidden',
'name': 'bbscttInnb',
'value': bbscttInnb
})
).append(
$('<input>', {
'type': 'hidden',
'name': 'bbsId',
'value': bbsId
})
).append(
$('<input>', {
'type': 'hidden',
'name': 'pageIndex',
'value': $("#pageIndex").val()
})
);
$('body').append(form);
form.submit();
}
/*}*/
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<c:set value="${resultMap.bbsInfo}" var = "bbsInfo"/>
<input type = "hidden" value = "<c:out value="${bbsInfo.bbsId}"/>" id = "bbsId">
<input type = "hidden" value = "<c:out value="${bbsInfo.bbsTyCd}"/>" id = "bbsTyCd">
<input type="hidden" name="slangFlterUseAt" id = "slangFlterUseAt" value = "<c:out value="${bbsInfo.slangFlterUseAt}"/>">
<div class="sub-right-content__section">
<h3 class="sub-right-content__title"><c:out value="${bbsInfo.bbsNm}"/></h3>
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 10%;">
<col style="width: 18%;">
<col style="width: auto;">
<col style="width: 15%;">
<col style="width: 10%">
</colgroup>
<thead>
<tr>
<th>번호</th>
<th>상품정보</th>
<th>문의내용</th>
<th>작성일</th>
<th>답변유무</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test = "${ not empty resultMap.resultList.resultList }">
<c:forEach var="resultList" items="${ resultMap.resultList.resultList}">
<tr class="tr-foldable-trigger" bbsctt-innb = "<c:out value = '${resultList.bbscttInnb}'/>">
<td><span class="board-number"><c:out value="${resultMap.paginationInfo.totalRecordCount - resultList.rnum+1 }" /></span></td>
<td class="text-left">
<div class="board-inner-product">
<div class="board-inner-product__right">
<a class="board-inner-product__name" href="" onclick = "fn_move_goods_dtl(<c:out value='${resultList.goodsInnb}'/>); return false;">
<c:out value="${resultList.goodsNm}"/>
</a>
</div>
</div>
</td>
<td class="text-left">
<div class="board-inner-product">
<div class="board-inner-product__right">
<p class="board-inner-product__title">
<span class="category"><c:if test = "${not empty resultList.answCn}">[<c:out value="${resultList.answCn}"/>]</c:if></span>
<c:out value="${resultList.sj}"/>
</p>
</div>
</div>
</td>
<td><span class="board-date"><c:out value="${resultList.sumRegistDt}"/></span></td>
<td>
<c:choose>
<c:when test = "${not empty resultList.answBbscttInnb}">
<span class="text-complete">답변완료</span>
</c:when>
<c:otherwise>
<span class="text-waiting">답변대기</span>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr class="tr-foldable">
<td colspan="5">
<div class="tr-foldable__content">
<div class="tr-foldable__qna">
<i class="icon icon_qna-q"></i>
<div class="tr-foldable__qna-content">
<p class="tr-foldable__qna-title"><c:out value="${resultList.sj}"/></p>
<div class = "cn" style="white-space: pre-wrap;"><c:out value="${resultList.cn}" /></div>
<br>
<div class = "file"></div>
</div>
</div>
<div class="tr-foldable__qna">
<i class="icon icon_qna-a"></i>
<div class="tr-foldable__qna-content">
<p class="tr-foldable__qna-title answSj"><c:out value="${resultList.answSj}"/></p>
<c:choose>
<c:when test = "${not empty resultList.answBbscttInnb}">
<div class = "cn ck-content"><c:out value="${resultList.answBbscttCn}" escapeXml="false"/></div>
</c:when>
<c:otherwise>
답변 등록 중 입니다.
</c:otherwise>
</c:choose>
</div>
</div>
<div class="tr-foldable__btn-container">
<input type = "hidden" name = "answAt"
value = <c:choose>
<c:when test = "${not empty resultList.answBbscttInnb}">
'Y'
</c:when>
<c:otherwise>
'N'
</c:otherwise>
</c:choose>>
<input type = "hidden" name = "bbscttInnb" value = <c:out value="${resultList.bbscttInnb}"/>>
<input type = "hidden" name = "goodsInnb" value = <c:out value="${resultList.goodsInnb}"/>>
<button type = "button" class="btn outline deleteBtn"><spring:message code="button.delete"/></button>
<c:if test = "${empty resultList.answBbscttInnb}">
<button type = "button" class="btn theme outline updateBtn"><spring:message code="button.update"/></button>
</c:if>
</div>
</div>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="4">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="조회 내역 없음">
<p class="table__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value = '${resultMap.bbsctt.pageIndex}'/>" />
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_List" />
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 질문 삭제 모달 -->
<div id="qna-delete" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
삭제된 게시글은 복구할 수 없습니다.
<br>
정말로 삭제 하시겠습니까?
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--cancel">취소</a>
<button type="button" class="alert-btn alert-btn--confirm" id = "alertDelBtn">확인</button>
</div>
</div>
<!-- 질문 수정 모달 -->
<%--<div id="qna-edit" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
답변이 등록된 상태입니다.
<br>
수정하실 수 없습니다.
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--confirm">확인</a>
</div>
</div>--%>
</body>
</html>

View File

@@ -0,0 +1,936 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : MyGoodsQaR.jsp
Description : 마이페이지 상품Q&A
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-11 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
fn_collect_evt();
});
/*********************************************************
* 이벤트 함수
*********************************************************/
const fn_collect_evt = () =>{
//내용 set
fn_select_cn();
//분류 change시 hidden value값 set
$(document).on('change', '#qesitmNmC', function () {
$("#qesitmInnb").val("");
$("#qesitmNm").val("");
$("#answCn").val("");
const option = $('option:selected', this);
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if ($(this).val() !== "") {
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmNm").val(qesitmNm);
$("#qesitmAt").val("Y");
$(this).closest("td").find("input[name='qesitmAtArr[]']").val("Y");
} else {
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmNm").val("");
$("#qesitmAt").val("N");
$(this).closest("td").find("input[name='qesitmAtArr[]']").val("N");
}
});
//추가입력 항목 라디오 'click' 이벤트
$(document).on('click', '.answRadioC', function () {
const radio = $(this);
//추가입력 항목 내용 요소 get
const answ = radio.closest(".custom-radio-container").find('[name="answCnArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest(".custom-radio-container").find('[name="qesitmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest(".custom-radio-container").find('.answRadio');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest(".custom-radio-container").find('[name="itmInnbArr[]"]');
//라디오 클릭 시 disabled 비활성
if (radio.is(":checked")) {
//답변 내용 초기화
answ.val("");
const radioVal = $(radio).attr('itm-cn');
answ.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
radio.closest(".custom-radio-container").find(".answRadioAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
radio.closest(".custom-radio-container").find(".answRadioAt").val("N");
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
$(document).on('change', '.answSelectC', function () {
const select = $(this);
const answ = select.closest("td").find('[name="answCnArr[]"]');
const qesitmInnb = select.closest("td").find('[name="qesitmInnbArr[]"]');
const contrlTarget = select.closest("td").find('.answSelect');
const option = $('option:selected', this);
if (select.val() != "") {
//답변 내용 초기화
answ.val("");
const selectVal = $(option).attr('itm-cn');
answ.val(selectVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(option).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//셀렉트 주위 input값 disable false처리
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
select.closest("td").find(".answSelectAt").val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
select.closest("td").find(".answSelectAt").val("N");
});
}
});
//추가입력 항목 체크박스 'click'이벤트
$(document).on('click', '.answChkC', function () {
const check = $(this);
const contrlTarget = check.closest("div").find('.answChk');
var isChecked = $(this).is(":checked");
//클릭한 체크박스 주위 input값 disable false처리
contrlTarget.each(function () {
if (isChecked) {
$(this).prop("disabled", false);
} else {
$(this).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = $('.answChkC:checked').length > 0;
contrlTarget.each(function () {
if (anyChecked) {
check.closest("td").find(".answChkAt").val("Y");
check.closest("td").find(".answChkAt").prop("disabled", false);
} else {
check.closest("td").find(".answChkAt").val("N");
check.closest("td").find(".answChkAt").prop("disabled", true);
}
});
});
//추가입력 항목 텍스트 'input'이벤트
$(document).on('input', '.answTxtC', function () {
const txt = $(this);
const contrlTarget = txt.closest("div").find('.answTxt');
const contrlAt = txt.closest("div").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
//파일 업로드
$(document).on("change", "#fileUpload", function () {
addFiles(event, 0);
});
//수정 이벤트
$("#updtBtn").on("click",function (){
fn_update_bbsctt();
});
//취소시 목록 이동
$("#canclBtn").on("click",function (){
const pageIndex = $("#pageIndex").val();
fn_select_List(pageIndex);
});
$("#updtComptBtn").on("click",function(){
const updtAt = $("#updtAt").val();
if(updtAt === 'Y'){
$("#pageIndex").val("1");
}
const form = $("#bbsUpdtForm");
form.attr("action","/sopmal/mpage/act/selectGoodsQnaDtlUpdtForm");
form.attr("method","post");
form.submit();
});
}
/*********************************************************
* 게시글 내용 조회
*********************************************************/
const fn_select_cn = function () {
let bbscttInnb = $("#bbscttInnb").val();
let bbsId = $("#bbsId").val();
let sopmalCd = $("#sopmalCd").val();
$.ajax({
type: "post",
url: "<c:url value ='/ajax/bbscttAjax/selectBOBbscttCnAjax'/>",
contentType: 'application/json',
data: JSON.stringify({
bbsId: bbsId,
bbscttInnb: bbscttInnb,
sopmalCd: sopmalCd
}),
success: function (data) {
let cn = data.result.cn;
$("#cnBbsUpdt").val(cn);
}
});
}
/*********************************************************
* 게시글 수정
*********************************************************/
const fn_update_bbsctt = () => {
let url = '<c:url value="/sopmal/csc/updateBbscttupdt"/>';
let saveForm = $('#bbsUpdtForm');
let formData = new FormData();
//파일 업로드
if ($("#contact-dropzone").length > 0) {
let myDropzone = Dropzone.forElement("#contact-dropzone");
myDropzone.files.forEach(function (file) {
formData.append("files", file);
});
}
//사용자 등록 시 노출 여부 Y
formData.append("expsrAt", "Y");
//입력항목 체크박스 disabled처리
$('.checkbox input[type="checkbox"]').each(function () {
if (!$(this).prop('checked')) {
fn_ctrl_disable([".checkbox"],);
}
});
//폼 내 input값 append
saveForm.serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
//사용자 등록 시 노출 여부 Y
if (confirm('게시글을 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'post',
url: url,
enctype:"multipart/form-data",
data: formData,
processData: false,
contentType: false,
success: function (result) {
$("#result-alert").modal();
}
});
}else{
fn_ctrl_disable("", [".checkbox"]);
}
}
/*********************************************************
* 목록 이동
*********************************************************/
const fn_select_List = (pageIndex) => {
if(!pageIndex){
pageIndex = 1;
}
const form = $('<form>', {
'action': '/sopmal/mpage/act/selectGoodsQnaInqire',
'method': 'post'
}).append(
$('<input>', {
'type': 'hidden',
'name': 'bbsId',
'value': $("#bbsId").val()
})
).append(
$('<input>', {
'type': 'hidden',
'name': 'pageIndex',
'value': pageIndex
})
);
$('body').append(form);
form.submit();
}
function fn_update_hidden_value () {
//분류 항목
const option = $('option:selected', $("#qesitmNmC"));
const qesitmInnb = $(option).attr('qesitm-innb');
const answCn = $(option).attr('answ-Cn');
const qesitmNm = $(option).attr('qesitm-nm');
if($("#qesitmNmC").val()!= ""){
$("#qesitmInnb").val(qesitmInnb);
$("#answCn").val(answCn);
$("#qesitmAt").val("Y");
}else{
$("#qesitmInnb").val("");
$("#answCn").val("");
$("#qesitmAt").val("N");
}
// 추가평가항목 라디오
const radio = $(".answRadioC:checked");
radio.each(function(idx) {
if (radio.eq(idx).val()) {
let radioAnsw = radio.eq(idx).closest("td").find('[name="answCnArr[]"]');
let radioQesitmInnb = radio.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let radioItmInnb = radio.eq(idx).closest("td").find('[name="itmInnbArr[]"]');
let radioQesitmAt = radio.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let radioContrlTarget = radio.eq(idx).closest("td").find('.answRadio');
// 답변 내용 set
radioAnsw.val(radio.eq(idx).attr('itm-cn'));
// 항목 내용 set
radioQesitmInnb.val(radio.eq(idx).attr('qesitm-innb'));
// 항목고유번호 내용 set
radioItmInnb.val(radio.eq(idx).val());
// 답변 여부
radioQesitmAt.val("Y");
// 라디오 주위 input값 disable false처리
radioContrlTarget.each(function(idx){
radioContrlTarget.eq(idx).prop("disabled", false);
});
} else {
let radioAnsw = radio.eq(idx).closest("td").find('[name="answCnArr[]"]');
let radioQesitmInnb = radio.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let radioItmInnb = radio.eq(idx).closest("td").find('[name="itmInnbArr[]"]');
let radioQesitmAt = radio.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let radioContrlTarget = radio.eq(idx).closest("div").find('.answRadio');
// 답변 내용 set
radioAnsw.val("");
// 항목 내용 set
radioQesitmInnb.val("");
// 항목고유번호 내용 set
radioItmInnb.val("");
// 답변 여부
radioQesitmAt.val("N");
// 라디오 주위 input값 disable false처리
radioContrlTarget.each(function(idx){
radioContrlTarget.eq(idx).prop("disabled", true);
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
const select =$('select.answSelectC[name="itmInnbArr[]"]');
select.each(function(idx) {
let selectIndex = select.eq(idx).find('option:selected').index();
if (selectIndex > 0) {
let selectQesitmAt = select.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let selectQesitmInnb = select.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let selectAnsw = select.eq(idx).closest("td").find('[name="answCnArr[]"]');
let selectOption = $('option:selected', select.eq(idx));
let selectContrlTarget = select.eq(idx).closest("td").find('.answSelect');
// 답변 여부
selectQesitmAt.val("Y");
// 항목 내용 set
selectQesitmInnb.val(selectOption.attr('qesitm-innb'));
// 답변 내용 set
selectAnsw.val(selectOption.attr('itm-cn'));
// 라디오 주위 input값 disable false처리
selectContrlTarget.each(function(idx){
selectContrlTarget.eq(idx).prop("disabled", false);
});
} else {
let selectQesitmAt = select.eq(idx).closest("td").find('[name="qesitmAtArr[]"]');
let selectQesitmInnb = select.eq(idx).closest("td").find('[name="qesitmInnbArr[]"]');
let selectAnsw = select.eq(idx).closest("td").find('[name="answCnArr[]"]');
let selectContrlTarget = select.eq(idx).closest("td").find('.answSelect');
// 답변 여부
selectQesitmAt.val("N");
// 항목 내용 set
selectQesitmInnb.val("");
// 답변 내용 set
selectAnsw.val("");
// 라디오 주위 input값 disable false처리
selectContrlTarget.each(function(idx){
selectContrlTarget.eq(idx).prop("disabled", true);
});
}
});
const check = $(".answChkC");
//클릭한 체크박스 주위 input값 disable false처리
check.each(function(idx){
let checkContrlTarget = check.eq(idx).closest(".checkbox").find('.answChk');
let isChecked = check.eq(idx).is(":checked");
checkContrlTarget.each(function (index) {
if (isChecked) {
checkContrlTarget.eq(index).prop("disabled", false);
} else {
checkContrlTarget.eq(index).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = check.eq(idx).closest("td").find(".answChkC:checked").length > 0;
if (anyChecked) {
check.eq(idx).closest("td").find(".answChkAt").val("Y");
} else {
check.eq(idx).closest("td").find(".answChkAt").val("N");
}
});
//추가입력 항목 텍스트 'input'이벤트
const txt = $('.answTxtC');
txt.each(function (idx) {
let contrlTarget = txt.eq(idx).closest("div").find('.answTxt');
let contrlAt = txt.eq(idx).closest("div").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if (txt.val() != "") {
contrlTarget.each(function () {
contrlTarget.prop("disabled", false);
contrlAt.val("Y");
});
} else {
contrlTarget.each(function () {
contrlTarget.prop("disabled", true);
contrlAt.val("N");
});
}
});
}
/*상품qna 버튼 클릭 제어*/
function fn_prevent_click(event) {
event.preventDefault(); // 체크박스 상태 변경 방지
}
</script>
<body>
<c:set value="${resultMap.bbscttInfo.bbscttInfo}" var="bbscttInfo"/>
<c:set value="${resultMap.bbscttVO}" var="bbscttVO"/>
<c:set value="${resultMap.bbscttInfo.qesitmAnswList}" var="qesitmAnswList"/>
<c:set value="${resultMap.bbscttInfo.fileInfoGson}" var="fileInfoGson"/>
<c:set value="${resultMap.bbscttInfo.goods}" var="goods"/>
<c:set value="${resultMap.bbscttInfo.wrter}" var="wrter"/>
<c:set value="${resultMap.bbsInfo}" var="bbsInfo"/>
<c:set value="${resultMap.qesitmList.qesitmList}" var="qesitmList"/>
<c:set value="${resultMap.qesitmList.itmCnList}" var="itmCnList"/>
<c:set value="${resultMap.itmList}" var="itmList"/>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<form id = "bbsUpdtForm">
<input type="hidden" name="dftCnUseAt" value="<c:out value = '${bbsInfo.dftCnUseAt}'/>" id="dftCnUseAt">
<input type="hidden" name="dftCn" value="<c:out value = '${bbsInfo.dftCn}'/>" id="dftCn">
<input type="hidden" name="slangFlter" value="<c:out value = '${bbsInfo.slangFlter}'/>">
<input type="hidden" name="password" value="<c:out value = '${bbscttInfo.password}'/>">
<input type="hidden" name="cmUseAt" value="<c:out value = '${bbscttInfo.cmUseAt}'/>">
<input type="hidden" name="sortOrdr" value="<c:out value = '${bbscttInfo.sortOrdr}'/>">
<input type="hidden" name="bbscttInnb" value="<c:out value = '${bbscttInfo.bbscttInnb}'/>" id="bbscttInnb">
<input type="hidden" name="bbsId" value="<c:out value = '${bbscttInfo.bbsId}'/>" id="bbsId">
<input type="hidden" name="pageIndex" value="<c:out value = '${bbsctt.pageIndex}'/>" id="pageIndex">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.extensions.images')" var="acceptFileExtensions"/> <%--허용 확장자--%>
<input type="hidden" name="acceptFileExtensions" value="<c:out value = '${acceptFileExtensions}'/>" id="acceptFileExtensions">
<input type="hidden" name="filAtch" value="${bbsInfo.filAtch }"/>
<input type="hidden" id="updtAt">
<input type="hidden" id="sopmalCd" value="<c:out value="${bbsInfo.sopmalCd}"/>" name="sopmalCd"/>
<input type="hidden" id="updtAt">
<%--존재 파일 여부 체크--%>
<c:choose>
<c:when test = "${not empty fileInfo}"><c:set var="filExtAt" value="Y"/></c:when>
<c:otherwise><c:set var="filExtAt" value="N"/></c:otherwise>
</c:choose>
<input type="hidden" id="filExtAt" name="filExtAt" value="${filExtAt}"/>
<input type="hidden" id="extFiles" name="extFiles" value=""/>
<input type="hidden" id="filesInfo" name="filesInfo"/>
<input type="hidden" id="extFilChangeAt" name="extFilChangeAt" value="N"/>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">상품 Q&A</h3>
<div class="table-wrapper">
<table class="table write">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 140px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>작성자</th>
<td>
<div class="td-inner"><c:out value="${bbscttInfo.regusrNm}"/></div>
</td>
</tr>
<c:if test="${bbsInfo.answRegist eq 'Y'&& bbsInfo.bbscttSndngMthCd ne '03'}"><%--답변사용여부와 게시글 문자사용여부 체크--%>
<tr>
<th>답변받기</th>
<td>
<div class="td-inner">
<input class="input-text" type="text" title="해당 인풋에 대한 설명" name="answMbtlnb"
id="answMbtlnb" maxlength="13" value = "<c:out value = '${bbscttInfo.answMbtlnb}'/>"
placeholder="휴대폰번호'-'없이 입력">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="answSmsRecptn" class="chkAt"
<c:if test="${bbscttInfo.answSmsRecptn eq 'Y'}">checked</c:if>>
<span class="check"></span>
<span class="control-label">SMS 알림요청</span>
</label>
</div>
</div>
</td>
</tr>
</c:if>
<tr>
<th>상품</th>
<c:forEach var="goods" items="${goods}">
<td class="text-left">
<div class="board-inner-product">
<img src="${cdnurl}${goods.img}" width="64" alt="상품이미지" onerror="this.src='/pc/images/image_placeholder.png'">
<div class="board-inner-product__right">
<p class="board-inner-product__name">
<c:out value="${goods.goodsNm}"/>
<input type="hidden" name="goodsInnbArr[]" value="${goods.goodsInnb}"/>
</p>
</div>
</div>
</td>
</c:forEach>
</tr>
<tr>
<th>문의유형<span class="required-asterisk">*</span></th>
<td>
<div class="td-inner">
<div class="select-box">
<%--문항답변필수여부 --%>
<input type="hidden" name="qesitmEssntlAtArr[]" value="Y">
<%--문항명 --%>
<input type="hidden" name="qesitmNmArr[]" id="qesitmNm"
value="분류"/>
<%--문항고유번호 --%>
<input type="hidden" name="qesitmInnbArr[]" id="qesitmInnb"
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
value = <c:out
value="${itmAnswList.qesitmInnb}"/>
</c:if>
</c:forEach>/>
<%--답변내용 --%>
<input type="hidden" name="answCnArr[]" id="answCn"
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
value = <c:out value="${itmAnswList.answCn}"/>
</c:if>
</c:forEach>/>
<%--답변여부 --%>
<input type="hidden" name="qesitmAtArr[]" id="qesitmAt"
<c:forEach var="itmAnswList" items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
<c:choose>
<c:when test="${empty itmAnswList.answCn}">value="N"</c:when>
<c:otherwise>value="Y"</c:otherwise>
</c:choose>
</c:if>
</c:forEach>>
<select class="md" id="qesitmNmC" name="itmInnbArr[]">
<option value="">분류 선택</option>
<c:forEach var="itm" items="${itmList}" varStatus="status">
<option value="<c:out value="${itm.itmInnb}"/>"
qesitm-innb="${itm.qesitmInnb}"
answ-Cn="${itm.itmCn}"
qesitm-nm="${itm.qesitmNm}"
<%--분류 답변 값 유지--%>
<c:forEach var="itmAnswList"
items="${qesitmAnswList}">
<c:if test="${itmAnswList.aditItmDvCd eq '03'}">
<c:if test="${itm.itmInnb eq itmAnswList.itmInnb }">selected</c:if>
</c:if>
</c:forEach>>
<c:out value="${itm.itmCn}"/>
</option>
</c:forEach>
</select>
</div>
</div>
</td>
</tr>
<c:if test="${not empty qesitmList}">
<c:forEach var="qesitmList" items="${qesitmList}">
<tr>
<c:if test="${ qesitmList.itmTyCd eq '01'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="custom-radio-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt}"
class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm}">
<input type="hidden" name="qesitmAtArr[]"
class="answRadioAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]"
class="answRadio"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answRadio"
disabled>
<input type="hidden" name="itmInnbArr[]" class="answRadio"
disabled>
<c:forEach items="${itmCnList}" var="itmCnList1" varStatus="status">
<c:if test="${itmCnList1.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="custom-radio is-medium">
<input type="radio" id="answCn${ status.index }"
class="answRadioC"
qesitm-innb='${itmCnList1.qesitmInnb}'
name="itmInnbArr${ qesitmList.qesitmInnb}[]"
value="${ itmCnList1.itmInnb}"
itm-cn="${ itmCnList1.itmCn }"
<c:forEach var="qesitmAnswList1" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList1.itmTyCd eq '01'}">
<c:if test="${qesitmAnswList1.itmInnb eq itmCnList1.itmInnb}">checked</c:if>
</c:if>
</c:forEach>>
<label for="answCn${ status.index }">${ itmCnList1.itmCn }</label>
</div>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '02'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answSelectAt qesitmAtChk" value="N">
<input type="hidden" name="qesitmInnbArr[]" class="answSelect"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answSelect" disabled>
<div class="select-box">
<select class="md answSelectC" name="itmInnbArr[]">
<option value="">전체</option>
<c:forEach items="${itmCnList}" var="itmCnList2">
<c:if test="${itmCnList2.qesitmInnb eq qesitmList.qesitmInnb}">
<c:set var="selected" value=""/>
<c:forEach var="qesitmAnswList2" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList2.itmInnb eq itmCnList2.itmInnb}">
<c:set var="selected" value="selected"/>
</c:if>
</c:forEach>
<option value="${itmCnList2.itmInnb}"
itm-cn="${itmCnList2.itmCn}"
qesitm-innb="${itmCnList2.qesitmInnb}" ${selected}>
${itmCnList2.itmCn}
</option>
</c:if>
</c:forEach>
</select>
</div>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '03'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }" class="essntlChk">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answChkAt qesitmAtChk"
value="N">
<c:forEach items="${itmCnList}" var="itmCnList3">
<c:if test="${itmCnList3.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<label class="b-checkbox checkbox">
<input type="hidden" class="answChk" name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" class="answChk" name="answCnArr[]"
value="${ itmCnList3.itmCn }" disabled>
<input type="checkbox" class="answChkC" name="itmInnbArr[]"
value="${ itmCnList3.itmInnb }"
itm-cn="${ itmCnList3.itmCn }"
qesitm-innb="${itmCnList3.qesitmInnb}"
<c:forEach var="qesitmAnswList3" items="${qesitmAnswList}">
<c:if test="${qesitmAnswList3.itmInnb eq itmCnList3.itmInnb}">checked</c:if>
</c:forEach>>
<span class="check"></span>
<span class="control-label">${ itmCnList3.itmCn }</span>
</label>
</div>
</c:if>
</c:forEach>
</td>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '04'}">
<th><c:out value="${ qesitmList.qesitmNm }"/><c:if
test="${qesitmList.qesitmEssntlAt eq 'Y'}"><span
class="required-asterisk">*</span></c:if></th>
<td>
<div class="td-inner">
<div class="input-grow-container">
<c:forEach items="${itmCnList}" var="itmCnList4">
<c:if test="${itmCnList4.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="input-container">
<input type="hidden" name="qesitmEssntlAtArr[]"
value="${ qesitmList.qesitmEssntlAt }">
<input type="hidden" name="qesitmNmArr[]"
value="${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]"
class="answTxtAt" value="N">
<input type="hidden" class="answTxt"
name="qesitmInnbArr[]"
value="${ qesitmList.qesitmInnb }" disabled>
<input type="text" class="input-text mm answTxtC"
name="answCnArr[]" title="추가문항답변"
placeholder="${ itmCnList4.itmCn }"
maxlength="666"
itm-cn="${ itmCnList4.itmCn }"
qesitm-innb="${itmCnList4.qesitmInnb}"
itm-innb="${itmCnList4.itmInnb}"
<c:forEach var="qesitmAnswList4"
items="${qesitmAnswList}">
<c:if test="${qesitmAnswList4.itmInnb eq itmCnList4.itmInnb}">
value="<c:out value = '${qesitmAnswList4.answCn}'/>"
</c:if>
</c:forEach>>
<input type="hidden" class="answTxt" name="itmInnbArr[]"
value="${ itmCnList4.itmInnb }" disabled>
</div>
<br>
</c:if>
</c:forEach>
</div>
</div>
</td>
</c:if>
</tr>
</c:forEach>
</c:if>
<tr>
<th>제목</th>
<td>
<div class="td-inner">
<input class="input-text xl" type="text" title="해당 인풋에 대한 설명"
name="sj"
placeholder="제목을 입력하세요." maxlength="100"
value="<c:out value = "${bbscttInfo.sj}"/>">
<c:if test="${bbsInfo.secretBbsctt eq 'Y'}">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" value="Y" name="secretBbscttAt"
<c:if test="${bbscttInfo.secretBbscttAt eq 'Y'}">checked</c:if>
onclick="fn_prevent_click(event);">
<span class="check"></span>
<span class="control-label">비밀글</span>
</label>
</div>
</c:if>
</div>
</td>
</tr>
<tr>
<th>내용</th>
<td>
<textarea class="textarea" rows="12" title="내용 입력란" name="cn"
id="cnBbsUpdt"><c:out value="${bbscttInfo.cn}"/></textarea>
</td>
</tr>
<%--게시판설정(파일첨부사용여부)--%>
<c:if test="${bbsInfo.filAtch eq 'Y'}">
<tr>
<th>이미지 등록</th>
<td>
<div class="dropzone-wrapper">
<div class="dropzone" id="contact-dropzone">
</div>
</div>
<ul class="contact-upload-info">
<li>사진 첨부는 최대 10MB 이하이며 3개까지 등록할 수 있습니다.</li>
<li>등록 가능 파일은 ${acceptFileExtensions} 파일만 가능합니다.</li>
<li>상품과 무관한 내용이거나 음란 불법적인 내용은 통보없이 삭제할 수 있습니다.</li>
</ul>
</td>
</tr>
</c:if>
</tbody>
</table>
</div>
<div class="sub-bottom-btn-container">
<button type="button" class="btn xl outline" id="canclBtn"><spring:message code="button.close"/></button>
<button type="button" class="btn xl theme" id="updtBtn"><spring:message code="button.update"/></button>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 수정/등록 알림 -->
<div id="result-alert" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
게시글을 수정하였습니다.
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--confirm" id = "updtComptBtn">확인</a>
</div>
</div>
</body>
<script>
// Dropzone 파일업로드
if ($("#contact-dropzone").length > 0) {
const maxFiles = 3;
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#contact-dropzone", {
url: "/file-upload",
maxFilesize: 10,
maxFiles: maxFiles,
acceptedFiles: "${acceptFileExtensions}",
autoProcessQueue: false,
addRemoveLinks: true,
dictDefaultMessage: "",
dictRemoveFile: "삭제",
dictCancelUpload: "취소",
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
dictResponseError: "서버에서 응답을 받지 못했습니다.",
init: function () {
let dropzoneInstance = this;
let imageData = ${fileInfoGson};
// 각 이미지를 Dropzone에 추가
$.each(imageData, function (index, image) {
// Dropzone 파일 객체 생성
let mockFile = {name: image.orginlFilNm, size: image.filMg};
dropzoneInstance.emit("addedfile", mockFile);
const cdnurl = '<c:out value="${cdnurl}"/>';
const imagePath =cdnurl+image.filCours + image.sysFilNm;
dropzoneInstance.emit("thumbnail", mockFile, imagePath);
// 이미지 오류 처리
$(mockFile.previewElement).find("img").on("error", function () {
this.src = '/pc/images/image_placeholder.png'; // 대체 이미지 경로로 설정
});
// Dropzone에 파일 추가
mockFile.customId = image.bbscttAtchmnfilInnb;
dropzoneInstance.files.push(mockFile);
});
// 파일이 삭제될 때마다 호출되는 이벤트 핸들러
this.on("removedfile", function (file) {
const customId = file.customId;
const result = dropzoneDeleteFiles(customId, '<c:out value="${bbscttVO.sopmalCd}"/>', "BDFL", 1);
if (result === "N") {//파일 삭제 안할 시 복원
file.customData = {restored: true, customId: file.customId}; //삭제 취소에 의한 구분자 부여
myDropzone.emit("addedfile", file); // 파일을 다시 추가하여 삭제 취소
myDropzone.emit("thumbnail", file, file.dataURL); // 파일의 썸네일을 복원
}
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
}
});
//파일 추가
this.on("addedfile", function (file) {
let restoreAt = '';
if (file.customData) { //파일 삭제 복구시
restoreAt = true;
} else {//새파일 추가시
restoreAt = false;
}
if (restoreAt) {// 파일 삭제 복구시 해당 id 재부여
file.customId = file.customData.customId;
} else {//새파일 추가시 임시 id 부여
let fileLength = myDropzone.files.length;
file.customId = "temp" + fileLength;
if (fileLength > maxFiles) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
this.removeFile(file);
$(file.previewElement).find(".dz-remove").attr("disabled", true);
}
}
});
// maxFiles 제한 관련 이벤트 핸들러
this.on("maxfilesexceeded", function (file) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
this.removeFile(file);
});
}
});
var inputElement = $('input[type="file"].dz-hidden-input');
// name 부여
inputElement.attr('name', 'file');
// id 부여
inputElement.attr('id', 'fileUpload');
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
} else {
$(".dz-message").hide();
}
}
</script>
</html>

View File

@@ -0,0 +1,97 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : MyRvwR.jsp
Description : 마이페이지 나의리뷰
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-11 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<c:choose>
<c:when test="${not empty resultMap.resultList.resultList}">
<div class="myReview">
<c:forEach var="resultList" items="${resultMap.resultList.resultList}">
<div class="myReview__item">
<div class="myReview__top">
<div class="cartItem">
<div class="cartItem__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')"
var="cdnurl"/>
<img onclick="fn_move_goods_dtl(<c:out value="${resultList.goodsInnb}"/>)"
style="cursor:pointer;"
src="<c:out value="${cdnurl}${resultList.img}"/>"
onerror="this.src='/pc/images/image_placeholder.png'" alt="리뷰 상품 사진">
</div>
<div class="cartItem__productInfo">
<span class="myReview__date"><c:out value="${resultList.registDt}"/></span>
<a onclick="fn_move_goods_dtl(<c:out value="${resultList.goodsInnb}"/>)"
style="cursor:pointer;"
class="cartItem__productTitle"><c:out value="${resultList.goodsNm}"/></a>
</div>
</div>
<c:if test="${not empty resultMap.resultList.fileList}">
<div class="myReview__thumbs">
<c:forEach var="fileList" items="${resultMap.resultList.fileList}">
<c:if test="${fileList.bbscttInnb eq resultList.bbscttInnb}">
<img src="<c:out value = '${cdnurl}${fileList.filCours}${fileList.sysFilNm}'/>"
onerror="this.src='/pc/images/image_placeholder.png'" alt="리뷰사진">
</c:if>
</c:forEach>
</div>
</c:if>
</div>
<div class="myReview__body">
<c:if test="${not empty resultList.evlScore}">
<div class="reviewStars__wrapper">
<div class="reviewStars star-<fmt:formatNumber value="${resultList.evlScore}" pattern="##"/>"></div>
<span class="reviewStars__num"><fmt:formatNumber value="${resultList.evlScore}"
pattern="##"/></span>
</div>
</c:if>
<div class="myReview__content" style="white-space: pre-wrap;"><c:out value="${resultList.cn}"/></div>
<div class="myReview__btnWrapper">
<c:if test="${fn:length(resultList.cn) gt 500}">
<button class="myReview__moreBtn btn lg outline">더보기</button>
</c:if>
</div>
<div class="myReview__btnControls">
<button type="button" class="btn sm outline deleteBtn"
bbsctt-innb="<c:out value = '${resultList.bbscttInnb}'/>"
bbs-id="<c:out value = '${resultList.bbsId}'/>"
bbs-ty-cd="<c:out value = '${resultList.bbsTyCd}'/>"
goods-innb="<c:out value = '${resultList.goodsInnb}'/>">
<spring:message code="button.delete"/>
</button>
</div>
</div>
</div>
</c:forEach>
</div>
<input type="hidden" id="myRvwpageIndex" name="pageIndex"
value="<c:out value='${resultMap.bbscttVO.pageIndex}'/>"/>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_move_myRvw"/>
</div>
</c:when>
<c:otherwise>
<div class="myReview">
<div class="myReview__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="myReview__no-result-text">
<spring:message code="common.nodata"/>
</p>
</div>
</div>
</c:otherwise>
</c:choose>
</html>

View File

@@ -0,0 +1,639 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : MyRvwR.jsp
Description : 마이페이지 나의리뷰
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-11 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
// /pc/script.js에 변수 선언됨
let boxTabs = $(".boxTab__tabBtn");
boxTabs.each(function (index) {
$(this).on("click", function () {
const divDv = $(this).attr('div-dv');
if(divDv == 'posblRvw'){
fn_move_writngPosblRvw(1);
}else if(divDv == 'myRvw'){
fn_move_myRvw(1);
}
});
});
const divDv = '<c:out value="${vo.divDv}"/>';
if (divDv === 'myRvw') {
$(".boxTab__tabBtn").eq(1).click();
} else {
$(".boxTab__tabBtn").eq(0).click();
}
// 작성 가능한 리뷰 이벤트 함수
fn_bind_writngPosblRvw();
// 리뷰 이벤트 함수
fn_bind_myRvwEvent();
$(document).on("click",".moveGoodsDtl",function(){
const goodsInnb = $(this).val();
fn_move_goods_dtl(goodsInnb);
});
});
//작성가능리뷰 조회
const fn_move_writngPosblRvw = (pageIndex) => {
//작성 가능 리뷰 조회 div
let posblRvwDiv = $("#posblRvwDiv");
if (!pageIndex) {
$('#wringPosblpageIndex').val(1);
} else {
$('#wringPosblpageIndex').val(pageIndex);
}
$.ajax({
type: "post",
url: "/sopmal/mpage/act/selectWritngPosblRvwInqire",
data:{"pageIndex":pageIndex},
success: function (data) {
if(posblRvwDiv.html()){
posblRvwDiv.empty();
}
posblRvwDiv.html(data);
}
});
}
//나의리뷰 조회
const fn_move_myRvw = (pageIndex) => {
//나의 리뷰 조회 div
let posblRvwDiv = $("#myRvwDiv");
if (!pageIndex) {
$('#myRvwpageIndex').val(1);
} else {
$('#myRvwpageIndex').val(pageIndex);
}
$.ajax({
type: "post",
url: "/sopmal/mpage/act/selectMyRvwInqire",
data:{"pageIndex":pageIndex},
success: function (data) {
if(posblRvwDiv.html()){
posblRvwDiv.empty();
}
posblRvwDiv.html(data);
//내용 html로 전환
$(".myReview__content").each(function(){
let cn = $('<div>').html($(this).text());
$(this).text(cn.text().trim());
});
}
});
}
//리뷰작성
const fn_move_writeRvw = (ordrGoodsOptnInnb,bbsTyCd,goodsInnb) => {
$.ajax({
type: "post",
url: "/sopmal/mpage/act/selectRvwWritngPopupForm",
data : {"ordrGoodsOptnInnb" : ordrGoodsOptnInnb,
"bbsTyCd" : bbsTyCd,
"goodsInnb" :goodsInnb},
success: function (data) {
if($("#modalDiv").html()){
fn_close_modal("orderReview-pop");
$(".dz-hidden-input").remove();
}
$("#modalDiv").html(data);
$("#orderReview-pop").modal();
$(".answSelectC").niceSelect();
}
});
}
/*********************************************************
* 작성 가능한 리뷰 이벤트 함수
*********************************************************/
const fn_bind_writngPosblRvw = () => {
//리뷰작성 클릭 시 모달 호출
$(document).on("click",".rvwBtn",function(){
/*주문 상품 옵션 고유번호*/
const ordrGoodsOptnInnb = $(this).attr("ordr-goods-optn-innb");
/*게시판 타입*/
const bbsTyCd = $(this).attr("bbs-ty-cd");
/*주문 상품 옵션 고유번호*/
const goodsInnb = $(this).val();
fn_move_writeRvw(ordrGoodsOptnInnb,bbsTyCd,goodsInnb);
});
/*리뷰 답변 항목 이벤트 제어*/
$(document).on('click','.rvwAnswRadioC',function(){
const radio = $(this);
//리뷰 항목 내용 요소 get
const score = radio.closest("div").find('[name="evlScoreArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest("div").find('[name="rvwQesitmInnbArr[]"]');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest("div").find('[name="rvwItmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest("div").find('.rvwAnswRadio');
//라디오 클릭 시 disabled 비활성
if(radio.is(":checked")){
const radioVal = $(radio).attr('itm-cn');
//평가 내용 set
score.val("");
score.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function() {
contrlTarget.prop("disabled",false);
radio.closest("div").find(".rvwAnswRadioAt").val("Y");
});
}else{
contrlTarget.each(function() {
contrlTarget.prop("disabled",true);
radio.closest("div").find(".rvwAnswRadioAt").val("N");
});
}
});
//추가입력 항목 라디오 'click' 이벤트
$(document).on('click','.answRadioC',function(){
const radio = $(this);
//추가입력 항목 내용 요소 get
const answ = radio.closest(".custom-radio-container").find('[name="answCnArr[]"]');
//추가입력 항목 내용 요소 get
const qesitmInnb = radio.closest(".custom-radio-container").find('[name="qesitmInnbArr[]"]');
//라디오 클릭으로 인한 제어 요소 get
const contrlTarget = radio.closest(".custom-radio-container").find('.answRadio');
//항목 고유번호 내용 요소 get
const itmInnb = radio.closest(".custom-radio-container").find('[name="itmInnbArr[]"]');
//라디오 클릭 시 disabled 비활성
if(radio.is(":checked")){
//답변 내용 초기화
answ.val("");
const radioVal = $(radio).attr('itm-cn');
answ.val(radioVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(radio).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//항목고유번호 내용 set
itmInnb.val("");
const itmInnbVal = $(radio).val();
itmInnb.val(itmInnbVal);
//라디오 주위 input값 disable false처리
contrlTarget.each(function() {
contrlTarget.prop("disabled",false);
radio.closest(".custom-radio-container").find(".answRadioAt").val("Y");
});
}else{
contrlTarget.each(function() {
contrlTarget.prop("disabled",true);
radio.closest(".custom-radio-container").find(".answRadioAt").val("N");
});
}
});
//추가입력 항목 셀렉트 'change'이벤트
$(document).on('change','.answSelectC',function(){
const select = $(this);
const answ = select.closest(".reviewRadio__item").find('[name="answCnArr[]"]');
const qesitmInnb = select.closest(".reviewRadio__item").find('[name="qesitmInnbArr[]"]');
const contrlTarget = select.closest(".reviewRadio__item").find('.answSelect');
const option = $('option:selected', this);
if(select.val()!= ""){
//답변 내용 초기화
answ.val("");
const selectVal = $(option).attr('itm-cn');
answ.val(selectVal);
//항목 내용 set
qesitmInnb.val("");
const qesitmInnbVal = $(option).attr('qesitm-innb');
qesitmInnb.val(qesitmInnbVal);
//셀렉트 주위 input값 disable false처리
contrlTarget.each(function() {
contrlTarget.prop("disabled",false);
select.closest(".reviewRadio__item").find(".answSelectAt").val("Y");
});
}else{
contrlTarget.each(function() {
contrlTarget.prop("disabled",true);
select.closest(".reviewRadio__item").find(".answSelectAt").val("N");
});
}
});
//추가입력 항목 체크박스 'click'이벤트
$(document).on('click','.answChkC',function(){
const check = $(this);
const contrlTarget = check.closest(".reviewRadio__item").find('.answChk');
var isChecked = $(this).is(":checked");
//클릭한 체크박스 주위 input값 disable false처리
contrlTarget.each(function() {
if (isChecked) {
$(this).prop("disabled", false);
} else {
$(this).prop("disabled", true);
}
});
// 체크된 체크박스가 하나라도 있는지 확인
let anyChecked = $('.answChkC:checked').length > 0;
contrlTarget.each(function() {
if (anyChecked) {
check.closest(".reviewRadio__item").find(".answChkAt").val("Y");
} else {
check.closest(".reviewRadio__item").find(".answChkAt").val("N");
}
});
});
//추가입력 항목 텍스트 'input'이벤트
$(document).on('input','.answTxtC',function(){
const txt = $(this);
const contrlTarget = txt.closest("div").find('.answTxt');
const contrlAt = txt.closest("div").find('.answTxtAt');
//클릭한 체크박스 주위 input값 disable false처리
if(txt.val() != ""){
contrlTarget.each(function() {
contrlTarget.prop("disabled",false);
contrlAt.val("Y");
});
}else{
contrlTarget.each(function() {
contrlTarget.prop("disabled",true);
contrlAt.val("N");
});
}
});
$(document).on("change","#fileUpload",function (){
addFiles(event,0);
});
$(document).on('change keyup', "#bbsRegForm" ,function(){
fn_validation_rvw();
});
//리뷰 등록 버튼 이벤트
$(document).on("click","#regBtn",function(){
const bbsId = $("#bbsId").val();
fn_regist_bbsctt(bbsId);
});
}
/*********************************************************
* 나의 리뷰 이벤트 함수
*********************************************************/
/*validation 체크*/
function fn_validation_rvw() {
//등록 조건 충족시 버튼 활성화
const essntlChkCnt = $(".essntlChk[value='Y']").length;
const qesitmAtChkCnt = $(".qesitmAtChk[value='Y']").length;
let writngChrCnt = '';
let writngChrAt = false;
const cnLength = $("#cn").val().length;
if ($("#writngChrCntAt").val() === "Y") {
writngChrCnt = parseInt($("#writngChrCnt").val(), 0);
if (writngChrCnt > cnLength) {
writngChrAt = false;
} else {
writngChrAt = true;
}
} else {
if (cnLength >= 1) {
writngChrAt = true;
}
}
//한달리뷰는 포토리뷰만 허용
let photoAt = false;
if ($("#bbsTyCd").val() === '06' || ($("#bbsTyCd").val() === '07' && $("#filExtAt").val() === 'Y')) {
photoAt = true;
}
if (essntlChkCnt === qesitmAtChkCnt && writngChrAt && photoAt && $("#regProccess").val() === 'N') {
$("#regBtn").prop("disabled", false);
} else {
$("#regBtn").prop("disabled", true);
}
}
const fn_bind_myRvwEvent = () => {
// 리뷰 상세보기
$(document).on('click','.myReview__moreBtn', function () {
if ($(this).hasClass('opened')) {
$(this).closest('.myReview__body').find('.myReview__content').removeClass('opened');
$(this).removeClass('opened');
$(this).text('더보기');
return;
}
$(this).closest('.myReview__body').find('.myReview__content').addClass('opened');
$(this).addClass('opened');
$(this).text('닫기');
})
// 리뷰 이미지 상세보기
$(document).on('click','.myReview__thumbs > img', function () {
// 클릭한 이미지의 인덱스
var index = $(this).index();
// 모달 생성 후, 이미지 슬라이더 초기화
$('#reviewImage-pop').modal();
$(document).on($.modal.BEFORE_OPEN, '#reviewImage-pop',function (event, modal) {
if ($('.slider-for').hasClass('slick-initialized')) {
//slick 이미지 중복 제거
let targetSlick = $('.slider-for, .slider-nav');
targetSlick.slick('slickRemove', null, null, true);
targetSlick.slick('unslick');
}
return false;
});
const div = $(this).closest('.myReview__item');
const img = $(div).find('.myReview__thumbs').html();
// const img = $(div).find('.myReview__thumbs').html();
$('.slider-for, .slider-nav').append(img);
$(document).off($.modal.OPEN).on($.modal.OPEN,'#reviewImage-pop',function (event, modal) {
// 메인 리뷰 이미지
$('.slider-for').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
fade: true,
infinite: false,
speed: 0,
asNavFor: '.slider-nav',
initialSlide: index // 클릭한 이미지의 인덱스
});
// 썸네일 리뷰 이미지
$('.slider-nav').slick({
slidesToShow: 3,
slidesToScroll: 3,
dots: false,
infinite: false,
asNavFor: '.slider-for',
focusOnSelect: true,
initialSlide: index, // 클릭한 이미지의 인덱스
useTransform: false
});
});
});
$(document).on("click",".deleteBtn", function(){
const bbscttInnb = $(this).attr("bbsctt-innb");
const bbsId = $(this).attr("bbs-id");
const bbsTyCd = $(this).attr("bbs-ty-cd");
const goodsInnb = $(this).attr("goods-innb");
$("#qna-delete").modal();
$("#modalBbsctt").val(bbscttInnb);
$("#modalBbsId").val(bbsId);
$("#modalBbsTyCd").val(bbsTyCd);
$("#modalGoodsInnb").val(goodsInnb);
});
$("#alertDelBtn").on("click",function(){
const bbscttInnb = $("#modalBbsctt").val();
const bbsId = $("#modalBbsId").val();
const bbsTyCd = $("#modalBbsTyCd").val();
const goodsInnb = $("#modalGoodsInnb").val();
fn_delete_bbsctt(bbscttInnb,bbsId, bbsTyCd, goodsInnb);
});
}
//게시글 삭제
const fn_delete_bbsctt = (bbscttInnb, bbsId, bbsTyCd, goodsInnb) => {
let delBbscttInnbArr = [];
let delInfoArr = [];
const delInfo = {
"bbscttInnb": bbscttInnb,
"goodsInnb": goodsInnb,
"regusrDvCd": '01'
}
delBbscttInnbArr.push(bbscttInnb);
delInfoArr.push(delInfo);
const data = {
"delBbscttInnbArr": delBbscttInnbArr,
"bbsId": bbsId,
"bbsTyCd": bbsTyCd,
"delInfoArr": delInfoArr, /*선택 삭제시 각 게시글 정보*/
};
$.ajax({
type: 'post',
url: "/sopmal/mpage/act/deleteRvwBbscttDel",
data: JSON.stringify(data),
dataType: "json",
contentType: 'application/json',
success: function () {
alert('<spring:message code="success.common.delete"/>');
fn_close_modal('qna-delete');
fn_move_myRvw(1);
}
});
}
/*********************************************************
* 게시글 등록
*********************************************************/
const fn_regist_bbsctt = function(bbsId) {
$('#regBtn').unbind('click');
let url = '<c:url value="/sopmal/csc/insertBbscttRegist"/>';
let saveForm = $('#bbsRegForm');
let formData = new FormData();
//파일 업로드
let myDropzone = Dropzone.forElement("#contact-dropzone");
myDropzone.files.forEach(function(file){
formData.append("files",file);
/*한달리뷰시 파일존재여부 체크(validation)*/
});
if(formData.get("files") == null){
$("#filExtAt").val("N");
}
//내용 get해서 sj
$("[name='sj']").val("");
const cn = $("#cn").val();
const removeTag = cn.replace(/<[^>]+>/g, ''); // HTML 태그 제거
let truncatedSj = removeTag.slice(0, 28); // 28글자로 제한
if (truncatedSj.length > 28) {
truncatedSj += "..."; // 28글자가 넘으면 뒤에 ... 추가
}
//제목
formData.append('sj',truncatedSj);
//체크박스
$('.checkbox input[type="checkbox"]').each(function() {
if (!$(this).prop('checked')) {
fn_ctrl_disable([".checkbox"],);
}
});
//설정정보
formData.append('setupInfoInnb',$("setupInfoInnb").val());
//폼 내 input값 append
saveForm.serializeArray().forEach(function(item) {
formData.append(item.name, item.value);
});
disableButton('#regBtn');
$("#regProccess").val("Y");
$.ajax({
type: 'post',
url: url,
data: formData,
processData: false,
contentType: false,
success: function (result) {
result = JSON.parse(result.resBody.result);
if(result.denyRvw === '0'){
alert("해당 주문건은\n리뷰가 모두 작성되었습니다.");
}else{
if (result.result == '1') {
alert('<spring:message code="success.common.insert"/>');
} else {
alert('<spring:message code="fail.common.insert"/>');
}
}
$('#boardFormItmC').empty();
fn_close_modal("orderReview-pop");
fn_move_writngPosblRvw();
fn_mpage_info_refresh();
$("#regProccess").val("N");
},
error: function (data, status, error) {
fn_ajax_error(data, status, error); /*공통 처리 함수*/
$("#regProccess").val("N");
}
});
}
//마이페이지 리프레쉬
const fn_mpage_info_refresh = function () {
$.ajax({
type: 'post',
url: '<c:url value="/sopmal/mpage/ordr/selectMpageInfoRefreshInqire"/>',
success: function (data) {
$('#mypageRightContainer').empty();
$('#mypageRightContainer').html(data);
}
});
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<div id="mypageRightContainer">
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
</div>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">나의 리뷰</h3>
<div class="infoBox">
<h6 class="infoBox__title">안내사항</h6>
<ol class="infoBox__list">
<li>리뷰는 구매 확정 후 6개월 이내 작성 하실 수 있습니다.</li>
<li>한달리뷰는 포토리뷰이므로 사진첨부는 필수 입니다.</li>
<c:if test = "${mlgAccmlNtc.goodsRvwMlgPymntAt eq 'Y'}">
<li>텍스트 리뷰는 <fmt:formatNumber value="${mlgAccmlNtc.gnrlRvwMlgAccmlmnyAmt}" pattern="#,###"/>원/
포토 리뷰는 <fmt:formatNumber value="${mlgAccmlNtc.photoRvwMlgAccmlmnyAmt}" pattern="#,###"/>
<c:if test = "${mlgAccmlNtc.monthBbsExpsrAt eq 'Y' && mlgAccmlNtc.goodsRvwMlgPymntMtAt eq 'Y'}"><%--한달리뷰 사용여부에 따른 분기처리--%>
/ 한달 리뷰는 <fmt:formatNumber value="${mlgAccmlNtc.monthPhotoRvwMlgAccmlmnyAmt}" pattern="#,###"/>원
</c:if>
적립금이 적립되며
리뷰 작성 후 수정이 불가하니 참고 부탁드립니다.</li>
<c:if test ="${mlgAccmlNtc.aditPymntMlgAccmlmnyAmt > 0}">
<li>
텍스트 리뷰 / 포토 리뷰 작성시 추가 마일리지 <fmt:formatNumber value="${mlgAccmlNtc.aditPymntMlgAccmlmnyAmt}" pattern="#,###"/> 적립됩니다.
(<c:out value = "${mlgAccmlNtc.aditMlgPymntBgnDe}"/>~<c:out value = "${mlgAccmlNtc.aditMlgPymntEndDe}"/>)
</li>
</c:if>
<c:if test = "${mlgAccmlNtc.monthAditPymntMlgAccmlmnyAmt > 0 && mlgAccmlNtc.goodsRvwMlgPymntMtAt eq 'Y'}">
<li>
한달 리뷰 작성시 추가 마일리지 <fmt:formatNumber value="${mlgAccmlNtc.monthAditPymntMlgAccmlmnyAmt}" pattern="#,###"/> 적립됩니다.
(<c:out value = "${mlgAccmlNtc.monthAditMlgPymntBgnDe}"/>~<c:out value = "${mlgAccmlNtc.monthAditMlgPymntEndDe}"/>)
</li>
</c:if>
</c:if>
</ol>
</div>
<div class="boxTab">
<button class="boxTab__tabBtn current" div-dv = 'posblRvw'>작성 가능한 리뷰</button>
<button class="boxTab__tabBtn" div-dv = 'myRvw'>나의 리뷰</button>
</div>
<div class="boxTab__content current">
<div id = "posblRvwDiv"></div>
</div>
<div class="boxTab__content" >
<div id = "myRvwDiv"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<div id = "modalDiv"></div>
<!-- 질문 삭제 모달 -->
<div id="qna-delete" class="modal alert">
<input type = "hidden" id="modalBbsctt">
<input type = "hidden" id="modalBbsId">
<input type = "hidden" id="modalBbsTyCd">
<input type = "hidden" id="modalGoodsInnb">
<div class="alert-content">
<p class="alert-content__text--sm">
삭제된 리뷰는 복구할 수 없으며
<br>
재작성은 불가합니다.
<br>
정말로 삭제 하시겠습니까?
</p>
</div>
<div class="alert-btn-container">
<a href="#" rel="modal:close" class="alert-btn alert-btn--cancel">취소</a>
<button type="button" class="alert-btn alert-btn--confirm" id = "alertDelBtn">확인</button>
</div>
</div>
<!-- 리뷰이미지 상세보기 -->
<div id="reviewImage-pop" class="modal modal--reviewImage" style="max-width: 1000px;">
<div class="modal-content">
<div class="reviewImage">
<div class="reviewImage__current">
<div class="slider-for"></div>
</div>
<div class="reviewImage__thumbs">
<div class="slider-nav"></div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,334 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<!DOCTYPE html>
<script>
$(document).ready(function(){
let placeholder = $("#cn").attr("placeholder");
placeholder = placeholder.replace(/<br\s*\/?>/gi, '\n');
$("#cn").attr("placeholder",placeholder);
$("#cn").val($("#cn").val().trimStart());
});
</script>
<html>
<c:set value = "${resultMap.regusrInfo}" var = "regusrInfo"/>
<c:set value = "${resultMap.bbsInfo}" var = "bbsInfo"/>
<c:set value = "${resultMap.mlgInfo}" var = "mlgInfo"/>
<c:set value = "${resultMap.qesitmList.qesitmList}" var = "qesitmList"/>
<c:set value = "${resultMap.qesitmList.itmCnList}" var = "itmCnList"/>
<c:set value = "${resultMap.rvwQesitmList.starQesitmList}" var = "starQesitmList"/>
<c:set value = "${resultMap.rvwQesitmList.starItmCnList}" var = "starItmCnList"/>
<c:set value = "${resultMap.itmList}" var = "itmList"/>
<c:set value = "${resultMap.rvwGoodsInfo}" var = "rvwGoodsInfo"/>
<!-- 리뷰작성 -->
<div id="orderReview-pop" class="modal default" style="max-width: 640px;">
<div class="modal-header">
<div class="modal-header__title">리뷰 작성</div>
</div>
<div class="modal-content">
<form id="bbsRegForm">
<div class="orderReviewPop">
<c:if test = "${mlgInfo.goodsRvwMlgPymntAt eq 'Y'}">
<div class="infoBox">
<p class="textInfo">
<%--마일리지 안내--%>
<i class="icon icon_textInfo--sm"></i>
텍스트 리뷰 <fmt:formatNumber value="${mlgInfo.gnrlRvwMlgAccmlmnyAmt}" pattern="#,###"/>원/
포토 리뷰 <fmt:formatNumber value="${mlgInfo.photoRvwMlgAccmlmnyAmt}" pattern="#,###"/>원
<c:if test="${mlgInfo.monthBbsExpsrAt eq 'Y' || mlgInfo.goodsRvwMlgPymntMtAt eq 'Y'}"><%--한달리뷰 사용여부에 따른 분기처리--%>
/한달 리뷰 <fmt:formatNumber value="${mlgInfo.monthPhotoRvwMlgAccmlmnyAmt}" pattern="#,###"/>원
</c:if>
적립<br>
<c:if test="${mlgInfo.aditPymntMlgAccmlmnyAmt > 0}">
텍스트 리뷰 / 포토 리뷰 작성시 추가 마일리지 <fmt:formatNumber value="${mlgInfo.aditPymntMlgAccmlmnyAmt}" pattern="#,###"/>
(<c:out value="${mlgInfo.aditMlgPymntBgnDe}"/>~<c:out value="${mlgInfo.aditMlgPymntEndDe}"/>)<br>
</c:if>
<c:if test="${mlgInfo.monthAditPymntMlgAccmlmnyAmt > 0}">
한달 리뷰 작성시 추가 마일리지 <fmt:formatNumber value="${mlgInfo.monthAditPymntMlgAccmlmnyAmt}" pattern="#,###"/><br>
(<c:out value="${mlgInfo.monthAditMlgPymntBgnDe}"/>~<c:out value="${mlgInfo.monthAditMlgPymntEndDe}"/>)
</c:if>
</p>
</div>
</c:if>
<div class="orderReviewPop__product">
<div class="cartItem">
<div class="cartItem__image">
<div><spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value = '${cdnurl}${rvwGoodsInfo.img}'/>" alt="상품이미지" id = "goodsImg" onerror="this.src='/pc/images/image_placeholder.png'">
</div>
</div>
<div class="cartItem__productInfo">
<div class="cartItem__productTitle"><c:out value = '${rvwGoodsInfo.goodsNm}'/></div>
</div>
</div>
</div>
<input type = "hidden" name = "bbsId" value = "${bbsInfo.bbsId}" id = "bbsId"/>
<input type = "hidden" name = "bbsTyCd" value = "${bbsInfo.bbsTyCd}" id = "bbsTyCd"/>
<input type = "hidden" name = "sopmalCd" value = "${bbsInfo.sopmalCd}" id = "sopmalCd"/>
<input type = "hidden" name = "regusrDvCd" value = "01"/>
<input type = "hidden" name = "ordrGoodsOptnInnb" value = "<c:out value = '${rvwGoodsInfo.ordrGoodsOptnInnb}'/>"/>
<input type = "hidden" name = "filExtAt" id = "filExtAt"/>
<input type = "hidden" name = "ordrInnb" id = "ordrInnb" value = "<c:out value = '${rvwGoodsInfo.ordrInnb}'/>"/>
<input type = "hidden" name = "goodsInnb" value = "<c:out value = '${rvwGoodsInfo.goodsInnb}'/>"/>
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.extensions.images')" var="acceptFileExtensions"/>
<input type = "hidden" name = "acceptFileExtensions" id = "acceptFileExtensions" value = "${acceptFileExtensions}"/>
<input type = "hidden" name = "goodsInnbArr[]" value = "<c:out value = '${rvwGoodsInfo.goodsInnb}'/>"/>
<c:if test = "${not empty starQesitmList}">
<c:forEach items="${starQesitmList}" var="starQesitm" varStatus="status">
<c:choose>
<c:when test="${starQesitm.scoreIndictMthCd eq '01'}">
<div class="reviewRating">
<span class="reviewRating__title"><c:out value="${starQesitm.qesitmNm}"/></span>
<div class="reviewRating__inner">
<input type="hidden" name="rvwQesitmEssntlAtArr[]" value="${starQesitm.qesitmEssntlAt}"
class="essntlChk">
<input type="hidden" name="rvwQesitmNmArr[]" value="${starQesitm.qesitmNm}">
<input type="hidden" name="rvwQesitmAtArr[]" class="rvwAnswRadioAt qesitmAtChk" value="N">
<input type="hidden" name="rvwQesitmInnbArr[]" class="rvwAnswRadio"
value="${starQesitm.qesitmInnb}" disabled>
<input type="hidden" name="evlScoreArr[]" class="rvwAnswRadio" disabled>
<input type="hidden" name="rvwItmInnbArr[]" class="rvwAnswRadio" disabled>
<c:forEach items="${resultMap.starItmList}" var="starItmCn" varStatus="status">
<c:if test="${starItmCn.qesitmInnb eq starQesitm.qesitmInnb}">
<input type="radio"
name="itmInnbArr<c:out value = '${starItmCn.qesitmInnb}'/>[]"
id="rvwCn<c:out value = '${status.index}'/>"
class="rvwAnswRadioC"
value="<c:out value='${starItmCn.itmInnb}'/>"
qesitm-innb='<c:out value = '${starItmCn.qesitmInnb}'/>'
itm-cn="<c:out value='${starItmCn.itmCn}'/>">
<label for="rvwCn${status.index}"></label>
</c:if>
</c:forEach>
</div>
</div>
</c:when>
<c:when test="${starQesitm.scoreIndictMthCd eq '02'}">
<div class="reviewRating">
<div class="reviewRating__title"><c:out value="${starQesitm.qesitmNm}"/></div>
<div class="custom-radio-container custom-radio-container--reviewRating">
<div class="custom-radio is-medium">
<input type="hidden" name="rvwQesitmEssntlAtArr[]" value="${starQesitm.qesitmEssntlAt}"
class="essntlChk">
<input type="hidden" name="rvwQesitmNmArr[]" value="${starQesitm.qesitmNm}">
<input type="hidden" name="rvwQesitmAtArr[]" class="rvwAnswRadioAt qesitmAtChk" value="N">
<input type="hidden" name="rvwQesitmInnbArr[]" class="rvwAnswRadio"
value="${starQesitm.qesitmInnb}" disabled>
<input type="hidden" name="evlScoreArr[]" class="rvwAnswRadio" disabled>
<input type="hidden" name="rvwItmInnbArr[]" class="rvwAnswRadio" disabled>
<c:forEach items="${starItmCnList}" var="starItmCn" varStatus="status">
<c:if test="${starItmCn.qesitmInnb eq starQesitm.qesitmInnb}">
<input type="radio"
name="itmInnbArr<c:out value = '${starItmCn.qesitmInnb}'/>[]"
id="rvwCn<c:out value = '${starItmCn.itmInnb}'/>"
class="rvwAnswRadioC"
value="<c:out value='${starItmCn.itmInnb}'/>"
qesitm-innb='<c:out value = '${starItmCn.qesitmInnb}'/>'
itm-cn="<c:out value='${starItmCn.itmCn}'/>">
<label for="rvwCn${starItmCn.itmInnb}"><c:out
value='${starItmCn.itmCn}'/>점&nbsp;</label>
</c:if>
</c:forEach>
</div>
</div>
</div>
</c:when>
</c:choose>
</c:forEach>
</c:if>
<c:if test = "${not empty qesitmList}">
<div class="reviewRadio">
<c:forEach items="${ qesitmList }" var="qesitmList" varStatus="status">
<c:if test="${ qesitmList.itmTyCd eq '01'}">
<div class="reviewRadio__item">
<div class="reviewRadio__title"><c:out value="${ qesitmList.qesitmNm }"/></div>
<div class="custom-radio-container">
<input type="hidden" name="qesitmEssntlAtArr[]" value="${ qesitmList.qesitmEssntlAt}" class = "essntlChk">
<input type="hidden" name="qesitmNmArr[]" value = "${ qesitmList.qesitmNm}">
<input type="hidden" name="qesitmAtArr[]" class = "answRadioAt qesitmAtChk" value = "N">
<input type="hidden" name="qesitmInnbArr[]" class="answRadio" value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answRadio" disabled>
<input type="hidden" name="itmInnbArr[]" class="answRadio" disabled>
<c:forEach items="${itmCnList}" var = "itmCnList1" varStatus = "status">
<c:if test ="${itmCnList1.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="custom-radio is-medium">
<input type="radio"
name="itmInnbArr<c:out value="${ qesitmList.qesitmInnb }"/>[]"
id="answCn<c:out value="${ status.index }"/>"
class = "answRadioC"
value="<c:out value="${ itmCnList1.itmInnb}"/>"
qesitm-innb = '<c:out value="${itmCnList1.qesitmInnb}"/>'
itm-cn="<c:out value="${ itmCnList1.itmCn }"/>">
<label for="answCn<c:out value="${ status.index }"/>">
<c:out value="${ itmCnList1.itmCn }"/>
</label>
</div>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '02'}">
<div class="reviewRadio__item">
<div class="reviewRadio__title"><c:out value="${ qesitmList.qesitmNm }"/></div>
<input type="hidden" name="qesitmEssntlAtArr[]" value="${ qesitmList.qesitmEssntlAt }" class = "essntlChk">
<input type="hidden" name="qesitmNmArr[]" value = "${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]" class = "answSelectAt qesitmAtChk" value = "N">
<input type="hidden" name="qesitmInnbArr[]" class="answSelect" value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" name="answCnArr[]" class="answSelect" disabled>
<div class="select-box">
<select class="md answSelectC" name="itmInnbArr[]">
<option value="" >전체</option>
<c:forEach items="${itmCnList}" var = "itmCnList2">
<c:if test ="${itmCnList2.qesitmInnb eq qesitmList.qesitmInnb}">
<option value="${ itmCnList2.itmInnb }" itm-cn="${ itmCnList2.itmCn}" qesitm-innb = '${itmCnList2.qesitmInnb}'>${ itmCnList2.itmCn }</option>
</c:if>
</c:forEach>
</select>
</div>
</div>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '03' }">
<div class="reviewRadio__item">
<div class="reviewRadio__title"><c:out value="${ qesitmList.qesitmNm }"/></div>
<input type="hidden" name="qesitmEssntlAtArr[]" value="${ qesitmList.qesitmEssntlAt }" class = "essntlChk">
<input type="hidden" name="qesitmNmArr[]" value = "${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]" class = "answChkAt qesitmAtChk" value = "N">
<c:forEach items="${itmCnList}" var = "itmCnList3">
<c:if test ="${itmCnList3.qesitmInnb eq qesitmList.qesitmInnb}">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="hidden" class="answChk" name="qesitmInnbArr[]" value="${ qesitmList.qesitmInnb }" disabled>
<input type="hidden" class="answChk" name="answCnArr[]" value="${ itmCnList3.itmCn }" disabled>
<input type="checkbox" class="answChkC" name="itmInnbArr[]" value="${ itmCnList3.itmInnb }">
<span class="check"></span>
<span class="control-label">${ itmCnList3.itmCn }</span>
</label>
</div>
</c:if>
</c:forEach>
</div>
</c:if>
<c:if test="${ qesitmList.itmTyCd eq '04' }">
<div class="reviewRadio__item">
<div class="reviewRadio__title"><c:out value="${ qesitmList.qesitmNm }"/></div>
<div class="reviewRadio__inputRow">
<c:forEach items="${itmCnList}" var = "itmCnList4">
<c:if test ="${itmCnList4.qesitmInnb eq qesitmList.qesitmInnb}">
<input type="hidden" name="qesitmEssntlAtArr[]" value="${ qesitmList.qesitmEssntlAt }" class = "essntlChk">
<input type="hidden" name="qesitmNmArr[]" value = "${ qesitmList.qesitmNm }">
<input type="hidden" name="qesitmAtArr[]" class = "answTxtAt qesitmAtChk" value = "N">
<input type="hidden" class="answTxt" name="qesitmInnbArr[]" value="${ qesitmList.qesitmInnb }" disabled>
<input type="text" class="answTxtC input-text full" name="answCnArr[]" title="추가문항답변" placeholder="${ itmCnList4.itmCn }" maxlength="666">
<input type="hidden" class="answTxt" name="itmInnbArr[]" value="${ itmCnList4.itmInnb }" disabled>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
</c:forEach>
</div>
</c:if>
<div class="orderRefundReason">
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">상품 리뷰를 작성해주세요.</div>
<textarea class="textarea" rows="6" title="상품 리뷰" name = "cn" id = "cn"
<c:choose>
<c:when test="${bbsInfo.dftCnUseAt eq 'Y'}">
placeholder= "<c:out value='${bbsInfo.dftCn}'/>"
</c:when>
<c:otherwise>
<c:if test="${not empty bbsInfo.writngChrCnt}">
placeholder="최소 <c:out value="${bbsInfo.writngChrCnt}"/>자 이상으로 입력해 주세요."
</c:if>
</c:otherwise>
</c:choose>>
</textarea>
<c:if test = "${not empty bbsInfo.writngChrCnt}">
<input type="hidden" id = "writngChrCntAt" value ="Y">
</c:if>
<input type="hidden" id = "writngChrCnt" value ="<c:out value = "${bbsInfo.writngChrCnt}"/>">
</div>
</div>
<c:if test="${bbsInfo.filAtch eq 'Y'}">
<div class="reviewImageUpload">
<div class="reviewImageUpload__title">이미지 등록(3장) <c:if test = "${bbsInfo.bbsTyCd eq '07'}"><span style="color:red">*</span></c:if></div>
<div class="dropzone-wrapper">
<div class="dropzone" id="contact-dropzone">
</div>
</div>
<ul class="contact-upload-info">
<li>사진 첨부는 최대 10MB 이하이며 3개까지 등록할 수 있습니다.</li>
<li>등록 가능 파일은 ${acceptFileExtensions} 파일만 가능합니다.</li>
<li>상품과 무관한 내용이거나 음란 불법적인 내용은 통보없이 삭제할 수 있습니다.</li>
</ul>
<input type="hidden" name="filAtch" id="filAtch" value="Y"/>
</div>
</c:if>
</div>
</form>
</div>
<div class="modal-footer">
<a href="#" rel="modal:close" class="btn large outline">닫기</a>
<button type = "button" class="btn large theme" id = "regBtn" disabled>리뷰 등록</button>
<input type = "hidden" id = "regProccess" value = "N"/>
</div>
</div>
<script>
// Dropzone 파일업로드
if ($("#contact-dropzone").length > 0) {
const maxFiles = 3;
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone("#contact-dropzone", {
url: "/file-upload",
maxFilesize: 10,
maxFiles: maxFiles,
acceptedFiles: "${acceptFileExtensions}",
autoProcessQueue: false,
addRemoveLinks: true,
dictDefaultMessage: "",
dictRemoveFile: "삭제",
dictCancelUpload: "취소",
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
dictResponseError: "서버에서 응답을 받지 못했습니다.",
});
var inputElement = $('input[type="file"].dz-hidden-input');
// name 부여
inputElement.attr('name', 'file');
// id 부여
inputElement.attr('id', 'fileUpload');
// 파일 추가 이벤트
myDropzone.on("addedfile", function(file) {
if (myDropzone.files.length >= maxFiles) {
$(".dz-message").hide();
}
$("#filExtAt").val("Y");
fn_validation_rvw();
});
myDropzone.on("removedfile", function(file) {
if (myDropzone.files.length < maxFiles) {
$(".dz-message").show();
}
if(myDropzone.files.length == 0){
$("#filExtAt").val("N");
fn_validation_rvw();
}
});
myDropzone.on("maxfilesexceeded", function(file) {
const dictMaxFilesExceeded = myDropzone.options.dictMaxFilesExceeded;
alert(dictMaxFilesExceeded);
this.removeFile(file);
$(file.previewElement).find(".dz-remove").attr("disabled", true);
});
}
</script>
</html>

View File

@@ -0,0 +1,79 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<!DOCTYPE html>
<html lang="ko">
<c:choose>
<c:when test="${not empty resultMap.resultList}">
<div class="orderList">
<c:forEach var = "resultList" items="${resultMap.resultList}">
<div class="orderList__item">
<div class="orderList__item__inner">
<button type="button" class="orderList__image moveGoodsDtl" value="<c:out value ='${resultList.goodsInnb}'/>">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value ='${cdnurl}${resultList.img}'/>" alt="" onerror="this.src='/pc/images/image_placeholder.png'">
</button>
<div class="orderList__description">
<div class="orderList__description__first">
<div class="orderList__item__top">
<a onclick="" style="cursor:pointer;" class="orderList__orderNum"><c:out value='${resultList.ordrInnb}'/>
</a>
</div>
<a href="" class="orderList__productTitle"><c:out value='${resultList.goodsNm}'/></a>
<c:if test = "${not empty resultList.optnNm}">
<span class="orderList__option">옵션: <c:out value='${resultList.optnNm}'/></span>
</c:if>
</div>
<div class="orderList__description__second">
</div>
<div class="orderList__description__third">
<span class="orderList__orderQuantity">
작성리뷰수:
<span class="comma rvwCnt"><c:out value ='${resultList.rvwCnt}'/></span><br>/
구매확정수량:
<span class="comma ordrGoodsQy"><c:out value ='${resultList.purchsDcsnQy}'/></span>
</span>
</div>
<div class="orderList__btnControls">
<%--구매확정수량이 리뷰 작성 수 보다 클 때만 노출--%>
<c:if test = "${resultList.purchsDcsnQy > resultList.rvwCnt}">
<button type = "button" class="btn outline sm full rvwBtn"
ordr-goods-optn-innb = "<c:out value ='${resultList.ordrGoodsOptnInnb}'/>"
bbs-ty-cd = "06"
value='<c:out value ='${resultList.goodsInnb}'/>'>리뷰작성</button>
</c:if>
<c:if test = "${resultList.mtRvwAt eq 'Y'}">
<button type = "button" class="btn theme sm full rvwBtn"
ordr-goods-optn-innb = "<c:out value ='${resultList.ordrGoodsOptnInnb}'/>"
bbs-ty-cd = "07"
value='<c:out value ='${resultList.goodsInnb}'/>'>한달리뷰작성</button>
</c:if>
</div>
</div>
</div>
</div>
</c:forEach>
</div>
<input type="hidden" id="setupInfoInnb" name="setupInfoInnb" value="<c:out value='${resultMap.bbsInfo.setupInfoInnb}'/>" />
<input type="hidden" id="wringPosblpageIndex" name="pageIndex" value="<c:out value='${resultMap.bbscttVO.pageIndex}'/>" />
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_move_writngPosblRvw" />
</div>
</c:when>
<c:otherwise>
<div class="orderList">
<div class="orderList__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="orderList__no-result-text">
작성 가능한 리뷰가 없습니다.
</p>
</div>
</div>
</c:otherwise>
</c:choose>
</html>

View File

@@ -0,0 +1,80 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<script>
$(document).ready(function() {
});
</script>
<div class="sub-tab__content current">
<div class="mileageList">
<c:choose>
<c:when test="${ not empty resultMap.cashList}">
<c:forEach var="list" items="${ resultMap.cashList}" varStatus="status">
<c:choose>
<c:when test = "${list.mlgAccmlDvCd eq 'add'}">
<c:set var="upAt" value="mileageList__item--saveUp"/>
</c:when>
<c:otherwise>
<c:set var="upAt" value=""/>
</c:otherwise>
</c:choose>
<div class="mileageList__item ${upAt}">
<div class="mileageList__itemHeader">
<div class="mileageList__itemHeaderMisc">
<span class="mileageList__itemDate"><c:out value="${ list.mpageRegistDt }"/></span>
<span class="mileageList__itemDot">·</span>
<span class="mileageList__itemBrand"><c:out value="${ list.sopmalNm }"/></span>
</div>
<span class="mileageList__itemTitle"><c:out value="${ list.mlgAccmlDvNm }"/> (잔여: <fmt:formatNumber value="${list.blce}" pattern="#,###"/>)</span>
</div>
<div class="mileageList__itemBody">
<span class="mileageList__itemDescription"><c:out value="${ list.mlgApplcDvNm }"/></span>
<span class="mileageList__itemNumber"><span class="comma"><fmt:formatNumber value="${list.accmlmnyAmt}" pattern="#,###"/></span></span>
</div>
<div class="mileageList__orderNum">
<c:if test="${ not empty list.ordrInnb && list.ordrInnb ne 0 }">
주문번호 <em><c:out value="${ list.ordrInnb }"/></em>
</c:if>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="orderList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">마일리지내역이 없습니다.</p>
</div>
</c:otherwise>
</c:choose>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_mlg_list" />
</div>
</div>
<div class="sub-tab__content">2</div>
<div class="sub-tab__content">3</div>
<div class="sub-tab__content">4</div>

View File

@@ -0,0 +1,397 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CashDtlsRForm.jsp
Description : 마이페이지 GC 머니 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
fn_select_mlg_list(pageIndex, pageUnit);
fn_start_display();
});
/******************************************************************
* 시작 화면 제어
******************************************************************/
const fn_start_display = function() {
/* 검색조건 > 날짜 구간 버튼 클릭 이벤트 */
$('.dateRange-btn').on('click', function() {
const date = $(this).attr('id');
$(this).closest('div').find('#dateRange').val(date);
if ('allDays' === date) {
$('#bgnDt, #endDt').val('');
return false;
}
fn_set_date('bgnDt', 'endDt', 'endDt', date);
});
/* 검색 버튼 클릭 이벤트 */
$('#btnSearch').on('click', function() {
fn_select_mlg_list(1);
});
/*pin 번호 등록*/
$(document).on("click","#pinAlertBtn",function(){
if ($("#pinAlertBtn").text() === "등록") {
fn_add_cash();
} else {
$("#closeBtn").click();
}
});
}
/* 검색조건 세팅 */
const fn_set_param = function() {
const params = ${paramVO};
const keys = Object.keys(params);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let data = params[key];
if ('bgnDt' == key || 'endDt' == key) {
if (!fn_is_empty(data)) {
for (let i = 0; i < data.length; i++) {
$('#' + key).val(data);
}
}
}
if ('dateRange' == key) {
$('#'+ data).trigger('click');
}
if ('srchwrd' == key) {
$('#' + key).val(data);
}
}
}
/******************************************************************
* 마일리지 목록 조회
******************************************************************/
const fn_select_mlg_list = function(pageIndex, pageUnit) {
const currentTabTxt = $(".sub-tab__btn.current").text();
if(currentTabTxt === '적립') {
$("#srchMlgAccmlDvCd").val("add");
} else if (currentTabTxt === 'use') {
$("#srchMlgAccmlDvCd").val("use");
} else if (currentTabTxt === 'exp') {
$("#srchMlgAccmlDvCd").val("exp");
}
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/bnef/selectCashDtlsInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
/******************************************************************
* 마일리지 목록 조회 지급구분
******************************************************************/
const fn_select_mlg_list_dv = function(srchMlgAccmlDvCd) {
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/bnef/selectCashDtlsInqire"/>',
data : {
srchMlgAccmlDvCd : srchMlgAccmlDvCd
},
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
/****************************************************************
상품권 충전 서비스 시작
****************************************************************/
const fn_select_crtnb = () => {
$.ajax({
type: "post",
url: '<c:url value="/sopmal/mpage/bnef/selectGiftCardCrtfcNb"/>',
data: {crtfcNb: $('#crtfcNb').val()},
success: function (result) {
result = JSON.parse(result.resBody.result);
$("#pinMsg").text(result.message);
const at = result.at;
if(at.possibleAt === 'Y'){
$("#pinAlertBtn").text("등록");
$('#pinNb').show();
$('#pinNb').val('');
$('#pinNb').focus();
$("#alertCrtnb").val(result.crtfcNb)
}else{
$("#pinAlertBtn").text("닫기");
$('#pinNb').hide();
}
$('#pinBtn').click();
}
});
}
/****************************************************************
상품권 충전
****************************************************************/
const fn_add_cash = () => {
$.ajax({
type: "post",
url: '<c:url value="/sopmal/mpage/bnef/insertGiftCard"/>',
data: {pinNb: $('#pinNb').val(),
crtfcNb: $('#alertCrtnb').val()},
success: function (result) {
result = JSON.parse(result.resBody.result);
alert(result.message);
$("#crtfcNb").val("");
$("#closeBtn").click();
$("#calBlce").text(fn_format_comma(result.blce));
fn_select_mlg_list(1); // 목록 새로고침
}
});
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">GC 머니 내역</h3>
<div class="mileageStatus">
<div class="mileageStatusCurrent">
<svg xmlns="http://www.w3.org/2000/svg" width="67" height="63" viewBox="0 0 67 63"
fill="none">
<g clip-path="url(#clip0_872_54192)">
<g style="mix-blend-mode:darken">
<path
d="M43.7905 51.5702C56.5262 51.5702 66.8505 41.2459 66.8505 28.5102C66.8505 15.7745 56.5262 5.4502 43.7905 5.4502C31.0548 5.4502 20.7305 15.7745 20.7305 28.5102C20.7305 41.2459 31.0548 51.5702 43.7905 51.5702Z"
fill="#DADBE1"></path>
</g>
<path d="M4.93945 15.2997V13.7197" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M2.58 17.6494H1" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M4.93945 20.0098V21.5898" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M7.28906 17.6494H8.86906" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M26.1895 2.42V1" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M24.0704 4.54004H22.6504" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M26.1895 6.66016V8.08016" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M28.3105 4.54004H29.7305" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M55.8999 13.9805H18.9199V21.8905H55.8999V13.9805Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M60.1909 21.8896H23.2109V29.8096H60.1909V21.8896Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M54.3804 29.8096H17.4004V37.7196H54.3804V29.8096Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M57.6909 37.7197H20.7109V45.6397H57.6909V37.7197Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M61.8804 45.6396H24.9004V53.5496H61.8804V45.6396Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M57.6909 53.5498H20.7109V61.4698H57.6909V53.5498Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<g style="mix-blend-mode:darken">
<path
d="M50.6004 42.0604C50.6004 43.2804 50.5104 44.4704 50.3404 45.6404C49.9204 48.4604 49.0204 51.1304 47.7204 53.5504C46.0604 56.6504 43.7504 59.3604 40.9604 61.4704H20.7104V53.5504H24.9004V45.6404H20.7104V37.7204H17.4004V29.8104H23.2104V21.8904H18.9204V18.7604C21.2204 18.0404 23.6604 17.6504 26.1904 17.6504C31.2704 17.6504 36.0004 19.2104 39.9104 21.8904C42.9204 23.9304 45.4504 26.6504 47.2904 29.8104C48.7004 32.2104 49.7004 34.8804 50.2004 37.7204C50.4704 39.1304 50.6004 40.5804 50.6004 42.0604Z"
fill="#DADBE1"></path>
</g>
<path
d="M2.54078 48.8405H38.8708C39.6608 46.7305 40.1108 44.4505 40.1108 42.0605H1.30078C1.30078 44.4505 1.75078 46.7305 2.54078 48.8405Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M20.7098 61.4709C26.1498 61.4709 31.0498 59.2309 34.5798 55.6309H6.83984C10.3598 59.2309 15.2698 61.4709 20.7098 61.4709Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M6.84102 55.6306H34.581C36.461 53.7106 37.921 51.4106 38.881 48.8506H2.54102C3.50102 51.4106 4.96102 53.7206 6.84102 55.6306Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M6.84102 28.4902C4.96102 30.4102 3.50102 32.7102 2.54102 35.2702H38.871C37.911 32.7102 36.451 30.4002 34.571 28.4902H6.84102Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M1.30078 42.0603H40.1208C40.1208 39.6703 39.6708 37.3903 38.8808 35.2803H2.54078C1.75078 37.3903 1.30078 39.6703 1.30078 42.0603Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M20.7098 22.6504C15.2698 22.6504 10.3698 24.8904 6.83984 28.4904H34.5798C31.0598 24.8904 26.1498 22.6504 20.7098 22.6504Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M26.1893 61.4704C36.9091 61.4704 45.5993 52.7802 45.5993 42.0604C45.5993 31.3405 36.9091 22.6504 26.1893 22.6504C15.4694 22.6504 6.7793 31.3405 6.7793 42.0604C6.7793 52.7802 15.4694 61.4704 26.1893 61.4704Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path class="svg-themeColor"
d="M19.3923 35.9873C19.5007 35.229 20.3132 34.3623 21.4507 34.3623C22.4798 34.3623 23.2923 35.1206 23.5632 35.879L26.0548 44.1665H26.109L28.6007 35.879C28.8173 35.1206 29.6298 34.3623 30.7132 34.3623C31.8507 34.3623 32.6632 35.229 32.7715 35.9873L34.6673 47.6873V48.0665C34.6673 48.9873 34.0173 49.5831 33.1507 49.5831C32.0673 49.5831 31.634 49.0956 31.5257 48.1206L30.334 39.5623H30.2798L27.7882 48.3373C27.6257 48.8248 27.2465 49.529 26.109 49.529C24.9715 49.529 24.5923 48.8248 24.4298 48.3373L21.8298 39.5081H21.7757L20.5298 48.0665C20.3673 49.0415 19.9882 49.529 18.9048 49.529C17.984 49.5831 17.334 48.9873 17.334 48.0665C17.334 47.9581 17.334 47.8498 17.334 47.6873L19.3923 35.9873Z"
fill="#3B3B3D"></path>
</g>
<defs>
<clipPath id="clip0_872_54192">
<rect width="66.86" height="62.47" fill="white"></rect>
</clipPath>
</defs>
</svg>
<span class="mileageStatusCurrent__title">잔여 GC 머니</span>
<span class="mileageStatusCurrent__number"><span class="comma" id="calBlce"><fmt:formatNumber value="${not empty resultMap.blce ? resultMap.blce : 0}" pattern="#,###"/></span></span>
<span class="mileageStatusCurrent__unit">점</span>
</div>
<div class="mileageStatusCurrent">
<input class="input-text full" type="search" title="검색어 입력" style="width : 300px; margin-right: 10px"
id="crtfcNb" name="crtfcNb" maxlength="50"
placeholder="등록하실 상품권 번호를 입력해 주세요.">
<button type="button" class="btn md dark" onclick="fn_select_crtnb();">
조회
</button>
</div>
</div>
<form id="listForm">
<input type="hidden" id="mlgInnb" name="mlgInnb" value=""/>
<input type="hidden" id="pageIndex" name="pageIndex" value="${paramVO.pageIndex}}"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="${paramVO.pageUnit}"/>
<input type="hidden" id="srchMlgAccmlDvCd" name="srchMlgAccmlDvCd" value=""/>
<div class="customer-search">
<div class="customer-search__row justify-start">
<div class="customer-search__controls">
<div class="dateRange-btnContainer">
<input type="hidden" name="dateRange" id="dateRange" value="allDays">
<button type="button" class="dateRange-btn" id="7D">일주일</button>
<button type="button" class="dateRange-btn" id="1M">1개월</button>
<button type="button" class="dateRange-btn" id="3M">3개월</button>
<button type="button" class="dateRange-btn selected" id="allDays">전체</button>
</div>
<div class="input-container">
<input type="text" name="srchStartDate" id="bgnDt" class="datepicker" title="시작 날짜 선택" autocomplete="off">
<span class="tilde">~</span>
<input type="text" name="srchEndDate" id="endDt" class="datepicker" title="종료 날짜 선택" autocomplete="off">
</div>
</div>
<button type="button" id="btnSearch" class="btn md dark">검색</button>
</div>
</div>
<div class="sub-tab">
<div class="sub-tab__trigger">
<button class="sub-tab__btn current" type="button" onclick="fn_select_mlg_list(1);">전체</button>
<c:if test = "${not empty resultMap.mlgAccmlDv}">
<c:forEach var = "mlgAccmlDv" items = "${resultMap.mlgAccmlDv}">
<c:if test="${mlgAccmlDv.cd eq 'add' || mlgAccmlDv.cd eq 'dn'}">
<button class="sub-tab__btn" type="button"
onclick="fn_select_mlg_list_dv('<c:out value="${mlgAccmlDv.cd}"/>');"><c:out value="${mlgAccmlDv.cdNm}"/>
</button>
</c:if>
</c:forEach>
</c:if>
</div>
<div id="pageDiv">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- pin 번호 인증 모달--%>
<a href="#alert-01" rel="modal:open" id="pinBtn"></a>
<div id="alert-01" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm" id="pinMsg"></p>
<br>
<input type="text" name="pinNb" id="pinNb" class="input-text full" placeholder="상품권 PIN 번호를 입력해 주세요." maxlength="50">
<input type = "hidden" name = "crtfcNb" id = "alertCrtnb"/>
</div>
<div class="alert-btn-container">
<button class="alert-btn alert-btn--confirm" id="pinAlertBtn">확인</button>
<a href="#" rel="modal:close" id="closeBtn"></a>
</div>
</div>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,322 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
let pageIndexDwld = '<c:out value="${ resultMapDwld.paramVO.pageIndex }"/>';
let pageUnitDwld = '<c:out value="${ resultMapDwld.paramVO.pageUnit }"/>';
fn_select_useposbl_coupon(pageIndex, pageUnit);
});
let alldwldCnt = '${ not empty resultMap.dwldPosblCouponCnt ? resultMap.dwldPosblCouponCnt : '0' }';
/************************************************
* 사용 가능 쿠폰 목록 조회
*************************************************/
const fn_select_useposbl_coupon = function(pageIndex, pageUnit) {
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#holdListForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#holdListForm').serialize();
} else {
dataStr = $('#holdListForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/bnef/selectCouponUsePosblDtlsInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#usePosblCouponDiv').empty();
$('#usePosblCouponDiv').html(resultHtml);
}
});
}
/************************************************
* 다운로드 가능 쿠폰 목록 조회
*************************************************/
const fn_select_dwld_coupon = function(pageIndexDwld, pageUnitDwld) {
let dataStr;
if(!pageIndexDwld) {
$('#pageIndexDwld').val(1);
} else {
$('#pageIndexDwld').val(pageIndexDwld);
}
if(!pageUnitDwld) {
dataStr = $('#dwldListForm').serialize();
} else {
if($('#pageUnitDwld').length){
$('#pageUnitDwld').val(pageUnitDwld);
dataStr = $('#dwldListForm').serialize();
} else {
dataStr = $('#dwldListForm').serialize()+'&pageUnitDwld='+pageUnitDwld;
}
}
$('#pageIndexDwld').val(pageIndexDwld);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/bnef/selectDwldCouponDtlsInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#dwldCouponDiv').empty();
$('#dwldCouponDiv').html(resultHtml);
}
});
}
/************************************************
* 쿠폰 상세 정보 조회 팝업 : 다운로드 가능 쿠폰
*************************************************/
const fn_open_modal_coupon_dtl = function(modalDivSltr, modalSlrt, url, param, sopmalCd, couponSndngInnb){
var couponInnb = param
$.ajax({
type: 'post',
url: url,
data: {
couponInnb : couponInnb,
sopmalCd : sopmalCd,
couopnSndngInnb : couponSndngInnb
},
success: function (data) {
$(modalSlrt).remove();
$(modalDivSltr).html(data);
$(modalSlrt).modal();
}
});
};
/************************************************
* 쿠폰 상세 정보 조회 팝업 : 사용가능 쿠폰
*************************************************/
const fn_open_modal_dwldcoupon_dtl = function(modalDivSltr, modalSlrt, url, param, sopmalCd){
var dwldCouponInnb = param
$.ajax({
type: 'post',
url: url,
data: {
dwldCouponInnb : dwldCouponInnb,
sopmalCd : sopmalCd
},
success: function (data) {
$(modalSlrt).remove();
$(modalDivSltr).html(data);
$(modalSlrt).modal();
}
});
};
/************************************************
* 인증번호 입력 쿠폰 등록
*************************************************/
const fn_regist_offline_coupon = function() {
if (fn_is_empty($('#oflneCouponCrtnb').val())) {
alert("등록하실 쿠폰 번호를 입력해 주세요.");
return false;
}
const data = $('#couponCodeRegistForm').serialize();
if (confirm('인증번호 쿠폰을 <spring:message code="confirm.common.insert"/>')) {
$.ajax({
type: "post",
url: '<c:url value="/sopmal/mpage/bnef/insertCouponRegist"/>',
data: data,
success: function (result) {
const parseResult = JSON.parse(result.resBody.result);
if (parseResult.status === '0') {
alert('<spring:message code="success.common.insert"/>');
// $('#useCouponListBtn').click();
location.reload();
$('#oflneCouponCrtnb').val('');
} else {
alert(parseResult.message);
}
}
});
}
}
/************************************************
* 쿠폰 다운로드 단건
*************************************************/
const fn_regist_dwld_coupon = function(couponInnb, sopmalCd, couponSndngInnb, cupnpkInnb, cupnpkNm, cupnpkDc) {
$.ajax({
type: "post",
url: '<c:url value="/sopmal/mpage/bnef/insertDwldCouponAllRegist"/>',
data: {
couponInnb: couponInnb,
sopmalCd: sopmalCd,
couponSndngInnb : couponSndngInnb,
cupnpkInnb : cupnpkInnb,
cupnpkNm : cupnpkNm,
cupnpkDc : cupnpkDc
},
success: function (resultHtml) {
alert('<spring:message code="success.common.save"/>');
// $('#useCouponListBtn').click();
location.reload();
}
});
}
/************************************************
* (모든) 쿠폰 다운로드 다건
*************************************************/
const fn_regist_dwld_coupon_all = function() {
const data = $('#dwldListForm').serialize();
if (alldwldCnt > 0) {
$.ajax({
type: "post",
url: '<c:url value="/sopmal/mpage/bnef/insertDwldCouponAllRegist"/>',
data: data,
success: function (resultHtml) {
alert('<spring:message code="success.common.save"/>');
// $('#useCouponListBtn').click();
location.reload();
}
});
} else {
alert('다운로드 받을 쿠폰이 없습니다.');
}
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">쿠폰 내역</h3>
<form id="couponCodeRegistForm">
<div class="customer-search">
<div class="customer-search__row justify-start">
<input class="input-text customer-search__search" type="search" title="검색어 입력" id="oflneCouponCrtnb" name="oflneCouponCrtnb"
placeholder="등록하실 쿠폰 번호를 입력해 주세요.">
<button type="button" class="btn md dark" onclick="fn_regist_offline_coupon();">쿠폰등록</button>
</div>
</div>
</form>
<div class="boxTab">
<button class="boxTab__tabBtn current" id="useCouponListBtn" onclick="fn_select_useposbl_coupon(); return false;">사용가능 쿠폰 (<c:out value="${ not empty resultMap.usePosblCouponCnt ? resultMap.usePosblCouponCnt : '0' }"/>)</button>
<button class="boxTab__tabBtn" onclick="fn_select_dwld_coupon(); return false;">쿠폰 다운로드 (<c:out value="${ not empty resultMap.dwldPosblCouponCnt ? resultMap.dwldPosblCouponCnt : '0' }"/>)</button>
</div>
<%-- 사용가능 쿠폰 내역 --%>
<div class="boxTab__content current" id="usePosblCouponDiv">
</div>
<%-- 다운로드 가능 쿠폰 내역--%>
<div class="boxTab__content" id="dwldCouponDiv">
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- 쿠폰정보 모달 -->
<div id="modalDiv">
</div>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,128 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<form id="dwldListForm">
<input type="hidden" id="pageIndexDwld" name="pageIndex" value="<c:out value="${ resultMapDwld.paramVO.pageIndex }"/>"/>
<input type="hidden" id="recordCountPerPageDwld" name="recordCountPerPage" value="<c:out value="${ resultMapDwld.paramVO.recordCountPerPage }"/> "/>
<input type="hidden" id="sopmalCdDwld" name="sopmalCd" value=""/>
<input type="hidden" id="mbrInnbDwld" name="mbrInnb" value=""/>
<input type="hidden" id="mbrDvCdDwld" name="mbrDvCd" value=""/>
<c:if test="${ fn:length(resultMapDwld.resultList) > 0 }">
<div class="couponList__btnContainer">
<button type="button" class="btn theme" onclick="fn_regist_dwld_coupon_all();">모든 쿠폰 다운로드</button>
</div>
</c:if>
<c:choose>
<c:when test="${ not empty resultMapDwld.resultList && fn:length(resultMapDwld.resultList) > 0 }">
<div class="couponList">
<c:forEach items="${ resultMapDwld.resultList }" var="couponList" varStatus="status">
<div class="couponList__item">
<div class="couponList__left">
<input type="hidden" name="couponArray" value="<c:out value="${ couponList.couponInnb }"/>" />
<p class="couponList__subTitle">
<c:out value="${ couponList.cupnpkNm }"/>
</p>
<p class="couponList__title">
<c:out value="${ couponList.couponSndngNm }"/><br>
<span class="couponList__date"><c:out value="${ couponList.coupNm }"/></span>
</p>
<p class="couponList__date">
<c:choose>
<c:when test="${ 'Y' eq couponList.dwldPdLmttAt }">
<c:out value="${couponList.dwldBgnDt}" /> ~
<c:out value="${couponList.dwldEndDt}" />
<c:if test="${ 0 lt couponList.validpdDay }"><span class="couponList__dayLeft">(<c:out value="${ couponList.validpdDay }"/>일 남음)</span></c:if>
</c:when>
<c:otherwise>
제한없음
</c:otherwise>
</c:choose>
</p>
<button type="button"
class="btn sm gray2 couponList__checkBtn"
onclick="fn_open_modal_coupon_dtl('#modalDiv', '#coupon-info-pop', '<c:out value="/sopmal/mpage/bnef/selectDwldYCouponDtlInfoInqirePopup"/>', '<c:out value="${ couponList.couponInnb }"/>', '<c:out value="${ couponList.sopmalCd }"/>', '<c:out value="${ couponList.couponSndngInnb }"/>'); return false;"
>
조회
</button>
</div>
<div class="couponList__right">
<div class="couponList__image">
<c:choose>
<c:when test="${ couponList.sopmalCd eq 'NC' }">
<img src="/pc/images/쿠폰이미지01.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'CH' }">
<img src="/pc/images/쿠폰이미지02.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'TZ' }">
<img src="/pc/images/쿠폰이미지03.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'DT' }">
<img src="/pc/images/쿠폰이미지04.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'PL' }">
<img src="/pc/images/쿠폰이미지05.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'LF' }">
<img src="/pc/images/쿠폰이미지06.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'AF' }">
<img src="/pc/images/쿠폰이미지07.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'DL' }">
<img src="/pc/images/쿠폰이미지08.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'JM' }">
<img src="/pc/images/쿠폰이미지09.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'NB' }">
<img src="/pc/images/쿠폰이미지10.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'BD' }">
<img src="/pc/images/쿠폰이미지11.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
</c:choose>
</div>
<button type="button" class="btn sm theme outline"
onclick="fn_regist_dwld_coupon(<c:out value="${ couponList.couponInnb }"/>,
'<c:out value="${ couponList.sopmalCd }"/>',
'<c:out value="${ couponList.couponSndngInnb }"/>',
'<c:out value="${ couponList.cupnpkInnb }"/>',
'<c:out value="${ couponList.cupnpkNm }"/>',
'<c:out value="${ couponList.cupnpkDc }"/>' );">
쿠폰 다운로드
</button>
</div>
</div>
</c:forEach>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMapDwld.paginationInfo}" type="image" jsFunction="fn_select_dwld_coupon" />
</div>
</c:when>
<c:otherwise>
<div class="couponList">
<div class="couponList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">다운로드 가능한 쿠폰이 없습니다.</p>
</div>
</div>
</c:otherwise>
</c:choose>
</form>

View File

@@ -0,0 +1,132 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
});
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<div class="myMemberRank">
<div class="myMemberRank__inner">
<h3 class="myMemberRank__title">회원등급</h3>
<p class="myMemberRank__text">고객님의 주문실적에 따라 다채로운 혜택을 받아보세요!</p>
</div>
<img src="/pc/images/회원등급이미지.png" alt="">
</div>
<div class="myMemberRankInfo">
<ul class="myMemberRankInfo__list">
<c:choose>
<c:when test="${ not empty resultMap.resultList && fn:length(resultMap.resultList) > 0 }">
<c:forEach var="gradList" items="${ resultMap.resultList }" varStatus="status">
<li class="myMemberRankInfo__item">
<div class="myMemberRankInfo__top">
<input type = "hidden" name = "" value = "<c:out value="${cdnurl}${gradList.mbrGradIconCours}"/>"/>
<c:if test = "${not empty gradList.mbrGradIconCours}">
<img src="<c:out value="${ cdnurl }${gradList.mbrGradIconCours}"/>" onerror="this.src='/pc/images/image_placeholder.png'" width="112" height="112" alt="${ gradList.mbrGradNm }">
</c:if>
<div class="myMemberRankInfo__topDescription">
<span class="myMemberRankInfo__topName"><c:out value="${ gradList.mbrGradNm }"/></span>
<p class="myMemberRankInfo__topText">
<c:choose>
<c:when test="${ gradList.mbrGradCndCd eq '01'}">
<c:out value="${ gradList.mbrGradCndCdNm }"/>
</c:when>
<c:when test="${ gradList.mbrGradCndCd eq '02'}">
<%-- 구매 횟수 1년에 <c:out value="${ gradList.mbrGradPurchsCnt }"/>회 이상,<br> --%>
구매금액 <c:out value="${ gradList.mbrGradAmtSop }"/> 이상인 경우
</c:when>
</c:choose>
</p>
</div>
</div>
<div class="myMemberRankInfo__body">
<c:if test="${ gradList.mbrGradCndCd eq '02' && not empty gradList.mlgAccmlAmt }">
<div class="myMemberRankInfo__box">
<img src="/pc/images/icon_member-mileage.png" alt="">
<span class="myMemberRankInfo__boxText">구매금액의 <em><c:out value="${ gradList.mlgAccmlAmt }"/><c:out value="${ gradList.mlgAccmlUnitDvCdNm }"/></em> 적립</span>
</div>
</c:if>
<c:if test="${ gradList.couponAt > 0 }">
<div class="myMemberRankInfo__box">
<img src="/pc/images/icon_member-coupon.png" alt="">
<span class="myMemberRankInfo__boxText"><em><c:out value="${ gradList.cupnpkNm }"/></em> 쿠폰팩 지급</span>
</div>
</c:if>
</div>
</li>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="100%" ><spring:message code="common.nodata"/></td>
</tr>
</c:otherwise>
</c:choose>
</ul>
</div>
<div class="infoBox">
<h6 class="infoBox__title">안내사항</h6>
<ol class="infoBox__list">
<li><c:out value="${resultMap.gradGroup.mbrGradInfo.calcPdMtCnt}"/>개월 동안 주문한 금액 기준이며, 혜택은 등업시 제공 합니다.</li>
</ol>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,83 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<script>
$(document).ready(function() {
});
</script>
<div class="sub-tab__content current">
<div class="mileageList">
<c:choose>
<c:when test="${ not empty resultMap.resultList && fn:length(resultMap.resultList) > 0 }">
<c:forEach var="list" items="${ resultMap.resultList }" varStatus="status">
<div class="mileageList__item
<c:if test="${ list.mlgAccmlDvCd eq 'add' || list.mlgAccmlDvCd eq 'up' }">
mileageList__item--saveUp
</c:if>"
>
<div class="mileageList__itemHeader">
<div class="mileageList__itemHeaderMisc">
<span class="mileageList__itemDate"><c:out value="${ list.mpageRegistDt }"/></span>
<span class="mileageList__itemDot">·</span>
<span class="mileageList__itemBrand"><c:out value="${ list.sopmalNm }"/></span>
<c:if test = "${list.mlgAccmlDvCd eq 'add' || list.mlgAccmlDvCd eq 'up'}"><%--적립 혹은 지급 일 때만 유효기간 노출--%>
<span class="mileageList__itemDot">·</span>
<span class="mileageList__itemDate"><c:out value="${ list.bgnDt }"/></span>
<span class="mileageList__itemDot">~</span>
<span class="mileageList__itemDate"><c:out value="${ list.endDt }"/></span>
</c:if>
</div>
<span class="mileageList__itemTitle"><c:out value="${ list.mlgAccmlDvNm }"/></span>
</div>
<div class="mileageList__itemBody">
<span class="mileageList__itemDescription"><c:out value="${ list.mlgApplcDvNm }"/></span>
<span class="mileageList__itemNumber"><span
class="comma"><fmt:formatNumber value="${list.accmlmnyAmt}" pattern="#,###"/></span></span>
</div>
<div class="mileageList__orderNum">
<c:if test="${ not empty list.ordrInnb && list.ordrInnb ne 0 }">
주문번호 <em><c:out value="${ list.ordrInnb }"/></em>
</c:if>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="orderList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">마일리지내역이 없습니다.</p>
</div>
</c:otherwise>
</c:choose>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_mlg_list" />
</div>
</div>
<div class="sub-tab__content">2</div>
<div class="sub-tab__content">3</div>
<div class="sub-tab__content">4</div>

View File

@@ -0,0 +1,341 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
fn_select_mlg_list(pageIndex, pageUnit);
fn_start_display();
});
/******************************************************************
* 시작 화면 제어
******************************************************************/
const fn_start_display = function() {
/* 검색조건 > 날짜 구간 버튼 클릭 이벤트 */
$('.dateRange-btn').on('click', function() {
const date = $(this).attr('id');
$(this).closest('div').find('#dateRange').val(date);
if ('allDays' === date) {
$('#bgnDt, #endDt').val('');
return false;
}
fn_set_date('bgnDt', 'endDt', 'endDt', date);
});
/* 검색 버튼 클릭 이벤트 */
$('#btnSearch').on('click', function() {
fn_select_mlg_list(1);
});
}
/* 검색조건 세팅 */
const fn_set_param = function() {
const params = ${paramVO};
const keys = Object.keys(params);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let data = params[key];
if ('bgnDt' == key || 'endDt' == key) {
if (!fn_is_empty(data)) {
for (let i = 0; i < data.length; i++) {
$('#' + key).val(data);
}
}
}
if ('dateRange' == key) {
$('#'+ data).trigger('click');
}
if ('srchwrd' == key) {
$('#' + key).val(data);
}
}
}
/******************************************************************
* 마일리지 목록 조회
******************************************************************/
const fn_select_mlg_list = function(pageIndex, pageUnit) {
const currentTabTxt = $(".sub-tab__btn.current").text();
if(currentTabTxt === '적립') {
$("#srchMlgAccmlDvCd").val("add");
} else if (currentTabTxt === 'use') {
$("#srchMlgAccmlDvCd").val("use");
} else if (currentTabTxt === 'exp') {
$("#srchMlgAccmlDvCd").val("exp");
}
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/bnef/selectMlgDtlsInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
/******************************************************************
* 마일리지 목록 조회 지급구분
******************************************************************/
const fn_select_mlg_list_dv = function(srchMlgAccmlDvCd) {
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/bnef/selectMlgDtlsInqire"/>',
data : {
srchMlgAccmlDvCd : srchMlgAccmlDvCd
},
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">마일리지 내역</h3>
<div class="mileageStatus">
<div class="mileageStatusCurrent">
<svg xmlns="http://www.w3.org/2000/svg" width="67" height="63" viewBox="0 0 67 63"
fill="none">
<g clip-path="url(#clip0_872_54192)">
<g style="mix-blend-mode:darken">
<path
d="M43.7905 51.5702C56.5262 51.5702 66.8505 41.2459 66.8505 28.5102C66.8505 15.7745 56.5262 5.4502 43.7905 5.4502C31.0548 5.4502 20.7305 15.7745 20.7305 28.5102C20.7305 41.2459 31.0548 51.5702 43.7905 51.5702Z"
fill="#DADBE1"></path>
</g>
<path d="M4.93945 15.2997V13.7197" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M2.58 17.6494H1" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M4.93945 20.0098V21.5898" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M7.28906 17.6494H8.86906" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M26.1895 2.42V1" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M24.0704 4.54004H22.6504" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M26.1895 6.66016V8.08016" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M28.3105 4.54004H29.7305" stroke="#3B3B3D" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M55.8999 13.9805H18.9199V21.8905H55.8999V13.9805Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M60.1909 21.8896H23.2109V29.8096H60.1909V21.8896Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M54.3804 29.8096H17.4004V37.7196H54.3804V29.8096Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M57.6909 37.7197H20.7109V45.6397H57.6909V37.7197Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M61.8804 45.6396H24.9004V53.5496H61.8804V45.6396Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path d="M57.6909 53.5498H20.7109V61.4698H57.6909V53.5498Z" fill="white"
stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<g style="mix-blend-mode:darken">
<path
d="M50.6004 42.0604C50.6004 43.2804 50.5104 44.4704 50.3404 45.6404C49.9204 48.4604 49.0204 51.1304 47.7204 53.5504C46.0604 56.6504 43.7504 59.3604 40.9604 61.4704H20.7104V53.5504H24.9004V45.6404H20.7104V37.7204H17.4004V29.8104H23.2104V21.8904H18.9204V18.7604C21.2204 18.0404 23.6604 17.6504 26.1904 17.6504C31.2704 17.6504 36.0004 19.2104 39.9104 21.8904C42.9204 23.9304 45.4504 26.6504 47.2904 29.8104C48.7004 32.2104 49.7004 34.8804 50.2004 37.7204C50.4704 39.1304 50.6004 40.5804 50.6004 42.0604Z"
fill="#DADBE1"></path>
</g>
<path
d="M2.54078 48.8405H38.8708C39.6608 46.7305 40.1108 44.4505 40.1108 42.0605H1.30078C1.30078 44.4505 1.75078 46.7305 2.54078 48.8405Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M20.7098 61.4709C26.1498 61.4709 31.0498 59.2309 34.5798 55.6309H6.83984C10.3598 59.2309 15.2698 61.4709 20.7098 61.4709Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M6.84102 55.6306H34.581C36.461 53.7106 37.921 51.4106 38.881 48.8506H2.54102C3.50102 51.4106 4.96102 53.7206 6.84102 55.6306Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M6.84102 28.4902C4.96102 30.4102 3.50102 32.7102 2.54102 35.2702H38.871C37.911 32.7102 36.451 30.4002 34.571 28.4902H6.84102Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M1.30078 42.0603H40.1208C40.1208 39.6703 39.6708 37.3903 38.8808 35.2803H2.54078C1.75078 37.3903 1.30078 39.6703 1.30078 42.0603Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M20.7098 22.6504C15.2698 22.6504 10.3698 24.8904 6.83984 28.4904H34.5798C31.0598 24.8904 26.1498 22.6504 20.7098 22.6504Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path
d="M26.1893 61.4704C36.9091 61.4704 45.5993 52.7802 45.5993 42.0604C45.5993 31.3405 36.9091 22.6504 26.1893 22.6504C15.4694 22.6504 6.7793 31.3405 6.7793 42.0604C6.7793 52.7802 15.4694 61.4704 26.1893 61.4704Z"
fill="white" stroke="#3B3B3D" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"></path>
<path class="svg-themeColor"
d="M19.3923 35.9873C19.5007 35.229 20.3132 34.3623 21.4507 34.3623C22.4798 34.3623 23.2923 35.1206 23.5632 35.879L26.0548 44.1665H26.109L28.6007 35.879C28.8173 35.1206 29.6298 34.3623 30.7132 34.3623C31.8507 34.3623 32.6632 35.229 32.7715 35.9873L34.6673 47.6873V48.0665C34.6673 48.9873 34.0173 49.5831 33.1507 49.5831C32.0673 49.5831 31.634 49.0956 31.5257 48.1206L30.334 39.5623H30.2798L27.7882 48.3373C27.6257 48.8248 27.2465 49.529 26.109 49.529C24.9715 49.529 24.5923 48.8248 24.4298 48.3373L21.8298 39.5081H21.7757L20.5298 48.0665C20.3673 49.0415 19.9882 49.529 18.9048 49.529C17.984 49.5831 17.334 48.9873 17.334 48.0665C17.334 47.9581 17.334 47.8498 17.334 47.6873L19.3923 35.9873Z"
fill="#3B3B3D"></path>
</g>
<defs>
<clipPath id="clip0_872_54192">
<rect width="66.86" height="62.47" fill="white"></rect>
</clipPath>
</defs>
</svg>
<span class="mileageStatusCurrent__title">사용가능 마일리지</span>
<span class="mileageStatusCurrent__number"><span class="comma"><c:out value="${ resultMap.blceSum }"/></span></span>
<span class="mileageStatusCurrent__unit">점</span>
</div>
<div class="mileageStatusMisc">
<div class="mileageStatusMisc__item mileageStatusMisc__item--scheduled">
<span class="mileageStatusMisc__title">적립예정 마일리지</span>
<span class="mileageStatusMisc__number"><span class="comma"><c:out value="${ resultMap.accmlPrearngeSum }"/></span></span>
<span class="mileageStatusMisc__unit">점</span>
</div>
<div class="mileageStatusMisc__item">
<span class="mileageStatusMisc__title">소멸예정 마일리지</span>
<span class="mileageStatusMisc__number"><span class="comma"><c:out value="${ resultMap.endInMnthBlceSum }"/></span></span>
<span class="mileageStatusMisc__unit">점</span>
</div>
</div>
</div>
<form id="listForm">
<input type="hidden" id="mlgInnb" name="mlgInnb" value=""/>
<input type="hidden" id="pageIndex" name="pageIndex" value="${ resultMap.paramVO.pageIndex} }"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="${ resultMap.paramVO.pageUnit} }"/>
<input type="hidden" id="srchMlgAccmlDvCd" name="srchMlgAccmlDvCd" value=""/>
<div class="customer-search">
<div class="customer-search__row justify-start">
<div class="customer-search__controls">
<div class="dateRange-btnContainer">
<input type="hidden" name="dateRange" id="dateRange" value="allDays">
<button type="button" class="dateRange-btn" id="7D">일주일</button>
<button type="button" class="dateRange-btn" id="1M">1개월</button>
<button type="button" class="dateRange-btn" id="3M">3개월</button>
<button type="button" class="dateRange-btn selected" id="allDays">전체</button>
</div>
<div class="input-container">
<input type="text" name="bgnDt" id="bgnDt" class="datepicker" title="시작 날짜 선택" autocomplete="off">
<span class="tilde">~</span>
<input type="text" name="endDt" id="endDt" class="datepicker" title="종료 날짜 선택" autocomplete="off">
</div>
</div>
<button type="button" id="btnSearch" class="btn md dark">검색</button>
</div>
</div>
<div class="sub-tab">
<div class="sub-tab__trigger">
<button class="sub-tab__btn current" type="button" onclick="fn_select_mlg_list(1);">전체</button>
<button class="sub-tab__btn" type="button" onclick="fn_select_mlg_list_dv('add');">적립</button>
<button class="sub-tab__btn" type="button" onclick="fn_select_mlg_list_dv('use');">사용</button>
<button class="sub-tab__btn" type="button" onclick="fn_select_mlg_list_dv('exp');">소멸</button>
</div>
<div id="pageDiv">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,179 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!-- 쿠폰정보 -->
<div id="coupon-info-pop" class="modal default" style="max-width: 560px;">
<div class="modal-header">
<div class="modal-header__title">쿠폰정보</div>
</div>
<div class="modal-content">
<div class="table-wrapper">
<table class="table tight">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 25%;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
쿠폰명
</th>
<td><c:out value="${ resultMap.dwldCouponVO.coupNm }"/></td>
</tr>
<tr>
<th>
혜택
</th>
<td>
<c:choose>
<c:when test="${ resultMap.dwldCouponVO.bnefDv eq '01' || resultMap.dwldCouponVO.bnefDv eq '03' }">
<span class="fw-500">
<c:out value="${ resultMap.dwldCouponVO.aditDscntAmt }"/> <c:out value="${ resultMap.dwldCouponVO.goodsDscntDvNm }"/> 할인
</span><br/>
<c:if test="${ '01' eq resultMap.dwldCouponVO.goodsDscntDv }">
<span class="gray-8">최대 <c:out value="${ resultMap.dwldCouponVO.dscntMxmmAmt }"/>원 할인</span>
</c:if>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.bnefDv eq '02' }">
<span class="fw-500">
<c:if test="${ '01' eq resultMap.dwldCouponVO.dlvyAmtDscntDv }">기본배송비 무료,
</span>
<br>
<span class="gray-8">
최대 <c:out value="${ resultMap.dwldCouponVO.dlvyAmtMxmmDscntAmt }"/>원 할인</c:if>
</span>
<span class="fw-500">
<c:if test="${ '02' eq resultMap.dwldCouponVO.dlvyAmtDscntDv }">배송비 <c:out value="${ resultMap.dwldCouponVO.dlvyAmtDscntAmt }"/>원 할인</c:if>
</span>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<th>
유효기간
</th>
<td>
<c:choose>
<c:when test="${ resultMap.dwldCouponVO.validpdKndCd eq '01' }">
<c:out value="${ resultMap.dwldCouponVO.validpdBgnDt }"/> ~ <c:out value="${ resultMap.dwldCouponVO.validpdEndDt }"/><c:if test="${ 0 lt resultMap.dwldCouponVO.validpdDay }">(<c:out value="${ resultMap.dwldCouponVO.validpdDay }"/>일 남음)</c:if>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.validpdKndCd eq '02' }">
<c:out value="${ resultMap.dwldCouponVO.validpdKndCdNm }"/> <c:out value="${ resultMap.dwldCouponVO.validpdDeCnt }"/> 일
</c:when>
<c:otherwise>
<c:out value="${ resultMap.dwldCouponVO.validpdBgnDt }"/> ~ <c:out value="${ resultMap.dwldCouponVO.validpdEndDt }"/><c:if test="${ 0 lt resultMap.dwldCouponVO.validpdDay }">(<c:out value="${ resultMap.dwldCouponVO.validpdDay }"/>일 남음)</c:if>
</c:otherwise>
</c:choose>
</td>
</tr>
</tbody>
</table>
</div>
<div class="infoBox">
<ul class="infoBox__list">
<%-- 사용환경 --%>
<c:if test="${ not empty resultMap.dwldCouponVO.useEnvrnCd }">
<c:choose>
<c:when test="${resultMap.dwldCouponVO.useEnvrnCd eq '01' }">
<li class="fyi gray-7">온라인 쿠폰</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.useEnvrnCd eq '02' }">
<li class="fyi gray-7">오프라인 쿠폰</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.useEnvrnCd eq '03' }">
<li class="fyi gray-7">온/오프라인 쿠폰</li>
</c:when>
</c:choose>
</c:if>
<%-- 타 쿠폰 동시사용여부 --%>
<c:if test="${ not empty resultMap.dwldCouponVO.otrCouponSmtmUseAt }">
<c:choose>
<c:when test="${resultMap.dwldCouponVO.otrCouponSmtmUseAt eq 'Y' }">
<li class="fyi gray-7">다른 쿠폰과 동시 사용 불가</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.otrCouponSmtmUseAt eq 'N' }">
<li class="fyi gray-7">다른 쿠폰과 동시 사용 가능</li>
</c:when>
</c:choose>
</c:if>
<%-- 사용가능금액(제품) --%>
<c:if test="${ not empty resultMap.dwldCouponVO.usePosblAmt && 0 ne fn:replace(resultMap.dwldCouponVO.usePosblAmt, ',', '') }">
<li class="fyi gray-7"><c:out value="${ resultMap.dwldCouponVO.usePosblAmt }"/>원 이상 구매 시</li>
</c:if>
<%-- 사용가능금액(대상제품 포함 구매제품 총합) --%>
<c:if test="${ not empty resultMap.dwldCouponVO.usePosblAllAmt && 0 ne fn:replace(resultMap.dwldCouponVO.usePosblAllAmt, ',', '') && resultMap.dwldCouponVO.usePosblAllAmtUseAt eq 'Y' }">
<li class="fyi gray-7"><c:out value="${ resultMap.dwldCouponVO.usePosblAllAmt }"/>원 이상 구매 시</li>
</c:if>
<%-- 중복다운로드 여부 --%>
<c:if test="${ not empty resultMap.dwldCouponVO.dplctDwldAt}">
<c:choose>
<c:when test="${resultMap.dwldCouponVO.dplctDwldAt eq 'N' }">
<li class="fyi gray-7">중복 다운로드 불가</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.dplctDwldAt eq 'Y' }">
<li class="fyi gray-7">중복 다운로드 가능</li>
</c:when>
</c:choose>
</c:if>
<%-- 중복할인여부 --%>
<c:if test="${ not empty resultMap.dwldCouponVO.dplctDscntAt}">
<c:choose>
<c:when test="${resultMap.dwldCouponVO.dplctDscntAt eq 'N' }">
<li class="fyi gray-7">중복 할인 불가</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.dplctDscntAt eq 'Y' }">
<li class="fyi gray-7">중복 할인 가능</li>
</c:when>
</c:choose>
</c:if>
<%-- 적용상품선정기준 --%>
<c:if test="${ not empty resultMap.dwldCouponVO.goodsApplcDvCd }">
<c:choose>
<c:when test="${resultMap.dwldCouponVO.goodsApplcDvCd eq '01' }">
<li class="fyi gray-7">모든 상품에 사용가능</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.goodsApplcDvCd eq '02' }">
<li class="fyi gray-7">특정 카테고리에 사용가능</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.goodsApplcDvCd eq '03' }">
<li class="fyi gray-7">특정 상품에 사용가능</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.goodsApplcDvCd eq '04' }">
<li class="fyi gray-7">특정 카테고리 외 사용가능</li>
</c:when>
<c:when test="${ resultMap.dwldCouponVO.goodsApplcDvCd eq '05' }">
<li class="fyi gray-7">특정 상품 외 사용가능</li>
</c:when>
</c:choose>
</c:if>
</ul>
</div>
</div>
<div class="modal-footer">
<a href="#" rel="modal:close" class="btn large outline">닫기</a>
<!-- <a href="#" rel="" class="btn large gray2">결제취소</a> -->
</div>
</div>

View File

@@ -0,0 +1,128 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : CouponDtlsR.jsp
Description : 마이페이지 쿠폰 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<form id="holdListForm">
<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value="${ resultMap.paramVO.pageIndex }"/>"/>
<input type="hidden" id="recordCountPerPage" name="recordCountPerPage" value="<c:out value="${ resultMap.paramVO.recordCountPerPage }"/> "/>
<input type="hidden" id="sopmalCd" name="sopmalCd"/>
<input type="hidden" id="mbrInnb" name="mbrInnb" />
<c:choose>
<c:when test="${ not empty resultMap.resultList && fn:length(resultMap.resultList) > 0 }">
<div class="couponList">
<c:forEach items="${ resultMap.resultList }" var="couponList" varStatus="status">
<div class="couponList__item">
<div class="couponList__left">
<p class="couponList__subTitle"><c:out value="${ couponList.cupnpkNm }"/></p>
<p class="couponList__title">
<c:out value="${ couponList.couponSndngNm }"/><br>
<span class="couponList__date"><c:out value="${ couponList.coupNm }"/></span>
</p>
<p class="couponList__date">
<c:out value="${ couponList.validpdBgnDt }"/> <br/> ~ <c:out value="${ couponList.validpdEndDt }"/>
<span class="couponList__dayLeft">
<c:set var="today" value="<%=new java.util.Date()%>" />
<c:set var="date"><fmt:formatDate value="${today}" pattern="yyyy-MM-dd" /></c:set>
<c:choose>
<c:when test="${ couponList.validpdEndDt gt date }">
(<c:out value="${ couponList.validpdDay }"/>일 남음)
</c:when>
<c:when test="${ couponList.validpdEndDt lt date}">
(<c:out value="${ couponList.validpdDay }"/>일 지남)
</c:when>
<c:when test="${ couponList.validpdEndDt eq date}">
(오늘까지)
</c:when>
</c:choose>
</span>
</p>
<button type="button"
class="btn sm gray2 couponList__checkBtn"
onclick="fn_open_modal_dwldcoupon_dtl('#modalDiv', '#coupon-info-pop', '<c:out value="/sopmal/mpage/bnef/selectCouponDtlInfoInqirePopup"/>', '<c:out value="${ couponList.dwldCouponInnb }"/>', '<c:out value="${ couponList.sopmalCd }"/>'); return false;"
>
조회
</button>
</div>
<div class="couponList__right">
<div class="couponList__image">
<c:choose>
<c:when test="${ couponList.sopmalCd eq 'NC' }">
<img src="/pc/images/쿠폰이미지01.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'CH' }">
<img src="/pc/images/쿠폰이미지02.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'TZ' }">
<img src="/pc/images/쿠폰이미지03.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'DT' }">
<img src="/pc/images/쿠폰이미지04.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'PL' }">
<img src="/pc/images/쿠폰이미지05.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'LF' }">
<img src="/pc/images/쿠폰이미지06.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'AF' }">
<img src="/pc/images/쿠폰이미지07.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'DL' }">
<img src="/pc/images/쿠폰이미지08.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'JM' }">
<img src="/pc/images/쿠폰이미지09.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'NB' }">
<img src="/pc/images/쿠폰이미지10.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
<c:when test="${ couponList.sopmalCd eq 'BD' }">
<img src="/pc/images/쿠폰이미지11.png" onerror="this.src='/pc/images/image_placeholder.png'" alt="">
</c:when>
</c:choose>
</div>
<c:set var="today" value="<%=new java.util.Date()%>" />
<c:set var="date"><fmt:formatDate value="${today}" pattern="yyyy-MM-dd HH:mm" /></c:set>
<c:choose>
<c:when test="${ couponList.couponSttusCd eq '03' }">
<span class="couponList__date" style="color: blue"><strong>사용함</strong></span>
</c:when>
<c:when test="${ couponList.couponSttusCd eq '02' && couponList.validpdEndDt ge date }">
<span class="couponList__date" style="color: red"><strong>미사용</strong></span>
</c:when>
<c:when test="${ couponList.couponSttusCd eq '02' && couponList.validpdEndDt lt date }">
<span class="couponList__date" style="color: gray"><strong>소멸함</strong></span>
</c:when>
</c:choose>
</div>
</div>
</c:forEach>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_useposbl_coupon" />
</div>
</c:when>
<c:otherwise>
<div class="couponList">
<div class="couponList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">사용 가능한 쿠폰이 없습니다.</p>
</div>
</div>
</c:otherwise>
</c:choose>
</form>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,115 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<!DOCTYPE html>
<%--
Class Name : DlvylcManagePopupR.jsp
Description : 배송지 관리 팝업.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-15 김혜인 최초 생성
--%>
<html>
<div id="dlvylcManage" class="modal" style="max-width: 520px;">
<div class="modal-header">
<div class="modal-header__title">배송지 관리</div>
</div>
<div class="modal-content">
<div class="modal-content__btn-controller">
<button type = "button" class="shipping-register-btn"
onclick="fn_move_dlvylc_regpage_pop('Y',<c:if test = "${empty resultMap.resultList}">'Y'</c:if>); return false;">
신규 배송지 등록
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="15" height="15" viewBox="0 0 24 24">
<path
d="M 11 3 L 11 11 L 3 11 L 3 13 L 11 13 L 11 21 L 13 21 L 13 13 L 21 13 L 21 11 L 13 11 L 13 3 L 11 3 z">
</path>
</svg>
</button>
</div>
<form id="mbrDlvylcList" name="mbrDlvylcList">
<c:choose>
<c:when test="${not empty resultMap.resultList}">
<c:forEach var="resultMap" items="${resultMap.resultList}" varStatus="status">
<div class="shipping-list">
<div class="shipping-list__item">
<div class="shipping-list__item-top">
<div class="custom-radio-container">
<div class="custom-radio" onclick = "fn_select_mngrOrdr_postcode(${callbackNm},${status.index}, '${formId}')">
<label for="${status.index}">
<span><c:out value="${resultMap.dlvylcDcCn }" /></span>
</label>
</div>
<c:if test="${resultMap.dftDlvylcAt eq 'Y'}">
<span class="default-address">기본배송지</span>
</c:if>
</div>
<button type = "button" class="shipping-modify-btn" id="upt<c:out value="${resultMap.adbkInnb}" />"
onclick="fn_move_dlvylc_uptpage_pop('<c:out value='${pageIndex}'/>',
'<c:out value='${resultMap.adbkInnb}'/>',
'Y');">
<spring:message code="button.update" />
</button>
<c:if test="${resultMap.dftDlvylcAt eq 'N'}">
<button type = "button" class="shipping-remove-btn" id="del<c:out value="${resultMap.adbkInnb}" />"
onclick="fn_delete_dlvylc('<spring:message code="success.common.delete"/>'
,'<c:out value="${resultMap.adbkInnb}" />'
,'Y',false); return false;">
<spring:message code="button.delete" />
</button>
</c:if>
</div>
<label for="${status.index}" onclick = "fn_select_mngrOrdr_postcode(${callbackNm},${status.index}, '${formId}')">
<div class="shipping-list__item-inner">
<p class="name"><c:out value="${resultMap.recpntNm }" /></p>
<p>(<c:out value="${resultMap.zip }" />)
<c:choose>
<c:when test="${resultMap.adresDv eq '01'}">
<c:out value="${resultMap.rnmAdres }" />
</c:when>
<c:when test="${resultMap.adresDv eq '02'}">
<c:out value="${resultMap.lnbAdres}"/>
</c:when>
</c:choose>
<c:out value="${resultMap.dtlAdres }" />
</p>
<p class="number mbtlnbPop"><c:out value="${resultMap.mbtlnb}" /></p>
</div>
</label>
</div>
</div>
<input type="hidden" name="zip" class = "zip" value="<c:out value='${resultMap.zip}'/>" />
<input type="hidden" name="adresDv" class = "adresDv" value="<c:out value='${resultMap.adresDv}'/>" />
<input type="hidden" name="rnmAdres" class = "rnmAdres" value="<c:out value='${resultMap.rnmAdres}'/>" />
<input type="hidden" name="lnbAdres" class = "lnbAdres"value="<c:out value='${resultMap.lnbAdres}'/>" />
<input type="hidden" name="recpntNm" class = "recpntNmR" value="<c:out value='${resultMap.recpntNm}'/>" />
<input type="hidden" name="dtlAdres" class = "dtlAdres" value="<c:out value='${resultMap.dtlAdres}'/>" />
<input type="hidden" name="mbtlnb" class = "mbtlnb" value="<c:out value='${resultMap.mbtlnb}' />" />
</c:forEach>
</c:when>
<c:otherwise>
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="배송지 없음">
<p class="table__no-result-text">
조회된 배송지가 없습니다.
</p>
</div>
</c:otherwise>
</c:choose>
<br>
<c:if test = "${not empty resultMap.resultList}">
<input type="hidden" id="pageIndex" name="pageIndex" value="${pageIndex}" />
<input type="hidden" id="isPop" name="isPop" value="Y" />
<div class="pagination__container mt-30">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_move_dlvylc_manage_pop" />
</div>
</c:if>
</form>
</div>
</div>
</html>

View File

@@ -0,0 +1,108 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<%--
Class Name : DlvylcManageR.jsp
Description : 배송지 관리.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-15 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<div class="addressManage__header">
<h5 class="addressManage__title">배송지 목록</h5>
<div class="addressManage__btnContainer">
<button type = "button" class="btn outline" id="insertDlvylcBtn" onclick="fn_move_dlvylc_regpage_pop('N',<c:if test="${empty resultMap.resultList}">'Y'</c:if>); return false;">배송지 추가
</button>
</div>
</div>
<form id="dlvylcList">
<div class="addressManage__list">
<c:choose>
<c:when test = "${not empty resultMap.resultList}">
<c:forEach var="dlvylc" items="${resultMap.resultList}">
<div class="addressManage__item">
<div class="addressManage__itemRadio">
<div class="custom-radio no-text is-medium">
<input type="radio" value="<c:out value = "${dlvylc.adbkInnb}"/>" id="<c:out value = "${dlvylc.adbkInnb}"/>" name="abdkInnb" <c:if test = "${dlvylc.dftDlvylcAt eq 'Y'}">checked</c:if>
onclick="fn_save_dftDlvylcAt('<spring:message code="success.common.update"/>','<c:out value="${dlvylc.adbkInnb}" />')">
<label for="<c:out value = "${dlvylc.adbkInnb}"/>"></label>
</div>
</div>
<div class="addressManage__itemBody">
<div class="addressManage__itemName">
<div class="addressManage__itemPerson <c:if test = "${dlvylc.dftDlvylcAt eq 'Y'}">current</c:if>"><c:out value = "${dlvylc.dlvylcDcCn}"/>
<c:if test = "${dlvylc.dftDlvylcAt eq 'Y'}">
<div class="addressManage__itemCheck">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"
viewBox="0 0 14 14" fill="none">
<g clip-path="url(#clip0_121_29551)">
<path d="M5.36085 12.2297C5.22721 12.3641 5.04489 12.4391 4.85549 12.4391C4.66609 12.4391 4.48376 12.3641 4.35012 12.2297L0.314136 8.19308C-0.104712 7.77424 -0.104712 7.09505 0.314136 6.67699L0.819501 6.17149C1.23848 5.75264 1.91688 5.75264 2.33573 6.17149L4.85549 8.69138L11.6642 1.88249C12.0832 1.46365 12.7623 1.46365 13.1805 1.88249L13.6858 2.38799C14.1047 2.80684 14.1047 3.48589 13.6858 3.90409L5.36085 12.2297Z" fill="black" />
</g>
<defs>
<clipPath id="clip0_121_29551">
<rect width="14" height="14" fill="white" />
</clipPath>
</defs>
</svg>
</div>
</c:if>
</div>
<c:if test = "${dlvylc.dftDlvylcAt eq 'Y'}"><span class="addressManage__itemBadge">기본배송지</span></c:if>
</div>
<span class="addressManage__itemPhone"><c:out value = "${dlvylc.recpntNm}"/></span>
<span class="addressManage__itemPhone mbtlnb"><c:out value = "${dlvylc.mbtlnb}"/></span>
<p class="addressManage__itemAddress">(<c:out value = "${dlvylc.zip}"/>)
<c:if test = "${dlvylc.adresDv eq '01'}">
<c:out value = "${dlvylc.rnmAdres}"/>
</c:if>
<c:if test = "${dlvylc.adresDv eq '02'}">
<c:out value = "${dlvylc.lnbAdres}"/>
</c:if>
<c:out value = "${dlvylc.dtlAdres}"/></p>
</div>
<div class="addressManage__itemControls">
<c:if test = "${dlvylc.dftDlvylcAt eq 'N'}">
<button type="button" class="btn outline sm" id="deleteDlvylcDel"
onclick="fn_delete_dlvylc('<spring:message code="success.common.delete"/>',
'<c:out value=" ${dlvylc.adbkInnb}"/>','N')">
<spring:message code="button.delete" />
</button>
</c:if>
<button type="button" class="btn outline theme sm" id="selectDlvylcUpdtPopupForm"
onclick="fn_move_dlvylc_uptpage_pop('<c:out value="${pageIndex}"/>',
'<c:out value="${dlvylc.adbkInnb}"/>',
'N')">
<spring:message code="button.update" />
</button>
</div>
</div>
</c:forEach>
</div>
<br>
<input type="hidden" id="pageIndex" name="pageIndex" value="${pageIndex}" />
<div class="pagination__container mt-30">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_dlvylcList" />
</div>
</c:when>
<c:otherwise>
<div class="addressManage__list">
<div class="addressManage__no-result">
<img src="/pc/images/icon__no-result.png" alt="배송지 없음">
<p class="addressManage__no-result-text">
등록된 배송지가 없습니다.
</p>
</div>
</div>
</c:otherwise>
</c:choose>
</form>
</html>

View File

@@ -0,0 +1,58 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : DlvylcManageRForm.jsp
Description : 배송지 관리.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-15 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
<%-- 배송지 관리js --%>
<script src="<c:url value='/js/dlvylc/dlvylc.js'/>"></script>
<script>
$(document).ready(function(){
fn_select_dlvylcList(1);
});
</script>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content" id = "top">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">배송지 관리</h3>
<div class="addressManage">
<div id = "content"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<div id="modalDiv">
</div>
</body>
</html>

View File

@@ -0,0 +1,79 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<!DOCTYPE html>
<%--
Class Name : DlvylcRegistPopupC.jsp
Description : 배송지 등록 팝업.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-15 김혜인 최초 생성
--%>
<html>
<!-- 배송지 등록-->
<div id="dlvylcRegist" class="modal default" style="max-width: 600px;">
<div class="modal-header">
<div class="modal-header__title">배송지 등록</div>
</div>
<form id = "dlvylcRegistForm">
<div class="modal-content">
<table class="table-address">
<caption>해당 테이블에 대한 내용</caption>
<colgroup>
<col style="width:116px;">
<col style="width:auto;">
</colgroup>
<tbody>
<tr>
<th>배송지명<span class="required-asterisk">*</span></th>
<td>
<input type="text" class="m-input" name="dlvylcDcCn" title="배송지명" maxlength="67">
</td>
</tr>
<tr>
<th>받으시는 분<span class="required-asterisk">*</span></th>
<td>
<input type="text" class="m-input" title="받으시는 분" name="recpntNm" title="받으시는 분" maxlength="13">
</td>
</tr>
<tr>
<th>배송지 주소<span class="required-asterisk">*</span></th>
<td>
<input type="text" class="m-input short" id="zip" name="zip" title="우편번호" maxlength="5" readonly>
<button class="find-address-btn" onclick="fn_select_postcode(fn_select_dlvylc_postcode); return false;">우편번호 찾기</button>
<input type="text" class="m-input long my" id="adres" name="adres" maxlength="66" readonly title="주소">
<input type="text" class="m-input long" id="dtlAdres" name="dtlAdres" title="상세주소" maxlength="66" placeholder="나머지 주소를 입력해 주세요">
</td>
</tr>
<tr>
<th>휴대전화번호<span class="required-asterisk">*</span></th>
<td>
<input name="mbtlnb" type="text" class="m-input telno" title="휴대전화번호" maxlength="13" placeholder="휴대폰번호'-'없이 입력하세요">
</td>
</tr>
</tbody>
</table>
<div class="shipping-register-bottom">
<label class="b-checkbox checkbox is-medium">
<input type="checkbox" id="dftDlvylcAt" name="dftDlvylcAt" value="Y">
<span class="check"></span>
<span class="control-label">기본 배송지</span>
</label>
</div>
<div class="shipping-btn-container">
<a href="#" rel="modal:close" class="btn large outline">취소</a>
<button type="button" id="DlvylcRegistBtn" class="btn theme large"
onclick="fn_insert_dlvylc('<spring:message code='success.common.insert'/>'); return false;">등록하기</button>
</div>
</div>
<input type="hidden" id="adresDv" name="adresDv">
<input type="hidden" id="isPop">
</form>
</div>
</html>

View File

@@ -0,0 +1,99 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
<!DOCTYPE html>
<%--
Class Name : DlvylcUpdtPopupU.jsp
Description : 배송지 수정.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-15 김혜인 최초 생성
--%>
<html>
<script>
$(document).ready(function (){
$(".telno").val(fn_format_mbtlnb($(".telno").val()));
});
</script>
<div id="dlvylcUpdate" class="modal default" style="max-width: 600px;">
<form id="dlvylcUpdtForm" name="dlvylcUpdtForm" action="<c:url value="/crm/dlvylc/updateDlvylcUpdt"/>" method="post">
<div class="modal-header">
<div class="modal-header__title">배송지 수정</div>
</div>
<div class="modal-content">
<table class="table-address">
<caption>해당 테이블에 대한 내용</caption>
<colgroup>
<col style="width:116px;">
<col style="width:auto;">
</colgroup>
<tbody>
<tr>
<th>배송지명<span class="required-asterisk">*</span></th>
<td>
<input type="text" class="m-input" name="dlvylcDcCn" title="배송지명" value="<c:out value = "${dtlDlvylc.resultVO.dlvylcDcCn}" />" maxlength="67">
</td>
</tr>
<tr>
<th>받으시는 분<span class="required-asterisk">*</span></th>
<td>
<input type="text" class="m-input" title="받으시는 분" name="recpntNm" title="받으시는 분" value="<c:out value="${dtlDlvylc.resultVO.recpntNm}" />" maxlength="13">
</td>
</tr>
<tr>
<th>배송지 주소<span class="required-asterisk">*</span></th>
<td>
<input type="text" class="m-input short" id="zip" name="zip" title="우편번호" value="<c:out value = "${dtlDlvylc.resultVO.zip}"/>" maxlength="5" readonly>
<button class="find-address-btn" onclick="fn_select_postcode(fn_select_dlvylc_postcode); return false;">우편번호 찾기</button>
<input type="text" class="m-input long my" id="adres" name="adres" title="주소" maxlength="66"
value=<c:choose>
<c:when test = "${dtlDlvylc.resultVO.adresDv eq '01'}">'<c:out value = "${dtlDlvylc.resultVO.rnmAdres}"/>'</c:when>
<c:when test = "${dtlDlvylc.resultVO.adresDv eq '02'}">'<c:out value = "${dtlDlvylc.resultVO.lnbAdres}"/>'</c:when>
</c:choose> readonly >
<input type="text" class="m-input long" id="dtlAdres" name="dtlAdres" title="상세주소" value="<c:out value = '${dtlDlvylc.resultVO.dtlAdres}'/>"
maxlength="66" placeholder="나머지 주소를 입력해 주세요">
</td>
</tr>
<tr>
<th>휴대전화번호<span class="required-asterisk">*</span></th>
<td>
<input name="mbtlnb" type="text" class="m-input telno" title="휴대전화번호" value="<c:out value = "${dtlDlvylc.resultVO.mbtlnb}"/>"
maxlength="13" placeholder="휴대폰번호'-'없이 입력하세요">
</td>
</tr>
</tbody>
</table>
<div class="shipping-register-bottom">
<label class="b-checkbox checkbox is-medium" id = "dftDlvylcAtLabel">
<c:choose>
<c:when test="${dtlDlvylc.resultVO.dftDlvylcAt eq 'Y'}">
<input type="checkbox" id="dftDlvylcAt" name="dftDlvylcAt" value="Y" checked>
</c:when>
<c:otherwise>
<input type="checkbox" id="dftDlvylcAt" name="dftDlvylcAt" value="Y">
</c:otherwise>
</c:choose>
<span class="check"></span>
<span class="control-label">기본 배송지</span>
</label>
</div>
<div class="shipping-btn-container">
<a href="#" rel="modal:close" class="btn large outline">취소</a>
<button id="DlvylcUpdateBtn" class="btn theme large outline"
onclick="fn_update_dlvylc('1','<spring:message code="success.common.update"/>','');return false;">
<spring:message code="button.update"/>하기
</button>
</div>
</div>
<input type="hidden" id="adbkInnb" name="adbkInnb" value="<c:out value = "${dtlDlvylc.resultVO.adbkInnb}" />">
<input type="hidden" id="adresDv" name="adresDv" value="<c:out value = "${dtlDlvylc.resultVO.adresDv}"/>">
<input type="hidden" id="isPop">
</form>
</div>
</html>

View File

@@ -0,0 +1,110 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : MbrInfoUpdtPasswordCnfirmR.jsp
Description : 회원 정보 수정 비밀번호 확인 .jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
$("#mbrPassword").on("keydown",function(e){
if (e.keyCode === 13) {
e.preventDefault();
}
});
});
/******************************************************
* 회원 비밀번호 확인
*******************************************************/
const fn_select_password = function() {
const data = $('#listForm').serialize();
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/mbr/selectMbrInfoUpdtPasswordCnfirm"/>',
data : data,
success:function(data) {
const resBody = data.resBody;
const parsedResult = JSON.parse(resBody.result);
let result = parsedResult.result;
if (result === 1) {
fn_move_target(); // 클릭한 메뉴로 이동
} else {
alert("비밀번호가 일치하지 않습니다.");
}
}
});
}
/******************************************************
* CRM 회원 검색 조회
*******************************************************/
const fn_move_target = function(goUrl) {
$('#listForm').attr('action', '<c:url value="/sopmal/mpage/mbr/selectMbrInfoUpdtForm"/>');
$('#listForm').attr('method', 'post');
$('#listForm').submit();
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">회원정보수정</h3>
<form id="listForm" name="listForm" action="">
<div class="passwordCheck">
<h5 class="passwordCheck__title">비밀번호 확인</h5>
<p class="passwordCheck__text">고객님의 소중한 개인 정보 보호를 위해
<br>
비밀번호를 다시 한번 입력해 주시기 바랍니다.
</p>
<input class="input-text" type="password" title="해당 인풋에 대한 설명" name="mbrPassword" id="mbrPassword" value=""
placeholder="비밀번호 입력">
<button class="btn xl theme passwordCheck__btn" type="button" onclick="fn_select_password(); return false;">확인</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,183 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : MbrSecsnU.jsp
Description : 회원 탈퇴.jsp
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
fn_display_ctrl();
});
/* ********************************************************
* 회원 탈퇴 함수
******************************************************** */
const fn_display_ctrl = function() {
$('.termCheck').on('change', function() {
const isChecked = $('.termCheck').is(':checked');
});
$("select[name='secsnResn']").niceSelect();
};
/* ********************************************************
* 회원 탈퇴 함수
******************************************************** */
const fn_regist_mbr_secsn = function () {
let secsnResn = $("select[name='secsnResn']").val();
const isChecked = $('.termCheck').is(':checked');
if (isChecked) {
if (confirm('회원 탈퇴하시겠습니까?')) {
$.ajax({
type: "post",
url: '<c:url value="/sopmal/mpage/mbr/updateMbrSecsn"/>',
data: {secsnResn: secsnResn},
success: function (data) {
alert('정상적으로 탈퇴 되었습니다.');
location.href ="/logout";
}
});
}
}else{
alert("정보 삭제 동의에 체크해야합니다.");
$('.termCheck').focus();
}
};
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<form id="registForm">
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">회원탈퇴</h3>
<h3 class="sub-right-content__title" style="text-align: center;">탈퇴하시면 혜택이 모두 사라져요</h3>
<div class="deleteAccount__image signUp-promotion__col-3 ck-content">
<c:out value='${resultMap.sopmalInfo.joinBnef}' escapeXml='false'/>
</div>
<p class="deleteAccount__title">탈퇴 신청</p>
<div class="deleteAccount">
<div class="deleteAccount__item">
<div class="deleteAccount__itemTitle">탈퇴 사유</div>
<div class="select-box">
<select class="lg" title="해당 셀렉트에 대한 설명" name="secsnResn">
<option value="" disabled selected>탈퇴 사유를 선택해 주세요.</option>
<option value="배송 주문 불만족">배송 주문 불만족</option>
<option value="사이트 이용 불편">사이트 이용 불편</option>
<option value="상품품질 불만족">상품품질 불만족</option>
<option value="서비스 불만족">서비스 불만족</option>
<option value="기타">기타</option>
</select>
</div>
</div>
<div class="deleteAccount__item">
<div class="deleteAccount__itemTitle">내용</div>
<textarea class="textarea" rows="9" title="해당 텍스트 에어리어에 대한 설명" placeholder="" id="memo" name="memo"></textarea>
</div>
<div class="infoBox">
<p class="textInfo"><i class="icon icon_textInfo--sm"></i>회원탈퇴 시 회원님의 개인정보, 주문내역,
마일리지, 쿠폰 등 모든 정보가 바로 삭제됩니다. 회원님의 모든 SNS계정 정보가 쇼핑몰에서 삭제 됩니다.
</p>
</div>
<div class="b-checkbox-container">
<label class="b-checkbox is-medium checkbox">
<input class="termCheck" type="checkbox" value="">
<span class="check"></span>
<span class="control-label">예, 정보 삭제에 동의합니다.</span>
</label>
</div>
</div>
<div class="sub-bottom-btn-container">
<button class="btn xl outline">취소</button>
<button type="button" class="btn xl theme" onclick="fn_regist_mbr_secsn();">탈퇴하기</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<script>
//변경 버튼 클릭시, 변경할 내용 노출
var editBtn = $('.editAccount__editBtn');
var editContent = $('.editAccount__editContent');
editContent.hide();
editBtn.on('click', function () {
var $this = $(this);
var $thisContent = $this.closest('td').find('.editAccount__editContent');
if ($thisContent.is(':visible')) {
$thisContent.hide();
} else {
editContent.hide();
$thisContent.show();
}
});
//휴대폰 인증 버튼 클릭시, 휴대폰 인증 박스 노출
var phoneAuthBtn = $('#phoneAuthBtn');
var phoneAuthContent = $('#phoneAuthContent');
phoneAuthContent.hide();
phoneAuthBtn.click(function () {
phoneAuthContent.show();
});
</script>
<!-- 모달 -->
</body>
</html>

View File

@@ -0,0 +1,131 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireR.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-27 추지훈 최초 생성
--%>
<!-- 모달 -->
<!-- 배송 조회 -->
<div id="delivery-check-pop" class="modal default" style="max-width: 640px;">
<div class="modal-header">
<div class="modal-header__title">배송 조회</div>
</div>
<c:choose>
<c:when test="${ not empty resultMap.resultList && fn:length(resultMap.resultList) > 0 }">
<c:forEach var="list" items="${ resultMap.resultList }" varStatus="status">
<div class="modal-content">
<div class="table-wrapper">
<table class="table deliveryInfo">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 20%;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
주문자
</th>
<td>
<c:out value="${ resultMap.result.ordrrNm }"/>
</td>
</tr>
<tr>
<th>
수령인
</th>
<td>
<c:out value="${ list.recpntNm }"/>
</td>
</tr>
<tr>
<th>
배송지
</th>
<td><c:if test="${ not empty list.dlvylcZip }">(<c:out value="${ list.dlvylcZip }"/>)</c:if>
<c:choose>
<c:when test="${ list.dlvylcAdresDvCd eq '01'}">
<c:out value="${ list.dlvylcRnmAdres }"/>
</c:when>
<c:when test="${ list.dlvylcAdresDvCd eq '02'}">
<c:out value="${ list.dlvylcLnbAdres }"/>
</c:when>
</c:choose>
<c:out value="${ list.dlvylcAdresDtl }"/>
</td>
</tr>
<tr>
<th>
택배사
</th>
<td>
<c:out value="${ list.hdrycpnNm }"/>
</td>
</tr>
<tr>
<th>
송장번호
</th>
<td><c:out value="${ list.invcnb }"/></td><!-- TODO : 주문 목록에 붙여서 파라미터로 받은 송장번호 출력 -->
</tr>
</tbody>
</table>
</div>
<div class="table-wrapper">
<table class="table deliveryStatus">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 30%;">
<col style="width: 30%;">
<col style="width: auto;">
</colgroup>
<thead>
<tr>
<th>처리일시</th>
<th>상품위치</th>
<th>배송상태</th>
</tr>
</thead>
<tbody>
<c:forEach var="trackingList" items="${ list.trackingDetails }" varStatus="status">
<tr>
<td><c:out value="${ trackingList.time }"/></td>
<td>
<c:out value="${ trackingList.where }"/>
</td>
<td><c:out value="${ trackingList.kind }"/></td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="couponList">
<div class="couponList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">배송 조회 내역이 없습니다.</p>
</div>
</div>
</c:otherwise>
</c:choose>
<div class="modal-footer">
<a href="#" rel="modal:close" class="btn large outline">닫기</a>
</div>
</div>

View File

@@ -0,0 +1,56 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : FdrmDlvyCycleChngU.jsp
Description : 마이페이지 배송 주기 변경 팝업
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-27 추지훈 최초 생성
--%>
<!-- 모달 -->
<!-- 배송주기 변경 -->
<form id="dlvyCycleUpdtForm">
<div id="delivery-cycle-pop" class="modal default" style="max-width: 640px;">
<div class="modal-header">
<div class="modal-header__title">배송주기 변경</div>
</div>
<div class="modal-content">
<div class="deliveryCyclePop">
<h4 class="modalSectionTitle">배송주기를 선택해 주세요.</h4>
<div class="deliveryCyclePop__checkWrapper">
<div class="custom-radio-container">
<c:forEach var="cdList" items="${ resultMap.dlvyCycleCdList }" varStatus="status">
<div class="custom-radio">
<input type="radio" id="<c:out value="${ cdList.cdNm }"/><c:out value="${ cdList.cd }"/>" name="dlvyCycleCd"
<c:choose>
<c:when test="${ not empty resultMap.paramVO.dlvyCycleCd }">
<c:if test="${ resultMap.paramVO.dlvyCycleCd eq cdList.cd }">checked="checked"</c:if>
</c:when>
<c:otherwise>
<c:if test="${ cdList.cd eq '01' }">checked="checked"</c:if>
</c:otherwise>
</c:choose>
>
<label for="<c:out value="${ cdList.cdNm }"/><c:out value="${ cdList.cd }"/>"><c:out value="${ cdList.cdNm }"/></label>
</div>
</c:forEach>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="ordrInnb" value="<c:out value="${ resultMap.paramVO.ordrInnb }"/>" />
<a href="#" rel="modal:close" class="btn large outline">닫기</a>
<button type="button" class="btn large theme" onclick="fn_update_dlvy_cycle();">배송주기 변경</button>
</div>
</div>
</form>

View File

@@ -0,0 +1,264 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireRForm.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
<script>
$(document).ready(function() {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
fn_select_fdrm_dlvy_list(pageIndex, pageUnit);
fn_start_display();
});
/******************************************************************
* 시작 화면 제어
******************************************************************/
const fn_start_display = function() {
/* 검색조건 > 날짜 구간 버튼 클릭 이벤트 */
$('.dateRange-btn').on('click', function() {
const date = $(this).attr('id');
$(this).closest('div').find('#dateRange').val(date);
if ('allDays' === date) {
$('#bgnDt, #endDt').val('');
return false;
}
fn_set_date('bgnDt', 'endDt', 'endDt', date);
});
/* 검색 버튼 클릭 이벤트 */
$('#btnSearch').on('click', function() {
fn_select_fdrm_dlvy_list(1);
});
}
/******************************************************************
* 정기배송 목록 조회
******************************************************************/
const fn_select_fdrm_dlvy_list = function(pageIndex, pageUnit) {
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/ordr/selectFdrmDlvyInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
/*********************************************************************
* 정기배송 > 배송주기 변경 팝업
* *******************************************************************/
const fn_dlvy_cycle_change_modal = function (modalDivSltr, modalSlrt, ordrInnb) {
// const data = $(formId).serialize();
const data = null;
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/mpage/ordr/selectFdrmDlvyCycleChngForm"/>',
data: {
ordrInnb : ordrInnb
},
success: function (data) {
$(modalSlrt).remove();
$(modalDivSltr).html(data);
$(modalSlrt).modal();
}
});
}
/*********************************************************************
* 정기배송 > 배송주기 변경 팝업 > 배송주기 변경
* *******************************************************************/
const fn_update_dlvy_cycle = function () {
const data = $('#dlvyCycleUpdtForm').serialize();
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/mpage/ordr/selectFdrmDlvyCycleChngForm"/>',
data: data,
success: function (result) {
}
});
}
/*********************************************************************
* 정기배송 > 배송 혜지
* *******************************************************************/
const fn_delete_fdrm_dlvy = function () {
const data = $('#dlvyCycleUpdtForm').serialize();
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/mpage/ordr/selectFdrmDlvyCycleChngForm"/>',
data: data,
success: function (result) {
}
});
}
/* 검색조건 세팅 */
const fn_set_param = function() {
const params = ${paramVO};
const keys = Object.keys(params);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let data = params[key];
if ('bgnDt' == key || 'endDt' == key) {
if (!fn_is_empty(data)) {
for (let i = 0; i < data.length; i++) {
$('#' + key).val(data);
}
}
}
if ('dateRange' == key) {
$('#'+ data).trigger('click');
}
if ('srchwrd' == key) {
$('#' + key).val(data);
}
}
}
</script>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">정기배송 관리</h3>
<form id="listForm">
<input type="hidden" name="pageIndex" id="pageIndex" value="1">
<div class="customer-search">
<div class="customer-search__row justify-start">
<input class="input-text customer-search__search" type="text" name="srchwrd" title="검색어 입력" placeholder="주문번호, 상품명 검색">
</div>
<div class="customer-search__row justify-start">
<div class="customer-search__controls">
<div class="dateRange-btnContainer">
<input type="hidden" name="dateRange" id="dateRange" value="allDays">
<button type="button" class="dateRange-btn" id="7D">일주일</button>
<button type="button" class="dateRange-btn" id="1M">1개월</button>
<button type="button" class="dateRange-btn" id="3M">3개월</button>
<button type="button" class="dateRange-btn selected" id="allDays">전체</button>
</div>
<div class="input-container">
<input type="text" readonly id="bgnDt" class="datepicker" name="bgnDt" title="시작 날짜 선택" autocomplete="off">
<span class="tilde">~</span>
<input type="text" readonly id="endDt" class="datepicker" name="endDt" title="종료 날짜 선택" autocomplete="off">
</div>
</div>
<button class="btn md dark" type="button" id="btnSearch" onclick="fn_select_fdrm_dlvy_list(1);" >검색</button>
</div>
</div>
</form>
<div class="sub-tab__content current" id="pageDiv">
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 모달 영역 -->
<div id="modalDiv">
</div>
</body>
</html>

View File

@@ -0,0 +1,71 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : RtngudCanclRefndListR.jsp
Description : 마이페이지 반품/환불 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-27 추지훈 최초 생성
--%>
<!--<div class="sub-tab__content current">-->
<div class="orderList">
<c:choose>
<c:when test="${ not empty resultMap.allOrdrList && fn:length(resultMap.allOrdrList) > 0 }">
<c:forEach var="list" items="${ resultMap.allOrdrList }" varStatus="status">
<div class="orderList__item">
<div class="orderList__item__inner">
<a href="" class="orderList__image">
<img src="<c:out value="${ list.goodsImageUrl }"/>" alt="상품 이미지">
</a>
<div class="orderList__description">
<div class="orderList__description__first">
<div class="orderList__item__top">
<a href="" class="orderList__orderNum"><c:out value="${ list.ordrInnb }"/>
</a>
<span class="orderList__dot">·</span>
<span class="orderList__date"><c:out value="${ list.ordrDt }"/> 주문</span>
</div>
<a href="" class="orderList__productTitle"><c:out value="${ list.goodsNm }"/></a>
<span class="orderList__option"><c:out value="${ not empty list.optnNm ? '옵션 : ' += list.optnNm : '' }"/></span>
</div>
<div class="orderList__description__second">
<span class="orderList__price"><span class="comma"><c:out value="${ list.setleAmt }"/></span>원</span>
</div>
<div class="orderList__description__third">
<span class="orderList__regularDelivery">
매월 15일
<span class="misc">(3회차)</span>
</span>
</div>
<div class="orderList__btnControls">
<button type="button" class="btn gray sm full" onclick="fn_delete_fdrm_dlvy();">배송해지</button>
<button type="button" class="btn outline sm full" onclick="fn_dlvy_cycle_change_modal( '#modalDiv', '#delivery-cycle-pop', '<c:out value="${ list.ordrInnb }"/>' );" >배송주기 변경</button>
</div>
</div>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="orderList__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="orderList__no-result-text">
주문내역이 없습니다.
</p>
</div>
</c:otherwise>
</c:choose>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_fdrm_dlvy_list" />
</div>
<!--</div>-->

View File

@@ -0,0 +1,241 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireRForm.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
<script src="<c:url value='/js/dlvylc/dlvylc.js'/>"></script>
<script>
$(document).ready(function() {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
fn_select_gift_list(pageIndex, pageUnit);
fn_start_display();
});
/******************************************************************
* 시작 화면 제어
******************************************************************/
const fn_start_display = function() {
/* 검색조건 > 날짜 구간 버튼 클릭 이벤트 */
$('.dateRange-btn').on('click', function() {
const date = $(this).attr('id');
$(this).closest('div').find('#dateRange').val(date);
if ('allDays' === date) {
$('#bgnDt, #endDt').val('');
return false;
}
fn_set_date('bgnDt', 'endDt', 'endDt', date);
});
/* 검색 버튼 클릭 이벤트 */
$('#btnSearch').on('click', function() {
fn_select_gift_list(1);
});
}
/* 주문상세 이동 */
const fn_go_ordr_dtl = function (sopmalCd, ordrInnb) {
var form = $('#listForm');
$(form).append($('<input/>', {type: 'hidden', name: 'ordrInnb', id: 'ordrInnb', value: ordrInnb}));
$(form).attr('method', 'get');
$(form).attr('action', '<c:url value="/sopmal/mpage/ordr/selectMbrOrdrDtlInqire"/>');
$(form).submit();
}
/******************************************************************
* 선물함 목록 조회
******************************************************************/
const fn_select_gift_list = function(pageIndex, pageUnit) {
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/ordr/selectGiftListInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
/*********************************************************************
* 성물함 > 선물현황 조회
* *******************************************************************/
const fn_select_gift_current_situation = function (modalDivSltr, modalSlrt, ordrInnb) {
const data = null;
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/mpage/ordr/selectGiftOrdrSittnPopupForm"/>',
data: {
ordrInnb : ordrInnb
},
success: function (result) {
$(modalSlrt).remove();
$(modalDivSltr).html(result);
$(modalSlrt).modal();
}
});
}
/* 검색조건 세팅 */
const fn_set_param = function() {
const params = ${paramVO};
const keys = Object.keys(params);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let data = params[key];
if ('bgnDt' == key || 'endDt' == key) {
if (!fn_is_empty(data)) {
for (let i = 0; i < data.length; i++) {
$('#' + key).val(data);
}
}
}
if ('dateRange' == key) {
$('#'+ data).trigger('click');
}
if ('srchwrd' == key) {
$('#' + key).val(data);
}
}
}
</script>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">선물함</h3>
<form id="listForm">
<input type="hidden" name="pageIndex" id="pageIndex" value="1">
<div class="customer-search">
<div class="customer-search__row justify-start">
<input class="input-text customer-search__search" type="text" name="srchwrd" title="검색어 입력" placeholder="주문번호, 상품명 검색">
</div>
<div class="customer-search__row justify-start">
<div class="customer-search__controls">
<div class="dateRange-btnContainer">
<input type="hidden" name="dateRange" id="dateRange" value="allDays">
<button type="button" class="dateRange-btn" id="7D">일주일</button>
<button type="button" class="dateRange-btn" id="1M">1개월</button>
<button type="button" class="dateRange-btn" id="3M">3개월</button>
<button type="button" class="dateRange-btn selected" id="allDays">전체</button>
</div>
<div class="input-container">
<input type="text" readonly id="bgnDt" class="datepicker" name="bgnDt" title="시작 날짜 선택" autocomplete="off">
<span class="tilde">~</span>
<input type="text" readonly id="endDt" class="datepicker" name="endDt" title="종료 날짜 선택" autocomplete="off">
</div>
</div>
<button class="btn md dark" type="button" id="btnSearch" onclick="fn_select_fdrm_dlvy_list(1);" >검색</button>
</div>
</div>
</form>
<div class="sub-tab__content current" id="pageDiv">
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 모달 영역 -->
<div id="modalDiv">
</div>
</body>
</html>

View File

@@ -0,0 +1,68 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : RtngudCanclRefndListR.jsp
Description : 마이페이지 반품/환불 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-27 추지훈 최초 생성
--%>
<!--<div class="sub-tab__content current">-->
<div class="orderList">
<c:choose>
<c:when test="${ not empty resultMap.allOrdrList && fn:length(resultMap.allOrdrList) > 0 }">
<c:forEach var="list" items="${ resultMap.allOrdrList }" varStatus="status">
<div class="orderList__item">
<div class="orderList__item__inner">
<a href="" class="orderList__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${ cdnurl }${list.goodsImageUrl}"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${list.goodsNm}"/>">
</a>
<div class="orderList__description">
<div class="orderList__description__first">
<div class="orderList__item__top">
<a href="" class="orderList__orderNum"><c:out value="${ list.ordrInnb }"/>
</a>
<span class="orderList__dot">·</span>
<span class="orderList__date"><c:out value="${ list.ordrDt }"/> 주문</span>
</div>
<a href="javascript:void(0);" onclick="fn_go_ordr_dtl('<c:out value="${list.sopmalCd}"/>', '<c:out value="${list.ordrInnb}"/>');" class="orderList__productTitle"><c:out value="${list.goodsNm}"/></a>
<span class="orderList__option"><c:out value="${ not empty list.optnNm ? '옵션 : ' += list.optnNm : '' }"/></span>
</div>
<div class="orderList__description__second">
<span class="orderList__price"><span class="comma"><c:out value="${ list.setleAmt }"/></span>원</span>
</div>
<div class="orderList__description__third">
<span class="orderList__mileage"><span class="comma">예상적립 <fmt:formatNumber value="${ list.mlgAmt }" pattern="#,###"/></span>원</span>
</div>
<div class="orderList__btnControls">
<button type="button" class="btn outline sm full" onclick="fn_select_gift_current_situation( '#modalDiv', '#gift-sittn-pop', '<c:out value="${ list.ordrInnb }"/>' );" >선물 조회</button>
</div>
</div>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="orderList__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="orderList__no-result-text">
선물내역이 없습니다.
</p>
</div>
</c:otherwise>
</c:choose>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_gift_list" />
</div>
<!--</div>-->

View File

@@ -0,0 +1,77 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : GiftOrdrSittnPopupR.jsp
Description : 마이페이지 선물함 선물현황 조회 팝업
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-27 추지훈 최초 생성
--%>
<!-- 모달 -->
<!-- 선물 조회 -->
<div id="gift-sittn-pop" class="modal default" style="max-width: 640px;">
<div class="modal-header">
<div class="modal-header__title">선물 조회</div>
</div>
<div class="modal-content">
<c:forEach var="list" items="${ resultMap.resultList }" varStatus="status">
<div class="table-wrapper">
<table class="table deliveryInfo">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 20%;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
수령인
</th>
<td><c:out value="${ list.recpntNm }"/></td>
</tr>
<tr>
<th>
선물상태
</th>
<td>
<c:out value="${ list.giftSttusCdNm }"/>
</td>
</tr>
<tr>
<th>
배송지
</th>
<td>
<c:if test="${ not empty list.dlvylcZip }">(<c:out value="${ list.dlvylcZip }"/>)</c:if>
<c:choose>
<c:when test="${ list.dlvylcAdresDvCd eq '01'}">
<c:out value="${ list.dlvylcRnmAdres }"/>
</c:when>
<c:when test="${ list.dlvylcAdresDvCd eq '02'}">
<c:out value="${ list.dlvylcLnbAdres }"/>
</c:when>
</c:choose>
<c:out value="${ list. dlvylcAdresDtl }"/>
</td>
</tr>
</tbody>
</table>
</div>
<hr>
<br>
</c:forEach>
</div>
<div class="modal-footer">
<a href="#" rel="modal:close" class="btn large outline">닫기</a>
</div>
</div>

View File

@@ -0,0 +1,475 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireRForm.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<script defer>
//상품 타이틀, 수량, 가격 저장하는 배열
// 배열 순서 -> [상품명, 수량, 1개당 가격, 상품 총가격(=수량x개당가격), 추가정보(색상, 사이즈등)]
fn_set_niceSelect_datePicker('.select-box-addCart')
//
// /*************************************************************
// 함께하면 좋은상품 이벤트 (모달)
// **************************************************************/
//
// //일반옵션
// // 라디오 버튼 클릭시, 상품 정보 배열에 추가 및 화면에 추가
$(".productDetailInfo__option__item").each(function () {
$(this).find("input[type=radio]").on("change", function () { // 라디오 버튼 클릭 시
if ($(this).prop('checked') == false) return; // 체크 해제시 리턴
const $title = $(this).closest(".productDetailInfo__option__item").find("label").text();
const $price = $(this).closest(".productDetailInfo__option__item").find(".productDetailInfo__option__price").text();
const $goodsOptnInnb = $(this).closest(".productDetailInfo__option__item").find('input[name="goodsOptnInnb"]').val()
const $goodsOptnTy = $(this).closest(".productDetailInfo__option__item").find('input[name="goodsOptnTy"]').val()
const $optnInfo = $(this).closest(".productDetailInfo__option__item").find('.productDetailInfo__option__monthly-payment').text();
const $priceNum = parseInt($price.replace(/,/g, ""));
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = productArr.some(function (item) {
return item[0] === $title;
});
if (isItemAlreadyAdded){
fn_goods_duplicate_select_modal()
return;
}
productArr.push([$title, 1, $priceNum, $priceNum * 1, $goodsOptnInnb, $goodsOptnTy]); // 배열에 상품 정보 추가
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">'+$optnInfo+'</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $price +
'</div>' +
'</div>' +
'</div>'
);
updateCartCounters(); // 화면에 상품 정보 업데이트
});
});
// 총 상품금액
var $cartTotalPrice = $(".modal .product-total__price__totalPriceNum");
// 수량 "-", "+" 버튼 클릭 시, 수량 증감 및 가격 변경 및 총 상품금액 변경
$("#cartCountContainer").on("click", ".productDetailInfo__count__amountBtn", function () { // 수량 버튼 클릭 시
var $counter = $(this);
var $index = $counter.closest(".productDetailInfo__count").index(); // 해당 상품의 인덱스
if ($(this).hasClass("minus")) { // "-" 버튼 클릭 시
if (productArr[$index][1] <= 1) return;
productArr[$index][1]--; // 배열에서 해당 상품의 수량 감소
productArr[$index][3] = productArr[$index][1] * productArr[$index][2]; // 배열에서 해당 상품의 총 가격 변경
} else { // "+" 버튼 클릭 시
productArr[$index][1]++; // 배열에서 해당 상품의 수량 증가
productArr[$index][3] = productArr[$index][1] * productArr[$index][2]; // 배열에서 해당 상품의 총 가격 변경
}
updateCartCounters(); // 화면에 상품 정보 업데이트
})
//
// //배열 내용을 바탕으로 각 아이템 텍스트 변경
function updateCartCounters() {
$(".modal .productDetailInfo__count").each(function () {
var $counter = $(this);
var $index = $counter.index();
var $number = $counter.find(".productDetailInfo__count__amountNumber");
var $price = $counter.find(".productDetailInfo__count__priceNum");
$number.text(productArr[$index][1]);
$price.text(addComma(productArr[$index][3]) + "원");
});
updateCartTotalPrice(); // 총 상품금액 업데이트
}
// 3자리마다 "," 추가
function addComma(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
// 총 상품금액 업데이트
function updateCartTotalPrice() {
var totalPrice = 0; // 총 상품금액
for (var i = 0; i < productArr.length; i++) {
totalPrice += productArr[i][3]; // 배열의 총 가격을 더함
}
$cartTotalPrice.text(addComma(totalPrice)); // 총 상품금액 텍스트 변경
}
// x버튼 클릭 시 삭제
$("#cartCountContainer").on("click", ".productDetailInfo__count__amountDelete", function () { // x 버튼 클릭 시
var $index = $(this).closest(".productDetailInfo__count").index();
productArr.splice($index, 1); // 배열에서 해당 상품 삭제
$(this).closest(".productDetailInfo__count").remove(); // 화면에서 해당 상품 삭제
updateCartCounters(); // 화면에 상품 정보 업데이트
//일반옵션이 하나일 경우 라디오 체크 해제
if($('#option-change-popUp .custom-radio:not(:has(span))').length ===1
|| productArr.filter(item => item[5] === '01'&& $('#goodsInnb').val() ===item[6]).length === 0){
$("input[name='r-group01']").prop('checked', false)
}
});
// // // 마지막으로 생성된 상품에 각인 정보 추가
// // $('#cartAddTextBtn').on('click', function () {
// // var $index = $(".modal .productDetailInfo__count").length - 1;
// // var $text = $('#cartAddTextInput').val();
// // console.log(productArr[$index]); // 인덱스 확인
// // $(".modal .productDetailInfo__count").eq($index).find(".productDetailInfo__count__amountTop").append('<div class="productDetailInfo__count__additionalSelect">각인문구 : ' + $text + '</div>');
// //
// // console.log(productArr); // 배열 정보확인
// // });
//
//재고옵션
$('#cartAdditionalSelect').on("change", "select", function () { // 셀렉트 선택 시
if ($('#cartAdditionalSelect').find('.option.selected.disabled').length > 0) return;
if ($('#cartAdditionalSelect').find('.option.selected').length == $('#cartAdditionalSelect').find('.nice-select').length) { // 모든 셀렉트가 선택되면
var $title = $('#addCartGoodsNm').val();
var $optInfo = $(this).closest(".productDetailInfo__additionalSelect__item").find(".option.selected").attr("data-value").split('|');
var $priceNum = $optInfo[0];
var $goodsOptnInnb = $optInfo[1];
var $goodsOptnInfo = $optInfo[2];
var $goodsOptnTy = $optInfo[3];
var arr = [];
for (var i = 0; i < $('#cartAdditionalSelect').find('.nice-select').length; i++) {
arr.push($('#cartAdditionalSelect').find('.nice-select').eq(i).find('.option.selected').text());
}
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = productArr.some(function (item) {
return item[0] === $title && item[6].join('') === arr.join('') || item[4] === $goodsOptnInnb;
});
if (isItemAlreadyAdded) {
fn_goods_duplicate_select_modal()
return;
}
productArr.push([$title, 1, $priceNum, $priceNum * 1, $goodsOptnInnb, $goodsOptnTy, arr]); // 배열에 상품 정보 추가
let cartAdditionalSelectText = '옵션 : ' + arr.join(' / ').replace(/\(\+.*?\)/g, ''); // 추가정보 텍스트로 변환
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<div class="productDetailInfo__count__additionalSelect">' + cartAdditionalSelectText + '</div>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">' + $goodsOptnInfo + '</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $priceNum +
'</div>' +
'</div>' +
'</div>'
);
}
updateCartCounters(); // 화면에 상품 정보 업데이트
});
// 추가구성옵션
$("#cartMoreItemsSelect").on("change",'select', function () {
var $moreItems = $('#cartMoreItemsSelect').find(".productDetailInfo__additionalSelect__item");
const $optInfoOptn3 = $(this).closest(".productDetailInfo__additionalSelect__item").find(".option.selected").attr("data-value").split('|');
const $priceNumOptn3 = $optInfoOptn3[0];
const $goodsOptnInnbOptn3 = $optInfoOptn3[1];
const $goodsOptnInfoOptn3 = $optInfoOptn3[2];
const $goodsOptnTyOptn3 = $optInfoOptn3[3];
const $optnEssnlAtOptn3 = $(this).closest(".productDetailInfo__additionalSelect__item").find('input[name="productDetailInfo__additionalSelect__otpnEssntlAt__relate__added"]').val();
// $moreItems.each(function () {
// if ($(this).find('.option.selected.disabled').length > 0) return;
var $title = $moreItems.find(".option.selected").text().replace(' ','').trim().replace('선택', ' ').replace(/\(\+.*?\)/g, '');
var $priceNum = $(this).find(".option.selected").attr("data-value");
//이미 추가된 상품인지 확인
var isItemAlreadyAdded = productArr.some(function (item) {
return item[4] === $goodsOptnInnbOptn3;
});
if (isItemAlreadyAdded){
fn_goods_duplicate_select_modal()
return;
}
productArr.push([$title, 1, $priceNumOptn3, $priceNumOptn3 * 1, $goodsOptnInnbOptn3, $goodsOptnTyOptn3, $optnEssnlAtOptn3]); // 배열에 상품 정보 추가
$('#cartCountContainer').append( // 화면에 상품 정보 추가
'<div class="productDetailInfo__count">' +
'<div class="productDetailInfo__count__amountTop">' +
'<span class="productDetailInfo__count__amountTitle">' + $title + '</span>' +
'<button class="productDetailInfo__count__amountDelete"><span class="visually-hidden">삭제</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountBottom">' +
'<div class="productDetailInfo__count__amountCounter">' +
'<button class="productDetailInfo__count__amountBtn minus"><span class="visually-hidden">감소</span></button>' +
'<span class="productDetailInfo__count__amountNumber">1</span>' +
'<button class="productDetailInfo__count__amountBtn plus"><span class="visually-hidden">추가</span></button>' +
'</div>' +
'<div class="productDetailInfo__count__amountPriceBox">' +
'<span class="productDetailInfo__count__amountMonthlyPrice">'+$goodsOptnInfoOptn3+'</span>' +
'<span class="productDetailInfo__count__amountPrice"><span class="comma productDetailInfo__count__priceNum">' + $priceNum +
'</div>' +
'</div>' +
'</div>'
);
$(this).val('').niceSelect('update')
updateCartCounters(); // 화면에 상품 정보 업데이트
// });
});
</script>
<div id="option-change-popUp" class="modal option">
<div class="option-header">
<div class="option-header__title">옵션 선택</div>
<input type="hidden" id="addCartGoodsInnb" value="${resultMap.goodsDtl.goodsInnb}"/>
<input type="hidden" id="sopmalCd" value="${resultMap.goodsDtl.sopmalCd}"/>
<input type="hidden" id="addCartGoodsNm" value="${resultMap.goodsDtl.goodsNm}"/>
<input type="hidden" id="slepricDscntAmt" value="${resultMap.goodsDtl.slepric}"/>
<c:forEach var="cardDv" items="${resultMap.cartDvList}">
<input type="hidden" value="${cardDv.cd}" id="cartDv-${cardDv.cdNm}"/>
</c:forEach>
</div>
<div class="option-content">
<div class="product-unit product-unit--relatedProduct">
<div class="product-unit-image">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${resultMap.goodsDtl.goodsInnb}"/>');">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${cdnurl}${fn:split(resultMap.goodsDtl.img, '|')[0]}"/> " onerror="this.src='/pc/images/image_placeholder.png'" alt="상품 이미지">
</a>
</div>
<div class="product-unit-info">
<div class="product-unit-info__inner">
<div class="product-unit-title">
<a href="javascript:void(0);" onclick="fn_move_goods_dtl('<c:out value="${resultMap.goodsDtl.goodsInnb}"/>');"><c:out value="${resultMap.goodsDtl.goodsNm}"/></a>
</div>
<div class="product-unit-price">
<div class="product-unit-price__price">
<span class="product-unit-price__original">
<span class="comma">
<fmt:formatNumber value="${resultMap.goodsDtl.cnsmrpric}"/></span>
<span class="priceUnit"></span>
</span>
<span class="product-unit-price__current">
<span class="comma"> <fmt:formatNumber value="${resultMap.goodsDtl.slepric - resultMap.goodsDtl.evtAditDscntAmt}"/></span>
<span class="priceUnit">원</span></span>
</div>
<div class="product-unit-price__sale">
<span class="percent">
<c:choose>
<c:when test="${resultMap.goodsDtl.eventAt eq 'Y'}">
<c:out value="${resultMap.goodsDtl.evtSlePercent}"/>
</c:when>
<c:otherwise>
<c:out value="${resultMap.goodsDtl.slePercent}"/>
</c:otherwise>
</c:choose>
%</span>
</div>
</div>
</div>
</div>
</div>
<c:if test="${resultMap.goodsDtl.goodsSttusCd ne '02' or resultMap.goodsDtl.goodsSttusCd ne '03'}">
<c:choose>
<c:when test="${not empty resultMap.optnList}">
<c:if test="${not empty resultMap.optnList.normalOptnList}">
<div class="productDetailInfo__option">
<div class="productDetailInfo__option__box">
<c:forEach var="goodsOpt01" items="${resultMap.optnList.normalOptnList}" varStatus="optList01">
<c:if test="${goodsOpt01.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOpt01.invntrySldoutExpsrAt eq 'Y'}">
<div class="productDetailInfo__option__item">
<c:if test="${not empty goodsOpt01.optnVal1}">
<div class="custom-radio is-medium">
<input type="radio" id="r-${goodsOpt01.optnOrdr}" value="${goodsOpt01.optnVal1}" name="r-group01" <c:if test="${goodsOpt01.disableAt eq 'Y'}"> disabled</c:if>>
<label for="r-${goodsOpt01.optnOrdr}">${goodsOpt01.optnVal1}</label>
<input type="hidden" name="optnCd" value="${goodsOpt01.optnCd1}">
<input type="hidden" name="goodsOptnInnb" value="${goodsOpt01.goodsOptnInnb}"/>
<input type="hidden" name="goodsOptnTy" value="${goodsOpt01.optnTy}"/>
<input type="hidden" name="goodsSopmalCd" value="${goodsOpt01.sopmalCd}"/>
<c:if test="${goodsOpt01.disableAt eq 'Y'}"> <span>(품절)</span></c:if>
</div>
<div class="productDetailInfo__option__right">
<span class="productDetailInfo__option__price"><span class="comma"><fmt:formatNumber value="${goodsOpt01.slepric}"/></span> <span class="priceUnit"> 원</span></span>
<span class="productDetailInfo__option__monthly-payment"><c:out value="${goodsOpt01.optnInfo}"/></span>
</div>
</c:if>
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
<c:if test="${not empty resultMap.optnList.invntryOptnList}">
<div class="productDetailInfo__additionalSelect" id="cartAdditionalSelect">
<span class="productDetailInfo__option__title">옵션선택(필수)</span>
<div class="productDetailInfo__additionalSelect__inner">
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty resultMap.optnList.invntryOptnList[0].optnNm1}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${resultMap.optnList.invntryOptnList[0].optnNm1}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn1" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
<c:forEach var="goodsOpt02" items="${resultMap.optnList.invntryOptnList}" varStatus="optList02">
<c:if test="${goodsOpt02.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOpt02.invntrySldoutExpsrAt eq 'Y'}">
<c:if test="${goodsOpt02.optnVal1 ne resultMap.optnList.invntryOptnList[optList02.index-1].optnVal1}">
<option value="${goodsOpt02.slepric}|${goodsOpt02.goodsOptnInnb}|${goodsOpt02.optnInfo}|${goodsOpt02.optnTy}" <c:if test="${goodsOpt02.disableAt eq 'Y'}"> disabled </c:if> >
<c:out value="${goodsOpt02.optnVal1}"/>
</option>
</c:if>
</c:if>
</c:if>
</c:forEach>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty resultMap.optnList.invntryOptnList[0].optnNm2}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${resultMap.optnList.invntryOptnList[0].optnNm2}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn2" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty resultMap.optnList.invntryOptnList[0].optnNm3}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${resultMap.optnList.invntryOptnList[0].optnNm3}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn3" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
<div class="productDetailInfo__additionalSelect__item">
<c:if test="${not empty resultMap.optnList.invntryOptnList[0].optnNm4}">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${resultMap.optnList.invntryOptnList[0].optnNm4}"/> </span>
<div class="select-box-addCart">
<select id="selectAddCartInvntryOptn4" name="selectAddCartInvntryOptn">
<option value="" disabled selected><c:out value="선택"/></option>
</select>
</div>
</c:if>
</div>
</div>
</div>
</c:if>
<c:if test="${not empty resultMap.optnList.addedOptnList}">
<div class="productDetailInfo__additionalSelect" id="cartMoreItemsSelect">
<span class="productDetailInfo__additionalSelect__title">추가구성</span>
<div class="productDetailInfo__additionalSelect__inner">
<c:forEach var="goodsOpt03" items="${resultMap.optnList.addedOptnList}" varStatus="optList03">
<c:if test="${not empty goodsOpt03.optnNm1}">
<c:if test="${resultMap.optnList.addedOptnList[optList03.index-1].optnNm1 ne goodsOpt03.optnNm1}">
<div class="productDetailInfo__additionalSelect__item">
<span class="productDetailInfo__additionalSelect__category"><c:out value="${goodsOpt03.optnNm1}"/> </span>
<input type="hidden" name="productDetailInfo__additionalSelect__otpnEssntlAt__relate__added" <c:if test="${goodsOpt03.optnEssntlAt eq 'Y'}"> value="Y"</c:if>/>
</c:if>
<c:if test="${resultMap.optnList.addedOptnList[optList03.index-1].optnNm1 ne goodsOpt03.optnNm1}">
<div class="select-box-addCart">
<select title="${goodsOpt03.OptnInfo}" name="selectRelateAddedOptn">
<option value="" disabled selected><c:out value="선택"/></option>
<c:forEach var="goodsOptVal03" items="${resultMap.optnList.addedOptnList}" varStatus="optVal03">
<c:if test="${goodsOptVal03.optnNm1 eq goodsOpt03.optnNm1}">
<c:if test="${goodsOptVal03.optnExpsrAt eq 'Y'}">
<c:if test="${goodsOptVal03.invntrySldoutExpsrAt eq 'Y'}">
<option value="${goodsOptVal03.slepric}|${goodsOptVal03.goodsOptnInnb}|${goodsOptVal03.optnInfo}|${goodsOptVal03.optnTy} " <c:if test="${goodsOptVal03.disableAt eq 'Y'}"> disabled</c:if> ><c:out value="${goodsOptVal03.optnVal1}"/> (+ <fmt:formatNumber value="${goodsOptVal03.slepric}"/>) <c:if test="${goodsOptVal03.disableAt eq 'Y'}"> <c:out value="(품절)"/> </c:if> </option>
</c:if>
</c:if>
</c:if>
</c:forEach>
</select>
</div>
</div>
</c:if>
</c:if>
</c:forEach>
</div>
</div>
</c:if>
<%-- <div class="productDetailInfo__confirmOption">--%>
<%-- <button class="btn md outline" id="cartMoreItemsButton">입력한 정보 선택</button>--%>
<%-- </div>--%>
<%--TODO :: 입력옵션 --%>
<%-- <div class="productDetailInfo__option">--%>
<%-- <span class="productDetailInfo__option__title">상품정보 입력</span>--%>
<%-- <div class="productDetailInfo__additionalSelect__inner">--%>
<%-- <div class="productDetailInfo__additionalSelect__item">--%>
<%-- <span class="productDetailInfo__additionalSelect__category">각인 옵션</span>--%>
<%-- <input id="cartAddTextInput" class="input-text full" type="text" title="해당 인풋에 대한 설명"--%>
<%-- placeholder="각인 문구를 입력해주세요" value="">--%>
<%-- <button id="cartAddTextBtn" class="btn outline">저장</button>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- </div>--%>
<div id="cartCountContainer">
</div>
</div>
</c:when>
<c:otherwise>
<%--옵션 없을 경우 빈값--%>
</c:otherwise>
</c:choose>
</c:if>
<div class="product-total__container">
<span class="product-total__text">총 상품금액</span>
<span class="product-total__price">
<span class="product-total__price__totalPriceNum">0</span>
<span class="won">원</span>
</span>
</div>
<c:choose>
<c:when test="${resultMap.goodsDtl.buttonRplcWordsUseAt ne 'Y'}">
<div class="product-btn-container">
<button class="btn theme large addCart">장바구니 담기</button>
</div>
</c:when>
<c:otherwise>
<div class="product-btn-container">
<a href="${resultMap.goodsDtl.pcButtonRplcLink}"
<c:if test="${resultMap.goodsDtl.buttonRplcLinkBrwsrDvCd eq '01'}"> target="_blank" </c:if> >
<span> <c:out value="${resultMap.goodsDtl.buttonRplcWords}"/> </span>
</a>
</div>
</c:otherwise>
</c:choose>
</div>

View File

@@ -0,0 +1,125 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : IndvdlSetleR.jsp
Description : 마이페이지 개인결제
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-04-11 김혜인 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
<script>
$(document).ready(function() {
fn_init();
fn_event();
});
/* ********************************************************
* 초기 설정
**********************************************************/
const fn_init = function() {
fn_get_indvdi_setle_list(1);
}
/* ********************************************************
* 이벤트 설정
**********************************************************/
const fn_event = function() {
}
/* ********************************************************
* function
**********************************************************/
/* 개인결제 목록 조회 */
const fn_get_indvdi_setle_list = function(index) {
if (!fn_is_empty(index)) {
$('#pageIndex').val(index);
}
let data = $('#condForm').serialize();
$.ajax({
type : 'post',
url : '<c:url value="/sopmal/mpage/ordr/selectIndvdlSetleInqireAjax"/>',
data : data,
success : function(html) {
$('#pageDiv').html(html);
},
error: function(data) {
let message = JSON.parse(JSON.parse(request.responseText).resBody.message);
alert(message.errorMsg);
}
});
}
/* 개인결제 등록 화면 이동 */
const fn_go_indvdl_setle_form = function(sopmalCd, ordrInnb, mbrInnb, mbrId, mbrDvCd) {
const form = $('<form></form>');
$(form).append($('<input/>', {type:'hidden', name:'sopmalCd', value:sopmalCd}));
$(form).append($('<input/>', {type:'hidden', name:'ordrInnb', value:ordrInnb}));
$(form).append($('<input/>', {type:'hidden', name:'mbrInnb', value:mbrInnb}));
$(form).append($('<input/>', {type:'hidden', name:'mbrId', value:mbrId}));
$(form).append($('<input/>', {type:'hidden', name:'mbrDvCd', value:mbrDvCd}));
$(form).attr('method', 'post');
$(form).attr('action', '<c:url value="/sopmal/ordr/selectIndvdlSetleForm"/>');
$(form).appendTo('body');
$(form).submit();
}
</script>
</head>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">개인결제</h3>
<form id="condForm">
<input type="hidden" name="pageIndex" id="pageIndex" value="1">
<input type="hidden" name="pageUnit" id="pageUnit" value="4"/>
</form>
<div id="pageDiv"></div>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
</body>
</html>

View File

@@ -0,0 +1,43 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<div class="personalPayment">
<c:choose>
<c:when test="${not empty data.resultList}">
<c:forEach var="setle" items="${data.resultList}">
<div class="product-unit">
<div class="product-unit-image">
<a href="javascript:void(0);" onclick="fn_go_indvdl_setle_form('<c:out value="${setle.sopmalCd}"/>', '<c:out value="${setle.ordrInnb}"/>', '<c:out value="${setle.mbrInnb}"/>', '<c:out value="${setle.mbrId}"/>', '<c:out value="${setle.mbrDvCd}"/>');">
<img src="<c:url value="/pc/images/개인결제이미지.png"/>" alt="개인결제">
</a>
</div>
<div class="product-unit-info">
<div class="product-unit-info__inner">
<span class="product-unit-price__current"><c:out value="${setle.indvdlSetleSj}"/></span>
<div class="product-unit-price">
<div class="product-unit-price__price">
<span class="product-unit-price__current"><c:out value="${setle.setleAmt}"/>원</span>
</div>
</div>
<div class="personalPayment__period"><c:out value="${setle.indvdlSetleValidDe}"/>까지</div>
</div>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="personalPayment__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="personalPayment__no-result-text">개인결제내역이 없습니다.</p>
</div>
</c:otherwise>
</c:choose>
</div>
<div class="pagination__container" style="margin-top: 20px">
<ui:pagination paginationInfo="${data.paginationInfo}" type="image" jsFunction="fn_get_indvdi_setle_list"/>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,794 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireRForm.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
fn_start_display();
});
/******************************************************************
* 시작 화면 제어
******************************************************************/
const fn_start_display = function() {
}
/*********************************************************************
* 반품 주소 변경
* *******************************************************************/
const fn_update_dlvy_info = function () {
const data = $('#returnDlvyUpdtForm').serializeArray();
if (confirm('반품 배송지 정보를 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/nmbr/ordr/updateRtngudCanclRefndUpdt"/>',
data: data,
success: function (result) {
alert('<spring:message code="success.common.update"/>');
location.reload();
}
});
}
}
/*********************************************************************
* 환불 계좌 정보 변경
* *******************************************************************/
const fn_update_acnt_info = function () {
const data = $('#refundAcntUpdtForm').serialize();
if (confirm('환불 계좌 정보를 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/nmbr/ordr/updateRtngudCanclRefndUpdt"/>',
data: data,
success: function (result) {
alert('<spring:message code="success.common.update"/>');
location.reload();
}
});
}
}
/* ********************************************************
* 우편번호 찾기
******************************************************** */
const fn_set_postcode = function(data) {
$('#postcode').val(data.postcode);
$('#adresDvCd').val(data.addressType);
if (data.addressType == '02') {
$('#address').val(data.jibunAddress);
} else if (data.addressType == '01') {
$('#address').val(data.roadAddress);
}
}
/**
* 반품 상품 QNA 문의 팝업
* @param goodsInnb
*/
const fn_goods_qna_pop_regist = (goodsInnb) => {
$.ajax({
type: "post",
data: {
authDv: "REGIST",
reqUrl: "modal",
bbsId: "goods_qna",
goodsInnb: goodsInnb,
listAt: "list",
},
url: "/sopmal/csc/selectBbscttAuth",
success: function (data) {
/*모달중복제거*/
fn_close_modal("qna-pop-regist");
fn_close_modal("qna-update-pop");
$("#modalDiv").html(data);
$("#qna-pop-regist").modal();
}
});
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<%-- 마이페이지 Left 영역 --%>
<div class="sub-right-content">
<div class="sub-right-content__section">
<h3 class="sub-right-content__title"><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 내역</h3>
<div class="sub-right-content__section">
<h3 class="orderDetail__title"><c:out value="${ resultMap.result.refnd.registDt }"/>
<span class="orderDetail__titleNum">
<c:choose>
<c:when test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">
반품번호
</c:when>
<c:otherwise>
환불번호
</c:otherwise>
</c:choose>
<c:out value="${ resultMap.result.refnd.orderRefundInnb }"/>
</span>
</h3>
<div class="cartOrder__list">
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: auto;">
<col style="width: 40px;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 7%;">
</colgroup>
<thead>
<tr>
<th>상품명</th>
<th>수량</th>
<th>상품금액</th>
<th>할인금액</th>
<th>할인적용금액</th>
<th>환불신청수량</th>
<th>배송비</th>
<th>문의</th>
</tr>
</thead>
<tbody>
<c:set var="rePreOrdrDlvyInnb" value="0"/>
<c:set var="reDlvyCnt" value="1"/>
<c:choose>
<c:when test="${ not empty resultMap.result.itemsList }">
<c:forEach var="refundList" items="${ resultMap.result.itemsList }" varStatus="status">
<tr>
<td>
<div class="cartItem">
<div class="cartItem__image">
<%--
<a href="">
<img src="<c:out value="${ refundList.img }"/>" alt="상품이미지">
</a>
--%>
<a class="orderList__image">
<img src="<c:out value="${ cdnurl }"/><c:out value="${ refundList.img }"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${refundList.goodsNm}"/>">
</a>
</div>
<div class="cartItem__productInfo">
<a class="cartItem__productTitle">
<c:out value="${ refundList.goodsNm }"/>
</a>
<c:if test="${ not empty refundList.optnNm }">
<span class="cartItem__productOption">
<span class="option-badge">옵션</span>
<c:out value="${ refundList.optnNm }"/>
</span>
</c:if>
(<c:out value="${ refundList.dlvylcZip }"/>)
<c:choose>
<c:when test="${ refundList.dlvylcAdresDvCd eq '01' }">
<c:out value="${ refundList.dlvylcRnmAdres }"/>
</c:when>
<c:when test="${ refundList.dlvylcAdresDvCd eq '02' }">
<c:out value="${ refundList.dlvylcLnbAdres }"/>
</c:when>
</c:choose>
<c:out value="${ refundList.dlvylAdresDtl }"/>
</div>
</div>
</td>
<td>
<span><c:out value="${ refundList.ordrQy }"/></span>
</td>
<td>
<span class="cartItem__normalPrice"><span
class=" comma"><c:out value="${ refundList.slepric }"/></span><span
class="priceUnit">원</span>
</span>
</td>
<td>
<span class="cartItem__discountPrice"><span
class="cartItem__discountMinus">(-)</span><span
class="comma"><c:out value="${ refundList.dscntAmt }"/></span><span
class="priceUnit">원</span>
</span>
</td>
<td>
<span class="cartItem__afterPrice"><span
class="comma"><c:out value="${ refundList.applyDscntAmt }"/></span>
<span class="priceUnit">원</span>
</span>
</td>
<td>
<span><c:out value="${ refundList.refundQy }"/></span>
</td>
<c:choose>
<c:when test="${ refundList.ordrTyCd eq '04' || refundList.ordrTyCd eq '05' }">
<c:set var="reRowspanCnt" value="0"/>
<c:forEach var="tmpGoods" items="${resultMap.result.itemsList}">
<c:set var="reRowspanCnt" value="${refundList.ordrDlvyInnb == tmpGoods.ordrDlvyInnb ? reRowspanCnt + 1 : reRowspanCnt}"/>
</c:forEach>
<c:if test="${rePreOrdrDlvyInnb != refundList.ordrDlvyInnb}">
<td class="center" rowspan="${reRowspanCnt}">
<span class="fs-13 fw-400">${reDlvyCnt += ' 번째 배송지'}</span><br>
<span class="fs-13 fw-400">${refundList.dlvyMthNm}</span><br>
<c:choose>
<c:when test="${0 == refundList.dlvyAmt}">
<span class="fs-13 fw-400">무료</span>
</c:when>
<c:otherwise>
<span class="fs-13 fw-400"><fmt:formatNumber value="${refundList.dlvyAmt}" pattern="#,###"/></span>
</c:otherwise>
</c:choose>
</td>
<c:set var="rePreOrdrDlvyInnb" value="${refundList.ordrDlvyInnb}"/>
<c:set var="reDlvyCnt" value="${reDlvyCnt + 1}"/>
</c:if>
</c:when>
<c:otherwise>
<td class="center">
<span class="fs-13 fw-400">${refundList.dlvyMthNm}</span><br>
<c:choose>
<c:when test="${0 == refundList.dlvyAmt}">
<span class="fs-13 fw-400">무료</span>
</c:when>
<c:otherwise>
<span class="fs-13 fw-400"><fmt:formatNumber value="${refundList.dlvyAmt}" pattern="#,###"/></span>
</c:otherwise>
</c:choose>
</td>
</c:otherwise>
</c:choose>
<td>
<button type="button" class="btn sm gray2 sub-right-content__innerTitleBtn" onclick="fn_goods_qna_pop_regist('<c:out value="${ refundList.goodsInnb }"/>')">문의</button>
</td>
<%---
<td>
<span class="cartItem__shippingFee"><span
class=" comma">3,000</span><span
class="priceUnit">원</span>
</span>
</td>
--%>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr class="row-no-data">
<td colspan="100%" class="text-center">조회된 데이터가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
<tfoot class="refundSum">
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle"><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 처리</h3>
<div class="table-wrapper orderDetail__table">
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 상태</th>
<td>
<c:choose>
<c:when test="${ not empty resultMap.result.refnd.returnProcsSttusCd }">
<c:out value="${ resultMap.result.refnd.returnProcsSttusCdNm }"/>
</c:when>
<c:otherwise>
<c:out value="${ resultMap.result.refnd.refundProcsSttusCdNm }"/>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<th><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 번호</th>
<td><c:out value="${ resultMap.result.refnd.orderRefundInnb }"/></td>
</tr>
<tr>
<th>환불 종류</th>
<td><c:out value="${ resultMap.result.refnd.refundTyCdNm }"/></td>
</tr>
<c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">
<tr>
<th>반품 접수일</th>
<td><c:out value="${ resultMap.result.refnd.returnRceptDt }"/></td>
</tr>
</c:if>
<tr>
<th>환불 접수일</th>
<td><c:out value="${ resultMap.result.refnd.refundReqstDt }"/></td>
</tr>
<c:if test = "${not empty resultMap.result.refnd.returnComptDt}">
<tr>
<th>반품 완료일</th>
<td><c:out value="${ resultMap.result.refnd.returnComptDt }"/></td>
</tr>
</c:if>
<c:if test = "${not empty resultMap.result.refnd.refundComptDt}">
<tr>
<th>환불 완료일</th>
<td><c:out value="${ resultMap.result.refnd.refundComptDt }"/></td>
</tr>
</c:if>
</tbody>
</table>
</div>
</div>
<c:if test="${ not empty resultMap.result.refnd.returnRceptDt }">
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle">반품정보
<c:if test="${ resultMap.result.refnd.returnProcsSttusCd eq '01' }">
<button id="returnInfoTrigger" class="btn sm gray2 sub-right-content__innerTitleBtn" onclick="fn_update_dlvy_info();">변경</button>
</c:if>
</h3>
<form id="returnDlvyUpdtForm">
<input type="hidden" name="orderReInnb" value="<c:out value="${ resultMap.result.refnd.orderRefundInnb }"/>"/>
<div id="returnInfoContent01" class="table-wrapper orderDetail__table">
<c:choose>
<c:when test="${ resultMap.result.refnd.returnProcsSttusCd eq '01' }">
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">회수방법</span>
</th>
<td>
<div class="select-box">
<select class="lg" title="해당 셀렉트에 대한 설명" name="returnMthCd">
<option value="" disabled selected>선택</option>
<c:forEach var="cdList" items="${ resultMap.returnMthCdList }" varStatus="status">
<c:choose>
<c:when test="${ resultMap.result.refnd.returnMthCd eq cdList.cd }">
<option value="<c:out value="${ cdList.cd }"/>" selected="selected"><c:out value="${ cdList.cdNm }"/></option>
</c:when>
<c:otherwise>
<option value="<c:out value="${ cdList.cd }"/>"><c:out value="${ cdList.cdNm }"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="editAccount__title">주소</span>
</th>
<td>
<div class="inputAddress">
<div class="inputAddress__postalCode">
<input class="input-text" type="text" id="postcode" name="zip" title="우편번호" value="<c:out value="${ resultMap.result.refnd.senderZip }"/>" placeholder="우편번호" readonly>
<button type="button" onclick="fn_select_postcode(fn_set_postcode); return false;" class="btn md theme outline">
우편번호 찾기
</button>
</div>
<input type="hidden" id="adresDvCd" name="adresDvCd" value="<c:out value="${ resultMap.result.refnd.senderAdresDvCd }"/>"/>
<input class="input-text full" type="text" id="address" name="lnbOrRnmAdres"
<c:choose>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '01' }">
value="<c:out value="${ resultMap.result.refnd.senderRnmAdres }"/>"
</c:when>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '02' }">
value="<c:out value="${ resultMap.result.refnd.senderLnbAdres }"/>"
</c:when>
</c:choose>
readonly title="지번 주소" placeholder="지번 주소">
<input class="input-text full" type="text" id="detailAddress" name="dtlAdres" value="<c:out value="${ resultMap.result.refnd.senderAdresDtl }"/>" title="상세 주소" placeholder="상세 주소">
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">휴대폰 번호</span>
</th>
<td>
<input class="input-text" type="text" title="해당 인풋에 대한 설명" value="<c:out value="${ resultMap.result.refnd.returnCstmrMbtlnb }"/>" name="returnCstmrMbtlnb" oninput="fn_fmt_telno($(this));" maxlength="13"
placeholder="">
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">반품 사유</span>
</th>
<td>
<div class="select-box">
<select class="lg" title="해당 셀렉트에 대한 설명" name="returnResnCd">
<c:forEach var="returnResn" items="${resultMap.returnResnList}">
<c:choose>
<c:when test="${ returnResn.cd eq resultMap.result.refnd.returnResnCd }">
<option value="<c:out value="${returnResn.cd}"/>" selected="selected"><c:out value="${returnResn.cdNm}"/></option>
</c:when>
<c:otherwise>
<option value="<c:out value="${returnResn.cd}"/>"><c:out value="${returnResn.cdNm}"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<textarea class="textarea" rows="6" title="해당 텍스트 에어리어에 대한 설명" name="returnResnCn"
placeholder="최소 10자 이상으로 입력해 주세요."><c:out value="${ resultMap.result.refnd.returnResnCn }"/></textarea>
</td>
</tr>
</tbody>
</table>
</c:when>
<c:otherwise>
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">회수방법</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnMthCdNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">주소</span>
</th>
<td>
<c:if test="${ not empty resultMap.result.refnd.senderZip }">
(<c:out value="${ resultMap.result.refnd.senderZip }"/>)
</c:if>
<c:choose>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '01'}">
<c:out value="${ resultMap.result.refnd.senderRnmAdres }"/>
</c:when>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '02'}">
<c:out value="${ resultMap.result.refnd.senderLnbAdres }"/>
</c:when>
</c:choose>
<c:out value="${ resultMap.result.refnd.senderAdresDtl }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">휴대폰 번호</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnCstmrMbtlnb }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">반품 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCdNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCn }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">배송비 입금</span>
</th>
<td>
<%--우리은행 1005-102-768159<br>(예금주: ㈜에스엘바이오텍)--%>
<c:if test="${ not empty resultMap.result.refnd.returnDlvyRcpmnyAcntnb }">
<c:out value="${ resultMap.result.refnd.returnDlvyRcpmnyAcntnb }"/><br>(예금주: <c:out value="${ resultMap.result.refnd.returnDlvyRcpmnyNm }"/>)
</c:if>
</td>
</tr>
</tbody>
</table>
</c:otherwise>
</c:choose>
</div>
</form>
</div>
</c:if>
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle">환불정보
<c:if test="${ resultMap.result.refnd.refundProcsSttusCd ne '03' }">
<button id="refundInfoTrigger" class="btn sm gray2 sub-right-content__innerTitleBtn" onclick="fn_update_acnt_info();">변경</button>
</c:if>
</h3>
<form id="refundAcntUpdtForm">
<input type="hidden" name="orderReInnb" value="<c:out value="${ resultMap.result.refnd.orderRefundInnb }"/>"/>
<div id="refundInfoContent01" class="table-wrapper orderDetail__table">
<c:choose>
<c:when test="${ resultMap.result.refnd.refundProcsSttusCd eq '03' }">
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">환불은행</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundAcntBnnkNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">예금주</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundAcntDpstrNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">계좌번호</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundAcntnb }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">취소 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCdNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCn }"/>
</td>
</tr>
</tbody>
</table>
</c:when>
<c:otherwise>
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">환불은행</span>
</th>
<td>
<%--
<input class="input-text" type="text" title="환불은행" value="<c:out value="${ resultMap.result.refnd.refundAcntBnnkNm }"/>" name="refundAcntBnnkNm"
placeholder="환불은행">
--%>
<div class="select-box">
<select class="sm" title="해당 셀렉트에 대한 설명" name="refundAcntBnnkNm" id="refundAcntBnnkNm">
<c:forEach var="cdList" items="${ resultMap.bankCdList }" varStatus="status">
<c:choose>
<c:when test="${ cdList.cd eq resultMap.result.refnd.refundAcntBnnkCd }">
<option value="<c:out value="${ cdList.cd }"/>,<c:out value="${ cdList.cdNm }"/>" selected="selected" ><c:out value="${ cdList.cdNm }"/></option>
</c:when>
<c:otherwise>
<option value="<c:out value="${ cdList.cd }"/>,<c:out value="${ cdList.cdNm }"/>" ><c:out value="${ cdList.cdNm }"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">예금주</span>
</th>
<td>
<input class="input-text" type="text" title="예금주명" value="<c:out value="${ resultMap.result.refnd.refundAcntDpstrNm }"/>" name="refundAcntDpstrNm"
placeholder="예금주명">
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">계좌번호</span>
</th>
<td><!-- TODO : 암호화 되어있어서 풀어줘야함 -->
<input class="input-text" type="text" title="계좌번호" value="<c:out value="${ resultMap.result.refnd.refundAcntnb }"/>" name="refundAcntnb"
placeholder="계좌번호 TODO : 암호화되어있는데 '-' 포함 or 숫자만 확인 필요">
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">환불사유내용</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundResnCn }"/>
</td>
</tr>
<%--
<tr>
<th>
<span class="orderDetail__thText">취소 사유</span>
</th>
<td>
<div class="select-box">
<select class="lg" title="해당 셀렉트에 대한 설명">
<option value="" disabled selected>선택</option>
<option value="">고객 단순 변심</option>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<textarea class="textarea" rows="6" title="해당 텍스트 에어리어에 대한 설명" name="refundResnCn"
placeholder="최소 10자 이상으로 입력해 주세요."><c:out value="${ resultMap.result.refnd.refundResnCn }"/></textarea>
</td>
</tr>
--%>
</tbody>
</table>
</c:otherwise>
</c:choose>
</div>
</form>
</div>
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle">환불 금액
</h3>
<div class="priceSum">
<c:set var="reTotAmt" value="${ resultMap.result.totRefundDscntAmt }"/>
<div class="priceSum__inner">
<div class="priceSum__item">
<span class="priceSum__itemTitle"><c:out value="${ reTotAmt.setleTyCdNm }"/></span>
<span class="priceSum__itemPrice">
<span class="comma priceSum__itemNum"><c:out value="${ reTotAmt.refundAmtQySum }"/></span>
<span class="priceUnit">원</span>
</span>
</div>
<div class="priceSum__equals">
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"
viewBox="0 0 28 28" fill="none">
<path d="M3.5 17.5H24.5V19.8333H3.5V17.5Z" fill="black" />
<path d="M3.5 8.16699H24.5V10.5003H3.5V8.16699Z" fill="black" />
</svg>
</div>
<div class="priceSum__total">
<span class="priceSum__totalTitle">환불 금액</span>
<div class="priceSum__totalPrice">
<span class="comma"><c:out value="${ reTotAmt.rlRefundAmt }"/></span>
<span class="priceUnit">원</span>
</div>
<div class="priceSum__totalDetail">
(상품금액 <span class="comma"><c:out value="${ reTotAmt.refundAmtQySum }"/></span>원 + 배송비 <span class="comma"><c:out value="${ reTotAmt.totReturnDlvyAmt }"/></span>원)
</div>
</div>
</div>
</div>
</div>
<!--
<div class="sub-bottom-btn-container">
<button type="button" class="btn xl outline theme" onclick="fn_order_refund_list();">반품 / 환불 목록</button>
</div>
-->
</div>
</div>
</div>
</div>
</main>
<form id="listForm">
<input type="hidden" id="orderRefundInnb" name ="orderRefundInnb"/>
<input type="hidden" id="pageIndex" name="pageIndex" value="${ paramVO.pageIndex }"/>
<input type="hidden" id="recordCountPerPage" name="recordCountPerPage" value="${ paramVO.recordCountPerPage }"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="${ paramVO.pageUnit }"/>
</form>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 모달 -->
<div id="modalDiv">
</div>
</body>
</html>

View File

@@ -0,0 +1,91 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<c:choose>
<c:when test="${not empty data.resultList}">
<c:forEach var="order" items="${data.resultList}" begin="0" end="4">
<div class="orderList__item">
<div class="orderList__item__inner">
<a href="<c:url value="/sopmal/goods/selectGoodsDtl?sopmalCd=${order.sopmalCd}&goodsInnb=${order.goodsInnb}"/>" class="orderList__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${ cdnurl }${order.goodsImageUrl}"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${order.goodsNm}"/>">
</a>
<div class="orderList__description">
<div class="orderList__description__first">
<div class="orderList__item__top">
<a href="javascript:void(0);" onclick="fn_go_ordr_dtl('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>');" class="orderList__orderNum"><c:out value="${order.ordrInnb}"/></a>
<span class="orderList__dot">·</span>
<span class="orderList__date"><c:out value="${order.ordrDt}"/> 주문</span>
</div>
<a href="javascript:void(0);" onclick="fn_go_ordr_dtl('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>');" class="orderList__productTitle"><c:out value="${order.goodsNm}"/></a>
<%--<span class="orderList__option"><c:out value="${order.optnNm}"/></span>--%>
<span class="cartItem__productOption"><span class="option-badge">옵션</span> <c:out value="${order.optnNm}"/></span>
<c:if test="${not empty order.inputOptnText}">
<span class="orderList__option"><c:out value="${order.inputOptnText}"/></span>
</c:if>
</div>
<div class="orderList__description__second">
<span class="orderList__price"><span class="comma"><fmt:formatNumber value="${order.setleAmt}" pattern="#,###"/></span>원</span>
</div>
<div class="orderList__description__third">
<span class="orderList__mileage"><span class="comma">예상적립 <fmt:formatNumber value="${order.mlgAmt}" pattern="#,###"/></span>원</span>
</div>
<div class="orderList__description__fourth">
<c:choose>
<c:when test="${order.ordrSttusCd > 14 && order.ordrSttusCd < 36}">
<span class="orderList__status"><c:out value="${order.ordrSttusNm}"/></span>
</c:when>
<c:when test="${order.ordrSttusCd > 39 && order.ordrSttusCd < 71}">
<span class="orderList__status delivery"><c:out value="${order.ordrSttusNm}"/></span>
</c:when>
<c:when test="${order.ordrSttusCd == 75}">
<span class="orderList__status complete"><c:out value="${order.ordrSttusNm}"/></span>
</c:when>
<c:when test="${order.ordrSttusCd > 84 && order.ordrSttusCd < 100}">
<span class="orderList__status cancel"><c:out value="${order.ordrSttusNm}"/></span>
</c:when>
</c:choose>
</div>
<%--
<div class="orderList__btnControls">
<c:choose>
<c:when test="${order.ordrSttusCd == 15}">
<a href="javascript:void(0);" onclick="fn_post_cancl_ordr('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>');" class="btn-ordr-sttus btn gray sm full">주문무효</a>
<a href="javascript:void(0);" onclick="fn_dlvylc_manage_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '<c:out value="${order.ordrDlvyInnb}"/>', '<c:out value="${order.mbrInnb}"/>', '<c:out value="${order.mbrDvCd}"/>');" class="btn-ordr-sttus btn outline sm full">배송지 변경</a>
</c:when>
<c:when test="${order.ordrSttusCd > 24 && order.ordrSttusCd < 36}">
<a href="javascript:void(0);" onclick="fn_call_setle_cancl_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '');" class="btn-ordr-sttus btn gray sm full">결제취소</a>
<a href="javascript:void(0);" onclick="fn_dlvylc_manage_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '<c:out value="${order.ordrDlvyInnb}"/>', '<c:out value="${order.mbrInnb}"/>', '<c:out value="${order.mbrDvCd}"/>');" class="btn-ordr-sttus btn outline sm full">배송지 변경</a>
</c:when>
<c:when test="${order.ordrSttusCd > 39 && order.ordrSttusCd < 66}">
<a href="javascript:void(0);" onclick="fn_call_dlvy_sweettracker_pop('<c:out value="${order.ordrInnb}"/>');" class="btn outline sm full">배송조회</a>
<a href="javascript:void(0);" onclick="fn_call_refund_pop('<c:out value="${order.ordrInnb}"/>');" class="btn-ordr-sttus btn gray sm full">반품신청</a>
</c:when>
<c:when test="${order.ordrSttusCd > 69 && order.ordrSttusCd < 76}">
<a href="javascript:void(0);" onclick="fn_call_dlvy_sweettracker_pop('<c:out value="${order.ordrInnb}"/>');" class="btn outline sm full">배송조회</a>
<a href="javascript:void(0);" onclick="fn_call_refund_pop('<c:out value="${order.ordrInnb}"/>');" class="btn-ordr-sttus btn gray sm full">반품신청</a>
<a href="<c:url value="/sopmal/mpage/act/selectMyRvwInqireForm"/>" class="btn-ordr-sttus btn outline sm full">리뷰작성</a>
<a href="javascript:void(0);" onclick="fn_post_purchs_dcsn_by_ordr('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>');" class="btn-ordr-sttus btn theme sm full">구매확정111</a>
</c:when>
</c:choose>
</div>
--%>
</div>
</div>
<a class="sub-right-content__more" href="/sopmal/mpage/ordr/selectMbrOrdrListInqire">전체보기</a>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="orderList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">주문내역이 없습니다.</p>
</div>
</c:otherwise>
</c:choose>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,120 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<c:choose>
<c:when test="${not empty data.resultList}">
<c:forEach var="order" items="${data.resultList}">
<div class="orderList__item">
<div class="orderList__item__inner">
<a href="<c:url value="/sopmal/goods/selectGoodsDtl?sopmalCd=${order.sopmalCd}&goodsInnb=${order.goodsInnb}"/>" class="orderList__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${ cdnurl }${order.goodsImageUrl}"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${order.goodsNm}"/>">
</a>
<div class="orderList__description">
<div class="orderList__description__first">
<div class="orderList__item__top">
<a href="javascript:void(0);" onclick="fn_go_ordr_dtl('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>');" class="orderList__orderNum"><c:out value="${order.ordrInnb}"/></a>
<span class="orderList__dot">·</span>
<span class="orderList__date"><c:out value="${order.ordrDt}"/> <span class="orderList__dot">·</span> ${order.ordrTyCdNm}</span>
</div>
<a href="javascript:void(0);" onclick="fn_go_ordr_dtl('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>');" class="orderList__productTitle"><c:out value="${order.goodsNm}"/></a>
<%--<span class="orderList__option"><c:out value="${order.optnNm}"/></span>--%>
<span class="cartItem__productOption"><span class="option-badge">옵션</span> <c:out value="${order.optnNm}"/></span>
<c:if test="${not empty order.inputOptnText}">
<span class="orderList__option"><c:out value="${order.inputOptnText}"/></span>
</c:if>
</div>
<div class="orderList__description__second">
<span class="orderList__price"><span class="comma"><fmt:formatNumber value="${order.setleAmt}" pattern="#,###"/></span>원</span>
</div>
<div class="orderList__description__third">
<c:if test = "${!(order.ordrSttusCd > 84 && order.ordrSttusCd < 100)}">
<span class="orderList__mileage"><span class="comma">예상적립 <fmt:formatNumber value="${order.mlgAmt}" pattern="#,###"/></span>원</span>
</c:if>
</div>
<div class="orderList__description__fourth">
<c:choose>
<c:when test="${order.ordrSttusCd > 14 && order.ordrSttusCd < 36}">
<span class="orderList__status"><c:out value="${order.ordrSttusNm}"/></span>
</c:when>
<c:when test="${order.ordrSttusCd > 39 && order.ordrSttusCd < 71}">
<span class="orderList__status delivery"><c:out value="${order.ordrSttusNm}"/></span>
</c:when>
<c:when test="${order.ordrSttusCd == 75}">
<span class="orderList__status complete"><c:out value="${order.ordrSttusNm}"/></span>
</c:when>
</c:choose>
<c:if test="${ order.ordrTyCd == '04'}">
<br/>
<c:choose>
<c:when test="${order.giftSttusCd == '01' }">
<span class="orderList__status">(<c:out value="${order.giftSttusCdNm}"/>)</span>
</c:when>
<c:when test="${order.giftSttusCd == '02' }">
<span class="orderList__status delivery">(<c:out value="${order.giftSttusCdNm}"/>)</span>
</c:when>
<c:when test="${order.giftSttusCd == '03' }">
<span class="orderList__status cancel">(<c:out value="${order.giftSttusCdNm}"/>)</span>
</c:when>
<c:when test="${order.giftSttusCd == '04' }">
<span class="orderList__status cancel">(<c:out value="${order.giftSttusCdNm}"/>)</span>
</c:when>
</c:choose>
</c:if>
</div>
<div class="orderList__btnControls">
<c:choose>
<c:when test="${order.ordrSttusCd == 15}">
<a href="javascript:void(0);" onclick="fn_post_cancl_ordr('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '<c:out value="${order.ordrSttusCd}"/>');" class="btn-ordr-sttus btn gray sm full">주문취소</a>
<c:if test="${ order.ordrTyCd != '05' }">
<a href="javascript:void(0);" onclick="fn_dlvylc_manage_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '<c:out value="${order.ordrDlvyInnb}"/>', '<c:out value="${order.mbrInnb}"/>', '<c:out value="${order.mbrDvCd}"/>');" class="btn-ordr-sttus btn outline sm full">배송지 변경</a>
</c:if>
</c:when>
<c:when test="${order.ordrSttusCd > 24 && order.ordrSttusCd < 34}">
<a href="javascript:void(0);" onclick="fn_call_setle_cancl_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '', '<c:out value="${order.ordrRceptDt}"/>', '<c:out value="${order.ordrSttusCd}"/>');" class="btn-ordr-sttus btn gray sm full">결제취소</a>
<c:if test="${ order.ordrTyCd != '05' }">
<a href="javascript:void(0);" onclick="fn_dlvylc_manage_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '<c:out value="${order.ordrDlvyInnb}"/>', '<c:out value="${order.mbrInnb}"/>', '<c:out value="${order.mbrDvCd}"/>');" class="btn-ordr-sttus btn outline sm full">배송지 변경</a>
</c:if>
</c:when>
<c:when test="${order.ordrSttusCd > 34 && order.ordrSttusCd < 55}">
<a href="javascript:void(0);" onclick="fn_call_dlvy_sweettracker_pop('<c:out value="${order.ordrInnb}"/>');" class="btn outline sm full">배송조회</a>
<a href="javascript:void(0);" onclick="fn_call_setle_cancl_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>', '', '<c:out value="${order.ordrRceptDt}"/>', '<c:out value="${order.ordrSttusCd}"/>');" class="btn-ordr-sttus btn gray sm full">결제취소</a>
</c:when>
<c:when test="${order.ordrSttusCd > 54 && order.ordrSttusCd < 76 && order.sknEnvrnCd ne 'POS'}">
<a href="javascript:void(0);" onclick="fn_call_dlvy_sweettracker_pop('<c:out value="${order.ordrInnb}"/>');" class="btn outline sm full">배송조회</a>
<c:if test="${ order.purchsDcsnAt eq 'Y' }">
<a href="javascript:void(0);" onclick="fn_call_refund_pop('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>','<c:out value="${order.ordrRceptDt}"/>', '<c:out value="${order.setleTyCd}"/>', '<c:out value="${order.ordrSttusCd}"/>');" class="btn-ordr-sttus btn gray sm full">반품신청</a>
</c:if>
<c:if test="${ order.reviewAt eq 'Y' }">
<a href="<c:url value="/sopmal/mpage/act/selectMyRvwInqireForm"/>" class="btn-ordr-sttus btn theme sm full">리뷰작성</a>
</c:if>
<c:if test="${ order.purchsDcsnAt eq 'Y' }">
<a href="javascript:void(0);" onclick="fn_post_purchs_dcsn_by_ordr('<c:out value="${order.sopmalCd}"/>', '<c:out value="${order.ordrInnb}"/>');" class="btn-ordr-sttus btn theme sm full">구매확정</a>
</c:if>
</c:when>
<c:when test="${order.ordrSttusCd > 84 && order.ordrSttusCd < 100}">
<a class="btn full orderList__status cancel" style="background-color:transparent;"><c:out value="${order.ordrSttusNm}"/></a>
</c:when>
</c:choose>
</div>
</div>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="orderList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">주문내역이 없습니다.</p>
</div>
</c:otherwise>
</c:choose>
<div class="pagination__container" style="margin-top: 20px">
<ui:pagination paginationInfo="${data.paginationInfo}" type="image" jsFunction="fn_get_ordr_dlvy_list"/>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,269 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<!-- 결제취소/환불정보 -->
<div id="refund-pop" class="modal default" style="max-width: 900px;">
<div class="modal-header">
<div class="modal-header__title">결제취소/환불정보</div>
</div>
<c:set var="order" value="${data.order}"/>
<div class="modal-content">
<div class="orderRefundPop">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<p class="orderRefundPop__orderNum">주문번호 <c:out value="${order.ordrInnb}"/></p>
<input type="hidden" id="sopmalCd" value="${order.sopmalCd}"/>
<input type="hidden" id="ordrInnb" value="${order.ordrInnb}"/>
<input type="hidden" id="ordrTyCd" value="${order.ordrTyCd}"/>
<input type="hidden" id="ordrSttusCd" value="${order.ordrSttusCd}"/>
<input type="hidden" id="isBank" value="${not empty order.bnnkNm ? 'Y' : 'N'}"/>
<input type="hidden" id="setleTyCd" value="${order.setleTyCd}"/> <!-- 결제유형 -->
<c:choose>
<c:when test="${'04' == order.ordrTyCd || '05' == order.ordrTyCd}">
<c:choose>
<c:when test="${not empty data.shippingList}">
<c:forEach var="shipping" items="${data.shippingList}" varStatus="status">
<div class="multiDeliveryStatus">
<p class="multiDeliveryStatus__title"><span class="multiDeliveryStatus__numTitle"><c:out value="${status.count > 1 ? status.count += '. ': ''}"/>배송지</span>
<c:out value="${shipping.recpntNm}"/> <c:out value="${not empty shipping.dlvylcZip ? '(' += shipping.dlvylcZip += ')' : ''}"/>
<c:out value="${shipping.adres}"/>
<c:out value="${shipping.dlvylcAdresDtl}"/>
<%--<em>2곳</em>--%>
</p>
</div>
<div class="cartOrder__list">
<h4 class="modalSectionTitle">주문상품 중 결제취소 가능 상품<span class="modalSectionTitle__sub">- 결제취소 시 상품과 수량을 선택하세요!(*결제확인 상태에서는 전체 취소만 가능합니다.)</span></h4>
<div class="table-wrapper">
<table class="table vertical orderRefundPop__table">
<caption>결제취소/환불정보</caption>
<colgroup>
<col style="width: auto;">
<col style="width: 80px">
<col style="width: 80px">
<col style="width: 120px">
<col style="width: 80px">
</colgroup>
<thead>
<tr>
<th>상품명</th>
<th>주문수량</th>
<th>취소가능수량</th>
<th>취소수량</th>
<th>처리상태</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${not empty shipping.goodsList}">
<c:forEach var="goods" items="${shipping.goodsList}" varStatus="status">
<tr class="cancl-goods">
<td>
<div class="cartItem">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" name="goodsCheck" value="" checked onclick="return false;">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
<div class="cartItem__image">
<img src="<c:out value="${ cdnurl }${goods.goodsImgCours}"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${goods.goodsNm}"/>">
</div>
<div class="cartItem__productInfo">
<a href="javascript:void(0);" class="cartItem__productTitle"><c:out value="${goods.goodsNm}"/></a>
<span class="cartItem__productOption"> <span class="option-badge">옵션</span><c:out value="${goods.optnNm}"/></span>
</div>
</div>
</td>
<td><c:out value="${goods.ordrQy}"/></td>
<td><c:out value="${goods.ordrQy - goods.setleCanclQy}"/></td>
<td>
<input type="hidden" class="sopmalCd" value="${goods.sopmalCd}"/>
<input type="hidden" class="ordrInnb" value="${goods.ordrInnb}"/>
<input type="hidden" class="ordrDlvyInnb" value="${shipping.ordrDlvyInnb}"/>
<input type="hidden" class="ordrGoodsInnb" value="${goods.ordrGoodsInnb}"/>
<input type="hidden" class="ordrGoodsOptnInnb" value="${goods.ordrGoodsOptnInnb}"/>
<input type="hidden" class="setleCanclQy" value="${goods.setleCanclQy}"/>
<input type="hidden" class="ordrQy" value="${goods.ordrQy}"/>
<input type="hidden" class="subscrptWthdrawPosblAt" value="${goods.subscrptWthdrawPosblAt}"/>
<input type="hidden" class="indvdlzCanclPosblAt" value="${goods.indvdlzCanclPosblAt}"/>
<input type="hidden" class="indvdlzReturnExchngPosblAt" value="${goods.indvdlzReturnExchngPosblAt}"/>
<div class="select-box">
<select class="canclQy" title="취소 수량" disabled>
<c:forEach var="item" begin="1" end="${goods.ordrQy - goods.setleCanclQy}" step="1" varStatus="status">
<option value="<c:out value="${status.count}"/>" <c:if test="${status.last}">selected</c:if>><c:out value="${status.count}"/></option>
</c:forEach>
</select>
</div>
</td>
<td>
<span class="orderList__status"><c:out value="${goods.ordrSttusNm}"/></span>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr><td colspan="100%" ><spring:message code="common.nodata"/></td></tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<div class="cartOrder__list">
<h4 class="modalSectionTitle">주문상품 중 결제취소 가능 상품<span class="modalSectionTitle__sub">- 결제취소 시 상품과 수량을 선택하세요!(*결제확인 상태에서는 전체 취소만 가능합니다.)</span></h4>
<div class="table-wrapper">
<table class="table vertical orderRefundPop__table">
<caption>결제취소/환불정보</caption>
<colgroup>
<col style="width: auto;">
<col style="width: 80px">
<col style="width: 80px">
<col style="width: 120px">
<col style="width: 80px">
</colgroup>
<thead>
<tr>
<th>상품명</th>
<th>주문수량</th>
<th>취소가능수량</th>
<th>취소수량</th>
<th>처리상태</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${not empty data.goodsList}">
<c:forEach var="goods" items="${data.goodsList}">
<tr class="cancl-goods">
<td>
<div class="cartItem">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" name="goodsCheck" value="" checked onclick="return false;">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
<div class="cartItem__image">
<img src="<c:out value="${ cdnurl }${goods.goodsImgCours}"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${goods.goodsNm}"/>">
</div>
<div class="cartItem__productInfo">
<a href="javascript:void(0);" class="cartItem__productTitle"><c:out value="${goods.goodsNm}"/></a>
<span class="cartItem__productOption"> <span class="option-badge">옵션</span><c:out value="${goods.optnNm}"/></span>
</div>
</div>
</td>
<td><c:out value="${goods.ordrQy}"/></td>
<td><c:out value="${goods.ordrQy - goods.setleCanclQy}"/></td>
<td>
<input type="hidden" class="sopmalCd" value="${goods.sopmalCd}"/>
<input type="hidden" class="ordrInnb" value="${goods.ordrInnb}"/>
<input type="hidden" class="ordrDlvyInnb" value="${goods.ordrDlvyInnb}"/>
<input type="hidden" class="ordrGoodsInnb" value="${goods.ordrGoodsInnb}"/>
<input type="hidden" class="ordrGoodsOptnInnb" value="${goods.ordrGoodsOptnInnb}"/>
<input type="hidden" class="ordrQy" value="${goods.ordrQy}"/>
<input type="hidden" class="subscrptWthdrawPosblAt" value="${goods.subscrptWthdrawPosblAt}"/>
<input type="hidden" class="indvdlzCanclPosblAt" value="${goods.indvdlzCanclPosblAt}"/>
<input type="hidden" class="indvdlzReturnExchngPosblAt" value="${goods.indvdlzReturnExchngPosblAt}"/>
<input type="hidden" class="indvdlzReturnExchngPosblAt" value="${goods.indvdlzReturnExchngPosblAt}"/>
<div class="select-box">
<select class="canclQy" title="취소 수량" disabled>
<c:forEach var="item" begin="1" end="${goods.ordrQy - goods.setleCanclQy}" step="1" varStatus="status">
<option value="<c:out value="${status.count}"/>" <c:if test="${status.last}">selected</c:if>><c:out value="${status.count}"/></option>
</c:forEach>
</select>
</div>
</td>
<td>
<span class="orderList__status"><c:out value="${goods.ordrSttusNm}"/></span>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr><td colspan="100%" ><spring:message code="common.nodata"/></td></tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
</div>
</c:otherwise>
</c:choose>
<p class="orderRefundReason__title">취소 사유를 선택해 주세요.</p>
<div class="orderRefundReason">
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">취소사유</div>
<div class="select-box">
<select name="returnResnCd" id="returnResnCd" class="lg" title="취소사유">
<option value="" selected>취소사유를 선택해 주세요.</option>
<c:forEach var="returnResn" items="${data.returnResnList}">
<option value="<c:out value="${returnResn.cd}"/>"><c:out value="${returnResn.cdNm}"/></option>
</c:forEach>
</select>
</div>
</div>
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">상세사유</div>
<textarea name="returnResnCn" id="returnResnCn" class="textarea" rows="6" title="상세사유" placeholder="최소 10자 이상으로 입력해 주세요."></textarea>
</div>
</div>
<c:if test="${not empty order.setleTyCd && ( order.setleTyCd eq '02' || order.setleTyCd eq '04' || order.setleTyCd eq '05' || order.setleTyCd eq '06' )}">
<p class="orderRefundReason__title">환불방법을 입력해 주세요</p>
<div class="orderRefundReason">
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">은행</div>
<div class="select-box">
<select class="sm" title="해당 셀렉트에 대한 설명" name="refundAcntBnnkNm" id="refundAcntBnnkNm">
<c:forEach var="cdList" items="${ data.bankCdList }" varStatus="status">
<option value="<c:out value="${ cdList.cd }"/>,<c:out value="${ cdList.cdNm }"/>" ><c:out value="${ cdList.cdNm }"/></option>
</c:forEach>
</select>
</div>
<%--<input type="text" name="refundAcntBnnkNm" id="refundAcntBnnkNm" class="input-text lg" title="은행" placeholder="환불 은행을 입력해 주세요." maxlength="20">--%>
<div class="orderRefundReason__itemTitle">예금주</div>
<input type="text" name="refundAcntDpstrNm" id="refundAcntDpstrNm" class="input-text lg" title="예금주" placeholder="예금주 이름을 입력해 주세요." maxlength="20">
<div class="orderRefundReason__itemTitle">계좌번호</div>
<input type="text" name="refundAcntnb" id="refundAcntnb" class="input-text lg" value="" title="계좌번호" placeholder="계좌번호를 입력해 주세요." maxlength="50">
</div>
</div>
</c:if>
<div class="infoBox">
<h6 class="infoBox__title">최초 배송비</h6>
<p class="infoBox__paragraph">부분 결제 취소 시 추가 배송비가 발생할 수 있으며, 이 때 추가 배송비를 결제해 주셔야만 결제취소 처리완료가 가능합니다.
</p>
<h6 class="infoBox__title">[추가 배송비가 발생하는 경우]</h6>
<ol class="infoBox__list">
<li>① ‘묶음배송비’ 상품의 배송비 무료(금액별 차등) 조건을 충족하여 배송비 무료</li>
<li>② 부분 결제취소로 배송비 무료 조건을 불충족하는 경우 추가 배송비 부과</li>
<li>③ 추가 배송비는 카드 또는 마일리지로 결제 가능</li>
</ol>
<h6 class="infoBox__title">유의사항</h6>
<ol class="infoBox__list">
<li>① 결제확인 상태에서는 전체 취소만 가능합니다.</li>
</ol>
</div>
</div>
</div>
<div class="modal-footer">
<a href="javascript:void(0);" rel="modal:close" class="btn large outline">닫기</a>
<a href="javascript:void(0);" id="btnSetleCancl" class="btn large gray2">결제취소</a>
</div>
</div>

View File

@@ -0,0 +1,534 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<script>
$(document).ready(function() {
$('select').niceSelect();
fn_ctrl_refund_resn_cd();
fn_ctrl_retrun_mth();
fn_ctrl_return_dlvy_mth();
$('#returnResnCd').on('change', function() {
fn_ctrl_refund_resn_cd();
});
});
</script>
<!-- 반품/환불 -->
<div id="return-pop" class="modal default" style="max-width: 900px;">
<div class="modal-header">
<div class="modal-header__title">반품/환불정보</div>
</div>
<c:set var="order" value="${data.order}"/>
<div class="modal-content">
<div class="orderRefundPop">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<p class="orderRefundPop__orderNum">주문번호 <c:out value="${order.ordrInnb}"/></p>
<input type="hidden" id="sopmalCd" value="${order.sopmalCd}"/>
<input type="hidden" id="ordrInnb" value="${order.ordrInnb}"/>
<input type="hidden" id="ordrTyCd" value="${order.ordrTyCd}"/>
<input type="hidden" id="ordrSttusCd" value="${order.ordrSttusCd}"/>
<input type="hidden" id="isBank" value="${not empty order.bnnkNm ? 'Y' : 'N'}"/>
<input type="hidden" id="setleTyCd" value="${order.setleTyCd}"/> <!-- 결제유형 -->
<input type="hidden" id="totalRlDlvyAmt" value=""/>
<input type="hidden" id="dlvyDwldCouponInnbArr" value=""/>
<c:forEach var="shipping" items="${data.shippingList}" varStatus="status">
<c:if test="${ status.first }">
<c:set var="defaultReturnAdress" value="${ shipping }"/>
</c:if>
</c:forEach>
<c:set var="totalRlDlvyAmt" value="0" />
<c:choose>
<c:when test="${'04' == order.ordrTyCd || '05' == order.ordrTyCd}">
<c:choose>
<c:when test="${not empty data.shippingList}">
<c:forEach var="shipping" items="${data.shippingList}" varStatus="status">
<div class="multiDeliveryStatus">
<p class="multiDeliveryStatus__title"><span class="multiDeliveryStatus__numTitle"><c:out value="${status.count > 1 ? status.count += '. ': ''}"/>배송지</span>
<c:out value="${shipping.recpntNm}"/> <c:out value="${not empty shipping.dlvylcZip ? '(' += shipping.dlvylcZip += ')' : ''}"/>
<c:out value="${shipping.adres}"/>
<c:out value="${shipping.dlvylcAdresDtl}"/>
<c:set var="shippingIndex" value="${status.index}"/>
<%--<em>2곳</em>--%>
<c:set var="totalRlDlvyAmt" value="${totalRlDlvyAmt + shipping.rlDlvyAmt}" />
<input type="hidden" name="rlDlvyAmt${shippingIndex}" value="${shipping.rlDlvyAmt}"/>
<input type="hidden" name="dlvyDwldCouponInnb${shippingIndex}" value="${ shipping.dlvyDwldCouponInnb }"/>
<%--<input type="text" name="rlDlvyAmt" value="${ totalRlDlvyAmt }"/>--%>
</p>
</div>
<div class="cartOrder__list">
<h4 class="modalSectionTitle">주문상품 중 반품/환불신청 가능 상품<span class="modalSectionTitle__sub">- 반품/환불신청 시 상품과 수량을 선택하세요!</span></h4>
<div class="table-wrapper">
<table class="table vertical orderRefundPop__table">
<caption>결제취소/환불정보</caption>
<colgroup>
<col style="width: auto;">
<col style="width: 80px">
<col style="width: 80px">
<col style="width: 120px">
<col style="width: 80px">
</colgroup>
<thead>
<tr>
<th>
상품명
<input type="hidden" class="checkAll" id="checkAll${shippingIndex}" data-index="${shippingIndex}">
</th>
<th>주문수량</th>
<th>취소가능수량</th>
<th>취소수량</th>
<th>처리상태</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${not empty shipping.goodsList}">
<c:forEach var="goods" items="${shipping.goodsList}" varStatus="status">
<tr class="cancl-goods">
<td>
<div class="cartItem">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" name="goodsCheck" class="checkbox${shippingIndex} goodsCheck${shippingIndex}" value="" onclick="fn_ctr_pCheckbox('#checkAll${shippingIndex}', '.checkbox${shippingIndex}'); calculateTotal();">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
<div class="cartItem__image">
<img src="<c:out value="${ cdnurl }${goods.goodsImgCours}"/>" onerror="this.src='<c:url value="/mngr/images/image_placeholder.png"/>" alt="<c:out value="${goods.goodsNm}"/>">
</div>
<div class="cartItem__productInfo">
<a href="javascript:void(0);" class="cartItem__productTitle"><c:out value="${goods.goodsNm}"/></a>
<span class="cartItem__productOption"> <span class="option-badge">옵션</span><c:out value="${goods.optnNm}"/></span>
</div>
</div>
</td>
<td><c:out value="${goods.ordrQy}"/></td>
<td><c:out value="${goods.ordrQy - goods.setleCanclQy}"/></td>
<td>
<input type="hidden" class="sopmalCd" value="${goods.sopmalCd}"/>
<input type="hidden" class="ordrInnb" value="${goods.ordrInnb}"/>
<input type="hidden" class="ordrDlvyInnb" value="${shipping.ordrDlvyInnb}"/>
<input type="hidden" class="ordrGoodsInnb" value="${goods.ordrGoodsInnb}"/>
<input type="hidden" class="ordrGoodsOptnInnb" value="${goods.ordrGoodsOptnInnb}"/>
<input type="hidden" class="setleCanclQy" value="${goods.setleCanclQy}"/>
<input type="hidden" class="ordrQy" value="${goods.ordrQy}"/>
<input type="hidden" class="subscrptWthdrawPosblAt" value="${goods.subscrptWthdrawPosblAt}"/>
<input type="hidden" class="indvdlzCanclPosblAt" value="${goods.indvdlzCanclPosblAt}"/>
<input type="hidden" class="indvdlzReturnExchngPosblAt" value="${goods.indvdlzReturnExchngPosblAt}"/>
<div class="select-box">
<select class="canclQy" title="취소 수량">
<option value="" selected>선택</option>
<c:forEach var="item" begin="1" end="${goods.ordrQy - goods.setleCanclQy}" step="1" varStatus="status">
<option value="<c:out value="${status.count}"/>"><c:out value="${status.count}"/></option>
</c:forEach>
</select>
</div>
</td>
<td>
<span class="orderList__status"><c:out value="${goods.ordrSttusNm}"/></span>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr><td colspan="100%" ><spring:message code="common.nodata"/></td></tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<div class="cartOrder__list">
<h4 class="modalSectionTitle">주문상품 중 반품/환불신청 가능 상품<span class="modalSectionTitle__sub">- 반품/환불신청 시 상품과 수량을 선택하세요!</span></h4>
<div class="table-wrapper">
<table class="table vertical orderRefundPop__table">
<caption>결제취소/환불정보</caption>
<colgroup>
<col style="width: auto;">
<col style="width: 80px">
<col style="width: 80px">
<col style="width: 120px">
<col style="width: 80px">
</colgroup>
<thead>
<tr>
<th>상품명</th>
<th>주문수량</th>
<th>취소가능수량</th>
<th>취소수량</th>
<th>처리상태</th>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${not empty data.goodsList}">
<c:forEach var="goods" items="${data.goodsList}" varStatus="status">
<tr class="cancl-goods">
<td>
<div class="cartItem">
<c:if test="${ status.index eq 0 }">
<input type="hidden" id="singleReDlvyAmt" value="${ goods.rlDlvyAmt }"/>
<input type="hidden" id="dlvyDwldCouponInnb" value="${ goods.dlvyDwldCouponInnb }"/>
</c:if>
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" name="goodsCheck" value="">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
<div class="cartItem__image">
<img src="<c:out value="${ cdnurl }${goods.goodsImgCours}"/>" onerror="this.src='<c:url value="/mngr/images/image_placeholder.png"/>" alt="<c:out value="${goods.goodsNm}"/>">
</div>
<div class="cartItem__productInfo">
<a href="javascript:void(0);" class="cartItem__productTitle"><c:out value="${goods.goodsNm}"/></a>
<span class="cartItem__productOption"> <span class="option-badge">옵션</span><c:out value="${goods.optnNm}"/></span>
</div>
</div>
</td>
<td><c:out value="${goods.ordrQy}"/></td>
<td><c:out value="${goods.ordrQy - goods.setleCanclQy}"/></td>
<td>
<input type="hidden" class="goodsDwldCouponInnb" value="${ goods.goodsDwldCouponInnb }"/>
<input type="hidden" class="sopmalCd" value="${goods.sopmalCd}"/>
<input type="hidden" class="ordrInnb" value="${goods.ordrInnb}"/>
<input type="hidden" class="ordrDlvyInnb" value="${goods.ordrDlvyInnb}"/>
<input type="hidden" class="ordrGoodsInnb" value="${goods.ordrGoodsInnb}"/>
<input type="hidden" class="ordrGoodsOptnInnb" value="${goods.ordrGoodsOptnInnb}"/>
<input type="hidden" class="ordrQy" value="${goods.ordrQy}"/>
<input type="hidden" class="subscrptWthdrawPosblAt" value="${goods.subscrptWthdrawPosblAt}"/>
<input type="hidden" class="indvdlzCanclPosblAt" value="${goods.indvdlzCanclPosblAt}"/>
<input type="hidden" class="indvdlzReturnExchngPosblAt" value="${goods.indvdlzReturnExchngPosblAt}"/>
<input type="hidden" class="indvdlzReturnExchngPosblAt" value="${goods.indvdlzReturnExchngPosblAt}"/>
<div class="select-box">
<select class="canclQy" title="취소 수량">
<option value="" selected>선택</option>
<c:forEach var="item" begin="1" end="${goods.ordrQy - goods.setleCanclQy}" step="1" varStatus="status">
<option value="<c:out value="${status.count}"/>"><c:out value="${status.count}"/></option>
</c:forEach>
</select>
</div>
</td>
<td>
<span class="orderList__status"><c:out value="${goods.ordrSttusNm}"/></span>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr><td colspan="100%" ><spring:message code="common.nodata"/></td></tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
</div>
</c:otherwise>
</c:choose>
<p class="orderRefundReason__title">취소 사유를 선택해 주세요.</p>
<div class="orderRefundReason">
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">취소사유</div>
<div class="select-box">
<select name="returnResnCd" id="returnResnCd" class="lg" title="취소사유">
<option value="" selected>취소사유를 선택해 주세요.</option>
<c:forEach var="returnResn" items="${data.returnResnList}">
<option value="<c:out value="${returnResn.cd}"/>" data-cddv="<c:out value="${ returnResn.cdDv }"/>" ><c:out value="${returnResn.cdNm}"/></option>
</c:forEach>
</select>
</div>
</div>
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">상세사유</div>
<textarea name="returnResnCn" id="returnResnCn" class="textarea" rows="6" title="상세사유" placeholder="최소 10자 이상으로 입력해 주세요."></textarea>
</div>
</div>
<p class="orderRefundReason__title">연락처</p>
<div class="cartOrder__list">
<div class="table-wrapper">
<table class="table vertical orderRefundPop__table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th>구매자</th>
<th>휴대폰
<c:set var="firstPart" value="${ fn:substring(order.ordrrMbtlnb, 0, 2)}" />
<c:set var="middlePart" value="${ fn:substring(order.ordrrMbtlnb, 4, 8)}" />
<c:set var="lastPart" value="${ fn:substring(order.ordrrMbtlnb, 9, 13)}" />
</th>
<%--
<th>연락처 ${order.ordrrTelnb}
<c:set var="firstPartTel" value="${ fn:substring(order.ordrrTelnb, 0, 2)}" />
<c:set var="middlePartTel" value="${ fn:substring(order.ordrrTelnb, 4, 8)}" />
<c:set var="lastPartTel" value="${ fn:substring(order.ordrrTelnb, 9, 12)}" />
</th>
--%>
</tr>
</thead>
<tbody>
<tr>
<td>
${order.mbrNm}
<input type="hidden" name="" value="${ order.mbrNm }"/>
</td>
<td>
<div class="inputEmail">
<div class="select-box">
<select class="short2" title="해당 셀렉트에 대한 설명" name="returnCstmrMbtlnb">
<option value="010" <c:if test="${firstPart eq '010'}">selected</c:if>>010</option>
<option value="011" <c:if test="${firstPart eq '011'}">selected</c:if>>011</option>
</select>
</div>
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${middlePart}" title="해당 인풋에 대한 설명" name="returnCstmrMbtlnb" maxlength="4">
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${lastPart}" title="해당 인풋에 대한 설명" name="returnCstmrMbtlnb" maxlength="4">
</div>
</td>
<%--
<td>
<div class="inputEmail">
<div class="select-box">
<select class="short2" title="해당 셀렉트에 대한 설명">
<option value="02" <c:if test="${firstPartTel eq '02'}">selected</c:if>>서울 02</option>
<option value="031" <c:if test="${firstPartTel eq '031'}">selected</c:if>>경기도 031</option>
</select>
</div>
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${middlePartTel}" title="해당 인풋에 대한 설명">
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${lastPartTel}" title="해당 인풋에 대한 설명">
</div>
</td>
--%>
</tr>
</tbody>
</table>
</div>
</div>
<%--
<p class="orderRefundReason__title">연락처</p>
<div class="signUp__inputBox__item">
<div class="inputEmail">
<div class="select-box">
<select name="domain" title="이메일 자동발송 발신주소" onchange="fn_set_domain(this.value);">
<option value="naver.com" >naver.com</option>
<option value="hanmail.net" >hanmail.net</option>
</select>
</div>
<span class="mx-3 fs-16">-</span>
<input class="input-text xsm" type="text" id="id" title="이메일 id" placeholder="이메일" maxlength="25">
<span class="mx-3 fs-16">-</span>
<input class="input-text xsm" type="text" id="domain" title="이메일 domain" maxlength="25">
</div>
</div>
<p class="orderRefundReason__title">연락처</p>
<div class="orderRefundReason">
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">구매자<br/></div>
<div class="orderRefundReason__itemTitle">
<input class="input-text" type="text" title="구매자" placeholder="구매자" id="" name="" value="${order.mbrNm}" readonly>
</div>
<div class="orderRefundReason__itemTitle">휴대폰<br/></div>
<div class="orderRefundReason__itemTitle">
<div class="select-box">
<select class="short2" title="해당 셀렉트에 대한 설명" name="returnCstmrMbtlnb">
<option value="010" <c:if test="${firstPart eq '010'}">selected</c:if>>010</option>
<option value="011" <c:if test="${firstPart eq '011'}">selected</c:if>>011</option>
</select>
</div>
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${middlePart}" title="해당 인풋에 대한 설명" name="returnCstmrMbtlnb">
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${lastPart}" title="해당 인풋에 대한 설명" name="returnCstmrMbtlnb">
</div>
<div class="orderRefundReason__itemTitle">연락처<br/></div>
<div class="orderRefundReason__itemTitle">
<div class="select-box">
<select class="short2" title="해당 셀렉트에 대한 설명" name="returnCstmrMbtlnb">
<option value="010" <c:if test="${firstPart eq '010'}">selected</c:if>>010</option>
<option value="011" <c:if test="${firstPart eq '011'}">selected</c:if>>011</option>
</select>
</div>
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${middlePart}" title="해당 인풋에 대한 설명" name="returnCstmrMbtlnb">
<span class="mx-3 fs-16">-</span>
<input type="text" class="input-text xsm" value="${lastPart}" title="해당 인풋에 대한 설명" name="returnCstmrMbtlnb">
</div>
</div>
</div>
--%>
<p class="orderRefundReason__title">반품 방법을 선택해 주세요.(반송주소 : <c:out value="${ data.returnAddress }"/> )</p>
<div class="orderRefundReason">
<div class="custom-radio-container">
<c:forEach var="cdList" items="${ data.returnMthCdList }" varStatus="status">
<div class="custom-radio is-medium">
<input type="radio" id="${ cdList.cdNm }${cdList.cd}" name="returnMthCd" value="${ cdList.cd }" <c:if test="${ cdList.cd eq '02' }">checked="checked"</c:if> onclick="fn_ctrl_retrun_mth();">
<label for="${ cdList.cdNm }${cdList.cd}">${ cdList.cdNm }</label>
</div>
</c:forEach>
</div>
<br/>
<div class="orderRefundReason__item addressSelectDiv">
<div class="orderRefundReason__itemTitle">배송지 주소<br/></div>
<div class="orderRefundReason__itemTitle">
<input class="input-text" type="text" title="해당 인풋에 대한 설명" placeholder="우편번호" id="senderZip" name="senderZip" readonly>
<input type="hidden" id="senderAdresDvCd" name="senderAdresDvCd" value=""/>
<button type="button" class="btn md theme outline" onclick="fn_select_postcode(fn_set_postcode_popup); return false;">우편번호 찾기</button><br>
</div>
<div class="orderRefundReason__itemTitle">
<input type="text" id="senderRnmAdres" name="senderRnmAdres" class="input-text lg" title="도로명 주소" placeholder="도로명 주소" maxlength="20" readonly>
</div>
<div class="orderRefundReason__itemTitle">
<input type="text" name="senderLnbAdres" id="senderLnbAdres" class="input-text lg" title="지번주소" placeholder="지번주소" maxlength="20" readonly>
</div>
<div class="orderRefundReason__itemTitle">상세 주소<br/></div>
<div class="orderRefundReason__itemTitle">
<input type="text" name="senderAdresDtl" id="senderAdresDtl" class="input-text lg" value="" title="상세 주소" placeholder="상세 주소" maxlength="50">
</div>
</div>
</div>
<c:if test="${not empty order.setleTyCd && ( order.setleTyCd eq '02' || order.setleTyCd eq '04' || order.setleTyCd eq '05' || order.setleTyCd eq '06' )}">
<p class="orderRefundReason__title">환불방법을 입력해 주세요</p>
<div class="orderRefundReason">
<div class="orderRefundReason__item">
<div class="orderRefundReason__itemTitle">은행</div>
<div class="select-box">
<select class="sm" title="해당 셀렉트에 대한 설명" name="refundAcntBnnkNm" id="refundAcntBnnkNm">
<c:forEach var="cdList" items="${ data.bankCdList }" varStatus="status">
<option value="<c:out value="${ cdList.cd }"/>,<c:out value="${ cdList.cdNm }"/>" ><c:out value="${ cdList.cdNm }"/></option>
</c:forEach>
</select>
</div>
<%--<input type="text" name="refundAcntBnnkNm" id="refundAcntBnnkNm" class="input-text lg" title="은행" placeholder="환불 은행을 입력해 주세요." maxlength="20">--%>
<div class="orderRefundReason__itemTitle">예금주</div>
<input type="text" name="refundAcntDpstrNm" id="refundAcntDpstrNm" class="input-text lg" title="예금주" placeholder="예금주 이름을 입력해 주세요." maxlength="20">
<div class="orderRefundReason__itemTitle">계좌번호</div>
<input type="text" name="refundAcntnb" id="refundAcntnb" class="input-text lg" value="" title="계좌번호" placeholder="계좌번호를 입력해 주세요." maxlength="50">
</div>
</div>
</c:if>
<p class="orderRefundReason__title returnDlvyAcntnbArea">배송비 결제방법을 선택해주세요.</p>
<div class="cartOrder__list returnDlvyAcntnbArea">
<div class="form-control-container mb-20">
<div class="left">
<div class="select-box">
<select class="lg" title="반품 배송비 결제방법" id="returnDlvyPymntTyCd" name="returnDlvyPymntTyCd" onchange="fn_ctrl_return_dlvy_mth();">
<option value="" disabled selected>반품 배송비 결제방법을 선택해 주세요.</option>
<c:forEach var="cdList" items="${data.returnMtcCdList}">
<option value="<c:out value="${cdList.cd}"/>" ><c:out value="${cdList.cdNm}"/></option>
</c:forEach>
</select>
</div>
</div>
<div class="center">
</div>
<div class="right">
</div>
</div>
<div class="table-wrapper" id="returnMtcDiv">
<table class="table vertical tight">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 50%;">
<col style="width: auto;">
</colgroup>
<thead>
<tr>
<th>은행</th>
<th>입금자명</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="select-box">
<select class="full" title="해당 셀렉트에 대한 설명" name="returnAcntBnnkNm" id="returnAcntBnnkNm">
<option value="" selected disabled>선택</option>
<c:forEach items="${ data.bankAccount }" var="bankAccount" varStatus="status">
<option value="<c:out value="${ bankAccount.acntnb }"/>"><c:out value="${ bankAccount.dpstrNm }"/> <c:out value="${ bankAccount.acntnb }"/></option>
</c:forEach>
</select>
</div>
</td>
<td>
<input type="text" class="input-text full" value="" name="returnAcntDpstrNm" id="returnAcntDpstrNm" title="입금자명">
</td>
</tr>
</tbody>
</table>
<%--<p class="fyi fs-13 mt-5 gray-7">환불 금액을 입력할 환불 계좌 정보입니다. 결제 수단이 무통장, 가상 계좌인 경우 결제 금액은 관리자가 수동으로 입금해주세요.--%>
</p>
</div>
</div>
<div class="infoBox">
<h6 class="infoBox__title">최초 배송비</h6>
<p class="infoBox__paragraph">부분 결제 취소 시 추가 배송비가 발생할 수 있으며, 이 때 추가 배송비를 결제해 주셔야만 결제취소 처리완료가 가능합니다.
</p>
<h6 class="infoBox__title">[추가 배송비가 발생하는 경우]</h6>
<ol class="infoBox__list">
<li>① ‘묶음배송비’ 상품의 배송비 무료(금액별 차등) 조건을 충족하여 배송비 무료</li>
<li>② 부분 결제취소로 배송비 무료 조건을 불충족하는 경우 추가 배송비 부과</li>
<li>③ 추가 배송비는 카드 또는 마일리지로 결제 가능</li>
</ol>
<h6 class="infoBox__title">유의사항</h6>
<ol class="infoBox__list">
<li>① 결제확인 상태에서는 전체 취소만 가능합니다.</li>
</ol>
</div>
</div>
</div>
<div class="modal-footer">
<a href="javascript:void(0);" rel="modal:close" class="btn large outline">닫기</a>
<a href="javascript:void(0);" id="btnReturnRegist" class="btn large gray2">반품/환불 신청</a>
</div>
</div>
<script>
let dlvylcZip = '${ defaultReturnAdress.dlvylcZip }';
let dlvylcAdresDvCd = '${ defaultReturnAdress.dlvylcAdresDvCd }';
let dlvylcRnmAdres = '${ defaultReturnAdress.dlvylcRnmAdres }';
let dlvylcLnbAdres = '${ defaultReturnAdress.dlvylcLnbAdres }';
let dlvylcAdresDtl = '${ defaultReturnAdress.dlvylcAdresDtl }';
$(document).ready(function() {
$('input[name="senderZip"]').val(dlvylcZip);
$('input[name="senderAdresDvCd"]').val(dlvylcAdresDvCd);
$('input[name="senderRnmAdres"]').val(dlvylcRnmAdres);
$('input[name="senderLnbAdres"]').val(dlvylcLnbAdres);
$('input[name="senderAdresDtl"]').val(dlvylcAdresDtl);
});
</script>

View File

@@ -0,0 +1,916 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireRForm.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
fn_start_display();
});
/******************************************************************
* 시작 화면 제어
******************************************************************/
const fn_start_display = function() {
}
/*********************************************************************
* 반품/환불 목록 이동
* *******************************************************************/
const fn_order_refund_list = function() {
$('#listForm').attr('action', '<c:url value="/sopmal/mpage/ordr/selectRtngudCanclRefndForm"/>');
$('#listForm').attr('method', 'post');
$('#listForm').submit();
}
/*********************************************************************
* 반품 주소 변경
* *******************************************************************/
const fn_update_dlvy_info = function () {
const data = $('#returnDlvyUpdtForm').serializeArray();
if (confirm('반품 배송지 정보를 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/mpage/ordr/updateRtngudCanclRefndUpdt"/>',
data: data,
success: function (result) {
alert('<spring:message code="success.common.update"/>');
location.reload();
}
});
}
}
/*********************************************************************
* 환불 계좌 정보 변경
* *******************************************************************/
const fn_update_acnt_info = function () {
const data = $('#refundAcntUpdtForm').serialize();
if (confirm('환불 계좌 정보를 <spring:message code="confirm.common.update"/>')) {
$.ajax({
type: 'POST',
url: '<c:url value="/sopmal/mpage/ordr/updateRtngudCanclRefndUpdt"/>',
data: data,
success: function (result) {
alert('<spring:message code="success.common.update"/>');
location.reload();
}
});
}
}
/* ********************************************************
* 우편번호 찾기
******************************************************** */
const fn_set_postcode = function(data) {
$('#postcode').val(data.postcode);
$('#adresDvCd').val(data.addressType);
if (data.addressType == '02') {
$('#address').val(data.jibunAddress);
} else if (data.addressType == '01') {
$('#address').val(data.roadAddress);
}
}
/**
* 반품 상품 QNA 문의 팝업
* @param goodsInnb
*/
const fn_goods_qna_pop_regist = (goodsInnb) => {
$.ajax({
type: "post",
data: {
authDv: "REGIST",
reqUrl: "modal",
bbsId: "goods_qna",
goodsInnb: goodsInnb,
listAt: "list",
},
url: "/sopmal/csc/selectBbscttAuth",
success: function (data) {
/*모달중복제거*/
fn_close_modal("qna-pop-regist");
fn_close_modal("qna-update-pop");
$("#modalDiv").html(data);
$("#qna-pop-regist").modal();
}
});
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title"><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 내역</h3>
<div class="sub-right-content__section">
<h3 class="orderDetail__title"><c:out value="${ resultMap.result.refnd.registDt }"/>
<span class="orderDetail__titleNum">
<c:choose>
<c:when test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">
반품번호
</c:when>
<c:otherwise>
환불번호
</c:otherwise>
</c:choose>
<c:out value="${ resultMap.result.refnd.orderRefundInnb }"/>
</span>
</h3>
<div class="cartOrder__list">
<div class="table-wrapper">
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: auto;">
<col style="width: 40px;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 10%;">
<col style="width: 7%;">
</colgroup>
<thead>
<tr>
<th>상품명</th>
<th>수량</th>
<th>상품금액</th>
<th>할인금액</th>
<th>할인적용금액</th>
<th>환불신청수량</th>
<th>배송비</th>
<th>문의</th>
</tr>
</thead>
<tbody>
<c:set var="rePreOrdrDlvyInnb" value="0"/>
<c:set var="reDlvyCnt" value="1"/>
<c:choose>
<c:when test="${ not empty resultMap.result.itemsList }">
<c:forEach var="refundList" items="${ resultMap.result.itemsList }" varStatus="status">
<tr>
<td>
<div class="cartItem">
<div class="cartItem__image">
<a href="<c:url value="/sopmal/goods/selectGoodsDtl?sopmalCd=${refundList.sopmalCd}&goodsInnb=${refundList.goodsInnb}"/>" class="orderList__image">
<img src="<c:out value="${ cdnurl }"/><c:out value="${ refundList.img }"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${refundList.goodsNm}"/>">
</a>
</div>
<div class="cartItem__productInfo">
<a href="" class="cartItem__productTitle">
<c:out value="${ refundList.goodsNm }"/>
</a>
<c:if test="${ not empty refundList.optnNm }">
<span class="cartItem__productOption">
<span class="option-badge">옵션</span>
<c:out value="${ refundList.optnNm }"/>
</span>
</c:if>
(<c:out value="${ refundList.dlvylcZip }"/>)
<c:choose>
<c:when test="${ refundList.dlvylcAdresDvCd eq '01' }">
<c:out value="${ refundList.dlvylcRnmAdres }"/>
</c:when>
<c:when test="${ refundList.dlvylcAdresDvCd eq '02' }">
<c:out value="${ refundList.dlvylcLnbAdres }"/>
</c:when>
</c:choose>
<c:out value="${ refundList.dlvylAdresDtl }"/>
</div>
</div>
</td>
<td>
<span><c:out value="${ refundList.ordrQy }"/></span>
</td>
<td>
<span class="cartItem__normalPrice"><span
class=" comma"><c:out value="${ refundList.slepric }"/></span><span
class="priceUnit">원</span>
</span>
</td>
<td>
<span class="cartItem__discountPrice"><span
class="cartItem__discountMinus">(-)</span><span
class="comma"><c:out value="${ refundList.dscntAmt }"/></span><span
class="priceUnit">원</span>
</span>
</td>
<td>
<span class="cartItem__afterPrice"><span
class="comma"><c:out value="${ refundList.applyDscntAmt }"/></span>
<span class="priceUnit">원</span>
</span>
</td>
<td>
<span><c:out value="${ refundList.refundQy }"/></span>
</td>
<c:choose>
<c:when test="${ refundList.ordrTyCd eq '04' || refundList.ordrTyCd eq '05' }">
<c:set var="reRowspanCnt" value="0"/>
<c:forEach var="tmpGoods" items="${resultMap.result.itemsList}">
<c:set var="reRowspanCnt" value="${refundList.ordrDlvyInnb == tmpGoods.ordrDlvyInnb ? reRowspanCnt + 1 : reRowspanCnt}"/>
</c:forEach>
<c:if test="${rePreOrdrDlvyInnb != refundList.ordrDlvyInnb}">
<td class="center" rowspan="${reRowspanCnt}">
<span class="fs-13 fw-400">${reDlvyCnt += ' 번째 배송지'}</span><br>
<span class="fs-13 fw-400">${refundList.dlvyMthNm}</span><br>
<c:choose>
<c:when test="${0 == refundList.dlvyAmt}">
<span class="fs-13 fw-400">무료</span>
</c:when>
<c:otherwise>
<span class="fs-13 fw-400"><fmt:formatNumber value="${refundList.dlvyAmt}" pattern="#,###"/></span>
</c:otherwise>
</c:choose>
</td>
<c:set var="rePreOrdrDlvyInnb" value="${refundList.ordrDlvyInnb}"/>
<c:set var="reDlvyCnt" value="${reDlvyCnt + 1}"/>
</c:if>
</c:when>
<c:otherwise>
<c:if test="${status.index == 0}">
<td class="center" ${fn:length(resultMap.result.itemsList) > 1 ? 'rowspan="' += fn:length(resultMap.result.itemsList) += '"' : ''}>
<span class="fs-13 fw-400">${refundList.dlvyMthNm}</span><br>
<c:choose>
<c:when test="${0 == refundList.dlvyAmt}">
<span class="fs-13 fw-400">무료</span>
</c:when>
<c:otherwise>
<span class="fs-13 fw-400"><fmt:formatNumber value="${refundList.dlvyAmt}" pattern="#,###"/></span>
</c:otherwise>
</c:choose>
</td>
</c:if>
</c:otherwise>
</c:choose>
<td>
<button type="button" class="btn sm gray2 sub-right-content__innerTitleBtn" onclick="fn_goods_qna_pop_regist('<c:out value="${ refundList.goodsInnb }"/>')">문의</button>
</td>
<%---
<td>
<span class="cartItem__shippingFee"><span
class=" comma">3,000</span><span
class="priceUnit">원</span>
</span>
</td>
--%>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr class="row-no-data">
<td colspan="100%" class="text-center">조회된 데이터가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
<tfoot class="refundSum">
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle"><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 처리</h3>
<div class="table-wrapper orderDetail__table">
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 상태</th>
<td>
<c:choose>
<c:when test="${ not empty resultMap.result.refnd.returnProcsSttusCd }">
<c:out value="${ resultMap.result.refnd.returnProcsSttusCdNm }"/>
</c:when>
<c:otherwise>
<c:out value="${ resultMap.result.refnd.refundProcsSttusCdNm }"/>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<th><c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">반품/</c:if>환불 번호</th>
<td><c:out value="${ resultMap.result.refnd.orderRefundInnb }"/></td>
</tr>
<tr>
<th>환불 종류</th>
<td><c:out value="${ resultMap.result.refnd.refundTyCdNm }"/></td>
</tr>
<c:if test = "${not empty resultMap.result.refnd.returnProcsSttusCd}">
<tr>
<th>반품 접수일</th>
<td><c:out value="${ resultMap.result.refnd.returnRceptDt }"/></td>
</tr>
</c:if>
<tr>
<th>환불 접수일</th>
<td><c:out value="${ resultMap.result.refnd.refundReqstDt }"/></td>
</tr>
<c:if test = "${not empty resultMap.result.refnd.returnComptDt}">
<tr>
<th>반품 완료일</th>
<td><c:out value="${ resultMap.result.refnd.returnComptDt }"/></td>
</tr>
</c:if>
<c:if test = "${not empty resultMap.result.refnd.refundComptDt}">
<tr>
<th>환불 완료일</th>
<td><c:out value="${ resultMap.result.refnd.refundComptDt }"/></td>
</tr>
</c:if>
</tbody>
</table>
</div>
</div>
<c:if test="${ not empty resultMap.result.refnd.returnRceptDt }">
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle">반품정보
<c:if test="${ resultMap.result.refnd.returnProcsSttusCd eq '01' }">
<button id="returnInfoTrigger" class="btn sm gray2 sub-right-content__innerTitleBtn" onclick="fn_update_dlvy_info();">변경</button>
</c:if>
</h3>
<form id="returnDlvyUpdtForm">
<input type="hidden" name="orderReInnb" value="<c:out value="${ resultMap.result.refnd.orderRefundInnb }"/>"/>
<div id="returnInfoContent01" class="table-wrapper orderDetail__table">
<c:choose>
<c:when test="${ resultMap.result.refnd.returnProcsSttusCd eq '01' }">
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">회수방법</span>
</th>
<td>
<div class="select-box">
<select class="lg" title="해당 셀렉트에 대한 설명" name="returnMthCd">
<option value="" disabled selected>선택</option>
<c:forEach var="cdList" items="${ resultMap.returnMthCdList }" varStatus="status">
<c:choose>
<c:when test="${ resultMap.result.refnd.returnMthCd eq cdList.cd }">
<option value="<c:out value="${ cdList.cd }"/>" selected="selected"><c:out value="${ cdList.cdNm }"/></option>
</c:when>
<c:otherwise>
<option value="<c:out value="${ cdList.cd }"/>"><c:out value="${ cdList.cdNm }"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="editAccount__title">주소</span>
</th>
<td>
<div class="inputAddress">
<div class="inputAddress__postalCode">
<input class="input-text" type="text" id="postcode" name="zip" title="우편번호" value="<c:out value="${ resultMap.result.refnd.senderZip }"/>" placeholder="우편번호" readonly>
<button type="button" onclick="fn_select_postcode(fn_set_postcode); return false;" class="btn md theme outline">
우편번호 찾기
</button>
</div>
<input type="hidden" id="adresDvCd" name="adresDvCd" value="<c:out value="${ resultMap.result.refnd.senderAdresDvCd }"/>"/>
<input class="input-text full" type="text" id="address" name="lnbOrRnmAdres"
<c:choose>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '01' }">
value="<c:out value="${ resultMap.result.refnd.senderRnmAdres }"/>"
</c:when>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '02' }">
value="<c:out value="${ resultMap.result.refnd.senderLnbAdres }"/>"
</c:when>
</c:choose>
readonly title="지번 주소" placeholder="지번 주소">
<input class="input-text full" type="text" id="detailAddress" name="dtlAdres" value="<c:out value="${ resultMap.result.refnd.senderAdresDtl }"/>" title="상세 주소" placeholder="상세 주소">
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">휴대폰 번호</span>
</th>
<td>
<input class="input-text" type="text" title="해당 인풋에 대한 설명" value="<c:out value="${ resultMap.result.refnd.returnCstmrMbtlnb }"/>" name="returnCstmrMbtlnb" oninput="fn_fmt_telno($(this));" maxlength="13"
placeholder="">
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">반품 사유</span>
</th>
<td>
<div class="select-box">
<select class="lg" title="해당 셀렉트에 대한 설명" name="returnResnCd">
<c:forEach var="returnResn" items="${resultMap.returnResnList}">
<c:choose>
<c:when test="${ returnResn.cd eq resultMap.result.refnd.returnResnCd }">
<option value="<c:out value="${returnResn.cd}"/>" selected="selected"><c:out value="${returnResn.cdNm}"/></option>
</c:when>
<c:otherwise>
<option value="<c:out value="${returnResn.cd}"/>"><c:out value="${returnResn.cdNm}"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<textarea class="textarea" rows="6" title="해당 텍스트 에어리어에 대한 설명" name="returnResnCn"
placeholder="최소 10자 이상으로 입력해 주세요."><c:out value="${ resultMap.result.refnd.returnResnCn }"/></textarea>
</td>
</tr>
</tbody>
</table>
</c:when>
<c:otherwise>
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">회수방법</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnMthCdNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">주소</span>
</th>
<td>
<c:if test="${ not empty resultMap.result.refnd.senderZip }">
(<c:out value="${ resultMap.result.refnd.senderZip }"/>)
</c:if>
<c:choose>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '01'}">
<c:out value="${ resultMap.result.refnd.senderRnmAdres }"/>
</c:when>
<c:when test="${ resultMap.result.refnd.senderAdresDvCd eq '02'}">
<c:out value="${ resultMap.result.refnd.senderLnbAdres }"/>
</c:when>
</c:choose>
<c:out value="${ resultMap.result.refnd.senderAdresDtl }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">휴대폰 번호</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnCstmrMbtlnb }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">반품 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCdNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCn }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">배송비 입금</span>
</th>
<td>
<%--우리은행 1005-102-768159<br>(예금주: ㈜에스엘바이오텍)--%>
<c:if test="${ not empty resultMap.result.refnd.returnDlvyRcpmnyAcntnb }">
<c:out value="${ resultMap.result.refnd.returnDlvyRcpmnyAcntnb }"/><br>(예금주: <c:out value="${ resultMap.result.refnd.returnDlvyRcpmnyNm }"/>)
</c:if>
</td>
</tr>
</tbody>
</table>
</c:otherwise>
</c:choose>
</div>
</form>
</div>
</c:if>
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle">환불정보
<c:if test="${ resultMap.result.refnd.refundProcsSttusCd ne '03' }">
<button id="refundInfoTrigger" class="btn sm gray2 sub-right-content__innerTitleBtn" onclick="fn_update_acnt_info();">변경</button>
</c:if>
</h3>
<form id="refundAcntUpdtForm">
<input type="hidden" name="orderReInnb" value="<c:out value="${ resultMap.result.refnd.orderRefundInnb }"/>"/>
<div id="refundInfoContent01" class="table-wrapper orderDetail__table">
<c:choose>
<c:when test="${ resultMap.result.refnd.refundProcsSttusCd eq '03' }">
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">환불은행</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundAcntBnnkNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">예금주</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundAcntDpstrNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">계좌번호</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundAcntnb }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">취소 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCdNm }"/>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.returnResnCn }"/>
</td>
</tr>
</tbody>
</table>
</c:when>
<c:otherwise>
<table class="table">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: 220px;">
<col style="width: auto;">
</colgroup>
<tbody>
<tr>
<th>
<span class="orderDetail__thText">환불은행</span>
</th>
<td>
<%--
<input class="input-text" type="text" title="환불은행" value="<c:out value="${ resultMap.result.refnd.refundAcntBnnkNm }"/>" name="refundAcntBnnkNm"
placeholder="환불은행">
--%>
<div class="select-box">
<select class="sm" title="해당 셀렉트에 대한 설명" name="refundAcntBnnkNm" id="refundAcntBnnkNm">
<c:forEach var="cdList" items="${ resultMap.bankCdList }" varStatus="status">
<c:choose>
<c:when test="${ cdList.cd eq resultMap.result.refnd.refundAcntBnnkCd }">
<option value="<c:out value="${ cdList.cd }"/>,<c:out value="${ cdList.cdNm }"/>" selected="selected" ><c:out value="${ cdList.cdNm }"/></option>
</c:when>
<c:otherwise>
<option value="<c:out value="${ cdList.cd }"/>,<c:out value="${ cdList.cdNm }"/>" ><c:out value="${ cdList.cdNm }"/></option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">예금주</span>
</th>
<td>
<input class="input-text" type="text" title="예금주명" value="<c:out value="${ resultMap.result.refnd.refundAcntDpstrNm }"/>" name="refundAcntDpstrNm"
placeholder="예금주명">
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">계좌번호</span>
</th>
<td>
<input class="input-text" type="text" title="계좌번호" value="<c:out value="${ resultMap.result.refnd.refundAcntnb }"/>" name="refundAcntnb"
placeholder="계좌번호 '-' 포함 or 숫자만 확인 필요">
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">환불사유내용</span>
</th>
<td>
<c:out value="${ resultMap.result.refnd.refundResnCn }"/>
</td>
</tr>
<%--
<tr>
<th>
<span class="orderDetail__thText">취소 사유</span>
</th>
<td>
<div class="select-box">
<select class="lg" title="해당 셀렉트에 대한 설명">
<option value="" disabled selected>선택</option>
<option value="">고객 단순 변심</option>
</select>
</div>
</td>
</tr>
<tr>
<th>
<span class="orderDetail__thText">상세 사유</span>
</th>
<td>
<textarea class="textarea" rows="6" title="해당 텍스트 에어리어에 대한 설명" name="refundResnCn"
placeholder="최소 10자 이상으로 입력해 주세요."><c:out value="${ resultMap.result.refnd.refundResnCn }"/></textarea>
</td>
</tr>
--%>
</tbody>
</table>
</c:otherwise>
</c:choose>
</div>
</form>
</div>
<div class="sub-right-content__section">
<h3 class="sub-right-content__innerTitle">
환불 금액
</h3>
<div class="priceSum">
<c:set var="reTotAmt" value="${ resultMap.result.totRefundDscntAmt }"/>
<div class="priceSum__inner">
<div class="priceSum__item">
<span class="priceSum__itemTitle"><c:out value="${ reTotAmt.setleTyCdNm }"/></span>
<span class="priceSum__itemPrice">
<span class="comma priceSum__itemNum"><c:out value="${ reTotAmt.refundAmtQySum }"/></span>
<span class="priceUnit">원</span>
</span>
</div>
<div class="priceSum__operator">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
viewBox="0 0 16 16" fill="none">
<g clip-path="url(#clip0_160_29539)">
<path
d="M8.99824 7.00176V0H7.00176V7.00176H0V8.99824H7.00176V16H8.99824V8.99824H16V7.00176H8.99824Z"
fill="black" />
</g>
<defs>
<clipPath id="clip0_160_29539">
<rect width="16" height="16" fill="white" />
</clipPath>
</defs>
</svg>
</div>
<div class="priceSum__item priceSum__item--misc">
<span class="priceSum__itemTitle">마일리지</span>
<span class="priceSum__itemPrice">
<span class="comma priceSum__itemNum"><c:out value="${ reTotAmt.totRefundMlgAmt }"/></span>
<span class="priceUnit">원</span>
</span>
</div>
<!-- 마이너스 -->
<!-- <div class="priceSum__operator">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"
fill="none">
<path d="M16 7H0V9.00002H16V7Z" fill="black" />
</svg>
</div> -->
<div class="priceSum__operator">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
viewBox="0 0 16 16" fill="none">
<g clip-path="url(#clip0_160_29539)">
<path
d="M8.99824 7.00176V0H7.00176V7.00176H0V8.99824H7.00176V16H8.99824V8.99824H16V7.00176H8.99824Z"
fill="black" />
</g>
<defs>
<clipPath id="clip0_160_29539">
<rect width="16" height="16" fill="white" />
</clipPath>
</defs>
</svg>
</div>
<div class="priceSum__item priceSum__item--misc">
<span class="priceSum__itemTitle">쿠폰</span>
<span class="priceSum__itemPrice">
<span class="comma priceSum__itemNum"><c:out value="${ reTotAmt.totRefundCouponAmt }"/></span>
<span class="priceUnit">원</span>
</span>
</div>
<c:if test="${ reTotAmt.rlDlvyAmtRefundAmt > 0}">
<div class="priceSum__operator">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"
fill="none">
<path d="M16 7H0V9.00002H16V7Z" fill="black" />
</svg>
</div>
<div class="priceSum__item priceSum__item--misc">
<span class="priceSum__itemTitle">반품배송비</span>
<span class="priceSum__itemPrice">
<span class="comma priceSum__itemNum"><c:out value="${ reTotAmt.rlDlvyAmtRefundAmt }"/></span>
<span class="priceUnit">원</span>
</span>
</div>
</c:if>
<c:if test="${ reTotAmt.totReturnDlvyAmt > 0}">
<div class="priceSum__operator">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
viewBox="0 0 16 16" fill="none">
<g clip-path="url(#clip0_160_29539)">
<path
d="M8.99824 7.00176V0H7.00176V7.00176H0V8.99824H7.00176V16H8.99824V8.99824H16V7.00176H8.99824Z"
fill="black" />
</g>
<defs>
<clipPath id="clip0_160_29539">
<rect width="16" height="16" fill="white" />
</clipPath>
</defs>
</svg>
</div>
<div class="priceSum__item priceSum__item--misc">
<span class="priceSum__itemTitle">환불배송비</span>
<span class="priceSum__itemPrice">
<span class="comma priceSum__itemNum"><c:out value="${ reTotAmt.totReturnDlvyAmt }"/></span>
<span class="priceUnit">원</span>
</span>
</div>
</c:if>
<div class="priceSum__equals">
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"
viewBox="0 0 28 28" fill="none">
<path d="M3.5 17.5H24.5V19.8333H3.5V17.5Z" fill="black" />
<path d="M3.5 8.16699H24.5V10.5003H3.5V8.16699Z" fill="black" />
</svg>
</div>
<div class="priceSum__total">
<span class="priceSum__totalTitle">환불 금액</span>
<div class="priceSum__totalPrice">
<span class="comma"><c:out value="${ reTotAmt.rlRefundAmt }"/></span>
<span class="priceUnit">원</span>
</div>
<div class="priceSum__totalDetail">
(상품금액 <span class="comma"><c:out value="${ reTotAmt.refundAmtQySum }"/></span>원 + 배송비 <span class="comma"><c:out value="${ reTotAmt.rlDlvyAmt }"/></span>원)
</div>
</div>
</div>
</div>
</div>
<!--
<div class="refundProcess">
<ol class="refundProcess__list">
<li class="refundProcess__item">
<span class="refundProcess__num">1</span>
<span class="refundProcess__title">반품/교환 신청</span>
<p class="refundProcess__text">고객님의 반품/교환 신청이<br>접수되었습니다.</p>
</li>
<li class="refundProcess__item">
<span class="refundProcess__num">2</span>
<span class="refundProcess__title">반품/교환 처리중</span>
<p class="refundProcess__text">고객님의 반품을<br>처리중입니다.</p>
</li>
<li class="refundProcess__item">
<span class="refundProcess__num">3</span>
<span class="refundProcess__title">반품/교환 완료</span>
<p class="refundProcess__text">고객님<br>반품이 완료되었습니다.</p>
</li>
</ol>
</div>
-->
<div class="sub-bottom-btn-container">
<button type="button" class="btn xl outline theme" onclick="fn_order_refund_list();">반품 / 환불 목록</button>
</div>
</div>
</div>
</div>
</div>
</main>
<form id="listForm">
<input type="hidden" id="orderRefundInnb" name ="orderRefundInnb"/>
<input type="hidden" id="pageIndex" name="pageIndex" value="${ paramVO.pageIndex }"/>
<input type="hidden" id="recordCountPerPage" name="recordCountPerPage" value="${ paramVO.recordCountPerPage }"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="${ paramVO.pageUnit }"/>
</form>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 모달 -->
<div id="modalDiv">
</div>
</body>
</html>

View File

@@ -0,0 +1,275 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireRForm.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
// fn_set_param();
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
fn_select_refund_list(pageIndex, pageUnit);
fn_start_display();
});
/******************************************************************
* 시작 화면 제어
******************************************************************/
const fn_start_display = function() {
/* 검색조건 > 날짜 구간 버튼 클릭 이벤트 */
$('.dateRange-btn').on('click', function() {
const date = $(this).attr('id');
$(this).closest('div').find('#dateRange').val(date);
if ('allDays' === date) {
$('#bgnDt, #endDt').val('');
return false;
}
fn_set_date('bgnDt', 'endDt', 'endDt', date);
});
/* 검색 버튼 클릭 이벤트 */
$('#btnSearch').on('click', function() {
fn_select_refund_list(1);
});
}
/* 검색조건 세팅 */
const fn_set_param = function() {
const params = ${paramVO};
const keys = Object.keys(params);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let data = params[key];
if ('bgnDt' == key || 'endDt' == key) {
if (!fn_is_empty(data)) {
for (let i = 0; i < data.length; i++) {
$('#' + key).val(data);
}
}
}
if ('dateRange' == key) {
$('#'+ data).trigger('click');
}
if ('srchwrd' == key) {
$('#' + key).val(data);
}
}
}
/******************************************************************
* 반품/환불 목록 조회
******************************************************************/
const fn_select_refund_list = function(pageIndex, pageUnit) {
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/ordr/selectRtngudCanclRefndInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#pageDiv').empty();
$('#pageDiv').html(resultHtml);
}
});
}
/****************************************************
* 반품환불 상세 수정폼 이동
*****************************************************/
const fn_move_dtlupdt = function(orderReInnb, ordrInnb) {
$('#listForm').attr('action', '<c:url value="/sopmal/mpage/ordr/selectRtngudCanclRefndDtlInqire"/>');
$('#listForm').attr('method', 'get');
$('#orderReInnb').val(orderReInnb);
$('#ordrInnb').val(ordrInnb);
$('#listForm').submit();
}
/* 주문상세 이동 */
const fn_go_ordr_dtl = function (sopmalCd, ordrInnb) {
var form = $('#listForm');
$(form).append($('<input/>', {type: 'hidden', name: 'sopmalCd', id: 'sopmalCd', value: sopmalCd}));
$('#ordrInnb').val(ordrInnb);
$(form).attr('method', 'get');
$(form).attr('action', '<c:url value="/sopmal/mpage/ordr/selectMbrOrdrDtlInqire"/>');
$(form).submit();
}
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">반품 / 교환 / 취소·환불 </h3>
<form id="listForm">
<input type="hidden" id="orderReInnb" name="orderReInnb" value=""/>
<input type="hidden" id="ordrInnb" name="ordrInnb" value=""/>
<input type="hidden" id="pageIndex" name="pageIndex" value="${ resultMap.paramVO.pageIndex}"/>
<input type="hidden" id="pageUnit" name="pageUnit" value="${ resultMap.paramVO.pageUnit}"/>
<div class="customer-search">
<div class="customer-search__row justify-start">
<input type="text" name="srchwrd" id="srchwrd" class="input-text customer-search__search" title="검색어 입력" placeholder="주문번호, 상품명 검색">
</div>
<div class="customer-search__row justify-start">
<div class="customer-search__controls">
<div class="dateRange-btnContainer">
<input type="hidden" name="dateRange" id="dateRange" value="allDays">
<button type="button" class="dateRange-btn" id="7D">일주일</button>
<button type="button" class="dateRange-btn" id="1M">1개월</button>
<button type="button" class="dateRange-btn" id="3M">3개월</button>
<button type="button" class="dateRange-btn selected" id="allDays">전체</button>
</div>
<div class="input-container">
<input type="text" name="bgnDt" id="bgnDt" class="datepicker" title="시작 날짜 선택" autocomplete="off">
<span class="tilde">~</span>
<input type="text" name="endDt" id="endDt" class="datepicker" title="종료 날짜 선택" autocomplete="off">
</div>
</div>
<button type="button" id="btnSearch" class="btn md dark">검색</button>
</div>
</div>
<div class="sub-tab">
<%--
<div class="sub-tab__trigger">
<button class="sub-tab__btn current">전체</button>
<button class="sub-tab__btn">환불</button>
<button class="sub-tab__btn">교환/반품</button>
</div>
--%>
<div id="pageDiv">
</div>
<%--
<div class="sub-tab__content">
2
</div>
<div class="sub-tab__content">
3
</div>
--%>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 상품 옵션 변경 모달 -->
<div id="goodsOptionDiv">
</div>
<script>
//장바구니 전체선택
$('#cartCheckAll').click(function () {
if ($('#cartCheckAll').is(':checked')) {
$('.cartCheck').prop('checked', true);
} else {
$('.cartCheck').prop('checked', false);
}
});
$('.cartCheck').click(function () {
if ($('.cartCheck').length == $('.cartCheck:checked').length) {
$('#cartCheckAll').prop('checked', true);
} else {
$('#cartCheckAll').prop('checked', false);
}
});
</script>
<!-- 모달 -->
</body>
</html>

View File

@@ -0,0 +1,89 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : RtngudCanclRefndListR.jsp
Description : 마이페이지 반품/환불 내역
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-27 추지훈 최초 생성
--%>
<div class="sub-tab__content current">
<div class="orderList">
<c:choose>
<c:when test="${ not empty resultMap.resultList && fn:length(resultMap.resultList) > 0 }">
<c:forEach var="refundList" items="${ resultMap.resultList }" varStatus="status">
<div class="orderList__item">
<div class="orderList__item__inner">
<%--
<a href="" class="orderList__image">
<img src="<c:out value="${ refundList.img }"/>" alt="상품 이미지">
</a>
--%>
<a href="<c:url value="/sopmal/goods/selectGoodsDtl?sopmalCd=${refundList.sopmalCd}&goodsInnb=${refundList.goodsInnb}"/>" class="orderList__image">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<img src="<c:out value="${ cdnurl }${ refundList.img }"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="<c:out value="${refundList.goodsNm}"/>">
</a>
<div class="orderList__description">
<div class="orderList__description__first">
<div class="orderList__item__top">
<button class="orderList__orderNum" onclick="fn_go_ordr_dtl('<c:out value="${ refundList.sopmalCd }"/>', '<c:out value="${ refundList.ordrInnb }"/>');">
<c:out value="${ refundList.ordrInnb }"/>
</button>
<c:if test = "${refundList.refundProcsSttusCd eq '03'}">
<span class="orderList__dot">·</span>
<span class="orderList__date">
<c:out value="${ refundList.refundComptDt }"/> 환불완료
</span>
</c:if>
</div>
<button type="button" onclick="fn_move_dtlupdt('<c:out value="${ refundList.orderRefundInnb }"/>', '<c:out value="${ refundList.ordrInnb }"/>');" class="orderList__productTitle"><c:out value="${ refundList.goodsNm }"/></button>
</div>
<div class="orderList__description__second">
<span class="orderList__price">
<span class="comma"><c:out value="${ refundList.refundAmt }"/></span>원
</span>
</div>
<div class="orderList__description__third">
<span class="orderList__refundCategory"><c:out value="${ refundList.refundTyCdNm }"/></span>
</div>
<div class="orderList__description__fourth">
<button type="button" class="orderList__status cancel">
<c:choose>
<c:when test="${ not empty refundList.returnRceptDt }">
<c:out value="${ refundList.returnProcsSttusCdNm }"/>
</c:when>
<c:otherwise>
<c:out value="${ refundList.refundProcsSttusCdNm }"/>
</c:otherwise>
</c:choose>
</button>
</div>
<div class="orderList__btnControls">
<span class="orderList__refundCategory"><c:out value="${ refundList.refundReqstDt }"/></span>
</div>
</div>
</div>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<div class="orderList__no-result">
<img src="<c:url value="/pc/images/icon__no-result.png"/>" alt="">
<p class="orderList__no-result-text">반품/환불내역이 없습니다.</p>
</div>
</c:otherwise>
</c:choose>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_refund_list" />
</div>
</div>

View File

@@ -0,0 +1,139 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireR.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-03-27 추지훈 최초 생성
--%>
<script>
$(document).ready(function() {
//해당 클래스를 가진 요소 3자리 마다 콤마
$(".comma").each(function () {
var text = $(this).text();
$(this).text(text.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, "$1,"));
});
});
</script>
<div class="cartOrder__list">
<div class="table-wrapper">
<spring:eval expression="@environment.getProperty('sopmalfo.common.fileupload.cdnurl')" var="cdnurl"/>
<table class="table vertical">
<caption>해당 테이블에 대한 설명</caption>
<!-- 각 열 width 설정 -->
<colgroup>
<col style="width: auto;">
<col style="width: 140px;">
<col style="width: 20px;">
<col style="width: 200px">
</colgroup>
<tbody id="wishListTbody">
<c:choose>
<c:when test="${ not empty resultMap.resultList && fn:length(resultMap.resultList) > 0 }">
<c:forEach items="${ resultMap.resultList }" var="list" varStatus="status">
<tr>
<td>
<input type="hidden" name="wslistInnb" value="<c:out value="${ list.wslistInnb }"/>"/>
<input type="hidden" name="goodsInnb" value="<c:out value="${ list.goodsInnb }"/>"/>
<div class="cartItem">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input class="cartCheck" type="checkbox" value="" onclick="fn_ctr_pCheckbox('#cartCheckAll', '.cartCheck');">
<span class="check"></span>
<span class="control-label"></span>
</label>
</div>
<div class="cartItem__image">
<a href="<c:url value="/sopmal/goods/selectGoodsDtl?sopmalCd=${list.sopmalCd}&goodsInnb=${list.goodsInnb}"/>">
<img src="<c:out value="${ cdnurl }${ list.img }"/>" onerror="this.src='/pc/images/image_placeholder.png'" alt="${ list.goodsNm }">
</a>
</div>
<div class="cartItem__productInfo">
<a href="" class="cartItem__productTitle"><c:out value="${ list.goodsNm }"/></a>
<%--
<button type="button" onclick="fn_open_modal('#goodsOptionDiv', '#option-change-popUp', '/sopmal/mpage/ordr/selectGoodsOptnSlcPopup', JSON.stringify({'goodsInnb':${list.goodsInnb}}));"
class="btn xsm outline">옵션선택</button>
--%>
</div>
<%-- <span class="">
판매가 : ${list.orgSlepric }<br>
이벤트 할인 금액 : ${list.evtAditDscntAmt }<br>
상품쿠폰할인 금액 : ${list.gdAditDscntAmt }<br>
상품쿠폰 적용 후 판매금액 : ${list.gdSlepric }<br>
(CT_ADIT_DSCNT_CD) : ${list.ctAditDscntCd }<br>
(CT_ADIT_DSCNT_AMT) : ${list.ctAditDscntAmt }<br>
(CT_DSCNT_MXMM_AMT) : ${list.ctDscntMxmmAmt }<br>
장바구니 할인 금액(RL_CT_ADIT_DSCNT_AMT) : ${list.rlCtAditDscntAmt }<br>
장바구니 후 최종 판매가 : ${list.slepric }<br>
할인율 : ${list.slePercent }
</span>--%>
</div>
</td>
<td>
<span class="cartItem__beforePrice"><span
class="comma"><fmt:parseNumber value="${ list.cnsmrpric }"/></span> 원</span>
<span class="cartItem__afterPrice"><span
class="comma"><fmt:parseNumber value="${ list.slepric }"/></span><span
class="priceUnit"> 원</span></span>
</td>
<td>
</td>
<td>
<c:choose>
<c:when test="${list.goodsSttusCd eq '01'}">
<button class="btn theme md" type="button" onclick="fn_open_addCart_modal('#goodsOptionDiv', '#option-change-popUp', '/sopmal/mpage/ordr/selectGoodsOptnSlcPopup', JSON.stringify({'goodsInnb':${list.goodsInnb}}));">장바구니 담기</button>
</c:when>
<c:otherwise>
<button class="btn theme md" type="button" disabled>${list.goodsSttusNm}</button>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="4">
<div class="table__no-result">
<img src="/pc/images/icon__no-result.png" alt="">
<p class="table__no-result-text">
위시리스트에 담긴 상품이 없습니다.
</p>
</div>
</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<%--
<div class="myWishlist__bottomBtnWrapper">
<button class="btn theme md" type="button" onclick="fn_delete_selectTr();">선택상품 장바구니</button>
</div>
--%>
</div>
<div class="pagination__container">
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_wish_list" />
</div>

View File

@@ -0,0 +1,925 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
<%--
Class Name : WslistInqireRForm.jsp
Description : 마이페이지 위시리스트
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2024-02-27 추지훈 최초 생성
--%>
<!DOCTYPE html>
<html lang="ko">
<head>
<%-- 공통 include --%>
<jsp:include page="/WEB-INF/views/comm/Include.jsp"/>
</head>
<script>
$(document).ready(function() {
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
fn_select_wish_list(pageIndex, pageUnit);
});
//위시리스트 옵션선택 배열
let productArr = [];
/********************************************
* 위시리스트 선택 삭제
********************************************/
const fn_delete_wishlist = function (tbodySltr, pageIndex, pageUnit) {
var $tbody = $(tbodySltr);
let arr = [];
// 체크된 input 찾기
$tbody.find('input[type="checkbox"]:checked').each(function () {
let closestInput = $(this).closest('tr').find('input[name="wslistInnb"]');
let value = closestInput.val();
arr.push(value);
});
if (arr.length > 0) {
if (confirm('상품을 <spring:message code="confirm.common.delete"/>')) {
$.ajax({
type: "post",
url: '<c:url value="/sopmal/mpage/ordr/deleteWslistGoodsDel"/>',
data: {
wslistInnbArr: arr
},
success: function (result) {
alert('<spring:message code="success.common.delete"/>');
fn_select_wish_list(pageIndex, pageUnit);
}
});
}
} else {
alert("삭제할 상품을 선택해 주세요.");
}
};
/************************************************
* 위시리스트 목록 조회
*************************************************/
const fn_select_wish_list = function(pageIndex, pageUnit) {
let dataStr;
if(!pageIndex) {
$('#pageIndex').val(1);
} else {
$('#pageIndex').val(pageIndex);
}
if(!pageUnit) {
dataStr = $('#listForm').serialize();
} else {
if($('#pageUnit').length){
$('#pageUnit').val(pageUnit);
dataStr = $('#listForm').serialize();
} else {
dataStr = $('#listForm').serialize()+'&pageUnit='+pageUnit;
}
}
$('#pageIndex').val(pageIndex);
$.ajax({
type: "post",
url : '<c:url value="/sopmal/mpage/ordr/selectWslistInqire"/>',
data : dataStr,
success:function(resultHtml) {
$('#pageDiv').html(resultHtml);
}
});
}
//인풋 생성함수
const fn_create_input = function (type, name, value, tgtForm) {
const input = document.createElement('input');
input.setAttribute("type", type);
input.setAttribute("name", name);
input.setAttribute("value", value);
tgtForm.appendChild(input);
}
//장바구니 담기 처리
const fn_add_cart = (gubun, data, goodsInnb) => {
const url = "<c:url value="/sopmal/ordr/insertSpbk"/>";
$.ajax({
type: 'post',
enctype: 'multipart/form-data',
url: url,
data: data,
contentType: false,
processData: false,
success: function (data) {
if (data.resBody != null) {
const result = JSON.parse(data.resBody.result);
if (result.result === 'success') {
if (gubun === 'cart') {
fn_cart_modal()
fn_reflesh_cart_cnt();
$('.addCart').prop("disabled", false);
}
if (gubun === 'direct') {
//구매화면 이동
fn_move_purchs_order(goodsInnb);
$('.purchsOrdr').prop('disabled', false);
}
} else {
alert('구매정보 <spring:message code="fail.common.insert"/>');
$('.addCart').prop("disabled", false);
$('.purchsOrdr').prop('disabled', false);
}
}
}
});
}
/*************************************************************
장바구니 목록 이동
**************************************************************/
const fn_move_cart_list = () => {
const form = $('<form></form>');
$(form).append($('<input/>', {type: 'hidden', name: 'cartDvCd', value: $('#cartDv-cart').val()}));
$(form).attr('target', '_self');
$(form).attr('method', 'post');
$(form).attr('action', '<c:url value="/sopmal/ordr/selectSpbk"/>');
$(form).appendTo('body');
//일반옵션 체크 해제
$('input[type="radio"]').prop('checked', false)
$(form).submit();
$(form).remove();
}
//구매하기 클릭 후 구매목록 이동
const fn_move_purchs_order = (goodsInnb) => {
<%--/* 구매하기 버튼 선택 이벤트 */--%>
const form = $('<form></form>');
$(form).append($('<input/>', {type: 'hidden', name: 'goodsInnb', value: goodsInnb}));
$(form).append($('<input/>', {type: 'hidden', name: 'cartDvCd', value: $('#cartDv-direct').val()}));
$(form).attr('method', 'post');
$(form).attr('action', '<c:url value="/sopmal/ordr/selectMbrPurchsForm"/>');
$(form).appendTo('body');
//일반옵션 체크 해제
$('input[type="radio"]').prop('checked', false)
$(form).submit();
$(form).remove();
}
//장바구니 담기 후 모달
const fn_cart_modal = () => {
const modal = `<div id="addCartModalDiv" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
상품이 장바구니에 담겼습니다.
<br>
지금 확인하시겠습니까?
</p>
</div>
<div class="alert-btn-container">
<a href="javascript:void(0);" onclick="fn_move_cart_list();" rel="modal:close" class="alert-btn alert-btn--confirm">예</a>
<a href="javascript:void(0);" onclick="fn_close_modal('option-change-popUp');" rel="modal:close" class="alert-btn alert-btn--confirm">아니오</a>
</div>
</div>`;
//장바구니 담은 후 페이지 이동 여부 모달
$('#addCartModalDiv').remove()
$('#addCartDiv').html(modal)
$('#addCartModalDiv').modal()
}
//장바구니 버튼 팝업 모달
const fn_open_addCart_modal = function (modalDivSltr, modalSlrt, url, param, callback) {
const submitType = 'POST';
$.ajax({
type: submitType,
contentType: 'application/json',
url: url,
data: param,
success: function (data) {
//callback함수가 없을 경우 default로 지정된 영역에 모달팝업 화면을 교체하고 화면 로딩
if (!callback) {
//이전에 선택한 상품 초기화
productArr = [];
$(modalSlrt).remove();
$(modalDivSltr).html(data);
$(modalSlrt).modal();
} else {
callback(data);
}
}
});
}
//상품 중복 선택 모달
const fn_goods_duplicate_select_modal = () => {
const modal = `<div id="goodsDuplicateModalDiv" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
중복된 상품입니다.
</p>
</div>
<div class="alert-btn-container">
<a href="javascript:void(0);" rel="modal:close" class="alert-btn alert-btn--confirm">확인</a>
</div>
</div>`;
//재고옵션 옵션 값 초기화
$('select[name="selectInvntryOptn"]').not(':first').each(function() {
$(this).find('option').each(function () {
// value가 빈 문자열이 아닌 경우에만 삭제
if ($(this).val() !== '') {
$(this).remove().niceSelect('update');
}
});
});
$('select[name="selectInvntryOptn"]').val('').niceSelect('update')
//함께하면 좋은상품 옵션 값 초기화
$('select[name="selectRelateInvntryOptn"]').not(':first').each(function() {
$(this).find('option').each(function () {
// value가 빈 문자열이 아닌 경우에만 삭제
if ($(this).val() !== '') {
$(this).remove().niceSelect('update');
}
});
});
//추가구성옵션 옵션 값 초기화
$('select[name="selectAddedOptn"]').val('').niceSelect('update')
$('select[name="selectRelateInvntryOptn"]').val('').niceSelect('update')
$('select[name="selectRelateAddedOptn"]').val('').niceSelect('update')
//모달 처리
$('#goodsDuplicateModalDiv').remove()
$('#goodsDuplicateDiv').html(modal)
$('#goodsDuplicateModalDiv').modal()
}
/*************************************************************
장바구니 버튼
**************************************************************/
$(document).on('click', '.addCart', function () {
$('.addCart').prop("disabled", true);
if($('#hiddenForm') != null){
$('#hiddenForm').remove()
}
//상품 선택 확인
if(productArr.length <= 0){
alert('상품옵션을 선택해 주세요');
$('.addCart').prop("disabled", false);
return;
}
//추가구성옵션 - 필수추가구성옵션 있는지 확인
var values = $('input[name="productDetailInfo__additionalSelect__otpnEssntlAt__relate__added"]').map(function() {
return $(this).val();
}).get();
if(values.includes('Y')){
var isAddedOptnEssntlAt = productArr.some(function (item) {
return item[6] === 'Y'
});
if(!isAddedOptnEssntlAt){
alert('필수추가옵션을 선택해 주세요');
$('.addCart').prop("disabled", false);
return;
}
}
const hiddenForm = document.createElement('form');
hiddenForm.name = 'hiddenForm';
hiddenForm.id = 'hiddenForm';
hiddenForm.method = 'post';
hiddenForm.action = '';
const goodsInnb = $('#addCartGoodsInnb').val();
const cartDvCdCart = $('#cartDv-cart').val();
/**
* 장바구니 담기 전 옵션조회해서 같은 물품 있을 경우 confirm후
* DELETE-INSERT 수행
* */
// 1. 해당 사용자의 모든 장바구니 정보 조회(상품옵션고유번호, 갯수 조회)
$.ajax({
type: 'post',
contentType: 'application/json',
url: '<c:out value="/sopmal/ordr/selectCartList"/>',
data: JSON.stringify({}),
success: async function (data) {
const result = JSON.parse(data.resBody.result)
if(result.message === 'success'){
const resultCartList = result.cartList;
let cartDuplicateOptnAt ='N';
let duplicatedOptn = [];
for(let i = productArr.length - 1; i >= 0; i--){
for(let j = resultCartList.length - 1; j >= 0; j--){
if(parseInt(resultCartList[j].goodsOptnInnb) === parseInt(productArr[i][4])){
//중복된 상품옵션의 기존 수량 + 선택한 수량
let newCartItem = {
...resultCartList[j],
cnt: resultCartList[j].cnt + productArr[i][1]
};
duplicatedOptn.push(newCartItem);
// resultCartList에서 해당 객체 삭제
resultCartList.splice(j, 1);
// productArr에서 해당 배열 삭제
productArr.splice(i, 1);
cartDuplicateOptnAt = 'Y'
break;
}
}
}
//2. 장바구니 중복 확인 결과
if(cartDuplicateOptnAt ==='Y'){
const dupliModal = await showConfirmModal();
if(dupliModal){
//선택한 상품옵션 장바구니 저장
const formData = new FormData();
let idx = 0;
if(productArr.length > 0 ){
for (let product of productArr) {
fn_create_input('hidden', "addCartList[" + idx + "].cartDvCd", cartDvCdCart, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsInnb", goodsInnb, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].qy", product[1], hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsOptnInnb", product[4], hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].optnTy", product[5], hiddenForm);
idx++;
}
}
let dupliIndex = 0;
//기존 장바구니에 담은 상품 저장
if(resultCartList.length > 0){
for(let resultCartItem of resultCartList){
fn_create_input('hidden', "addCartList[" + idx + "].cartDvCd", resultCartItem.cartDvCd, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsInnb", resultCartItem.goodsInnb, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].qy", resultCartItem.cnt, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsOptnInnb", resultCartItem.goodsOptnInnb, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].optnTy", resultCartItem.optnTy, hiddenForm);
idx++;
}
}
//중복된 상품 옵션 저장
for(let dupliItem of duplicatedOptn){
fn_create_input('hidden', "addCartList[" + idx + "].cartDvCd", dupliItem.cartDvCd, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsInnb", dupliItem.goodsInnb, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].qy", dupliItem.cnt, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsOptnInnb", dupliItem.goodsOptnInnb, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].optnTy", dupliItem.optnTy, hiddenForm);
idx++;
}
//장바구니 중복으로 인한 수정 여부
fn_create_input('hidden', "addCartUptAt", 'Y', hiddenForm);
fn_create_input('hidden', "cartDvCd", $('#cartDv-cart').val(), hiddenForm);
document.body.appendChild(hiddenForm);
$('#hiddenForm').serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
fn_add_cart('cart', formData, goodsInnb)
}else{
//장바구니 중복 상품 추가 안할 경우 전체 초기화
productArr = []
$('input[type="radio"]').prop("checked", false)
fn_close_modal('option-change-popUp')
$('.addCart').prop("disabled", false);
}
}else{
//상품 중복옵션 없을 경우 장바구니 저장 진행
const formData = new FormData();
for (let idx in productArr) {
fn_create_input('hidden', "addCartList[" + idx + "].cartDvCd", cartDvCdCart, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsInnb", goodsInnb, hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].qy", productArr[idx][1], hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].goodsOptnInnb", productArr[idx][4], hiddenForm);
fn_create_input('hidden', "addCartList[" + idx + "].optnTy", productArr[idx][5], hiddenForm);
}
//장바구니 중복으로 인한 수정 여부
fn_create_input('hidden', "addCartUptAt", 'N', hiddenForm);
fn_create_input('hidden', "cartDvCd", $('#cartDv-cart').val(), hiddenForm);
document.body.appendChild(hiddenForm);
$('#hiddenForm').serializeArray().forEach(function (item) {
formData.append(item.name, item.value);
});
fn_add_cart('cart', formData, goodsInnb)
}
}//result success END
}//ajax success END
});//ajax END
})
//장바구니 중복 상품 추가 confirm 모달 버튼 true/false 반환
function showConfirmModal() {
return new Promise(function(resolve, reject) {
<%--상품 중복담기 모달--%>
const modal =`
<div id="modal-error-confirm-add-cart-duplicate" class="modal alert">
<div class="alert-content">
<p class="alert-content__text--sm">
장바구니에 선택한 상품이 있습니다. <br/> 장바구니에 추가하시겠습니까?
</p>
</div>
<div class="alert-btn-container">
<a type="button" class="alert-btn alert-btn--confirm" id="modal-error-confirm-yesButton" rel="modal:close">예</a>
<a type="button" onclick="fn_close_modal('option-change-popUp');" class="alert-btn alert-btn--confirm" id="modal-error-confirm-noButton" rel="modal:close">아니오</a>
</div>
</div>`
$('#modal-error-confirm-add-cart-duplicate').remove()
$('#modal-error-confirm-add-cart-duplicate-div').html(modal)
$('#modal-error-confirm-add-cart-duplicate').modal()
$('#modal-error-confirm-yesButton').one('click', function() {
resolve(true); // 예를 클릭하면 true 반환
});
$('#modal-error-confirm-noButton').one('click', function() {
resolve(false); // 아니오를 클릭하면 false 반환
});
$('#modal-error-confirm-add-cart-duplicate').on('hidden.bs.modal', function () {
resolve(false); // 모달이 닫힐 때 기본적으로 false 반환
});
});
}
//재고옵션 다음 셀렉트 옵션 값 호출
$(document).on('change', 'select[name="selectAddCartInvntryOptn"]', function () {
const id = $(this).attr('id');
let sourceId = id.slice(-1); // 아이디로 셀렉트 옵션 순서 확인
let nextId = (parseInt(sourceId)+1).toString();
const lastId = $('select[name="selectAddCartInvntryOptn"]:last').attr('id')
if($(this).val() === '0'){
return false;
}
const selectOptnVal1 = fn_nvl($('#selectAddCartInvntryOptn1 option:selected').text(),'').replaceAll(' ','').trim()
const selectOptnVal2 = fn_nvl($('#selectAddCartInvntryOptn2 option:selected').text(),'').replaceAll(' ','').trim()
const selectOptnVal3 = fn_nvl($('#selectAddCartInvntryOptn3 option:selected').text(),'').replaceAll(' ','').trim()
const selectOptnVal4 = fn_nvl($('#selectAddCartInvntryOptn4 option:selected').text(),'').replaceAll(' ','').trim()
let optnVal1 = selectOptnVal1 === '선택'?'': selectOptnVal1
let optnVal2 = selectOptnVal2 === '선택'?'': selectOptnVal2
let optnVal3 = selectOptnVal3 === '선택'?'': selectOptnVal3
let optnVal4 = selectOptnVal4 === '선택'?'': selectOptnVal4
switch (sourceId) {
case '1':
optnVal2 = '';
optnVal3 = '';
optnVal4 = '';
$('select[name="selectAddCartInvntryOptn"]').not(':first').each(function() {
$(this).find('option').each(function () {
// value가 빈 문자열이 아닌 경우에만 삭제
if ($(this).val() !== '') {
$(this).remove().niceSelect('update');
}
});
});
$('select[name="selectAddCartInvntryOptn"]').not(':first').val('').niceSelect('update')
break;
case '2':
optnVal3 = '';
optnVal4 = '';
$('select[name="selectAddCartInvntryOptn"]').not(':lt(2)').each(function() {
$(this).find('option').each(function () {
// value가 빈 문자열이 아닌 경우에만 삭제
if ($(this).val() !== '') {
$(this).remove().niceSelect('update');
}
});
});
$('select[name="selectAddCartInvntryOptn"]').not(':lt(2)').val('')
$('select[name="selectAddCartInvntryOptn"]').niceSelect('update')
break;
case '3':
optnVal4 = '';
$('select[name="selectAddCartInvntryOptn"]').not(':lt(3)').each(function() {
$(this).find('option').each(function () {
// value가 빈 문자열이 아닌 경우에만 삭제
if ($(this).val() !== '') {
$(this).remove().niceSelect('update');
}
});
});
$('select[name="selectAddCartInvntryOptn"]').not(':lt(3)').val('')
$('select[name="selectAddCartInvntryOptn"]').niceSelect('update')
break;
}
$.ajax({
type: 'post',
contentType : 'application/json',
url: '/sopmal/goods/selectGoodsOptnInfo',
data: JSON.stringify(
{
'goodsInnb' : $('#addCartGoodsInnb').val()
,'optnTy' : '02'
,'optnVal1' : optnVal1
,'optnVal2' : optnVal2
,'optnVal3' : optnVal3
,'optnVal4' : optnVal4
}
),
success: function (data) {
let str = JSON.parse(data.resBody.result);
if (str.result === 'success') {
//판매가
const slepricDscntAmt = $('#slepricDscntAmt').val()
switch (sourceId){
case '1' :
//1선택하면 서버 요청해서 2번 옵션값 받아옴
//2번에 option에 옵션값 뿌리기
const uniqueData2 = [];
const seenOptnVal2 = new Set();
str.goodsOptnList.forEach(item => {
if (!seenOptnVal2.has(item.optnVal2)){
uniqueData2.push(item);
seenOptnVal2.add(item.optnVal2);
}
});
uniqueData2.forEach(function(option) {
if($('#selectAddCartInvntryOptn'+nextId).attr('id') === lastId){
//재고품절시 노출여부
if(option.invntrySldoutExpsrAt ==='N'){
//옵션 노출 안함
//품절표시
}else if(option.disableAt === 'Y'){
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal2+ '(+' + addComma((parseInt(option.slepric) - parseInt(slepricDscntAmt))) +')' +'(품절)' ,
disabled: true
}));
}else{
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal2 + '(+' + addComma((parseInt(option.slepric) - parseInt(slepricDscntAmt))) +')'
}));
}
}else{
//재고품절시 노출여부
if(option.invntrySldoutExpsrAt ==='N'){
//옵션 노출 안함
//품절표시
}else if(option.disableAt === 'Y'){
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal2+'(품절)',
disabled: true
}));
}else{
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal2
}));
}
}
});
$('#selectAddCartInvntryOptn'+nextId).niceSelect('update');
break;
case '2' :
const uniqueData3 = [];
const seenOptnVal3 = new Set();
str.goodsOptnList.forEach(item => {
if (!seenOptnVal3.has(item.optnVal3)){
uniqueData3.push(item);
seenOptnVal3.add(item.optnVal3);
}
});
uniqueData3.forEach(function(option) {
if($('#selectAddCartInvntryOptn'+nextId).attr('id') === lastId){
//재고품절시 노출여부
if(option.invntrySldoutExpsrAt ==='N'){
//옵션 노출 안함
//품절표시
}else if(option.disableAt === 'Y'){
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal3 + '(+' + addComma((parseInt(option.slepric) - parseInt(slepricDscntAmt))) +')' + '(품절)',
disabled: true
}));
}else{
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal3 + '(+' + addComma((parseInt(option.slepric) - parseInt(slepricDscntAmt))) +')'
}));
}
}else{
//재고품절시 노출여부
if(option.invntrySldoutExpsrAt ==='N'){
//옵션 노출 안함
//품절표시
}else if(option.disableAt === 'Y'){
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal3+'(품절)',
disabled: true
}));
}else{
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal3
}));
}
}
});
$('#selectAddCartInvntryOptn'+nextId).niceSelect('update');
break;
case '3' :
const uniqueData4 = [];
const seenOptnVal4 = new Set();
str.goodsOptnList.forEach(item => {
if (!seenOptnVal4.has(item.optnVal4)){
uniqueData4.push(item);
seenOptnVal4.add(item.optnVal4);
}
});
uniqueData4.forEach(function(option) {
if($('#selectAddCartInvntryOptn'+nextId).attr('id') === lastId){
//재고품절시 노출여부
if(option.invntrySldoutExpsrAt ==='N'){
//옵션 노출 안함
//품절표시
}else if(option.disableAt === 'Y'){
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal4 + '(+' + addComma((parseInt(option.slepric) - parseInt(slepricDscntAmt))) +')' + '(품절)',
disabled: true
}));
}else{
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal4 + '(+' + addComma((parseInt(option.slepric) - parseInt(slepricDscntAmt))) +')'
}));
}
}else{
//재고품절시 노출여부
if(option.invntrySldoutExpsrAt ==='N'){
//옵션 노출 안함
//품절표시
}else if(option.disableAt === 'Y'){
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal4 + '(품절)',
disabled: true
}));
}else{
$('#selectAddCartInvntryOptn'+nextId).append($('<option>', {
value: option.slepric+'|'+option.goodsOptnInnb+'|'+option.optnInfo+'|'+option.optnTy,
text: option.optnVal4
}));
}
}
});
$('#selectAddCartInvntryOptn'+nextId).niceSelect('update');
break;
}
//마지막 선택일 경우 셀렉트 기본값으로 되돌림
if(id === lastId){
$('select[name="selectAddCartInvntryOptn"]').not(':first').each(function() {
$(this).find('option').each(function () {
// value가 빈 문자열이 아닌 경우에만 삭제
if ($(this).val() !== '') {
$(this).remove().niceSelect('update');
}
});
});
$('select[name="selectAddCartInvntryOptn"]').val('').niceSelect('update')
}
}
}
});
})
</script>
<body>
<%-- 공통 Header --%>
<jsp:include page="/WEB-INF/views/comm/Header.jsp"/>
<!-- 메인 컨텐츠 영역 -->
<main>
<div class="sub-wrapper">
<div class="sub-content">
<div class="sub-rl">
<%-- 마이페이지 Left 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageLeft.jsp"/>
<div class="sub-right-content">
<%-- 마이페이지 Right 영역 --%>
<jsp:include page="/WEB-INF/views/comm/mpage/MypageRight.jsp"/>
<form id="listForm">
<input type="hidden" id="pageIndex" name="pageIndex" value="${ resultMap.paramVO.pageIndex} }"/>
<div class="sub-right-content__section">
<h3 class="sub-right-content__title">위시리스트</h3>
<div class="myWishlist">
<div class="cartOrder__control">
<div class="b-checkbox-container">
<label class="b-checkbox checkbox">
<input type="checkbox" id="cartCheckAll" value="">
<span class="check"></span>
<span class="control-label">전체선택</span>
</label>
</div>
<div class="cartOrder__control__btnContainer">
<button class="btn sm outline" type="button" onclick="fn_delete_wishlist('#wishListTbody', '<c:out value="${ resultMap.paramVO.pageIndex }"/>', '<c:out value="${ resultMap.paramVO.pageUnit }"/>');">선택삭제</button>
</div>
</div>
<div id="pageDiv">
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<%-- 공통 Footer --%>
<jsp:include page="/WEB-INF/views/comm/Footer.jsp"/>
<!-- 상품 옵션 변경 모달 -->
<div id="goodsOptionDiv">
</div>
<%--장바구니에 선택한 상품 존재시 모달 --%>
<div id="modal-error-confirm-add-cart-duplicate-div"></div>
<script>
//장바구니 전체선택
$('#cartCheckAll').click(function () {
if ($('#cartCheckAll').is(':checked')) {
$('.cartCheck').prop('checked', true);
} else {
$('.cartCheck').prop('checked', false);
}
});
$('.cartCheck').click(function () {
if ($('.cartCheck').length == $('.cartCheck:checked').length) {
$('#cartCheckAll').prop('checked', true);
} else {
$('#cartCheckAll').prop('checked', false);
}
});
</script>
<!-- 모달 -->
<!-- 장바구니 담기-->
<div id = "addCartDiv"></div>
<%--상품 중복선택 모달--%>
<div id = "goodsDuplicateDiv"></div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More