Commit 4db50925 by Lee Munkyeong

写真協業実装

parent 6638f5dd
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({}); webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({}); webkit.messageHandlers.getGlobalParameter.postMessage({});
} }
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) { function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl; CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl; CMS_SERVER_URL = cmsServerUrl;
......
...@@ -1268,19 +1268,36 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1268,19 +1268,36 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
} }
checkBeforeDate = messageTime.createdAtDay; checkBeforeDate = messageTime.createdAtDay;
beforeDate = message.insertDate; beforeDate = message.insertDate;
if (message.messageType == messageType.COMMUNICATIONSTART || message.messageType == messageType.COMMUNICATIONEND) {
var collaborationInfo = JSON.parse(message.message);
var userInCollaboration = JSON.parse(android.getUserInfoList(collaborationInfo.userList));
let html = Mustache.render(template, { console.log(messageTime);
text: message.message, userInCollaboration.forEach(function(user) {
from: message.loginId, user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
shopMemberId: message.shopMemberId, })
profileImage: message.profileUrl, let html = Mustache.render(template, {
createdAtDay: messageTime.createdAtDay, roomName: roomName,
createdAtTime: messageTime.createdAtTime, userCount: userInCollaboration.length,
unreadCount: message.unreadCount, userList: userInCollaboration.length > 3 ? userInCollaboration.slice(0, 3) : userInCollaboration,
isToday: isToday insertDate: message.insertDate
}); });
html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html; html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
workVal = html + workVal; workVal = html + workVal;
} else {
let html = Mustache.render(template, {
text: message.message,
from: message.loginId,
shopMemberId: message.shopMemberId,
profileImage: message.profileUrl,
createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime,
unreadCount: message.unreadCount,
isToday: isToday
});
html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
workVal = html + workVal;
}
}) })
// メッセージの画面描画 // メッセージの画面描画
...@@ -1301,6 +1318,7 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1301,6 +1318,7 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom); CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom);
// ユーザ削除ボタン表示しない // ユーザ削除ボタン表示しない
$("#userSelectionDeleteBtn").hide(); $("#userSelectionDeleteBtn").hide();
setInterval(updateDuration, 1000);
CHAT_UI.scrollToBottom(); CHAT_UI.scrollToBottom();
}; };
......
...@@ -89,3 +89,49 @@ CHAT_UTIL.findDow = function(data) { ...@@ -89,3 +89,49 @@ CHAT_UTIL.findDow = function(data) {
} }
return dow; return dow;
} }
function msToTime(s) {
var ms = s % 1000;
s = (s - ms) / 1000;
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
return hrs + ':' + mins + ':' + secs;
}
function updateDuration() {
var now = new Date();
console.log('updateDuration');
$('.collaboration_duration').each(function() {
var insertDateString = $(this).data('insertdate');
insertDateString = insertDateString.toString();
var insertDateString = "20210414103256";
var year = insertDateString.substring(0,4);
var month = insertDateString.substring(4,6);
var day = insertDateString.substring(6,8);
var hour = insertDateString.substring(8,10);
var min = insertDateString.substring(10,12);
var sec = insertDateString.substring(12,14);
var insertDate = new Date(year, month-1 , day, hour, min, sec);
$(this).html(msToTime(now - insertDate));
});
}
CHAT_UTIL.getCollaborationType = function(key) {
switch(key) {
case collaborationTypeKey.AUDIO:
return collaborationType.AUDIO;
break;
case collaborationTypeKey.CAMERA:
return collaborationType.CAMERA;
break;
case collaborationTypeKey.VIDEO:
return collaborationType.VIDEO;
break;
default:
return 0;
break;
}
}
\ No newline at end of file
...@@ -38,11 +38,17 @@ const nameCardAreaId = { ...@@ -38,11 +38,17 @@ const nameCardAreaId = {
} }
const collaborationTypeKey = { const collaborationTypeKey = {
CAMERA : "camera",
AUDIO : "audio", AUDIO : "audio",
CAMERA : "camera",
VIDEO : "video" VIDEO : "video"
} }
const collaborationType = {
AUDIO : 0,
CAMERA : 2,
VIDEO : 3
}
const makeRoomFlg = { const makeRoomFlg = {
NAME_CARD : 0, NAME_CARD : 0,
MAKE_ROOM : 1 MAKE_ROOM : 1
......
...@@ -152,7 +152,6 @@ $(function(){ ...@@ -152,7 +152,6 @@ $(function(){
switch (json.api){ switch (json.api){
case "LoginResponse": case "LoginResponse":
if(globalUserInfo.coWorkType = collaborationTypeKey.CAMERA) { if(globalUserInfo.coWorkType = collaborationTypeKey.CAMERA) {
globalUserInfo.coWorkType = "camera";
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType); coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
Coview_moveToVideoShareArea(); Coview_moveToVideoShareArea();
} }
...@@ -160,9 +159,9 @@ $(function(){ ...@@ -160,9 +159,9 @@ $(function(){
break; break;
case "CreateRoomResponse": case "CreateRoomResponse":
if(json.resultCode == 200){ if(json.resultCode == 200){
var coviewInviteMessage = "coviewsharerequest:" + globalUserInfo.coWorkType; var coviewInviteMessage = "" + messageSeperator + messageType.COMMUNICATIONSTART + messageSeperator + CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType);
socket.emit('createMessage', { socket.emit('createMessage', {
text: coviewInviteMessage + messageSeperator + messageType.COMMUNICATIONSTART text: coviewInviteMessage
}, 0); }, 0);
} }
else{ else{
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
</div> </div>
<div class="d-flex flex-row justify-content-between"> <div class="d-flex flex-row justify-content-between">
<div class="collabo_user_list d-flex flex-row"> <div class="collabo_user_list d-flex flex-row">
<div class="img_wrap"><img src="img/noImage.png" alt="プロフィール画像"></div> {{#userList}}
<div class="img_wrap"><img src="img/noImage.png" alt="プロフィール画像"></div> <div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'"></div>
<div class="img_wrap"><img src="img/noImage.png" alt="プロフィール画像"></div> {{/userList}}
<div class="num"><span>10</span></div> <div class="num"><span>{{userCount}}</span></div>
</div> </div>
<div class="collabo_time"> <div class="collabo_time">
<span>1:10:20</span> <span class="collaboration_duration" data-insertDate="{{insertDate}}"></span>
</div> </div>
</div> </div>
<div class="collabo_btn"> <div class="collabo_btn">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="chat_item d-flex flex-row align-items-center"> <div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l"> <div class="chat_item_l">
<div class="thumbnail"> <div class="thumbnail">
<div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'" /></div> <div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'"/></div>
</div> </div>
</div> </div>
<div class="chat_item_m px-0"> <div class="chat_item_m px-0">
......
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