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
3b3c371e
authored
Jul 24, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
111
parent
4ab601da
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
21 deletions
Application/Home/View/Search/index.html
dist/js/chat/index.js
dist/js/search/index.js
Application/Home/View/Search/index.html
View file @
3b3c371e
...
...
@@ -63,7 +63,7 @@
<script
type=
"text/html"
id=
"sphtml"
>
<
div
class
=
"my_xj_list clr "
>
{{
#
layui
.
each
(
d
,
function
(
index
,
item
){
}}
<
div
class
=
"my_xj_item fl boxsiz sp_item"
goodid
=
"{{item.goods_id}}"
style
=
"cursor:pointer"
>
<
div
class
=
"my_xj_item fl boxsiz sp_item"
goodid
=
"{{item.goods_id}}"
style
=
"cursor:pointer"
userid
=
"{{item.user_id}}"
>
<
div
class
=
"item_top clr"
>
<
div
class
=
"fl num ellipsis"
>
{{
item
.
goods_name
}}
<
/div
>
<
/div
>
...
...
dist/js/chat/index.js
View file @
3b3c371e
...
...
@@ -23,7 +23,7 @@ $(function () {
},
function
(
res
)
{
if
(
res
.
err_code
==
0
)
{
self
.
img
=
res
.
data
.
avatar
;
self
.
name
=
res
.
data
.
company_name
||
'--'
;
self
.
name
=
res
.
data
.
company_name
||
'--'
;
self
.
id
=
res
.
data
.
user_id
+
''
;
self
.
getHistoryUsers
(
res
.
data
.
im_username
,
res
.
data
.
im_password
);
...
...
@@ -57,7 +57,7 @@ $(function () {
}
else
{
console
.
log
(
'添加聊天成员失败'
)
}
},
false
);
},
false
);
},
rendChatSection
:
function
(
data
)
{
console
.
log
(
'获取成员'
)
...
...
@@ -356,6 +356,9 @@ $(function () {
if
(
!
len
)
{
//新用户
if
(
Util
.
getCookie
(
'templateBoolean'
))
{
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
}
var
userStr
=
'<div class="notice_classify active" userid="'
+
message
.
from
+
'" firstClick="true" newMember="true">'
+
self
.
userHtml
(
0
,
message
,
regContent
)
+
'</div>'
;
var
messageStr
=
'<div class="chat_item active" id="'
+
message
.
from
+
'">'
+
...
...
@@ -385,6 +388,9 @@ $(function () {
}
else
{
//非当前用户
if
(
Util
.
getCookie
(
'templateBoolean'
))
{
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
}
var
num
=
Number
(
$
(
this
).
find
(
'.num'
).
text
());
$
(
this
).
html
(
self
.
userHtml
(
num
+
1
,
message
,
regContent
));
var
html
=
$
(
this
).
clone
();
...
...
@@ -400,7 +406,9 @@ $(function () {
}
else
{
if
(
index
==
len
-
1
)
{
//新用户
console
.
log
(
'新用户'
)
if
(
Util
.
getCookie
(
'templateBoolean'
))
{
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
}
var
userStr
=
'<div class="notice_classify" userid="'
+
message
.
from
+
'" newMember="true">'
+
self
.
userHtml
(
1
,
message
,
regContent
)
+
'</div>'
;
...
...
@@ -425,18 +433,18 @@ $(function () {
},
onTextMessage
:
function
(
message
)
{
self
.
receiveData
(
1
,
{
name
:
message
.
ext
.
name
||
'--'
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
message
:
message
.
data
,
from
:
message
.
from
},
false
)
},
//收到文本消息;
onEmojiMessage
:
function
(
message
)
{
self
.
receiveData
(
3
,
{
name
:
message
.
ext
.
name
||
'--'
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
message
:
message
.
data
,
from
:
message
.
from
,
},
false
)
...
...
@@ -445,9 +453,9 @@ $(function () {
onCmdMessage
:
function
(
message
)
{
console
.
log
(
message
)
self
.
receiveData
(
1
,
{
name
:
message
.
ext
.
name
||
'--'
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
from
:
message
.
from
,
type
:
message
.
ext
.
type
,
price
:
message
.
ext
.
price
,
...
...
@@ -467,9 +475,9 @@ $(function () {
options
.
onFileDownloadComplete
=
function
()
{
// 图片下载成功;
self
.
receiveData
(
2
,
{
name
:
message
.
ext
.
name
||
'--'
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
),
from
:
message
.
from
,
url
:
message
.
url
},
false
)
...
...
@@ -576,9 +584,9 @@ $(function () {
params
,
true
));
var
contentHeight
=
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
)
.
height
();
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'#'
+
userId
).
find
(
'.notice_list'
).
scrollTop
(
contentHeight
);
},
200
)
},
200
)
},
fail
:
function
()
{
...
...
@@ -626,9 +634,9 @@ $(function () {
var
contentHeight
=
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
)
.
height
();
// $('#' + userId).find('.notice_list').scrollTop(contentHeight);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'#'
+
userId
).
find
(
'.notice_list'
).
scrollTop
(
contentHeight
);
},
200
)
},
200
)
$
(
'#img_upload'
).
val
(
''
);
},
fail
:
function
()
{
...
...
@@ -700,9 +708,9 @@ $(function () {
}
else
{
var
contentHeight
=
$
(
'#'
+
id
).
find
(
'.notice_item_content'
).
height
();
// $('#' + id).find('.notice_list').scrollTop(contentHeight);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'#'
+
id
).
find
(
'.notice_list'
).
scrollTop
(
contentHeight
);
},
200
)
},
200
)
if
(
newMember
)
{
return
...
...
@@ -789,9 +797,9 @@ $(function () {
var
contentHeight
=
$
(
'#'
+
id
).
find
(
'.notice_item_content'
)
.
height
();
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'#'
+
id
).
find
(
'.notice_list'
).
scrollTop
(
contentHeight
);
},
200
)
},
200
)
},
};
...
...
dist/js/search/index.js
View file @
3b3c371e
...
...
@@ -131,7 +131,15 @@ $(function () {
});
$
(
'.goods_data_list'
).
on
(
'click'
,
'.sp_item'
,
function
()
{
var
goodid
=
$
(
this
).
attr
(
'goodid'
);
window
.
location
.
href
=
"/gooddetail?type=2&id="
+
goodid
var
eleuserid
=
$
(
this
).
attr
(
'userid'
);
var
userid
=
Util
.
getCookie
(
'user_id'
)
||
""
;
var
type
;
if
(
userid
===
eleuserid
){
type
=
1
}
else
{
type
=
2
}
window
.
location
.
href
=
"/gooddetail?type="
+
type
+
"&id="
+
goodid
});
$
(
'.goods_data_list'
).
on
(
'click'
,
'.lx_cus'
,
function
()
{
window
.
location
.
href
=
"/chat"
...
...
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