Commit 1f2b3576 by hoangson

fix bug remove session when reload webview

parent f1343cf4
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
<div></div> <div></div>
<h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang" data-msg="dashboardHeaderTitle">ダッシュボード</h1> <h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang" data-msg="dashboardHeaderTitle">ダッシュボード</h1>
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<a href="dashboard-setting.html" class="nav-link text-white lht-0 p-1 mr-2"> <a href="javascript:CHK.goUrlWithCurrentParams('dashboard-setting.html');" class="nav-link text-white lht-0 p-1 mr-2">
<img class="icon" src="img/icon_dashboard_setting.svg" alt="設定"> <img class="icon" src="img/icon_dashboard_setting.svg" alt="設定">
<span class="d-none d-md-inline fs-10 align-middle multi-lang" data-msg="buttonDashboardSetting"> <span class="d-none d-md-inline fs-10 align-middle multi-lang" data-msg="buttonDashboardSetting">
設定 設定
......
var CHK_Dashboard = {}; var CHK_Dashboard = {};
CHK_Dashboard.pickupItems = [ CHK_Dashboard.pickupItems = [
{id: 'newReport', href: 'pickup.html?pickupActive=newReport', count: 0, enabled: true, img: {src: 'img/icon_new.svg'}, msg: 'newRegistrationTitle'}, {id: 'newReport', href: "javascript:CHK_Dashboard.goPickup('newReport');", count: 0, enabled: true, img: {src: 'img/icon_new.svg'}, msg: 'newRegistrationTitle'},
{id: 'continousWork', href: 'pickup.html?pickupActive=continousWork', count: 0, enabled: true, img: {src: 'img/icon_proccess.svg'}, msg: 'continousWorkTitle'}, {id: 'continousWork', href: "javascript:CHK_Dashboard.goPickup('continousWork');", count: 0, enabled: true, img: {src: 'img/icon_proccess.svg'}, msg: 'continousWorkTitle'},
{id: 'reportWarning', href: 'pickup.html?pickupActive=reportWarning', count: 0, enabled: true, img: {src: 'img/icon_alert.svg'}, msg: 'reportWarningTitle'}, {id: 'reportWarning', href: "javascript:CHK_Dashboard.goPickup('reportWarning');", count: 0, enabled: true, img: {src: 'img/icon_alert.svg'}, msg: 'reportWarningTitle'},
]; ];
CHK_Dashboard.communicationItems = [ CHK_Dashboard.communicationItems = [
{id: 'messageList', href: "message-list.html", count: 0, enabled: true, img: {src: 'img/icon_message_lsit.svg'}, msg: 'messageListTitle'}, {id: 'messageList', href: "javascript:CHK_Dashboard.goMessageList();", count: 0, enabled: true, img: {src: 'img/icon_message_lsit.svg'}, msg: 'messageListTitle'},
{id: 'sendMessage', href: "javascript:CHK.sendAppCommand('goSendMessage');", count: 0, enabled: true, img: {src: 'img/icon_send_message.svg'}, msg: 'sendMessageTitle'}, {id: 'sendMessage', href: "javascript:CHK.sendAppCommand('goSendMessage');", count: 0, enabled: true, img: {src: 'img/icon_send_message.svg'}, msg: 'sendMessageTitle'},
{id: 'distanceSupport', href: "javascript:CHK.sendAppCommand('goDistanceSupport');", count: 0, enabled: true, img: {src: 'img/icon_remote.svg'}, msg: 'distanceSupportTitle'}, {id: 'distanceSupport', href: "javascript:CHK.sendAppCommand('goDistanceSupport');", count: 0, enabled: true, img: {src: 'img/icon_remote.svg'}, msg: 'distanceSupportTitle'},
{id: 'chat', href: "javascript:CHK.sendAppCommand('goChat');", count: 0, enabled: false, img: {src: 'img/icon_chat.svg'}, msg: 'chatTitle'}, {id: 'chat', href: "javascript:CHK.sendAppCommand('goChat');", count: 0, enabled: false, img: {src: 'img/icon_chat.svg'}, msg: 'chatTitle'},
...@@ -89,4 +89,12 @@ CHK_Dashboard.updateDataCommunications = function() { ...@@ -89,4 +89,12 @@ CHK_Dashboard.updateDataCommunications = function() {
item.enabled = CHK.isChat; item.enabled = CHK.isChat;
} }
}); });
}
CHK_Dashboard.goPickup = function(pickupId) {
CHK.goUrlWithCurrentParams('pickup.html', {pickupActive: pickupId});
}
CHK_Dashboard.goMessageList = function() {
CHK.goUrlWithCurrentParams('message-list.html', {});
} }
\ No newline at end of file
...@@ -50,9 +50,8 @@ CHK_Footer.isIndexPage = function() { ...@@ -50,9 +50,8 @@ CHK_Footer.isIndexPage = function() {
} }
CHK_Footer.goIndexPage = function(tabId) { CHK_Footer.goIndexPage = function(tabId) {
var href = 'index.html';
sessionStorage.activeTab = tabId; sessionStorage.activeTab = tabId;
location.href = href; CHK.goUrlWithCurrentParams('index.html', {activeTab: tabId});
} }
CHK_Footer.activeDashboardBottomNav = function() { CHK_Footer.activeDashboardBottomNav = function() {
......
...@@ -27,7 +27,7 @@ CHK_MessageList.refresh = function() { ...@@ -27,7 +27,7 @@ CHK_MessageList.refresh = function() {
CHK_MessageList.clickMessage = function(pushMessageId) { CHK_MessageList.clickMessage = function(pushMessageId) {
$("#pushMessageId_" + pushMessageId).removeClass('unread'); $("#pushMessageId_" + pushMessageId).removeClass('unread');
location.href = 'message-detail.html?pushMessageId=' + pushMessageId; CHK.goUrlWithCurrentParams('message-detail.html', {pushMessageId: pushMessageId});
} }
CHK_MessageList.createMessageList = function(messageList) { CHK_MessageList.createMessageList = function(messageList) {
......
...@@ -383,6 +383,17 @@ CHK.saveInitSession = function() { ...@@ -383,6 +383,17 @@ CHK.saveInitSession = function() {
sessionStorage.CHK = JSON.stringify(sessionData); sessionStorage.CHK = JSON.stringify(sessionData);
} }
CHK.goUrlWithCurrentParams = function(url, params) {
//ios will remove all web types data when reopen webview
//need add common parameters: app, lang, debug, mobile_flg, isChat, ...
const mixParams = Object.assign(CHK.getUrlParameter(), params);
if (url.includes("?")) {
location.href = url + '&' + new URLSearchParams(mixParams);
} else {
location.href = url + '?' + new URLSearchParams(mixParams);
}
}
// 共通初期処理 // 共通初期処理
CHK.initCommon = function() { CHK.initCommon = function() {
//JSON初期化 //JSON初期化
......
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