내정보, 비밀번호 확인, 내정보 수정 : UX에 따라 수정 필요.
This commit is contained in:
@@ -61,12 +61,12 @@
|
||||
obj,
|
||||
function (rstData, status) {
|
||||
if(rstData.code ==='SUCCESS'){
|
||||
location.href = ENV.httpUrl.user;
|
||||
location.replace(ENV.httpUrl.user);
|
||||
} else if (rstData.code === 'ERROR'){
|
||||
if(rstData.message ==='INVALID_PASSWORD'){
|
||||
ajaxUtil._alert('비밀번호가 일치하지 않습니다.', '비밀번호 확인');
|
||||
ajaxUtil._alert('입력하신 정보가 맞지 않습니다.\n 다시 확인해주세요.',null);
|
||||
} else {
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', '비밀번호 확인');
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<p class="form-desc">필수입력</p>
|
||||
|
||||
<section class="form-group">
|
||||
<form method="post" name="reqForm" id="reqForm" onsubmit="formControl.authInfoUser();" th:action="@{/api/front/info/user/update}" th:object="${userInfo}">
|
||||
<!-- 이름 -->
|
||||
<div class="component-input">
|
||||
<div class="input-label">
|
||||
@@ -18,7 +19,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="text" id="temp_input_0001" placeholder="이름을 입력해 주세요">
|
||||
<input type="text" id="temp_input_0001" placeholder="이름을 입력해 주세요" th:field="*{ownerName}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 연령 -->
|
||||
@@ -29,19 +30,21 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0002" placeholder="만 나이를 입력해 주세요">
|
||||
<input type="number" id="temp_input_0002" placeholder="만 나이를 입력해 주세요" th:field="*{ownerAge}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 가구연락처 -->
|
||||
<div class="input-flex-group type-num">
|
||||
<div class="input-label">
|
||||
<label for="temp_input_00012" class="label-txt">
|
||||
<label for="tel1Id" class="label-txt">
|
||||
가구 연락처
|
||||
</label>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="select-group">
|
||||
<div id="temp_input_00012" class="component-select bottom-sheet" data-props-default="선택" data-props-type="bottomSheet">
|
||||
|
||||
<div id="tel1Id" class="component-select bottom-sheet" th:data-props-default="${userInfo.tel1}" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{tel1}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
@@ -54,12 +57,23 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="02">02</li>
|
||||
<li class="option" data-value="31">31</li>
|
||||
<li class="option" data-value="033">033</li>
|
||||
<li class="option" data-value="042">042</li>
|
||||
<li class="option" data-value="043">043</li>
|
||||
<li class="option" data-value="051">051</li>
|
||||
<li class="option" data-value="052">052</li>
|
||||
<li class="option" data-value="053">053</li>
|
||||
<li class="option" data-value="054">054</li>
|
||||
<li class="option" data-value="055">055</li>
|
||||
<li class="option" data-value="061">061</li>
|
||||
<li class="option" data-value="062">062</li>
|
||||
<li class="option" data-value="063">063</li>
|
||||
<li class="option" data-value="064">064</li>
|
||||
<li class="option" data-value="010">010</li>
|
||||
<li class="option" data-value="011">011</li>
|
||||
<li class="option" data-value="111">111</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,12 +81,12 @@
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0003" placeholder=0000>
|
||||
<input type="number" placeholder=0000 th:field="*{tel2}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0004" placeholder=0000>
|
||||
<input type="number" placeholder=0000 th:field="*{tel3}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,13 +94,16 @@
|
||||
<!-- 휴대폰 번호 -->
|
||||
<div class="input-flex-group type-num">
|
||||
<div class="input-label">
|
||||
<label for="temp_input_0005" class="label-txt">
|
||||
<label for="phoneId" class="label-txt">
|
||||
휴대폰 번호 <i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="select-group">
|
||||
<div id="temp_input_0005" class="component-select bottom-sheet" data-props-default="선택" data-props-type="bottomSheet">
|
||||
|
||||
|
||||
<div id="phoneId" class="component-select bottom-sheet" th:data-props-default="${userInfo.phone1}" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{phone1}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
@@ -99,12 +116,8 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="010">010</li>
|
||||
<li class="option" data-value="011">011</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,12 +125,12 @@
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0006" placeholder=0000>
|
||||
<input type="number" id="temp_input_0006" placeholder=0000 th:field="*{phone2}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="number" id="temp_input_0007" placeholder=0000>
|
||||
<input type="number" id="temp_input_0007" placeholder=0000 th:field="*{phone3}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -131,7 +144,10 @@
|
||||
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
|
||||
</p>
|
||||
</div>
|
||||
<div id="select213" class="component-select bottom-sheet" data-props-default="시/도 선택" data-props-type="bottomSheet">
|
||||
|
||||
|
||||
<div id="regionMainCodeId" class="component-select bottom-sheet" data-props-default="시/도 선택" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{regionMainCode}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt">선택</span>
|
||||
</button>
|
||||
@@ -144,20 +160,20 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="option7">option7</li>
|
||||
<th:block th:each="item : ${regionMainList}">
|
||||
<li class="option" th:data-value="${item.codeValue}" th:text="${item.codeText}">option1</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="select-group">
|
||||
<div id="select3" class="component-select bottom-sheet" data-props-default="시/군/구 선택" data-props-type="bottomSheet">
|
||||
<div id="regionSubCodeId" class="component-select bottom-sheet" data-props-default="시/군/구 선택" data-props-type="bottomSheet">
|
||||
<input type="hidden" th:field="*{regionSubCode}" data-type="select">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt">선택</span>
|
||||
</button>
|
||||
@@ -170,13 +186,10 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option" data-value="option1">option1</li>
|
||||
<li class="option" data-value="option2">option2</li>
|
||||
<li class="option" data-value="option3">option3</li>
|
||||
<li class="option" data-value="option4">option4</li>
|
||||
<li class="option" data-value="option5">option5</li>
|
||||
<li class="option" data-value="option6">option6</li>
|
||||
<li class="option" data-value="option7">option7</li>
|
||||
<th:block th:each="item : ${regionSubList}">
|
||||
<li class="option" th:data-value="${item.codeValue}" th:text="${item.codeText}" >option1</li>
|
||||
</th:block>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -184,15 +197,16 @@
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="text" id="temp_input_00023" placeholder="세부 주소를 입력해 주세요">
|
||||
<input type="text" id="temp_input_00023" placeholder="세부 주소를 입력해 주세요" th:field="*{address}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary" onclick="formControl.confirmPopup()">
|
||||
<span class="btn-txt">변경</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -200,42 +214,147 @@
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 모달 팝업 -->
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal confirmPopup" data-props-dimm-click="true">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-tit">개인정보 수집 및 활용 동의</h3>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<div>
|
||||
이런 저런 내용<br><br><br><br><br><br><br><br><br>모달 스크롤 적용필요!!!
|
||||
</div>
|
||||
<div class="component-btns">
|
||||
<div class="btns-row two-col">
|
||||
<div class="btns-col-1">
|
||||
<button type="button" class="btn btn-full btn-l btn-secondary" onclick="ENV.module.confirmPopup.close();">
|
||||
<span class="btn-txt">동의 안함</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btns-col-2">
|
||||
<button type="button" class="btn btn-full btn-l btn-primary" onclick="formControl.confirmPopupOk()">
|
||||
<span class="btn-txt">동의</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="modal-close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- //모달 팝업 -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[|#{uri.front.info.user.path}/password|]]*/'rootUrl',
|
||||
auth: /*[[|/api/front#{uri.front.info.user.path}/password/auth|]]*/'passwordAuthUrl',
|
||||
user: /*[[#{uri.front.info.user.path}]]*/'userUrl',
|
||||
|
||||
root: /*[[#{uri.front.info.user.path}]]*/'rootUrl',
|
||||
user: /*[[|/api/front#{uri.front.info.user.path}/update|]]*/'updateUrl',
|
||||
myInfo: /*[[#{uri.front.info.path}]]*/'myInfoUrl',
|
||||
},
|
||||
module:{
|
||||
confirmPopup : null
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
|
||||
let formControl = {
|
||||
authInfoUser() {
|
||||
init(){
|
||||
this._bindUI()
|
||||
},
|
||||
_bindUI(){
|
||||
ENV.module.confirmPopup = document.querySelector(".confirmPopup").ui;
|
||||
},
|
||||
confirmPopup(){
|
||||
ENV.module.confirmPopup.open();
|
||||
},
|
||||
confirmPopupOk(){
|
||||
ENV.module.confirmPopup.close();
|
||||
|
||||
setTimeout(function() {
|
||||
formControl.updateUserInfo();
|
||||
}, 500);
|
||||
},
|
||||
updateUserInfo() {
|
||||
|
||||
const f = document.reqForm;
|
||||
// TODO 어쩔수 없이 이렇게 하는데..... 콤포넌트값 핸들링 방법 UX에서 지정하면 수정해야함.
|
||||
const tel1Element = document.getElementById('tel1Id');
|
||||
const phone1IdElement = document.getElementById('phone1Id');
|
||||
const regionMainCodeIdElement = document.getElementById('regionMainCodeId');
|
||||
const regionSubCodeIdElement = document.getElementById('regionSubCodeId');
|
||||
if (tel1Element && tel1Element.value) {
|
||||
f.tel1.value = tel1Element.value;
|
||||
}
|
||||
if (phone1IdElement && phone1IdElement.value) {
|
||||
f.phone1.value = phone1IdElement.value;
|
||||
}
|
||||
if (regionMainCodeIdElement && regionMainCodeIdElement.value) {
|
||||
f.regionMainCode.value = regionMainCodeIdElement.value;
|
||||
}
|
||||
if (regionSubCodeIdElement && regionSubCodeIdElement.value) {
|
||||
f.regionSubCode.value = regionSubCodeIdElement.value;
|
||||
}
|
||||
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
console.log(obj)
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.auth,
|
||||
obj,
|
||||
function (rstData, status) {
|
||||
if(rstData.code ==='SUCCESS'){
|
||||
location.href = ENV.httpUrl.user;
|
||||
} else if (rstData.code === 'ERROR'){
|
||||
if(rstData.message ==='INVALID_PASSWORD'){
|
||||
ajaxUtil._alert('비밀번호가 일치하지 않습니다.', '비밀번호 확인');
|
||||
} else {
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', '비밀번호 확인');
|
||||
}
|
||||
}
|
||||
},
|
||||
ENV.httpUrl.user,
|
||||
obj,
|
||||
function (rstData, status) {
|
||||
if(rstData.code ==='SUCCESS'){
|
||||
ajaxUtil._alert('개인정보 변경이 완료되었습니다.', null, function () {
|
||||
/**
|
||||
* TODO
|
||||
* 내정보에서만 들어온다는 가정하에서 back을 하게함 SB에는 내정보로 이동하게 되어 있음.
|
||||
*/
|
||||
history.back()
|
||||
});
|
||||
} else if (rstData.code === 'ERROR'){
|
||||
ajaxUtil._alert('잠시 뒤에 다시 시도해 주세요.', null);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
telAndPhoneCheck(tel1, tel2, tel3) {
|
||||
// 공백 제거
|
||||
tel1 = tel1.trim();
|
||||
tel2 = tel2.trim();
|
||||
tel3 = tel3.trim();
|
||||
|
||||
const telRegex = /^[0-9]+$/;
|
||||
if (!telRegex.test(tel1) || !telRegex.test(tel2) || !telRegex.test(tel3)) {
|
||||
return null;
|
||||
}
|
||||
if (!((tel1.length === 2 || tel1.length === 3) && tel2.length === 4 && tel3.length === 4)) {
|
||||
return null;
|
||||
}
|
||||
const formatted = `${tel1}-${tel2}-${tel3}`;
|
||||
return formatted;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
</h3>
|
||||
|
||||
<div class="">
|
||||
<label for="">ID</label>
|
||||
<input autofocus class="" id="floatingInput" name="username" placeholder="ID를 입력해주세요"
|
||||
<label for="floatingInput">ID</label>
|
||||
<input autofocus class="" id="floatingInput" name="username" placeholder="ID를 입력해주세요" value="11111"
|
||||
type="text">
|
||||
</div>
|
||||
<div class="">
|
||||
<label for="floatingPassword">Password</label>
|
||||
<input class="f" id="floatingPassword" name="password" placeholder="Password" type="password">
|
||||
<input class="f" id="floatingPassword" name="password" placeholder="Password" type="password" value="1111">
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
|
||||
Reference in New Issue
Block a user