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
c82f6320
authored
Jul 15, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
11
parent
d5b2a85c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
19 deletions
Application/Home/View/Home/index.html
dist/js/chat/index.js
dist/js/home/index.js
Application/Home/View/Home/index.html
View file @
c82f6320
...
...
@@ -94,7 +94,7 @@
<!--
询价模板
-->
<
div
class
=
"my_xj_list clr"
>
{{
#
layui
.
each
(
d
,
function
(
index
,
item
){
}}
<
div
class
=
"my_xj_item fl boxsiz"
>
<
div
class
=
"my_xj_item fl boxsiz
xj_item"
style
=
"cursor:pointer"
userid
=
"{{item.inquiry_items_id}}
"
>
<
div
class
=
"item_top clr"
>
<
span
class
=
"fl type xtype lineBlock"
>
询
<
/span
>
<
div
class
=
"fl num ellipsis"
>
{{
item
.
goods_name
}}
<
/div
>
...
...
@@ -126,7 +126,7 @@
<!--
报价模板
-->
<
div
class
=
"my_xj_list clr"
>
{{
#
layui
.
each
(
d
,
function
(
index
,
item
){
}}
<
div
class
=
"my_xj_item fl boxsiz"
>
<
div
class
=
"my_xj_item fl boxsiz
bj_item"
style
=
"cursor:pointer"
userid
=
"{{item.inquiry_items_id}}"
offerid
=
"{{item.offer_id}}
"
>
<
div
class
=
"item_top clr"
>
<
span
class
=
"fl type btype lineBlock"
>
报
<
/span
>
<
div
class
=
"fl num ellipsis"
>
{{
item
.
goods_name
}}
<
/div
>
...
...
@@ -170,7 +170,7 @@
<
/div
>
<
div
class
=
"new_xj_list"
>
{{
#
layui
.
each
(
d
,
function
(
index
,
item
){
}}
<
div
class
=
"new_xj_item clr"
userid
=
"{{item.inquiry_items_id}}"
offerid
=
"{{item.offer_id}}"
>
<
div
class
=
"new_xj_item clr"
userid
=
"{{item.inquiry_items_id}}"
offerid
=
"{{item.offer_id}}"
style
=
"cursor:pointer"
>
<
div
class
=
"type fl bold ellipsis boxsiz"
>
{{
item
.
goods_name
}}
<
/div
>
<
div
class
=
"brand fl ellipsis boxsiz"
>
品牌:
<
span
>
{{
item
.
brand_name
}}
<
/span></
div
>
<
div
class
=
"num fl ellipsis boxsiz"
>
数量:
<
span
>
PCS
{{
item
.
number
}}
<
/span></
div
>
...
...
dist/js/chat/index.js
View file @
c82f6320
...
...
@@ -5,6 +5,7 @@ $(function () {
appName
:
"icsales"
,
// defaultName:"18664936975",
defaultName
:
"18589050841"
,
eleTarget
:
"18589050841"
,
init
:
function
()
{
this
.
ieFun
()
this
.
connection
();
...
...
@@ -23,12 +24,13 @@ $(function () {
}
},
undefined
,
true
)
},
getHistoryData
:
function
(
id
)
{
getHistoryData
:
function
(
id
,
isCustomer
)
{
var
self
=
this
;
this
.
conn
.
fetchHistoryMessages
({
queue
:
id
,
count
:
"10
00
"
,
count
:
"10"
,
success
:
function
(
data
)
{
console
.
log
(
data
)
self
.
renderHistory
(
isCustomer
,
data
,
id
)
},
fail
:
function
(
e
)
{
console
.
log
(
e
)
...
...
@@ -36,19 +38,51 @@ $(function () {
}
})
},
renderHistory
:
function
(
isCustomer
,
data
)
{
renderHistory
:
function
(
isCustomer
,
data
,
id
)
{
var
len
=
data
.
length
;
var
arr
=
[];
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
fromId
=
data
[
i
].
from
,
//发送者的id
toId
=
data
[
i
].
to
;
//接收者的id
if
(
data
[
i
].
from
==
'18271408717'
)
{
//自己发送的
this
.
historyHtml
(
1
)
}
else
{
//自己接收的
this
.
historyHtml
(
2
)
var
fromId
=
data
[
i
].
from
,
//发送者的id
toId
=
data
[
i
].
to
;
//接收者的id
if
(
fromId
==
'18271408717'
)
{
//自己发送的
this
.
historyHtml
(
1
,
data
[
i
])
}
else
{
//自己接收的
this
.
historyHtml
(
2
,
data
[
i
]);
if
(
data
.
action
==
'action'
)
{
arr
.
push
({
type
:
1
,
data
:
{
ext
:
data
.
ext
}
})
}
else
{
if
(
typeof
(
data
.
data
)
==
'string'
)
{
arr
.
push
({
type
:
3
,
data
:
{
ext
:
data
.
ext
}
})
}
else
{
arr
.
push
({
type
:
3
,
data
:
{
ext
:
data
.
ext
}
})
}
}
}
}
},
historyHtml
:
function
(
leftOrRight
,
data
){
//1右边 2左边
historyHtml
:
function
(
leftOrRight
,
data
)
{
//1右边 2左边
if
(
leftOrRight
==
1
)
{
}
else
{
}
},
defaultUser
:
function
()
{
...
...
@@ -364,7 +398,7 @@ $(function () {
console
.
log
(
'登入成功'
)
self
.
defaultUser
();
self
.
singleChat
();
self
.
getHistoryData
(
self
.
defaultName
);
self
.
getHistoryData
(
self
.
defaultName
,
true
);
},
onTextMessage
:
function
(
message
)
{
...
...
dist/js/home/index.js
View file @
c82f6320
...
...
@@ -73,12 +73,12 @@ $(function () {
});
$
(
'.input_btn'
).
click
(
function
()
{
var
key
=
$
(
'.search-input'
).
val
();
if
(
key
)
{
window
.
location
.
href
=
"/search?key="
+
key
;
}
else
{
if
(
key
)
{
window
.
location
.
href
=
"/search?key="
+
key
;
}
else
{
window
.
location
.
href
=
"/search"
}
});
$
(
'.home_content'
).
on
(
'click'
,
'.newXjIcon'
,
function
()
{
...
...
@@ -88,6 +88,15 @@ $(function () {
var
userid
=
$
(
this
).
parent
(
'.new_xj_item'
).
attr
(
'userid'
);
window
.
location
.
href
=
"/quotedetail?id="
+
userid
});
$
(
'.goods_data_list'
).
on
(
'click'
,
'.xj_item'
,
function
()
{
var
userid
=
$
(
this
).
attr
(
'userid'
);
window
.
location
.
href
=
"/inquirydetail?id="
+
userid
});
$
(
'.goods_data_list'
).
on
(
'click'
,
'.bj_item'
,
function
()
{
var
userid
=
$
(
this
).
attr
(
'userid'
),
offerid
=
$
(
this
).
attr
(
'offerid'
)
window
.
location
.
href
=
"/quotedetail?id="
+
userid
+
'&offerid='
+
offerid
})
}
};
homeObj
.
init
()
...
...
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