Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f2f7fc4d
authored
Jul 18, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1111
parent
4592519d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
dist/js/chat/index.js
dist/js/chat/websdk-1.4.8.js
dist/js/chat/index.js
View file @
f2f7fc4d
...
@@ -211,7 +211,7 @@ $(function () {
...
@@ -211,7 +211,7 @@ $(function () {
'</div>'
'</div>'
}
}
},
},
messageHtml
:
function
(
leftOrRight
,
html
,
isTemplate
)
{
messageHtml
:
function
(
leftOrRight
,
html
,
isTemplate
,
isHistory
,
time
)
{
//右边消息的dom拼接 isTemplate 是否是模板
//右边消息的dom拼接 isTemplate 是否是模板
var
htmlp
=
'<p>'
+
html
+
'</p>'
;
var
htmlp
=
'<p>'
+
html
+
'</p>'
;
if
(
isTemplate
)
{
if
(
isTemplate
)
{
...
@@ -242,7 +242,7 @@ $(function () {
...
@@ -242,7 +242,7 @@ $(function () {
'<img src="'
+
dist
+
'/images/default.jpg" alt="" class="fr user_logo">'
+
'<img src="'
+
dist
+
'/images/default.jpg" alt="" class="fr user_logo">'
+
'<div class="notice_content">'
+
'<div class="notice_content">'
+
htmlp
+
htmlp
+
'<div>'
+
this
.
curentTime
(
)
+
'</div>'
+
'<div>'
+
(
isHistory
?
time
:
this
.
curentTime
()
)
+
'</div>'
+
'</div>'
+
'</div>'
+
'</div>'
'</div>'
}
else
{
}
else
{
...
@@ -255,7 +255,7 @@ $(function () {
...
@@ -255,7 +255,7 @@ $(function () {
'<img src="'
+
dist
+
'/images/default.jpg" alt="" class="fl user_logo">'
+
'<img src="'
+
dist
+
'/images/default.jpg" alt="" class="fl user_logo">'
+
'<div class="notice_content">'
+
'<div class="notice_content">'
+
htmlp
+
htmlp
+
'<div>'
+
this
.
curentTime
(
)
+
'</div>'
+
'<div>'
+
(
isHistory
?
time
:
this
.
curentTime
()
)
+
'</div>'
+
'</div>'
+
'</div>'
+
'</div>'
'</div>'
}
else
{
}
else
{
...
@@ -374,7 +374,6 @@ $(function () {
...
@@ -374,7 +374,6 @@ $(function () {
},
//收到表情消息;
},
//收到表情消息;
onCmdMessage
:
function
(
message
)
{
onCmdMessage
:
function
(
message
)
{
console
.
log
(
message
)
self
.
receiveData
(
1
,
message
,
true
);
self
.
receiveData
(
1
,
message
,
true
);
self
.
addChatMember
(
message
.
from
)
self
.
addChatMember
(
message
.
from
)
},
//收到命令消息;
},
//收到命令消息;
...
@@ -438,6 +437,9 @@ $(function () {
...
@@ -438,6 +437,9 @@ $(function () {
msg
.
set
({
msg
.
set
({
msg
:
content
,
// 消息内容;
msg
:
content
,
// 消息内容;
to
:
userId
,
// 接收消息对象;
to
:
userId
,
// 接收消息对象;
ext
:{
timer
:
self
.
curentTime
()
},
success
:
function
(
id
,
serverMsgId
)
{
success
:
function
(
id
,
serverMsgId
)
{
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
1
,
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
1
,
emojiMessage
,
false
));
emojiMessage
,
false
));
...
@@ -458,15 +460,16 @@ $(function () {
...
@@ -458,15 +460,16 @@ $(function () {
var
userId
=
$
(
'.notice_left '
).
find
(
'.active'
).
attr
(
'userid'
);
var
userId
=
$
(
'.notice_left '
).
find
(
'.active'
).
attr
(
'userid'
);
var
id
=
this
.
conn
.
getUniqueId
();
var
id
=
this
.
conn
.
getUniqueId
();
var
msg
=
new
WebIM
.
default
.
message
(
'cmd'
,
id
);
var
msg
=
new
WebIM
.
default
.
message
(
'cmd'
,
id
);
var
params
=
$
.
extend
({},
templateObj
,{
timer
:
self
.
curentTime
()});
msg
.
set
({
msg
.
set
({
msg
:
'template'
,
msg
:
'template'
,
to
:
userId
,
to
:
userId
,
action
:
"template"
,
action
:
"template"
,
ext
:
templateObj
,
ext
:
params
,
success
:
function
()
{
success
:
function
()
{
self
.
addChatMember
(
userId
)
self
.
addChatMember
(
userId
)
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
1
,
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
1
,
templateObj
,
true
));
params
,
true
));
var
contentHeight
=
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
)
var
contentHeight
=
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
)
.
height
();
.
height
();
$
(
'#'
+
userId
).
find
(
'.notice_list'
).
scrollTop
(
contentHeight
);
$
(
'#'
+
userId
).
find
(
'.notice_list'
).
scrollTop
(
contentHeight
);
...
@@ -476,7 +479,7 @@ $(function () {
...
@@ -476,7 +479,7 @@ $(function () {
}
}
});
});
this
.
conn
.
send
(
msg
.
body
);
this
.
conn
.
send
(
msg
.
body
);
console
.
log
(
msg
.
body
)
},
},
sendPrivateImg
:
function
()
{
sendPrivateImg
:
function
()
{
...
@@ -491,6 +494,9 @@ $(function () {
...
@@ -491,6 +494,9 @@ $(function () {
apiUrl
:
WebIM
.
config
.
apiURL
,
apiUrl
:
WebIM
.
config
.
apiURL
,
file
:
file
,
file
:
file
,
to
:
userId
,
to
:
userId
,
ext
:{
timer
:
self
.
curentTime
()
},
flashUpload
:
WebIM
.
flashUpload
,
flashUpload
:
WebIM
.
flashUpload
,
onFileUploadError
:
function
()
{
onFileUploadError
:
function
()
{
console
.
log
(
'失败'
)
console
.
log
(
'失败'
)
...
@@ -598,7 +604,7 @@ $(function () {
...
@@ -598,7 +604,7 @@ $(function () {
}
}
if
(
data
[
i
].
data
)
{
//消息或者表情
if
(
data
[
i
].
data
)
{
//消息或者表情
if
(
typeof
(
data
[
i
].
data
)
==
'string'
)
{
if
(
typeof
(
data
[
i
].
data
)
==
'string'
)
{
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
data
[
i
].
data
);
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
data
[
i
].
data
,
false
,
true
,
data
[
i
].
ext
.
timer
);
}
else
{
}
else
{
for
(
var
j
=
0
;
j
<
data
[
i
].
data
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
data
[
i
].
data
.
length
;
j
++
)
{
if
(
data
[
i
].
data
[
j
].
type
==
"txt"
)
{
if
(
data
[
i
].
data
[
j
].
type
==
"txt"
)
{
...
@@ -607,15 +613,15 @@ $(function () {
...
@@ -607,15 +613,15 @@ $(function () {
emojiTxt
+=
'<img src ="'
+
data
[
i
].
data
[
j
].
data
+
'" width=25 height=25/>'
;
emojiTxt
+=
'<img src ="'
+
data
[
i
].
data
[
j
].
data
+
'" width=25 height=25/>'
;
}
}
}
}
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
emojiTxt
);
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
emojiTxt
,
false
,
true
,
data
[
i
].
ext
.
timer
);
}
}
}
else
if
(
data
[
i
].
url
)
{
//图片
}
else
if
(
data
[
i
].
url
)
{
//图片
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
'<img src ="'
+
data
[
i
].
url
+
'" class="edit_img"/>'
);
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
'<img src ="'
+
data
[
i
].
url
+
'" class="edit_img"/>'
,
false
,
true
,
data
[
i
].
ext
.
timer
);
}
else
if
(
data
[
i
].
action
==
'template'
)
{
//模板
}
else
if
(
data
[
i
].
action
==
'template'
)
{
//模板
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
data
[
i
].
ext
,
true
);
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
data
[
i
].
ext
,
true
,
true
,
data
[
i
].
ext
.
timer
);
}
}
}
}
...
...
dist/js/chat/websdk-1.4.8.js
View file @
f2f7fc4d
This diff could not be displayed because it is too large.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment