FindIdFormWeb.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org"
  4. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  5. layout:decorator="web/common/layout/DefaultLayoutWeb">
  6. <!--
  7. *******************************************************************************
  8. * @source : FindIdFormWeb.html
  9. * @desc : 아이디 비번 찾기 Page
  10. *============================================================================
  11. * STYLE24
  12. * Copyright(C) 2021 TSIT, All rights reserved.
  13. *============================================================================
  14. * VER DATE AUTHOR DESCRIPTION
  15. * === =========== ========== =============================================
  16. * 1.0 2021.02.05 jsshin 최초 작성
  17. *******************************************************************************
  18. -->
  19. <body>
  20. <th:block layout:fragment="content">
  21. <div id="container" class="container mb">
  22. <div class="wrap">
  23. <div class="content find">
  24. <div class="cont_head">
  25. <h3>style24</h3>
  26. </div>
  27. <div class="cont_body">
  28. <div class="form_wrap form_col_c">
  29. <div class="form_head">
  30. <h4>아이디&#47;비밀번호 찾기</h4>
  31. </div>
  32. <div class="registration_nav">
  33. <ul>
  34. <li class="active"><a href="javascript:void(0)" onclick="cfnGoToPage(_PAGE_CUSTOMER_ID_FIND);">아이디 찾기</a></li>
  35. <li><a href="javascript:void(0)" onclick="cfnGoToPage(_PAGE_CUSTOMER_PWD_FIND);">비밀번호 찾기</a></li>
  36. </ul>
  37. </div>
  38. <div class="registration_tap">
  39. <div class="form_group" style="display: block;">
  40. <!-- 아이디찾기일경우 -->
  41. <div id="searchDiv" class="foldGroup checkcase">
  42. <ul>
  43. <li>
  44. <form id="searchCustInfo" name="searchCustInfo" class="form_wrap" method="post">
  45. <div class="fold_head">
  46. <a href="javascript:void(0)">
  47. <div>
  48. <div class="fold_tit">
  49. <span>회원정보로 찾기</span>
  50. </div>
  51. </div>
  52. </a>
  53. </div>
  54. <div class="fold_cont">
  55. <div class="txt mb30">
  56. <p>등록된 내 회원정보로 찾을 수 있습니다.</p>
  57. </div>
  58. <div class="form_field">
  59. <label class="input_label sr-only">이름</label>
  60. <div class="ui_col_12">
  61. <div class="input_wrap">
  62. <input type="text" id="custNm" name="custNm" placeholder="이름" class="form_control" maxlength="30"/>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="form_field">
  67. <label class="input_label sr-only">생년월일 8자리 (예:19880912)</label>
  68. <div class="ui_col_12">
  69. <div class="input_wrap">
  70. <input type="text" id="birthYmd" name="birthYmd" placeholder="생년월일 8자리 (예:19880912)" class="form_control" maxlength="8" data-valid-type="numeric"/>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="form_field">
  75. <label class="input_label sr-only">이메일</label>
  76. <div class="ui_col_12">
  77. <div class="input_wrap">
  78. <input type="text" id="email" name="email" placeholder="이메일" class="form_control" maxlength="30"/>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="btn_group_block ui_row mt20">
  83. <div class="ui_col_12">
  84. <button type="button" id="btnInfoConfirm" class="btn btn_dark btn_block">
  85. <span>확인</span>
  86. </button>
  87. </div>
  88. </div>
  89. </div>
  90. </form>
  91. </li>
  92. <li>
  93. <div class="fold_head">
  94. <a href="javascript:void(0)">
  95. <div>
  96. <div class="fold_tit" style="width: inherit;">
  97. <span style="width: inherit;">휴대폰 본인인증으로 찾기</span>
  98. </div>
  99. </div>
  100. </a>
  101. </div>
  102. <div class="fold_cont">
  103. <div class="txt">
  104. <p>회원님의 명의로 등록된 휴대폰으로 본인확인을 진행합니다.</p>
  105. </div>
  106. <div class="ui_row mt20">
  107. <div class="ui_col_12">
  108. <button type="button" id="btnCellPhoneCertify" class="btn btn_dark btn_block">
  109. <span>본인명의 휴대폰으로 인증</span>
  110. </button>
  111. </div>
  112. </div>
  113. </div>
  114. </li>
  115. <li>
  116. <div class="fold_head">
  117. <a href="javascript:void(0)">
  118. <div>
  119. <div class="fold_tit" style="width: inherit;">
  120. <span style="width: inherit;">아이핀 인증으로 찾기</span>
  121. </div>
  122. </div>
  123. </a>
  124. </div>
  125. <div class="fold_cont">
  126. <div class="txt">
  127. <p>아이핀 인증을 통해 찾을 수 있습니다.</p>
  128. </div>
  129. <div class="ui_row mt20">
  130. <div class="ui_col_12">
  131. <button type="button" id="btnIpinCertify" class="btn btn_dark btn_block">
  132. <span>아이핀 인증</span>
  133. </button>
  134. </div>
  135. </div>
  136. </div>
  137. </li>
  138. </ul>
  139. </div>
  140. <!-- //아이디찾기일경우 -->
  141. <!-- 아이디찾기 성공일경우 -->
  142. <div id="succeedCustId" class="find_result clear" style="display:none;">
  143. <div class="form_info">
  144. <span class="ico_content_find"></span>
  145. <p>아이디 찾기 결과 안내</p>
  146. </div>
  147. <div class="form_print_bar mt40">
  148. <ul>
  149. <li>
  150. <span class="t_span">아이디</span>
  151. <span id="resultId" name="resultId" class="c_primary bold" data-font="lato"></span>
  152. </li>
  153. <li>
  154. <span class="t_span">가입일자</span>
  155. <span id="joinDt" name="joinDt" class="bold" data-font="lato"></span>
  156. </li>
  157. <li id="liJoinPath" style="display: none;">
  158. <span class="t_span">가입경로</span>
  159. <span id="joinPath" name="joinPath" class="bold" data-font="lato"></span>
  160. </li>
  161. </ul>
  162. </div>
  163. <div class="btn_group_block btn_group_md ui_row">
  164. <div class="ui_col_12">
  165. <button type="button" class="btn btn_dark btn_block">
  166. <span>로그인 하기</span>
  167. </button>
  168. </div>
  169. </div>
  170. </div>
  171. <!-- //아이디찾기 성공일경우 -->
  172. <!-- 회원정보로 아이디찾기 실패일경우 -->
  173. <div id="failCustId" class="find_result clear" style="display: none;">
  174. <div class="form_info">
  175. <span class="ico_content_none"></span>
  176. <p>입력한 정보와 일치하는 아이디가 존재하지 않습니다.</p>
  177. <p class="t_info mt10">
  178. 정확한 확인을 위해 휴대폰 인증/아이핀 인증을 통한<br>아이디 찾기를 진행해 주세요.
  179. </p>
  180. </div>
  181. <div class="btn_group_block btn_group_md ui_row">
  182. <div class="ui_col_6">
  183. <button type="button" class="btn btn_primary btn_block" onclick="cfnGoToPage(_PAGE_CUSTOMER_JOIN);">
  184. <span>회원가입</span>
  185. </button>
  186. </div>
  187. <div class="ui_col_6">
  188. <button type="button" class="btn btn_dark btn_block" onclick="cfnGoToPage(_PAGE_CUSTOMER_ID_FIND);">
  189. <span>다시 찾기</span>
  190. </button>
  191. </div>
  192. </div>
  193. </div>
  194. <!-- //회원정보로 아이디찾기 실패일경우 -->
  195. <!-- 휴대폰,아이핀 본인인증으로 아이디찾기 실패일경우 -->
  196. <div id="failAuthentication" class="find_result clear" style="display: none;">
  197. <div class="form_info">
  198. <span class="ico_content_none"></span>
  199. <p>입력한 정보와 일치하는 아이디가 존재하지 않습니다.</p>
  200. <p class="t_info mt10">
  201. <span class="c_primary">STYLE24의 새로운 가족이 되어 주세요!</span>
  202. </p>
  203. </div>
  204. <div class="btn_group_block btn_group_md ui_row">
  205. <div class="ui_col_12">
  206. <button type="button" class="btn btn_primary btn_block" onclick="cfnGoToPage(_PAGE_CUSTOMER_JOIN);">
  207. <span>회원가입</span>
  208. </button>
  209. </div>
  210. </div>
  211. </div>
  212. <!-- //휴대폰,아이핀 본인인증으로 아이디찾기 실패일경우 -->
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. <script th:inline="javascript">
  221. /*<![CDATA[*/
  222. // 회원정보로 아이디 찾기
  223. $('#btnInfoConfirm').on('click', function() {
  224. let custInfo = $('#searchCustInfo').serializeObject();
  225. if (gagajf.isNull(custInfo.custNm)) {
  226. alert('이름을 형식에 맞게 입력해주세요.');
  227. return;
  228. }
  229. if (gagajf.isNull(custInfo.email)) {
  230. alert('이메일을 입력하여 주세요.');
  231. return;
  232. }
  233. if (!fnCheckValidationEmail(custInfo.email)) {
  234. alert('이메일 형식에 맞게 입력해주세요.');
  235. return;
  236. }
  237. custInfo.authMethod = 'custInfo';
  238. let jsonData = JSON.stringify(custInfo);
  239. //console.log('jsonData', jsonData);
  240. ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack);
  241. });
  242. // 휴대폰 인증
  243. $('#btnCellPhoneCertify').on('click', function () {
  244. cfnOpenCellphoneCertify();
  245. });
  246. // 아이핀 인증
  247. $('#btnIpinCertify').on('click', function () {
  248. cfnOpenIpinCertify();
  249. });
  250. // 나이스 본인인증 후 콜백
  251. var fnNiceCallBack = function(encData, authMethod) {
  252. if (!gagajf.isNull(encData)) {
  253. let custInfo = {};
  254. custInfo.encData = encData;
  255. custInfo.authMethod = authMethod;
  256. let jsonData = JSON.stringify(custInfo);
  257. ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack)
  258. }
  259. };
  260. // 찾기결과
  261. var fnInfoConfirmCallBack = function (result) {
  262. $('#searchDiv').hide();
  263. if (result.isFind) {
  264. fnGetDisplaySucc(result.authMethod, result);
  265. } else {
  266. fnGetDisplayFail(result.authMethod);
  267. }
  268. };
  269. // 찾기성공
  270. var fnGetDisplaySucc = function (authMethod, custInfo) {
  271. $('#resultId').text(custInfo.maskingCustId);
  272. $('#joinDt').text(toDateFormat(custInfo.joinDt).replaceAll('-','.'));
  273. let joinPath = fnSnsJoinPath(custInfo); // 가입경로 : 직접이면 표시 안함, 간편가입 연동 표시
  274. if (!gagajf.isNull(joinPath)) {
  275. $('#liJoinPath').show();
  276. $('#joinPath').text(joinPath);
  277. }
  278. $('#succeedCustId').show();
  279. };
  280. // 찾기실패
  281. var fnGetDisplayFail = function (authMethod) {
  282. $('.form_head').hide();
  283. $('.registration_nav').hide();
  284. if (authMethod === 'custInfo') {
  285. $('#failCustId').show();
  286. }
  287. if (authMethod === 'mobile' || authMethod === 'ipin') {
  288. $('#failAuthentication').show();
  289. }
  290. };
  291. // 가입경로
  292. var fnSnsJoinPath = function (custInfo) {
  293. let snsType = '';
  294. if (!gagajf.isNull(custInfo.ysJoinDt)) {
  295. snsType += 'YES24로 연동';
  296. }
  297. if (!gagajf.isNull(custInfo.nvJoinDt)) {
  298. if (!gagajf.isNull(snsType)) {
  299. snsType += '/'
  300. }
  301. snsType = '네이버로 연동'
  302. }
  303. if (!gagajf.isNull(custInfo.kkJoinDt)) {
  304. if (!gagajf.isNull(snsType)) {
  305. snsType += '/'
  306. }
  307. snsType += '카카오로 연동';
  308. }
  309. return snsType;
  310. };
  311. // 이메일 체크
  312. var fnCheckValidationEmail = function (email) {
  313. const regexp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
  314. let result = true;
  315. if (!regexp.test(email)) {
  316. result = false;
  317. }
  318. return result;
  319. };
  320. var toDateFormat = function(value) {
  321. if (gagajf.isNull(value))
  322. return "";
  323. return value.replaceAll("/", "").replaceAll("-", "").toDate("YYYYMMDD").format("YYYY-MM-DD");
  324. }
  325. var ajaxJsonSubmit = function (url, json, callback) {
  326. $.ajax({
  327. type : "POST",
  328. url : url,
  329. dataType : 'json',
  330. data : json,
  331. beforeSend : function(xhr, opts) { // 통신 전
  332. // when validation is false
  333. // AJAX call
  334. xhr.setRequestHeader('AJAX', 'true');
  335. // dataType: "json"일 때
  336. xhr.setRequestHeader('Accept', 'application/json');
  337. xhr.setRequestHeader('Content-Type', 'application/json');
  338. },
  339. success : function(result) {
  340. if (typeof(result.status) == 'undefined' || result.status === 200) { // 성공
  341. if (!gagajf.isNull(result.message)) {
  342. if (alert(result.message)) {
  343. if (typeof(callback) === 'function') {
  344. callback.call(this, result);
  345. }
  346. }
  347. } else {
  348. if (typeof(callback) == "function") {
  349. callback.call(this, result);
  350. }
  351. }
  352. } else { // 실패
  353. if (!gagajf.isNull(result.error.message)) {
  354. alert(result.error.message);
  355. }
  356. }
  357. },
  358. error : function() {
  359. // error code
  360. alert('오류로 인해 처리되지 않았습니다.');
  361. }
  362. });
  363. }
  364. /*]]>*/
  365. </script>
  366. </th:block>
  367. </body>
  368. </html>