Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
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
585e1c18
authored
Jul 17, 2021
by
panjiangyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
从im拿会话列表
parent
c102ba83
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
37 deletions
chat-list.vue
chat-room.vue
store/index.ts
chat-list.vue
View file @
585e1c18
...
@@ -58,7 +58,10 @@
...
@@ -58,7 +58,10 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"empty"
v-if=
"chatRooms && chatRooms.length
<
=
0
"
>
<div
class=
"empty"
v-if=
"chatRooms && chatRooms.length
<
=
0
"
>
{{
searchKeyword
?
"无相关接待"
:
"无接待"
}}
{{
searchKeyword
?
"无相关接待"
:
"无接待"
}}
</div>
</div>
</el-scrollbar>
</el-scrollbar>
...
@@ -101,9 +104,6 @@ export default class ChatList extends Vue {
...
@@ -101,9 +104,6 @@ export default class ChatList extends Vue {
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_UNIPLAT_ID
)
private
readonly
currentChatUniplatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_UNIPLAT_ID
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_VERSION
)
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_VERSION
)
private
readonly
uniplatVersion
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_VERSION
;
private
readonly
uniplatVersion
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_VERSION
;
...
@@ -123,7 +123,7 @@ export default class ChatList extends Vue {
...
@@ -123,7 +123,7 @@ export default class ChatList extends Vue {
private
readonly
saveChatTitle
!
:
ChatStore
.
MUTATION_SAVE_CHAT_TITLE
;
private
readonly
saveChatTitle
!
:
ChatStore
.
MUTATION_SAVE_CHAT_TITLE
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SHOW_CHAT
)
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SHOW_CHAT
)
private
readonly
showChat
:
ChatStore
.
MUTATION_SHOW_CHAT
private
readonly
showChat
:
ChatStore
.
MUTATION_SHOW_CHAT
;
@
Prop
({
type
:
String
,
default
:
"-1"
})
@
Prop
({
type
:
String
,
default
:
"-1"
})
private
selected
!
:
string
;
private
selected
!
:
string
;
...
@@ -135,8 +135,8 @@ export default class ChatList extends Vue {
...
@@ -135,8 +135,8 @@ export default class ChatList extends Vue {
}
}
private
isSelected
(
item
:
Chat
)
{
private
isSelected
(
item
:
Chat
)
{
if
(
this
.
currentChatUnipl
atId
)
{
if
(
this
.
ch
atId
)
{
return
item
.
uniplatId
===
this
.
currentChatUnipl
atId
;
return
item
.
chat_id
===
this
.
ch
atId
;
}
}
return
this
.
selected
===
item
.
uniplatId
;
return
this
.
selected
===
item
.
uniplatId
;
}
}
...
@@ -181,14 +181,15 @@ export default class ChatList extends Vue {
...
@@ -181,14 +181,15 @@ export default class ChatList extends Vue {
}
}
private
goToChatRoom
(
data
:
Chat
)
{
private
goToChatRoom
(
data
:
Chat
)
{
if
(
this
.
currentChatUniplatId
===
data
.
uniplatI
d
)
{
if
(
this
.
chatId
===
data
.
chat_i
d
)
{
this
.
showChat
();
this
.
showChat
();
return
;
return
;
}
}
const
wantedChatRoom
=
this
.
chatRooms
.
find
(
const
wantedChatRoom
=
this
.
chatRooms
.
find
(
(
k
)
=>
k
.
uniplatId
===
data
.
uniplatI
d
(
k
)
=>
k
.
chat_id
===
data
.
chat_i
d
);
);
if
(
wantedChatRoom
==
null
)
return
;
if
(
wantedChatRoom
==
null
)
return
;
console
.
log
(
"fuck"
,
wantedChatRoom
);
this
.
saveChatId
({
this
.
saveChatId
({
chatId
:
wantedChatRoom
.
chat_id
,
chatId
:
wantedChatRoom
.
chat_id
,
v
:
data
.
uniplat_version
,
v
:
data
.
uniplat_version
,
...
...
chat-room.vue
View file @
585e1c18
<
template
>
<
template
>
<div
class=
"chat-room-con h-100 pos-rel"
>
<div
class=
"chat-room-con h-100 pos-rel"
>
{{
chatId
}}
-
{{
uniplatId
}}
<div
class=
"chat-panel"
>
<div
class=
"chat-panel"
>
<div
class=
"chat-area h-100"
>
<div
class=
"chat-area h-100"
>
<template
v-if=
"notOnlyCheck"
>
<template
v-if=
"notOnlyCheck"
>
...
@@ -24,13 +25,7 @@
...
@@ -24,13 +25,7 @@
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
import
{
Component
,
Prop
,
Provide
,
Vue
,
Watch
}
from
"vue-property-decorator"
;
Component
,
Prop
,
Provide
,
Vue
,
Watch
,
}
from
"vue-property-decorator"
;
import
MessageInput
from
"@/customer-service/message-input.vue"
;
import
MessageInput
from
"@/customer-service/message-input.vue"
;
import
messages
from
"@/customer-service/message-list.vue"
;
import
messages
from
"@/customer-service/message-list.vue"
;
...
@@ -45,6 +40,12 @@ type RoomInfoTab = "customer" | "order";
...
@@ -45,6 +40,12 @@ type RoomInfoTab = "customer" | "order";
},
},
})
})
export
default
class
ChatRoom
extends
Vue
{
export
default
class
ChatRoom
extends
Vue
{
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_VERSION
)
private
readonly
uniplatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_VERSION
;
@
chatStore
.
Getter
(
ChatStore
.
GETTER_CURRENT_CHAT_PRESENT_MEMBERS
)
@
chatStore
.
Getter
(
ChatStore
.
GETTER_CURRENT_CHAT_PRESENT_MEMBERS
)
private
readonly
chatMembers
!
:
ChatStore
.
GETTER_CURRENT_CHAT_PRESENT_MEMBERS
;
private
readonly
chatMembers
!
:
ChatStore
.
GETTER_CURRENT_CHAT_PRESENT_MEMBERS
;
...
@@ -114,7 +115,6 @@ export default class ChatRoom extends Vue {
...
@@ -114,7 +115,6 @@ export default class ChatRoom extends Vue {
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.chat-status
{
.chat-status
{
display
:
inline-block
;
display
:
inline-block
;
width
:
46px
;
width
:
46px
;
...
...
store/index.ts
View file @
585e1c18
...
@@ -285,28 +285,15 @@ export default {
...
@@ -285,28 +285,15 @@ export default {
commit
,
commit
,
})
/* ...params: Parameters<ChatStore.ACTION_GET_MY_CHAT_LIST> */
{
})
/* ...params: Parameters<ChatStore.ACTION_GET_MY_CHAT_LIST> */
{
const
data
=
await
xim
.
fetchChatList
();
const
data
=
await
xim
.
fetchChatList
();
console
.
log
(
"debugg"
,
data
);
const
chatList
=
data
.
args
[
0
];
const
{
pageData
}
=
await
model
().
list
().
query
({
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
{
pageIndex
:
1
,
list
:
chatList
.
map
(
chat
=>
{
item_size
:
50
,
});
const
result
=
pageData
.
rows
.
map
((
row
)
=>
{
return
{
return
{
uniplatId
:
row
.
id
.
value
,
...
chat
,
chat_id
:
Number
(
row
.
ImChatId
.
value
),
chat_id
:
chat
.
id
,
msg
:
row
.
LastMsgContent
.
value
,
customer_name
:
row
.
id
.
value
,
customer_avatar_url
:
""
,
uniplat_version
:
Number
(
row
.
uniplat_version
.
value
),
msg_type
:
row
.
LastMsgType
.
value
,
is_finish
:
row
.
Status
.
value
,
};
};
})
}),
.
filter
((
k
)
=>
!
k
.
is_finish
);
total
:
9999
,
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
{
list
:
result
,
total
:
pageData
.
record_count
,
});
});
},
},
// async [ChatStore.ACTION_JOIN_CHAT](
// async [ChatStore.ACTION_JOIN_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