Commit 4db50925 by Lee Munkyeong

写真協業実装

parent 6638f5dd
......@@ -187,7 +187,7 @@
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
webkit.messageHandlers.getGlobalParameter.postMessage({});
}
function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
CHAT_SERVER_URL = chatServerUrl;
CMS_SERVER_URL = cmsServerUrl;
......
......@@ -1268,19 +1268,36 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
}
checkBeforeDate = messageTime.createdAtDay;
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, {
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;
console.log(messageTime);
userInCollaboration.forEach(function(user) {
user.profileUrl = CHAT.getProfileImgUrl(user.profileUrl);
})
let html = Mustache.render(template, {
roomName: roomName,
userCount: userInCollaboration.length,
userList: userInCollaboration.length > 3 ? userInCollaboration.slice(0, 3) : userInCollaboration,
insertDate: message.insertDate
});
html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
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) {
CHAT_UI.waitForLoadingImage(jQueryMessages, CHAT_UI.scrollToBottom);
// ユーザ削除ボタン表示しない
$("#userSelectionDeleteBtn").hide();
setInterval(updateDuration, 1000);
CHAT_UI.scrollToBottom();
};
......
......@@ -89,3 +89,49 @@ CHAT_UTIL.findDow = function(data) {
}
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 = {
}
const collaborationTypeKey = {
CAMERA : "camera",
AUDIO : "audio",
CAMERA : "camera",
VIDEO : "video"
}
const collaborationType = {
AUDIO : 0,
CAMERA : 2,
VIDEO : 3
}
const makeRoomFlg = {
NAME_CARD : 0,
MAKE_ROOM : 1
......
......@@ -152,7 +152,6 @@ $(function(){
switch (json.api){
case "LoginResponse":
if(globalUserInfo.coWorkType = collaborationTypeKey.CAMERA) {
globalUserInfo.coWorkType = "camera";
coview_api.CreateRoom(globalUserInfo.roomId, globalUserInfo.coWorkType);
Coview_moveToVideoShareArea();
}
......@@ -160,9 +159,9 @@ $(function(){
break;
case "CreateRoomResponse":
if(json.resultCode == 200){
var coviewInviteMessage = "coviewsharerequest:" + globalUserInfo.coWorkType;
var coviewInviteMessage = "" + messageSeperator + messageType.COMMUNICATIONSTART + messageSeperator + CHAT_UTIL.getCollaborationType(globalUserInfo.coWorkType);
socket.emit('createMessage', {
text: coviewInviteMessage + messageSeperator + messageType.COMMUNICATIONSTART
text: coviewInviteMessage
}, 0);
}
else{
......
......@@ -12,13 +12,13 @@
</div>
<div class="d-flex flex-row justify-content-between">
<div class="collabo_user_list d-flex flex-row">
<div class="img_wrap"><img src="img/noImage.png" alt="プロフィール画像"></div>
<div class="img_wrap"><img src="img/noImage.png" alt="プロフィール画像"></div>
<div class="img_wrap"><img src="img/noImage.png" alt="プロフィール画像"></div>
<div class="num"><span>10</span></div>
{{#userList}}
<div class="img_wrap"><img src="{{profileUrl}}" onError="this.src='./img/noImage.png'"></div>
{{/userList}}
<div class="num"><span>{{userCount}}</span></div>
</div>
<div class="collabo_time">
<span>1:10:20</span>
<span class="collaboration_duration" data-insertDate="{{insertDate}}"></span>
</div>
</div>
<div class="collabo_btn">
......
......@@ -5,7 +5,7 @@
<div class="chat_item d-flex flex-row align-items-center">
<div class="chat_item_l">
<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 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