瀏覽代碼

모바일 PUSH 적용

juney 2 年之前
父節點
當前提交
c6b327f254
共有 2 個文件被更改,包括 19 次插入5 次删除
  1. 12 5
      src/main/webapp/mobile/js/app/main.js
  2. 7 0
      src/main/webapp/mobile/js/config.js

+ 12 - 5
src/main/webapp/mobile/js/app/main.js

@@ -29,11 +29,18 @@ function clickNotify(nticeNo) {
29
  
29
  
30
 var mobMainObj = {
30
 var mobMainObj = {
31
 	init: function () {
31
 	init: function () {
32
-		this.ui();
33
-		this.action();
34
-		this.notice.init();
35
-		// this.count.init();
36
-		// this.chart.init();
32
+		var PushURL = urlParams.PushURL;
33
+		if(PushURL) {
34
+			const id = PushURL.substring(PushURL.lastIndexOf('/') + 1, PushURL.length).replace(".html", "");
35
+			const href = MOBILE_CONTEXTPATH + PushURL;
36
+			_this.loadPage(id, href);
37
+		} else {
38
+			this.ui();
39
+			this.action();
40
+			this.notice.init();
41
+			// this.count.init();
42
+			// this.chart.init();
43
+		}
37
 		
44
 		
38
 	},
45
 	},
39
 	ui: function() { 
46
 	ui: function() { 

+ 7 - 0
src/main/webapp/mobile/js/config.js

@@ -915,6 +915,13 @@ let CommonObj = {
915
 	isApp: (/oqpo_android|oqpo_ios/).test(navigator.userAgent.toLowerCase())
915
 	isApp: (/oqpo_android|oqpo_ios/).test(navigator.userAgent.toLowerCase())
916
 };
916
 };
917
 
917
 
918
+var urlParams = location.search.split(/[?&]/).slice(1).map(function(paramPair) {
919
+	return paramPair.split(/=(.+)?/).slice(0, 2);
920
+}).reduce(function(obj, pairArray) {
921
+	obj[pairArray[0]] = pairArray[1];
922
+	return obj;
923
+}, {});
924
+
918
 function itp_fn_date_format(date, type) {
925
 function itp_fn_date_format(date, type) {
919
 	let month = date.getMonth() + 1;
926
 	let month = date.getMonth() + 1;
920
 	let day = date.getDate();
927
 	let day = date.getDate();