Commit 0b9baea9 by Lee Munkyeong

コードレビュー対応

parent 67e11f79
...@@ -706,3 +706,23 @@ a.article:hover { ...@@ -706,3 +706,23 @@ a.article:hover {
.chat-list-type-btn { .chat-list-type-btn {
width: 30%; width: 30%;
} }
#my_info > div > div {
padding-left: 5%;
}
#favorite_list > div > div {
padding-left: 5%;
}
#my_group_list > div > div {
padding-left: 5%;
}
.contact-seperator {
width: 100%;
background-color: #095395!important;
color: white;
margin-bottom: 0px;
}
...@@ -234,14 +234,14 @@ ...@@ -234,14 +234,14 @@
</div> </div>
<div id="my_info" class="inbox_user row"> <div id="my_info" class="inbox_user row">
</div> </div>
<div class="collapsible-content">
<label class="contact-seperator" id="favorite-seperator">Favorite</label>
<div id="favorite_list" class="inbox_user row"> <div id="favorite_list" class="inbox_user row">
</div> </div>
</div> <label class="contact-seperator" id="mygroup-seperator">MY GROUP</label>
<div class="collapsible-content">
<div id="my_group_list" class="inbox_user row"> <div id="my_group_list" class="inbox_user row">
</div> </div>
</div>
</div> </div>
</div> </div>
...@@ -458,6 +458,28 @@ ...@@ -458,6 +458,28 @@
</div> </div>
</div> </div>
</script> </script>
<script id="favorite-user-template" type="text/template">
<div class="user_list col-12" data-name="{{name}}">
<div class="user_people">
<div class="user_img">
<img src="{{profileImage}}" alt="">
</div>
<div class="user_ib">
<h5>{{name}}</h5>
<p>{{info}}</p>
</div>
<div class="squareBox userCheckBox" data-name="{{name}}" data-id="{{id}}">
<div class="squareBoxContent">
<div>
<span>
<i class="fas fa-check"></i>
</span>
</div>
</div>
</div>
</div>
</div>
</script>
<script src="./socket.io/dist/socket.io.js"></script> <script src="./socket.io/dist/socket.io.js"></script>
<script src="./js/libs/socket.io.js"></script> <script src="./js/libs/socket.io.js"></script>
<script src="./js/libs/jquery-3.3.1.min.js"></script> <script src="./js/libs/jquery-3.3.1.min.js"></script>
......
...@@ -133,7 +133,7 @@ $('#room-search').on('input', function(event) { ...@@ -133,7 +133,7 @@ $('#room-search').on('input', function(event) {
} else { } else {
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
android.updateRoomList(); android.updateRoomList();
CHAT_UI.refreshRoomList("1"); CHAT_UI.refreshRoomList(chatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
} }
...@@ -401,7 +401,7 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function (e) { ...@@ -401,7 +401,7 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function (e) {
android.updateRoomList(); android.updateRoomList();
}); });
} }
CHAT_UI.refreshRoomList("1"); CHAT_UI.refreshRoomList(chatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
}); });
console.log("show #pills-chat") console.log("show #pills-chat")
...@@ -826,6 +826,9 @@ CHAT_UI.htmlElementTextInitialize = function(languageCode) { ...@@ -826,6 +826,9 @@ CHAT_UI.htmlElementTextInitialize = function(languageCode) {
$("#dmBtn").text(getLocalizedString("directMessageChatRoom")) $("#dmBtn").text(getLocalizedString("directMessageChatRoom"))
$("#groupBtn").text(getLocalizedString("groupChatRoom")) $("#groupBtn").text(getLocalizedString("groupChatRoom"))
$("#favorite-seperator").text(getLocalizedString("favorite"))
$("#mygroup-seperator").text(getLocalizedString("mygroup"))
} }
// 画像の読み込みが全て終わったタイミングでコールバック実行 // 画像の読み込みが全て終わったタイミングでコールバック実行
...@@ -854,6 +857,10 @@ $('#contactButton').on('click', function(event){ ...@@ -854,6 +857,10 @@ $('#contactButton').on('click', function(event){
CHAT_UI.refreshContactScreen(); CHAT_UI.refreshContactScreen();
}); });
$('#chatButton').on('click', function(event){
CHAT_UI.refreshRoomList(chatRoomType.DM);
});
CHAT_UI.refreshContactScreen = function() { CHAT_UI.refreshContactScreen = function() {
//loadingIndicatorを表示 //loadingIndicatorを表示
$('#my_info').html(''); $('#my_info').html('');
...@@ -896,7 +903,9 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -896,7 +903,9 @@ CHAT_UI.refreshContactScreen = function() {
$('#my_info').append(obj); $('#my_info').append(obj);
var groupUserList = CHAT_DB.getMyGroupUsers(); var groupUserList = CHAT_DB.getMyGroupUsers();
console.log(groupUserList);
groupUserList.forEach(function(groupUser) { groupUserList.forEach(function(groupUser) {
groupUser.profileImagePath = CHAT.getProfileImgUrl(groupUser.profileUrl)
let html = Mustache.render(userTemplate, { let html = Mustache.render(userTemplate, {
id: groupUser.shopMemberId, id: groupUser.shopMemberId,
profileImage: groupUser.profileImagePath, profileImage: groupUser.profileImagePath,
...@@ -905,12 +914,11 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -905,12 +914,11 @@ CHAT_UI.refreshContactScreen = function() {
let obj = $(jQuery.parseHTML(html)).on('click',function(){ let obj = $(jQuery.parseHTML(html)).on('click',function(){
//TODO need onClick Action //TODO need onClick Action
console.log('groupUserClick');
}); });
$('#my_group_list').append(obj); $('#my_group_list').append(obj);
}) })
var favoriteCount = 0;
var favoriteGroupList = CHAT_DB.getFavoriteGroups(); var favoriteGroupList = CHAT_DB.getFavoriteGroups();
favoriteGroupList.forEach(function(favoriteGroup) { favoriteGroupList.forEach(function(favoriteGroup) {
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
...@@ -919,14 +927,14 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -919,14 +927,14 @@ CHAT_UI.refreshContactScreen = function() {
let obj = $(jQuery.parseHTML(html)).on('click',function(){ let obj = $(jQuery.parseHTML(html)).on('click',function(){
//TODO need onClick Action //TODO need onClick Action
console.log('groupClick');
}); });
favoriteCount++
$('#favorite_list').append(obj); $('#favorite_list').append(obj);
}) })
var favoriteUserList = CHAT_DB.getFavoriteUsers(); var favoriteUserList = CHAT_DB.getFavoriteUsers();
favoriteUserList.forEach(function(favoriteUser) { favoriteUserList.forEach(function(favoriteUser) {
favoriteUser.profileImagePath = CHAT.getProfileImgUrl(favoriteUser.profileUrl)
let html = Mustache.render(groupTemplate, { let html = Mustache.render(groupTemplate, {
id: favoriteUser.shopMemberId, id: favoriteUser.shopMemberId,
profileImage: favoriteUser.profileImagePath, profileImage: favoriteUser.profileImagePath,
...@@ -935,12 +943,18 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -935,12 +943,18 @@ CHAT_UI.refreshContactScreen = function() {
let obj = $(jQuery.parseHTML(html)).on('click',function(){ let obj = $(jQuery.parseHTML(html)).on('click',function(){
//TODO need onClick Action //TODO need onClick Action
console.log('userClick');
}); });
favoriteCount++
$('#favorite_list').append(obj); $('#favorite_list').append(obj);
}) })
if (favoriteCount == 0) {
$('#favorite_list').hide();
$('#favorite-seperator').hide();
} else {
$('#favorite_list').show();
$('#favorite-seperator').show();
}
console.log('LOAD DONE CONTACT SCREEN'); console.log('LOAD DONE CONTACT SCREEN');
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
...@@ -1035,7 +1049,6 @@ CHAT_UI.joinRoom = function(roomId,roomName) { ...@@ -1035,7 +1049,6 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
android.updateMessages(roomId); android.updateMessages(roomId);
socket.emit('joinRoom', roomId, roomName, function() { socket.emit('joinRoom', roomId, roomName, function() {
}); });
} else {
} }
var messages = CHAT_DB.getMessages(roomId); var messages = CHAT_DB.getMessages(roomId);
console.log(messages); console.log(messages);
...@@ -1110,9 +1123,9 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) { ...@@ -1110,9 +1123,9 @@ CHAT_UI.loadMessages = function(messages, roomId, roomName) {
$('#dmBtn').on('click', function (e){ $('#dmBtn').on('click', function (e){
CHAT_UI.refreshRoomList("1"); CHAT_UI.refreshRoomList(chatRoomType.DM);
}); });
$('#groupBtn').on('click', function (e){ $('#groupBtn').on('click', function (e){
CHAT_UI.refreshRoomList("0"); CHAT_UI.refreshRoomList(chatRoomType.GROUP);
}); });
\ No newline at end of file
...@@ -7,33 +7,31 @@ function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnlin ...@@ -7,33 +7,31 @@ function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnlin
IS_MOBILE = isMobile; IS_MOBILE = isMobile;
IS_ONLINE = isOnline; IS_ONLINE = isOnline;
connectSocket(); connectSocket();
}; };
android.getGlobalParameter(); android.getGlobalParameter();
function connectSocket() { function connectSocket() {
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
console.log('isOnline');
socket = io(CHAT_SERVER_URL); socket = io(CHAT_SERVER_URL);
console.log('insOnline');
setSocketAction(); setSocketAction();
android.updateRoomList(); android.updateRoomList();
CHAT_UI.refreshRoomList("1"); CHAT_UI.refreshRoomList(chatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
$('#createChatRoom').show(); $('#createChatRoom').show();
} else { } else {
console.log('insOffline'); console.log('isOffline');
//オフラインの場合、DBからルーム一覧を表示。 //オフラインの場合、DBからルーム一覧を表示。
if (CHAT_UTIL.isIOS()) { if (CHAT_UTIL.isIOS()) {
//TODO IOSの場合 //TODO IOSの場合
} else if (CHAT_UTIL.isAndroid()) { } else if (CHAT_UTIL.isAndroid()) {
console.log('insAnd');
//$('.overlay').removeClass('active undismissable'); //$('.overlay').removeClass('active undismissable');
// loadingIndicatorを表示 // loadingIndicatorを表示
CHAT_UI.showLoadingIndicator(); CHAT_UI.showLoadingIndicator();
android.getLoginParameter(); android.getLoginParameter();
console.log('init') CHAT_UI.refreshRoomList(chatRoomType.DM);
CHAT_UI.refreshRoomList("1");
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
$('#createChatRoom').show(); $('#createChatRoom').show();
} }
...@@ -400,7 +398,7 @@ function setSocketAction () { ...@@ -400,7 +398,7 @@ function setSocketAction () {
} else { } else {
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
android.updateRoomList(); android.updateRoomList();
CHAT_UI.refreshRoomList("1"); CHAT_UI.refreshRoomList(chatRoomType.DM);
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
} }
......
...@@ -20,3 +20,8 @@ const messageType = { ...@@ -20,3 +20,8 @@ const messageType = {
const userAPICmd = { const userAPICmd = {
MYINFO : 9 MYINFO : 9
} }
const chatRoomType = {
DM : "1",
GROUP : "0"
}
...@@ -56,5 +56,7 @@ $.lang.en = { ...@@ -56,5 +56,7 @@ $.lang.en = {
"contactListTitle":"Contact", "contactListTitle":"Contact",
"contactSearch":"Contact search", "contactSearch":"Contact search",
"directMessageChatRoom":"DM", "directMessageChatRoom":"DM",
"favorite":"Favorite List",
"mygroup":"My Group",
"groupChatRoom":"Group" "groupChatRoom":"Group"
} }
...@@ -56,5 +56,7 @@ $.lang.ja = { ...@@ -56,5 +56,7 @@ $.lang.ja = {
"contactListTitle":"コンタクト", "contactListTitle":"コンタクト",
"contactSearch":"コンタクト検索", "contactSearch":"コンタクト検索",
"directMessageChatRoom":"DM", "directMessageChatRoom":"DM",
"favorite":"お気に入りリスト",
"mygroup":"マイグループ",
"groupChatRoom":"グループ" "groupChatRoom":"グループ"
} }
...@@ -56,5 +56,7 @@ $.lang.ko = { ...@@ -56,5 +56,7 @@ $.lang.ko = {
"contactListTitle":"연락처", "contactListTitle":"연락처",
"contactSearch":"연락처 검색", "contactSearch":"연락처 검색",
"directMessageChatRoom":"DM", "directMessageChatRoom":"DM",
"favorite":"즐겨찾기리스트",
"mygroup":"마이그룹",
"groupChatRoom":"그룹" "groupChatRoom":"그룹"
} }
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