Commit d214c054 by Lee Munkyeong

Favorite

parent 50c56bc6
...@@ -48,3 +48,12 @@ CHAT_DB.getFavoriteGroups = function() { ...@@ -48,3 +48,12 @@ CHAT_DB.getFavoriteGroups = function() {
return JSON.parse(android.getFavoriteGroups()); return JSON.parse(android.getFavoriteGroups());
} }
}; };
CHAT_DB.getMyGroupUsers = function() {
if (CHAT_UTIL.isIOS()) {
//TODO IOS処理追加必要
} else if (CHAT_UTIL.isAndroid()) {
//String形式をJsonに変更してReturn
return JSON.parse(android.getMyGroupUsers());
}
};
\ No newline at end of file
...@@ -875,13 +875,11 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -875,13 +875,11 @@ CHAT_UI.refreshContactScreen = function() {
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
android.updateGroupInfo(); android.updateGroupInfo();
android.updateMyInfo(); android.updateMyInfo();
android.updateGroupUser();
} }
var myInfo = CHAT_DB.getMyInfo(); var myInfo = CHAT_DB.getMyInfo();
console.log(myInfo);
myInfo.profileImagePath = CHAT.getProfileImgUrl(myInfo.profileUrl) myInfo.profileImagePath = CHAT.getProfileImgUrl(myInfo.profileUrl)
let html = Mustache.render(userTemplate, { let html = Mustache.render(userTemplate, {
...@@ -897,8 +895,52 @@ CHAT_UI.refreshContactScreen = function() { ...@@ -897,8 +895,52 @@ CHAT_UI.refreshContactScreen = function() {
$('#my_info').append(obj); $('#my_info').append(obj);
//TODO get favorite list var groupUserList = CHAT_DB.getMyGroupUsers();
//TODO get my group user list groupUserList.forEach(function(groupUser) {
let html = Mustache.render(userTemplate, {
id: groupUser.shopMemberId,
profileImage: groupUser.profileImagePath,
name: groupUser.shopMemberName
});
let obj = $(jQuery.parseHTML(html)).on('click',function(){
//TODO need onClick Action
console.log('groupUserClick');
});
$('#my_group_list').append(obj);
}
var favoriteGroupList = CHAT_DB.getFavoriteGroups();
favoriteGroupList.forEach(function(favoriteGroup) {
let html = Mustache.render(groupTemplate, {
name: favoriteGroup.groupName
});
let obj = $(jQuery.parseHTML(html)).on('click',function(){
//TODO need onClick Action
console.log('groupClick');
});
$('#favorite_list').append(obj);
}
var favoriteUserList = CHAT_DB.getFavoriteUsers();
favoriteUserList.forEach(function(favoriteUser) {
let html = Mustache.render(groupTemplate, {
id: favoriteUser.shopMemberId,
profileImage: favoriteUser.profileImagePath,
name: favoriteUser.shopMemberName
});
let obj = $(jQuery.parseHTML(html)).on('click',function(){
//TODO need onClick Action
console.log('userClick');
});
$('#favorite_list').append(obj);
}
console.log('LOAD DONE CONTACT SCREEN'); console.log('LOAD DONE CONTACT SCREEN');
CHAT_UI.dismissLoadingIndicator(); CHAT_UI.dismissLoadingIndicator();
} }
......
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