Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_front_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqikuai
fns_front_2
Commits
8e5beb98
Commit
8e5beb98
authored
Oct 12, 2021
by
Zhang Xiaojie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of gitlab.33.cn:chenqikuai/fns_front_2 into dev
parents
2e20f97a
ef865f20
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
10 deletions
+19
-10
ContactPersonService.ts
src/db/ContactPersonService.ts
+3
-3
index.ts
src/db/index.ts
+3
-3
index.ts
src/service/UserService/index.ts
+4
-1
types.ts
src/service/UserService/types.ts
+2
-0
displayName.ts
src/utils/displayName.ts
+6
-2
index.vue
src/views/withMenu/ChatList/index.vue
+1
-1
No files found.
src/db/ContactPersonService.ts
View file @
8e5beb98
import
{
iContact
}
from
'@/service/UserService/types'
import
{
iContact2
}
from
'@/service/UserService/types'
import
{
MyAppDatabase
}
from
'./index'
export
default
class
ContactPersonService
{
static
instance
:
ContactPersonService
private
contactPerson
:
Dexie
.
Table
<
iContact
,
number
>
private
contactPerson
:
Dexie
.
Table
<
iContact
2
,
number
>
static
getInstance
()
{
if
(
!
ContactPersonService
.
instance
)
{
ContactPersonService
.
instance
=
new
ContactPersonService
()
...
...
@@ -16,7 +16,7 @@ export default class ContactPersonService {
this
.
contactPerson
=
db
.
contactPerson
}
save
(
list
:
iContact
[])
{
save
(
list
:
iContact
2
[])
{
return
this
.
contactPerson
.
bulkAdd
(
list
)
}
...
...
src/db/index.ts
View file @
8e5beb98
import
Dexie
from
'dexie'
import
{
DisplayMessage
}
from
'@/store/messagesStore'
import
{
iContact
,
iUserinfo
}
from
'@/service/UserService/types'
import
{
iContact
,
i
Contact2
,
i
Userinfo
}
from
'@/service/UserService/types'
export
interface
iChatMessage
extends
DisplayMessage
{
masterId
:
string
// 这条消息展示在谁的页面上
...
...
@@ -18,7 +18,7 @@ export interface iChatListCard {
export
class
MyAppDatabase
extends
Dexie
{
chatMessage
:
Dexie
.
Table
<
iChatMessage
,
number
>
chatListCard
:
Dexie
.
Table
<
iChatListCard
,
number
>
contactPerson
:
Dexie
.
Table
<
iContact
,
number
>
contactPerson
:
Dexie
.
Table
<
iContact
2
,
number
>
userInfo
:
Dexie
.
Table
<
iUserinfo
,
number
>
constructor
()
{
...
...
@@ -28,7 +28,7 @@ export class MyAppDatabase extends Dexie {
chatMessage
:
'++id, content, from, uuid, state, uploadProgress, type, datetime, hideDatetime, logid, masterId, readed'
,
chatListCard
:
'++id, masterId, targetId, unreadMsgCount, content, inChat'
,
contactPerson
:
'++id, addr, bank, phone, user_name'
,
contactPerson
:
'++id, addr, bank, phone, user_name
, out_let_name
'
,
userInfo
:
'++id, created_at, phone, remark, user_name, uuid, addr'
,
})
...
...
src/service/UserService/index.ts
View file @
8e5beb98
...
...
@@ -18,7 +18,10 @@ class UserService {
}
staffInfo
(
data
:
{
addrs
:
string
[]
})
{
return
baseAxios
<
{
total
:
number
;
item
:
iContact
[]
}
>
({
return
baseAxios
<
{
total
:
number
item
:
(
iContact
&
{
out_let_name
:
string
})[]
}
>
({
url
:
'/user/staff_info'
,
method
:
'get'
,
params
:
data
,
...
...
src/service/UserService/types.ts
View file @
8e5beb98
...
...
@@ -5,6 +5,8 @@ export interface iContact {
user_name
:
string
}
export
type
iContact2
=
iContact
&
{
out_let_name
:
string
}
export
interface
iUserinfo
{
addr
:
string
created_at
:
number
...
...
src/utils/displayName.ts
View file @
8e5beb98
...
...
@@ -50,7 +50,11 @@ export const getDisplayNamesFromAddress = async (
return
addressList
.
map
((
item
)
=>
{
const
msg
=
fullList
.
find
((
i
:
any
)
=>
i
?.
addr
===
item
)
return
msg
?.
user_name
||
msg
?.
phone
if
(
msg
?.
out_let_name
)
{
return
msg
?.
out_let_name
+
'客服经理'
}
else
{
return
msg
?.
phone
}
})
}
...
...
@@ -99,6 +103,6 @@ export const getMsgFromAddress = async (
return
addressList
.
map
((
item
)
=>
{
const
msg
=
fullList
.
find
((
i
:
any
)
=>
i
?.
addr
===
item
)
return
msg
;
return
msg
})
}
src/views/withMenu/ChatList/index.vue
View file @
8e5beb98
...
...
@@ -29,7 +29,7 @@
v-if=
"isChatListEmpty"
class=
"empty text-center fixed w-full top-1/2 transform -translate-y-1/2 -mt-6"
>
<img
src=
"@/assets/img/empty.png"
class=
"mb-5"
alt
/>
<img
src=
"@/assets/img/empty.png"
class=
"mb-5"
/>
<div
class=
"no-chat mb-2.5"
>
暂无聊天
</div>
<div
v-if=
"userType === eRole.user"
class=
"tip"
>
咨询客户经理后,可以在这里快捷查看消息哦!
</div>
<div
v-else-if=
"userType === eRole.staff"
class=
"tip"
>
客户咨询后,可以在这里快捷查看消息哦!
</div>
...
...
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