Commit e3cf3b7f by Lee Munkyeong

メッセージUI

parent 9a9fc89d
...@@ -1187,13 +1187,20 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1187,13 +1187,20 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
message.message = replacePath; message.message = replacePath;
/* if (message.message contain) { /* if (message.message contain) {
}*/ }*/
var isToday = false;
if (messageTime.createdAt.includes(':')) {
isToday = true;
}
let html = Mustache.render(template, { let html = Mustache.render(template, {
text: message.message, text: message.message,
from: message.loginId, from: message.loginId,
shopMemberId: message.shopMemberId, shopMemberId: message.shopMemberId,
profileImage: message.profileUrl, profileImage: message.profileUrl,
createdAtDay: messageTime.createdAtDay, createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime createdAtTime: messageTime.createdAtTime,
isToday: isToday
}); });
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;
......
...@@ -200,7 +200,8 @@ function setSocketAction () { ...@@ -200,7 +200,8 @@ function setSocketAction () {
from: message.from, from: message.from,
profileImage: message.profileImagePath, profileImage: message.profileImagePath,
createdAtDay: messageTime.createdAtDay, createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime createdAtTime: messageTime.createdAtTime,
isToday: true
}); });
// イメージの場合、img tagを追加する // イメージの場合、img tagを追加する
html = message.text.includes('attachedImages') || message.text.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html; html = message.text.includes('attachedImages') || message.text.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
......
<div class="room_right"> <div class="room_right">
<div class="text">{{text}}</div> <div class="text">{{text}}</div>
{{#isToday}}
<div class="date d-flex flex-column"><span></span><span>{{createdAtTime}}</span></div>
{{/isToday}}
{{^isToday}}
<div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div> <div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div>
{{/isToday}}
<div class="read d-flex align-items-end"><span></span></div> <div class="read d-flex align-items-end"><span></span></div>
</div> </div>
\ No newline at end of file
...@@ -6,6 +6,11 @@ ...@@ -6,6 +6,11 @@
<div class="name">{{from}}</div> <div class="name">{{from}}</div>
<div class="text">{{text}}</div> <div class="text">{{text}}</div>
</div> </div>
{{#isToday}}
<div class="date d-flex flex-column"><span></span><span>{{createdAtTime}}</span></div>
{{/isToday}}
{{^isToday}}
<div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div> <div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div>
{{/isToday}}
<div class="read d-flex align-items-end"><span></span></div> <div class="read d-flex align-items-end"><span></span></div>
</div> </div>
\ No newline at end of file
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