messageTemplate.html
7.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!-- messageTemplate: 一个消息的页面 -->
<!-- class="rongcloud-audioState"声音消息播放状态
class="rongcloud-audioBox" 声音消息容器
此类名不能被修改 -->
{%switch(this.messageType){%}{%case 'TextMessage':%}
<div class="rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}" id="rcs-templte-message-text">
<div>
<div class="rongcloud-Message-header"><img class="rongcloud-img rongcloud-Message-avatar rongcloud-avatar" src="{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}" alt="">
<div class="rongcloud-Message-author rongcloud-clearfix">
<a class="rongcloud-author">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>
</div>
</div>
</div>
<div class="rongcloud-Message-body">
<div class="rongcloud-Message-text">
<pre class="rongcloud-Message-entry">{%this.content.content%}</pre>
</div>
</div>
</div>{%break;%}
{%case 'ImageMessage':%}
<div class="rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}" id="rcs-templte-message-text">
<div>
<div class="rongcloud-Message-header"><img class="rongcloud-img rongcloud-Message-avatar rongcloud-avatar" src="{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}" alt="">
<div class="rongcloud-Message-author rongcloud-clearfix">
<a class="rongcloud-author">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>
</div>
</div>
</div>
<div class="rongcloud-Message-body">
<div class="rongcloud-Message-img">
<span class="rongcloud-Message-entry">
<a onclick="RCS.viewImage(event)" class="cursor-pointer" data-img="{%this.content.imageUri%}">
<img src="{%this.content.imageUri%}" onload="RCS.scrollBottom()" data-img="{%this.content.imageUri%}">
</a>
</span>
</div>
</div>
</div>{%break;%}
{%case 'FileMessage':%}
<div class="rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}" id="rcs-templte-message-text">
<div>
<div class="rongcloud-Message-header"><img class="rongcloud-img rongcloud-Message-avatar rongcloud-avatar" src="{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}" alt="">
<div class="rongcloud-Message-author rongcloud-clearfix">
<a class="rongcloud-author">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>
</div>
</div>
</div>
<div class="rongcloud-Message-body">
<div class="rongcloud-Message-file">
<div class="rongcloud-sprite rongcloud-file-icon"></div>
<div class="rongcloud-file-name">{%this.content.name%}</div>
<div class="rongcloud-file-size">{%this.content.size%}</div>
<a class="rongcloud-sprite rongcloud-file-download" href="{%this.content.fileUrl%}" download="{%this.content.name%}"></a>
</div>
</div>
</div>{%break;%}
{%case 'VoiceMessage':%}
<div class="rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}" id="rcs-templte-message-text">
<div>
<div class="rongcloud-Message-header"><img class="rongcloud-img rongcloud-Message-avatar rongcloud-avatar" src="{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}" alt="">
<div class="rongcloud-Message-author rongcloud-clearfix">
<a class="rongcloud-author">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>
</div>
</div>
</div>
<div class="rongcloud-Message-body">
<div class="rongcloud-Message-audio">
<span class="rongcloud-Message-entry">
{%if(this.messageDirection == 1){%}
<div style="display:inline-block;">
<span class="rongcloud-audioTimer">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>
</div>
<span class="rongcloud-r-audioBox rongcloud-clearfix" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>
<i></i><i></i><i></i>
</span>
{%}else{%}
<span class="rongcloud-audioBox rongcloud-clearfix" onclick='RCS.play(event, {%JSON.stringify(this.content)%})'>
<i></i><i></i><i></i>
</span>
<div style="display:inline-block;">
<span class="rongcloud-audioTimer">{%Math.ceil(this.content.duration || this.content.duration.length / 1024)%}''</span>
<span class="rongcloud-audioState"></span>
</div>
{%}%}
</span>
</div>
</div>
</div>{%break;%}
{%case 'TimeMessage':%}
<div class="rongcloud-Messages-date">
<b>{%this.sentTime%}</b>
</div>{%break;%}
{%case 'InformationNotificationMessage':%}
<div class="rongcloud-sys-tips">
<span>{%this.content.message%}</span>
</div>{%break;%}
{%case 'AlertMessage':%}
<div class="rongcloud-sys-tips">
<span>{%this.content.content%}</span>
</div>{%break;%}
{%case 'SightMessage': %}
<div class="rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}" id="rcs-templte-message-text">
<div>
<div class="rongcloud-Message-header"><img class="rongcloud-img rongcloud-Message-avatar rongcloud-avatar" src="{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}" alt="">
<div class="rongcloud-Message-author rongcloud-clearfix">
<a class="rongcloud-author">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>
</div>
</div>
</div>
<div class="rongcloud-Message-body">
<div class="rongcloud-Message-sight" onclick="RCS.playVideo(event)">
<video poster="{% 'data:image/jpg;base64,' + this.content.content %}" src="{% this.content.sightUrl %}"></video>
<div class="play-btn"></div>
</div>
</div>
</div>
{%break;%}
{%default: %}
<div class="rongcloud-Message rongcloud-clearfix {%if(this.messageDirection == 1){%} {%'rongcloud-Message-send'%} {%}%}" id="rcs-templte-message-text">
<div>
<div class="rongcloud-Message-header"><img class="rongcloud-img rongcloud-Message-avatar rongcloud-avatar" src="{%if(this.messageDirection != 1){%} {%if(this.content.user.icon){%}{%this.content.user.icon%}{%}else{%} {%RCS.config.csIcon%} {%}%} {%}else{%} {%RCS.config.userIcon%} {%}%}" alt="">
<div class="rongcloud-Message-author rongcloud-clearfix">
<a class="rongcloud-author">{%if(this.messageDirection != 1){%}{%this.content.user.name%}{%}else{%} {%'我'%} {%}%}</a>
</div>
</div>
</div>
<div class="rongcloud-Message-body">
<div class="rongcloud-Message-text">
<pre class="rongcloud-Message-entry">当前版本暂不支持查看此消息</pre>
</div>
</div>
</div>{%}%}