Commit 84e2b3a1 by NGUYEN HOANG SON

load header with template

parent 3e8b4c1e
......@@ -24,11 +24,17 @@
<script src="../common/js/constant.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">
$(document).ready(function(){
PushMessageDetail.init();
});
</script>
</head>
<body onload="PushMessageDetail.init();">
<body>
<!-- header -->
<div id="includedHeader"></div>
......
......@@ -3,6 +3,7 @@ var PushMessageDetail = {};
PushMessageDetail.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'pushMessageDetail/';
PushMessageDetail.dummyMessageDetailJson = {
pushMessageId: 1,
pushMessage: "内容が入ります。内容が入ります。内容が入ります。内容が入ります。",
pushSendDate: "2022/07/06 14:14",
operationName: "絞り検索",
......@@ -10,9 +11,7 @@ PushMessageDetail.dummyMessageDetailJson = {
}
PushMessageDetail.init = function() {
$("#includedHeader").load("../common/header.html" , function() {
I18N.initi18n();
});
TEMPLATE.loadHearder("#includedHeader");
let urlParam = COMMON.getUrlParameter();
if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') {
return;
......@@ -28,15 +27,12 @@ PushMessageDetail.getMessageDetail = function(pushMessageId, callback) {
pushMessageId: pushMessageId
};
const url = PushMessageDetail.baseApiUrl;
COMMON.cmsAjax(url, param, false, function (json) {
if (callback) {
callback(json);
COMMON.cmsAjax(url, param, true, function (json) {
if (callback && json && json.pushMessage) {
callback(json.pushMessage);
}
}, function() {
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