Commit 84e2b3a1 by NGUYEN HOANG SON

load header with template

parent 3e8b4c1e
...@@ -24,11 +24,17 @@ ...@@ -24,11 +24,17 @@
<script src="../common/js/constant.js?__UPDATEID__"></script> <script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script> <script src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/pushMessageDetail/push-message-detail.js"></script> <script type="text/javascript" src="../js/pushMessageDetail/push-message-detail.js"></script>
<script type="text/javascript">
$(document).ready(function(){
PushMessageDetail.init();
});
</script>
</head> </head>
<body onload="PushMessageDetail.init();"> <body>
<!-- header --> <!-- header -->
<div id="includedHeader"></div> <div id="includedHeader"></div>
......
...@@ -3,6 +3,7 @@ var PushMessageDetail = {}; ...@@ -3,6 +3,7 @@ var PushMessageDetail = {};
PushMessageDetail.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'pushMessageDetail/'; PushMessageDetail.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'pushMessageDetail/';
PushMessageDetail.dummyMessageDetailJson = { PushMessageDetail.dummyMessageDetailJson = {
pushMessageId: 1,
pushMessage: "内容が入ります。内容が入ります。内容が入ります。内容が入ります。", pushMessage: "内容が入ります。内容が入ります。内容が入ります。内容が入ります。",
pushSendDate: "2022/07/06 14:14", pushSendDate: "2022/07/06 14:14",
operationName: "絞り検索", operationName: "絞り検索",
...@@ -10,9 +11,7 @@ PushMessageDetail.dummyMessageDetailJson = { ...@@ -10,9 +11,7 @@ PushMessageDetail.dummyMessageDetailJson = {
} }
PushMessageDetail.init = function() { PushMessageDetail.init = function() {
$("#includedHeader").load("../common/header.html" , function() { TEMPLATE.loadHearder("#includedHeader");
I18N.initi18n();
});
let urlParam = COMMON.getUrlParameter(); let urlParam = COMMON.getUrlParameter();
if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') { if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') {
return; return;
...@@ -28,15 +27,12 @@ PushMessageDetail.getMessageDetail = function(pushMessageId, callback) { ...@@ -28,15 +27,12 @@ PushMessageDetail.getMessageDetail = function(pushMessageId, callback) {
pushMessageId: pushMessageId pushMessageId: pushMessageId
}; };
const url = PushMessageDetail.baseApiUrl; const url = PushMessageDetail.baseApiUrl;
COMMON.cmsAjax(url, param, false, function (json) { COMMON.cmsAjax(url, param, true, function (json) {
if (callback) { if (callback && json && json.pushMessage) {
callback(json); callback(json.pushMessage);
} }
}, function() { }, function() {
console.log('PushMessageDetail.getMessageDetail error'); console.log('PushMessageDetail.getMessageDetail error');
if (callback) {
callback(PushMessageDetail.dummyMessageDetailJson);
}
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment