Commit 1984f4df by Takatoshi Miura

db連携中

parent f92daabd
...@@ -5,19 +5,35 @@ var CHAT_DB = {}; ...@@ -5,19 +5,35 @@ var CHAT_DB = {};
//ロカールDBからルーム一覧情報を取得 //ロカールDBからルーム一覧情報を取得
CHAT_DB.getRoomList = function(roomType) { CHAT_DB.getRoomList = function(roomType) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要 return JSON.parse(iosRoomList);
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn //String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType)); return JSON.parse(android.getRoomList(roomType));
} }
}; };
var iosRoomList;
CHAT_DB.getIosRoomList = function(roomList) {
iosRoomList = roomList;
CHAT_DB.getRoomList(0);
};
CHAT_DB.callGetRoomList = function(roomType) {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.getRoomList.postMessage({roomType});
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getRoomList(roomType));
}
}
//ロカールDBからログインしたユーザのデータを取得する。 //ロカールDBからログインしたユーザのデータを取得する。
CHAT_DB.getMyInfo = function(input) { CHAT_DB.getMyInfo = function(input) {
var result = JSON.parse(android.getMyInfo()); var result = JSON.parse(android.getMyInfo());
CHAT.globalLoginParameter.shopMemberId = result.shopMemberId; CHAT.globalLoginParameter.shopMemberId = result.shopMemberId;
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要 //TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn //String形式をJsonに変更してReturn
return result; return result;
...@@ -107,10 +123,6 @@ CHAT_DB.getGroupByName = function(groupName) { ...@@ -107,10 +123,6 @@ CHAT_DB.getGroupByName = function(groupName) {
// アーカイブ一覧 // アーカイブ一覧
var iosArchiveList; var iosArchiveList;
getIosArchiveList = function(archiveList) {
iosArchiveList = archiveList;
CHAT_UI.refreshArchiveScreen();
};
CHAT_DB.callGetArchiveList = function() { CHAT_DB.callGetArchiveList = function() {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
...@@ -121,6 +133,11 @@ CHAT_DB.callGetArchiveList = function() { ...@@ -121,6 +133,11 @@ CHAT_DB.callGetArchiveList = function() {
} }
}; };
CHAT_DB.getIosArchiveList = function(archiveList) {
iosArchiveList = archiveList;
CHAT_UI.refreshArchiveScreen();
};
CHAT_DB.getArchiveList = function() { CHAT_DB.getArchiveList = function() {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
return JSON.parse(iosArchiveList); return JSON.parse(iosArchiveList);
...@@ -140,10 +157,6 @@ CHAT_DB.updateArchiveList = function() { ...@@ -140,10 +157,6 @@ CHAT_DB.updateArchiveList = function() {
// アーカイブ一覧検索 // アーカイブ一覧検索
var iosSearchArchiveList; var iosSearchArchiveList;
var searchWord; var searchWord;
getIosSearchArchiveList = function(archiveList) {
iosSearchArchiveList = archiveList;
ARCHIVE_UI.refreshSearchScreen(searchWord);
};
CHAT_DB.callGetArchiveByName = function(keyword) { CHAT_DB.callGetArchiveByName = function(keyword) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
...@@ -155,10 +168,14 @@ CHAT_DB.callGetArchiveByName = function(keyword) { ...@@ -155,10 +168,14 @@ CHAT_DB.callGetArchiveByName = function(keyword) {
} }
}; };
CHAT_DB.getIosSearchArchiveList = function(archiveList) {
iosSearchArchiveList = archiveList;
ARCHIVE_UI.refreshSearchScreen(searchWord);
};
CHAT_DB.getArchiveByName = function(archiveName) { CHAT_DB.getArchiveByName = function(archiveName) {
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
return JSON.parse(iosSearchArchiveList);
return JSON.parse();
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
// TODO // TODO
} }
......
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