| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <!DOCTYPE html>
- <html lang="ko"
- xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorator="mob/common/layout/AppLayoutMob">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <!--
- *******************************************************************************
- * @source : NoticeFormMob.html
- * @desc : 알림함 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2021 TSIT, All rights reserved.
- *============================================================================
- * VER DATE AUTHOR DESCRIPTION
- * === =========== ========== =============================================
- * 1.0 2021.05.21 jsshin 최초 작성
- *******************************************************************************
- -->
- <body>
- <th:block layout:fragment="content">
- <main class="container app-only">
- <!-- ★ 컨텐츠 시작 -->
- <section id="notice" class="notice nodata">
- </section>
- <!-- ★ 컨텐츠 종료 -->
- </main>
- <script th:inline="javascript">
- $(document).ready(function(){
- $('#htopTitle').text('알림함');
- if (_isApp === 'true') {
- if (_osType === 'A') {
- window.style24.getPushList();
- } else if (_osType === 'I') {
- window.webkit.messageHandlers.getPushList.postMessage({"dummy":"dummy"});
- }
- } else {
- $('#notice').addClass('nodata');
- }
- });
- var pushListInfo = function (pushList) {
- let orgPushList;
- //IOS는 앱에서 BASE64로 인코딩 한후 전달 한다.
- if (_osType === 'I') {
- orgPushList = window.atob(pushList);
- } else if (_osType === 'A') {
- orgPushList = pushList;
- }
- if (!gagajf.isNull(orgPushList)) {
- let pushListJosn = JSON.parse(orgPushList);
- let html = '';
- $.each(pushListJosn.pushList, function(idx, item) {
- if (_osType === 'I') {
- alert('fnDecodeUnicode :' + fnDecodeUnicode(item.title.toLowerCase()) + 'escape :' + escape(item.title)
- + ' unescape :' + unescape(item.title)
- + ' encodeURI:' + encodeURI(item.title)
- + ' decodeURI:' + decodeURI(item.title)
- + ' encodeURIComponent:' + encodeURIComponent(item.title)
- + ' decodeURIComponent:' + decodeURIComponent(item.title)
- );
- }
- html += '<div class="inner">\n';
- html += ' <a href="'+item.link+'">\n';
- html += ' <dl>\n';
- html += ' <dt class="tit">\n';
- let title = '';
- if (_osType === 'I') {
- title = fnDecodeUnicode(item.title.toLowerCase());
- } else if(_osType === 'A') {
- title = item.title;
- }
- html += title;
- html += ' </dt>\n'
- html += ' <dd class="cont_txt">\n';
- let content = '';
- if (_osType === 'I') {
- content = fnDecodeUnicode(item.content.toLowerCase());
- } else if(_osType === 'A') {
- content = item.content;
- }
- html += content;
- html += ' </dd>\n';
- if (!gagajf.isNull(item.imgUrl)) {
- html += ' <dd class="cont_img">\n';
- html += ' <img src="'+ item.imgUrl +'" />\n';
- html += ' </dd>\n';
- }
- html += ' <dd class="cont_data">\n';
- html += ' <span>\n';
- html += fnDisplayDate(item.date);
- html += ' </span>\n';
- html += ' </dd>\n'
- html += ' </dl>\n'
- html += ' </a>';
- html += '</div>\n'
- });
- $('#notice').removeClass('nodata');
- $('#notice').html(html);
- } else {
- $('#notice').addClass('nodata');
- }
- }
-
- var fnDisplayDate = function (date) {
- let resultDate = '';
- if(!gagajf.isNull(date)) {
- let year = date.substring(0, 4);
- let month = date.substring(4, 6);
- let day = date.substring(6, 8);
- resultDate = year+'.'+month+'.'+day;
- }
- return resultDate;
- }
- var fnDecodeUnicode = function(context) {
- const regExp = /\\u([\d\w]{4})/gi;
- context = context.replace(regExp, function (match, grp)
- { return String.fromCharCode(parseInt(grp, 16)); } );
- return unescape(context);
- }
- </script>
- </th:block>
- </body>
- </html>
|