Quellcode durchsuchen

아이폰 푸시기능 테스트 위해 함수 추가

jsshin vor 4 Jahren
Ursprung
Commit
6ea87de38a
1 geänderte Dateien mit 67 neuen und 1 gelöschten Zeilen
  1. 67 1
      src/main/webapp/WEB-INF/views/mob/app/NoticeFormMob.html

+ 67 - 1
src/main/webapp/WEB-INF/views/mob/app/NoticeFormMob.html

@@ -42,7 +42,7 @@
 	});
 
 	var pushListInfo = function (pushList) {
-		alert('pushListInfo Call ===> ' + pushList);
+		alert('pushListInfo1 Call ===> ' + pushList);
 		// let orgPushList;
 		// //IOS는 앱에서 BASE64로 인코딩 한후 전달 한다.
 		// if (_osType === 'I') {
@@ -106,6 +106,72 @@
 			$('#notice').addClass('nodata');
 		}
 	}
+
+	var pushListInfo2 = function (pushList) {
+		alert('pushListInfo2 Call ===> ' + 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.content.toLowerCase())
+					 + 'escape :' + escape(item.content)
+					 + ' unescape :' + unescape(item.content)
+					 + ' encodeURI:' + encodeURI(item.content)
+					 + ' decodeURI:' + decodeURI(item.content)
+					 + ' encodeURIComponent:' + encodeURIComponent(item.content)
+					 + ' decodeURIComponent:' + decodeURIComponent(item.content)
+					);
+				}
+				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 = '';