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
265739a4
authored
Aug 06, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
32
parent
5aa54a93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
dist/js/chat/index.js
dist/js/chat/index.js
View file @
265739a4
...
...
@@ -81,9 +81,10 @@ $(function () {
if
(
JSON
.
stringify
(
this
.
templateObj
)
==
'{}'
)
{
if
(
this
.
customerNum
!==
this
.
defaultName
)
{
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
click
();
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
attr
(
'position'
,
'first'
)
}
else
{
$
(
".notice_classify"
).
first
().
click
();
$
(
".notice_classify"
).
first
().
attr
(
'position'
,
'first'
)
}
}
else
{
Util
.
delCookie
(
'template'
,
cookieHostname
);
...
...
@@ -407,6 +408,7 @@ $(function () {
var
userId
=
$
(
this
).
attr
(
'userid'
);
var
isNowChat
=
$
(
'.notice_classify'
).
eq
(
index
).
hasClass
(
'active'
);
var
firstClick
=
$
(
this
).
attr
(
'firstClick'
);
var
position
=
$
(
this
).
attr
(
'position'
);
if
(
userId
==
message
.
from
)
{
//已有用户
if
(
isNowChat
)
{
...
...
@@ -415,8 +417,11 @@ $(function () {
if
(
Util
.
getCookie
(
'templateBoolean'
))
{
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
}
else
{
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
2
,
htmlStr
,
isTemplate
));
if
(
!
position
)
{
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
2
,
htmlStr
,
isTemplate
));
}
}
var
imgLen
=
$
(
'#'
+
userId
).
find
(
'img'
).
length
;
if
(
!
imgLen
)
{
...
...
@@ -574,14 +579,17 @@ $(function () {
},
//失败回调;
});
},
judgeCustomer
:
function
(
message
)
{
//1 标题 2//图片
var
obj
=
{
name
:
""
,
img
:
""
};
judgeCustomer
:
function
(
message
)
{
//1 标题 2//图片
var
obj
=
{
name
:
""
,
img
:
""
};
if
(
message
.
from
==
this
.
defaultName
)
{
obj
.
img
=
dist
+
"/images/timg.jpg"
;
obj
.
name
=
'IC助手客服'
;
}
else
{
obj
.
img
=
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
);
obj
.
name
=
message
.
ext
.
name
||
'--'
;
obj
.
name
=
message
.
ext
.
name
||
'--'
;
}
return
obj
},
...
...
@@ -617,7 +625,7 @@ $(function () {
timer
:
self
.
curentTime
(),
id
:
self
.
id
,
name
:
self
.
name
,
img
:
self
.
img
,
img
:
self
.
img
,
touserid
:
touserid
,
name1
:
name
,
img1
:
img
...
...
@@ -731,7 +739,7 @@ $(function () {
ext
:
{
timer
:
self
.
curentTime
(),
id
:
self
.
id
,
name
:
self
.
name
,
name
:
self
.
name
,
img
:
self
.
img
,
touserid
:
touserid
,
name1
:
name
,
...
...
@@ -914,7 +922,10 @@ $(function () {
})
},
rendHistoryMessage
:
function
(
id
,
data
,
isTemplate
)
{
console
.
log
(
data
)
var
position
=
$
(
".notice_classify[userid="
+
id
+
"]"
).
attr
(
'position'
);
if
(
position
){
$
(
".notice_classify[userid="
+
id
+
"]"
).
removeAttr
(
'position'
)
}
var
chatCon
=
""
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
fromId
=
data
[
i
].
from
;
...
...
@@ -927,8 +938,8 @@ $(function () {
if
(
typeof
(
data
[
i
].
data
)
==
'string'
)
{
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
{
message
:
data
[
i
].
data
,
name
:
this
.
judgeCustomer
(
data
[
i
]).
name
,
img
:
this
.
judgeCustomer
(
data
[
i
]).
img
,
name
:
this
.
judgeCustomer
(
data
[
i
]).
name
,
img
:
this
.
judgeCustomer
(
data
[
i
]).
img
,
id
:
data
[
i
].
ext
.
id
},
false
,
true
,
data
[
i
].
ext
.
timer
);
}
else
{
...
...
@@ -941,8 +952,8 @@ $(function () {
}
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
{
message
:
emojiTxt
,
name
:
this
.
judgeCustomer
(
data
[
i
]).
name
,
img
:
this
.
judgeCustomer
(
data
[
i
]).
img
,
name
:
this
.
judgeCustomer
(
data
[
i
]).
name
,
img
:
this
.
judgeCustomer
(
data
[
i
]).
img
,
id
:
data
[
i
].
ext
.
id
},
false
,
true
,
data
[
i
].
ext
.
timer
);
}
...
...
@@ -950,8 +961,8 @@ $(function () {
}
else
if
(
data
[
i
].
url
)
{
//图片
chatCon
+=
this
.
messageHtml
(
rightOrLeft
,
{
message
:
'<img src ="'
+
data
[
i
].
url
+
'" class="edit_img"/>'
,
name
:
this
.
judgeCustomer
(
data
[
i
]).
name
,
img
:
this
.
judgeCustomer
(
data
[
i
]).
img
,
name
:
this
.
judgeCustomer
(
data
[
i
]).
name
,
img
:
this
.
judgeCustomer
(
data
[
i
]).
img
,
id
:
data
[
i
].
ext
.
id
},
false
,
true
,
data
[
i
].
ext
.
timer
);
}
else
if
(
data
[
i
].
action
==
'template'
)
{
//模板
...
...
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