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
23d14d85
Commit
23d14d85
authored
Oct 14, 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
248b821f
cfdc6467
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
549 additions
and
196 deletions
+549
-196
App.vue
src/App.vue
+0
-4
index.vue
src/components/HotNews/index.vue
+19
-1
index.vue
src/components/Loan/LoanCard2/index.vue
+29
-11
branch.vue
src/components/Mine/Branch/branch.vue
+8
-12
index.vue
src/components/PolicyCard/index.vue
+15
-2
index.vue
src/components/showCall/index.vue
+4
-5
chat.ts
src/config/chat.ts
+6
-1
ChatDBService.ts
src/db/ChatDBService.ts
+53
-11
ChatListCardDB.ts
src/db/ChatListCardDB.ts
+5
-4
ChatMessageDB.ts
src/db/ChatMessageDB.ts
+31
-5
index.ts
src/db/index.ts
+3
-2
navigate.ts
src/router/navigate.ts
+21
-0
index.ts
src/service/AddressService/index.ts
+17
-1
types.ts
src/service/AddressService/types.ts
+16
-0
index.ts
src/service/index.ts
+2
-0
messagesStore.ts
src/store/messagesStore.ts
+5
-3
displayName.ts
src/utils/displayName.ts
+35
-1
index.vue
src/views/Auth/PwdSetting/index.vue
+13
-2
Chat.vue
src/views/Chat/Chat.vue
+148
-40
ChatContentMessage.vue
src/views/Chat/ChatContentMessage.vue
+2
-2
ChatInput.vue
src/views/Chat/ChatInput.vue
+8
-2
index.vue
src/views/LoanDetail/index.vue
+32
-38
index.vue
src/views/News/NewsList/index.vue
+15
-3
index.vue
src/views/withMenu/ChatList/index.vue
+26
-9
appList.ts
src/views/withMenu/Home/appList.ts
+5
-1
branch.vue
src/views/withMenu/Mine/branch.vue
+22
-21
setting.vue
src/views/withMenu/Mine/setting.vue
+9
-15
No files found.
src/App.vue
View file @
23d14d85
...
@@ -49,7 +49,6 @@ export default defineComponent({
...
@@ -49,7 +49,6 @@ export default defineComponent({
}
}
fmp
fmp
.
authorize
({
.
authorize
({
appId
:
"dtalk"
,
appId
:
"dtalk"
,
...
@@ -103,9 +102,6 @@ export default defineComponent({
...
@@ -103,9 +102,6 @@ export default defineComponent({
if
(
getUserMsg
())
{
if
(
getUserMsg
())
{
connect
();
connect
();
}
}
getVisitorId
().
then
(
id
=>
{
console
.
log
(
id
,
"show id"
);
})
})
})
watch
(()
=>
connectionState
.
error
,
()
=>
{
watch
(()
=>
connectionState
.
error
,
()
=>
{
...
...
src/components/HotNews/index.vue
View file @
23d14d85
<
template
>
<
template
>
<div
class=
"mx-5"
>
<div
class=
"mx-5"
>
<div
class=
"wrap22 flex items-center"
@
click=
"$router.push(
{path: 'NewsDetail', query: { uuid: info?.uuid, type: 'news' }})">
<div
class=
"wrap22 flex items-center"
@
click=
"$router.push(
{path: 'NewsDetail', query: { uuid: info?.uuid, type: 'news' }})">
<div
class=
"box1 flex-col flex-grow justify-between"
>
<div
class=
"box1 flex-col flex-grow justify-between
overflow-hidden
"
>
<span
class=
"info8"
>
{{
info
?.
title
}}
</span>
<span
class=
"info8"
>
{{
info
?.
title
}}
</span>
<span
class=
"info10"
>
{{
info
?.
desc
}}
</span>
<div
class=
"layer4 flex pr-20"
>
<div
class=
"layer4 flex pr-20"
>
<span
class=
"info9"
>
{{
info
?.
writer
}}
</span>
<span
class=
"info9"
>
{{
info
?.
writer
}}
</span>
<span
class=
"word24"
>
{{
$format
(
info
?.
created_at
,
'YYYY-MM-DD'
)
}}
</span>
<span
class=
"word24"
>
{{
$format
(
info
?.
created_at
,
'YYYY-MM-DD'
)
}}
</span>
...
@@ -62,6 +63,23 @@ export default defineComponent({
...
@@ -62,6 +63,23 @@ export default defineComponent({
text-align
:
left
;
text-align
:
left
;
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
}
.info10
{
z-index
:
205
;
display
:
block
;
overflow-wrap
:
break-word
;
color
:
rgba
(
141
,
146
,
175
,
1
);
margin-top
:
5px
;
font-size
:
12px
;
letter-spacing
:
0.1679999977350235px
;
font-family
:
PingFangSC-Medium
;
line-height
:
25px
;
text-align
:
left
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
}
}
.layer4
{
.layer4
{
...
...
src/components/Loan/LoanCard2/index.vue
View file @
23d14d85
<
script
lang=
"tsx"
>
<
script
lang=
"tsx"
>
import
{
goToChatWithOutletRoboot
}
from
"@/router/navigate"
;
import
AddressService
from
"@/service/AddressService"
;
import
{
defineComponent
,
ref
}
from
"vue"
;
import
{
defineComponent
,
ref
}
from
"vue"
;
export
default
defineComponent
({
export
default
defineComponent
({
props
:
[
"setRef"
,
"min_amount"
,
"max_amount"
,
"rate_lower"
,
"rate_upper"
],
props
:
[
"setRef"
,
"min_amount"
,
"max_amount"
,
"rate_lower"
,
"rate_upper"
],
setup
(
props
)
{
setup
(
props
)
{
const
handleClick
=
async
()
=>
{
console
.
log
(
1
);
const
ret
=
await
AddressService
.
getInstance
().
getNearby
({
bank_code
:
Number
(
process
.
env
.
VUE_APP_BANK_CODE
),
number
:
1
,
})
if
(
ret
.
code
===
200
)
{
goToChatWithOutletRoboot
({
outletId
:
ret
.
data
[
0
].
outlet_id
})
}
}
return
()
=>
(
return
()
=>
(
<
div
class
=
"group2 flex-col"
>
<
div
class
=
"group2 flex-col"
>
<
button
<
div
class
=
"bd13 w-full"
>
class
=
"bd12 flex-col"
onClick
=
{()
=>
{}}
ref
=
{(
el
)
=>
{
props
.
setRef
(
el
);
}}
>
<
span
class
=
"txt9"
>
立即申请
<
/span
>
<
/button
>
<
div
class
=
"bd13 flex-col w-full"
>
<
div
class
=
"layer12 flex-col w-full"
>
<
div
class
=
"layer12 flex-col w-full"
>
<
span
class
=
"word18"
>
借款额度(万元)
<
/span
>
<
span
class
=
"word18"
>
借款额度(万元)
<
/span
>
<
span
class
=
"txt10"
>
<
span
class
=
"txt10"
>
...
@@ -26,6 +32,18 @@ export default defineComponent({
...
@@ -26,6 +32,18 @@ export default defineComponent({
<
/span
>
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
button
class
=
"bd12 flex-col"
onClick
=
{()
=>
{
console
.
log
(
1123123
)
handleClick
();
}}
ref
=
{(
el
)
=>
{
props
.
setRef
(
el
);
}}
>
<
span
class
=
"txt9"
>
立即申请
<
/span
>
<
/button
>
<
/div
>
<
/div
>
);
);
},
},
...
@@ -46,7 +64,7 @@ export default defineComponent({
...
@@ -46,7 +64,7 @@ export default defineComponent({
left: 20px;
left: 20px;
top: 222px;
top: 222px;
.bd12 {
.bd12 {
z-index: 1
2
;
z-index: 1
5
;
height: 40px;
height: 40px;
border-radius: 20px;
border-radius: 20px;
background-color: rgba(62, 79, 175, 1);
background-color: rgba(62, 79, 175, 1);
...
...
src/components/Mine/Branch/branch.vue
View file @
23d14d85
...
@@ -77,7 +77,10 @@
...
@@ -77,7 +77,10 @@
</div>
</div>
</div>
</div>
<!-- 底部操作 -->
<!-- 底部操作 -->
<div
class=
"flex text-center py-3 text-gray-800 bg-branch-tab-bg rounded-b-2xl"
v-if=
"is_normal_work"
>
<div
class=
"flex text-center py-3 text-gray-800 bg-branch-tab-bg rounded-b-2xl"
v-if=
"is_normal_work"
>
<p
class=
"w-1/2 border-r border-gray-200 mb-0"
@
click=
"handleClickChatWithClientManager"
>
联系客服
</p>
<p
class=
"w-1/2 border-r border-gray-200 mb-0"
@
click=
"handleClickChatWithClientManager"
>
联系客服
</p>
<p
class=
"w-1/2 mb-0"
:class=
"isOpen ? 'text-app-blue' : 'text-gray-800'"
@
click=
"toCall"
>
电话咨询
</p>
<p
class=
"w-1/2 mb-0"
:class=
"isOpen ? 'text-app-blue' : 'text-gray-800'"
@
click=
"toCall"
>
电话咨询
</p>
</div>
</div>
...
@@ -97,6 +100,7 @@ import UserService from '@/service/UserService'
...
@@ -97,6 +100,7 @@ import UserService from '@/service/UserService'
import
{
authCheck
}
from
'@/utils/authCheck'
import
{
authCheck
}
from
'@/utils/authCheck'
import
router
from
'@/router'
import
router
from
'@/router'
import
ShowCall
from
'@/components/showCall/index.vue'
import
ShowCall
from
'@/components/showCall/index.vue'
import
{
goToChatWithOutletRoboot
}
from
'@/router/navigate'
const
addressService
=
new
AddressService
()
const
addressService
=
new
AddressService
()
...
@@ -182,6 +186,7 @@ const isOpen = computed(() => {
...
@@ -182,6 +186,7 @@ const isOpen = computed(() => {
return
false
return
false
}
}
})
})
const
error
=
"由于施工原因,本营业厅暂时不营业搬迁中"
const
errorReason
=
ref
(
''
)
const
errorReason
=
ref
(
''
)
const
getErrorNote
=
()
=>
{
const
getErrorNote
=
()
=>
{
if
(
props
.
is_normal_work
)
return
if
(
props
.
is_normal_work
)
return
...
@@ -219,19 +224,10 @@ const handleClickNagigate = () => {
...
@@ -219,19 +224,10 @@ const handleClickNagigate = () => {
const
handleClickChatWithClientManager
=
async
()
=>
{
const
handleClickChatWithClientManager
=
async
()
=>
{
authCheck
(
async
()
=>
{
authCheck
(
async
()
=>
{
const
ret
=
await
UserService
.
getInstance
().
contact_custom_service
({
goToChatWithOutletRoboot
({
out
LetID
:
props
.
outlet_id
as
number
out
letId
:
props
.
outlet_id
as
number
})
})
if
(
ret
.
code
===
200
)
{
router
.
push
({
name
:
'Chat'
,
query
:
{
targetId
:
ret
.
data
.
addr
,
}
})
}
})
})
}
}
</
script
>
</
script
>
...
...
src/components/PolicyCard/index.vue
View file @
23d14d85
<
template
>
<
template
>
<div
@
click=
"$router.push(
{path: 'NewsDetail', query: { uuid: info.uuid, type: 'policy' }})">
<div
@
click=
"$router.push(
{path: 'NewsDetail', query: { uuid: info.uuid, type: 'policy' }})">
<div
class=
" text-base text-gray-800 font-semibold pt-5"
>
{{
info
.
title
}}
</div>
<div
class=
" text-base text-gray-800 font-semibold pt-5
news-title
"
>
{{
info
.
title
}}
</div>
<!--
<p
class=
" text-xs text-gray-400 pt-5"
>
{{
info
.
desc
}}
</p>
-->
<!--
<p
class=
" text-xs text-gray-400 pt-5"
>
{{
info
.
desc
}}
</p>
-->
<div
class=
" text-sm text-gray-800 text-justify pt-3"
>
{{
info
.
desc
}}
</div>
<div
class=
" text-sm text-gray-800 text-justify pt-3
news-info
"
>
{{
info
.
desc
}}
</div>
<div
class=
" text-xs text-gray-400 py-5 border-b border-red border-solid"
>
发布时间:
{{
$format
(
info
.
created_at
,
'YYYY-MM-DD'
)
}}
作者:
{{
info
.
writer
}}
</div>
<div
class=
" text-xs text-gray-400 py-5 border-b border-red border-solid"
>
发布时间:
{{
$format
(
info
.
created_at
,
'YYYY-MM-DD'
)
}}
作者:
{{
info
.
writer
}}
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -26,4 +26,16 @@ export default defineComponent({
...
@@ -26,4 +26,16 @@ export default defineComponent({
<
style
scoped
>
<
style
scoped
>
.news-title
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
}
.news-info
{
display
:
-webkit-box
;
overflow
:
hidden
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
word-break
:
break-all
;
}
</
style
>
</
style
>
\ No newline at end of file
src/components/showCall/index.vue
View file @
23d14d85
...
@@ -37,9 +37,9 @@
...
@@ -37,9 +37,9 @@
import
Vue
,
{
getCurrentInstance
}
from
'vue'
import
Vue
,
{
getCurrentInstance
}
from
'vue'
import
jsBridge
from
"@/utils/jsBridge2"
import
jsBridge
from
"@/utils/jsBridge2"
const
{
ctx
}
=
getCurrentInstance
()
as
any
//
const { ctx } = getCurrentInstance() as any
cons
ole
.
log
(
ctx
)
cons
t
emit
=
defineEmits
([
'hidden'
]
)
const
props
=
defineProps
({
const
props
=
defineProps
({
show
:
{
show
:
{
...
@@ -52,14 +52,13 @@ const props = defineProps({
...
@@ -52,14 +52,13 @@ const props = defineProps({
})
})
const
hide
=
()
=>
{
const
hide
=
()
=>
{
console
.
log
(
ctx
,
'ctx'
)
emit
(
'hidden'
,
false
)
ctx
.
$emit
(
'hidden'
,
false
)
}
}
const
handleClickCall
=
async
()
=>
{
const
handleClickCall
=
async
()
=>
{
console
.
log
(
props
.
phone
)
console
.
log
(
props
.
phone
)
new
jsBridge
().
bridge_call
(
props
.
phone
,
()
=>
{
new
jsBridge
().
bridge_call
(
props
.
phone
,
()
=>
{
ctx
.
$
emit
(
'hidden'
,
false
)
emit
(
'hidden'
,
false
)
})
})
}
}
...
...
src/config/chat.ts
View file @
23d14d85
...
@@ -11,4 +11,9 @@ export const CONST_END_CHAT = {
...
@@ -11,4 +11,9 @@ export const CONST_END_CHAT = {
staff
:
{
id
:
'4'
,
value
:
'会话已结束'
},
staff
:
{
id
:
'4'
,
value
:
'会话已结束'
},
}
}
export
const
CHAT_CONST_LIST
=
[
CONST_START_CHAT
,
CONST_END_CHAT
]
export
const
CONST_WARNING
=
{
user
:
{
id
:
'5'
,
value
:
'您好,非常抱歉,该网点暂无营业人员。'
},
staff
:
{
id
:
'6'
,
value
:
''
},
}
export
const
CHAT_CONST_LIST
=
[
CONST_START_CHAT
,
CONST_END_CHAT
,
CONST_WARNING
]
src/db/ChatDBService.ts
View file @
23d14d85
import
{
DisplayMessage
}
from
'@/store/messagesStore'
import
{
DisplayMessage
}
from
'@/store/messagesStore'
import
{
getMasterIdFromDisplayMsg
,
getTargetIdFromDisplayMsg
}
from
'@/utils/chatutils'
import
{
getMasterIdFromDisplayMsg
,
getTargetIdFromDisplayMsg
,
}
from
'@/utils/chatutils'
import
ChatListCardDB
from
'./ChatListCardDB'
import
ChatListCardDB
from
'./ChatListCardDB'
import
ChatMessageDB
from
'./ChatMessageDB'
import
ChatMessageDB
from
'./ChatMessageDB'
interface
iRecevedMsg
{
msg
:
DisplayMessage
masterId
:
string
isChattingWithTargetId
:
boolean
isRoboot
?:
boolean
}
export
default
class
ChatDBService
{
export
default
class
ChatDBService
{
static
instance
:
ChatDBService
static
instance
:
ChatDBService
static
getInstance
()
{
static
getInstance
()
{
...
@@ -14,30 +24,62 @@ export default class ChatDBService {
...
@@ -14,30 +24,62 @@ export default class ChatDBService {
msg
:
DisplayMessage
msg
:
DisplayMessage
masterId
:
string
masterId
:
string
isChattingWithTargetId
:
boolean
isChattingWithTargetId
:
boolean
isRoboot
?:
boolean
})
{
let
firstInsert
=
false
const
isQueueEmpty
=
this
.
dataList
.
length
===
0
if
(
isQueueEmpty
)
{
firstInsert
=
true
}
this
.
pushToList
(
data
)
if
(
firstInsert
===
true
)
{
await
this
.
exec
(
this
.
dataList
[
0
])
this
.
dataList
.
shift
()
this
.
startExecList
()
}
}
private
async
startExecList
():
Promise
<
any
>
{
if
(
this
.
dataList
.
length
!==
0
)
{
const
msg
=
this
.
dataList
[
0
]
await
this
.
exec
(
msg
)
this
.
dataList
.
shift
()
return
this
.
startExecList
()
}
}
private
async
exec
(
data
:
{
msg
:
DisplayMessage
masterId
:
string
isChattingWithTargetId
:
boolean
isRoboot
?:
boolean
})
{
})
{
/* 检查和对象之间的聊天记录,如果数量为0,则表示之前没有和他聊过,需要新增一个chatcard */
/* 如果数量为1,表示之前和他聊过 */
const
{
msg
,
masterId
,
isChattingWithTargetId
}
=
data
const
{
msg
,
masterId
,
isChattingWithTargetId
}
=
data
console
.
log
(
data
,
"show in handleEveryRecive"
);
await
ChatMessageDB
.
getInstance
().
saveMsg
(
msg
,
masterId
)
const
thePersonAlreadyInChatList
=
await
Chat
ListCard
DB
.
getInstance
().
thePersonAlreadyInChatList
(
const
thePersonAlreadyInChatList
=
await
Chat
Message
DB
.
getInstance
().
thePersonAlreadyInChatList
(
getMasterIdFromDisplayMsg
(
msg
),
getMasterIdFromDisplayMsg
(
msg
),
getTargetIdFromDisplayMsg
(
msg
),
getTargetIdFromDisplayMsg
(
msg
),
)
)
await
ChatMessageDB
.
getInstance
().
saveMsg
(
msg
,
masterId
)
console
.
log
(
thePersonAlreadyInChatList
,
'show thePersonAlreadyInChatList'
);
if
(
thePersonAlreadyInChatList
)
{
if
(
thePersonAlreadyInChatList
)
{
await
ChatListCardDB
.
getInstance
().
updateNewestCard
({
return
await
ChatListCardDB
.
getInstance
().
updateNewestCard
({
msg
,
msg
,
isChattingWithTargetId
,
isChattingWithTargetId
,
})
})
}
else
{
}
else
{
await
ChatListCardDB
.
getInstance
().
addNewCard
({
return
await
ChatListCardDB
.
getInstance
().
addNewCard
({
msg
,
msg
,
isChattingWithTargetId
,
isChattingWithTargetId
,
isRobootCard
:
data
.
isRoboot
,
})
})
}
}
}
}
private
dataList
=
[]
as
iRecevedMsg
[]
private
pushToList
(
msg
:
iRecevedMsg
)
{
this
.
dataList
.
push
(
msg
)
}
}
}
src/db/ChatListCardDB.ts
View file @
23d14d85
...
@@ -52,8 +52,7 @@ export default class ChatListCardDB extends MyAppDatabase {
...
@@ -52,8 +52,7 @@ export default class ChatListCardDB extends MyAppDatabase {
return
this
.
chatListCard
return
this
.
chatListCard
.
filter
((
item
)
=>
{
.
filter
((
item
)
=>
{
return
item
.
masterId
===
masterId
return
item
.
masterId
===
masterId
})
}).
reverse
().
sortBy
(
'datetime'
)
.
toArray
()
}
}
async
thePersonAlreadyInChatList
(
masterId
:
string
,
personId
:
string
)
{
async
thePersonAlreadyInChatList
(
masterId
:
string
,
personId
:
string
)
{
...
@@ -105,7 +104,8 @@ export default class ChatListCardDB extends MyAppDatabase {
...
@@ -105,7 +104,8 @@ export default class ChatListCardDB extends MyAppDatabase {
async
addNewCard
(
data
:
{
async
addNewCard
(
data
:
{
msg
:
DisplayMessage
msg
:
DisplayMessage
isChattingWithTargetId
:
boolean
isChattingWithTargetId
:
boolean
,
isRobootCard
?:
boolean
})
{
})
{
const
content
=
data
.
msg
.
content
?.
content
||
'[新消息]'
const
content
=
data
.
msg
.
content
?.
content
||
'[新消息]'
const
masterId
=
getMasterIdFromDisplayMsg
(
data
.
msg
)
const
masterId
=
getMasterIdFromDisplayMsg
(
data
.
msg
)
...
@@ -118,7 +118,8 @@ export default class ChatListCardDB extends MyAppDatabase {
...
@@ -118,7 +118,8 @@ export default class ChatListCardDB extends MyAppDatabase {
unreadMsgCount
:
data
.
isChattingWithTargetId
?
0
:
1
,
unreadMsgCount
:
data
.
isChattingWithTargetId
?
0
:
1
,
content
,
content
,
inChat
:
false
,
inChat
:
false
,
datetime
:
data
.
msg
.
datetime
datetime
:
data
.
msg
.
datetime
,
isRobootCard
:
data
.
isRobootCard
,
})
})
}
}
...
...
src/db/ChatMessageDB.ts
View file @
23d14d85
...
@@ -30,7 +30,11 @@ export default class ChatMessageDB extends MyAppDatabase {
...
@@ -30,7 +30,11 @@ export default class ChatMessageDB extends MyAppDatabase {
}
}
async
deleteMsg
({
uuid
,
logid
}:
{
uuid
?:
string
;
logid
?:
string
})
{
async
deleteMsg
({
uuid
,
logid
}:
{
uuid
?:
string
;
logid
?:
string
})
{
const
updateChatList
=
async
(
masterId
:
string
,
target
:
string
,
deletedMsgDatetime
:
number
)
=>
{
const
updateChatList
=
async
(
masterId
:
string
,
target
:
string
,
deletedMsgDatetime
:
number
,
)
=>
{
const
latestedMsg
=
await
this
.
getLatestedMessage
(
masterId
,
target
)
const
latestedMsg
=
await
this
.
getLatestedMessage
(
masterId
,
target
)
if
(
latestedMsg
)
{
if
(
latestedMsg
)
{
...
@@ -39,8 +43,8 @@ export default class ChatMessageDB extends MyAppDatabase {
...
@@ -39,8 +43,8 @@ export default class ChatMessageDB extends MyAppDatabase {
this
.
chatListCard
this
.
chatListCard
.
filter
((
i
)
=>
i
.
masterId
===
masterId
&&
i
.
targetId
===
target
)
.
filter
((
i
)
=>
i
.
masterId
===
masterId
&&
i
.
targetId
===
target
)
.
modify
((
i
)
=>
{
.
modify
((
i
)
=>
{
i
.
content
=
latestedMsg
.
content
.
content
as
string
;
i
.
content
=
latestedMsg
.
content
.
content
as
string
i
.
datetime
=
latestedMsg
.
datetime
;
i
.
datetime
=
latestedMsg
.
datetime
})
})
}
else
{
}
else
{
/* 如果和target没有聊天消息 */
/* 如果和target没有聊天消息 */
...
@@ -56,11 +60,21 @@ export default class ChatMessageDB extends MyAppDatabase {
...
@@ -56,11 +60,21 @@ export default class ChatMessageDB extends MyAppDatabase {
if
(
uuid
)
{
if
(
uuid
)
{
const
item
=
await
this
.
chatMessage
.
where
(
'uuid'
).
equals
(
uuid
).
first
()
const
item
=
await
this
.
chatMessage
.
where
(
'uuid'
).
equals
(
uuid
).
first
()
await
this
.
chatMessage
.
where
(
'uuid'
).
equals
(
uuid
).
delete
()
await
this
.
chatMessage
.
where
(
'uuid'
).
equals
(
uuid
).
delete
()
item
&&
updateChatList
(
item
?.
masterId
,
getTargetIdFromDisplayMsg
(
item
),
item
?.
datetime
)
item
&&
updateChatList
(
item
?.
masterId
,
getTargetIdFromDisplayMsg
(
item
),
item
?.
datetime
,
)
}
else
if
(
logid
)
{
}
else
if
(
logid
)
{
const
item
=
await
this
.
chatMessage
.
where
(
'logid'
).
equals
(
logid
).
first
()
const
item
=
await
this
.
chatMessage
.
where
(
'logid'
).
equals
(
logid
).
first
()
await
this
.
chatMessage
.
where
(
'logid'
).
equals
(
logid
).
delete
()
await
this
.
chatMessage
.
where
(
'logid'
).
equals
(
logid
).
delete
()
item
&&
updateChatList
(
item
?.
masterId
,
getTargetIdFromDisplayMsg
(
item
),
item
?.
datetime
)
item
&&
updateChatList
(
item
?.
masterId
,
getTargetIdFromDisplayMsg
(
item
),
item
?.
datetime
,
)
}
else
{
}
else
{
throw
new
Error
(
'没有uuid或者logid'
)
throw
new
Error
(
'没有uuid或者logid'
)
}
}
...
@@ -78,6 +92,18 @@ export default class ChatMessageDB extends MyAppDatabase {
...
@@ -78,6 +92,18 @@ export default class ChatMessageDB extends MyAppDatabase {
}
}
}
}
async
thePersonAlreadyInChatList
(
masterId
:
string
,
personId
:
string
)
{
return
(
(
await
this
.
chatMessage
.
filter
(
(
i
)
=>
(
i
.
masterId
===
masterId
&&
((
i
.
state
===
null
&&
i
.
from
===
personId
)
||
(
i
.
state
!==
null
&&
i
.
target
===
personId
)))
)
.
count
())
!==
0
)
}
/* from表示自己的address,target表示对话人的address */
/* from表示自己的address,target表示对话人的address */
getMessage
(
from
:
string
,
target
:
string
)
{
getMessage
(
from
:
string
,
target
:
string
)
{
return
this
.
chatMessage
return
this
.
chatMessage
...
...
src/db/index.ts
View file @
23d14d85
...
@@ -13,6 +13,7 @@ export interface iChatListCard {
...
@@ -13,6 +13,7 @@ export interface iChatListCard {
content
:
string
content
:
string
datetime
:
number
datetime
:
number
inChat
:
boolean
// 会话状态,会话中?
inChat
:
boolean
// 会话状态,会话中?
isRobootCard
?:
boolean
}
}
export
class
MyAppDatabase
extends
Dexie
{
export
class
MyAppDatabase
extends
Dexie
{
...
@@ -24,10 +25,10 @@ export class MyAppDatabase extends Dexie {
...
@@ -24,10 +25,10 @@ export class MyAppDatabase extends Dexie {
constructor
()
{
constructor
()
{
super
(
'MyAppDatabase'
)
super
(
'MyAppDatabase'
)
this
.
version
(
1.
3
).
stores
({
this
.
version
(
1.
4
).
stores
({
chatMessage
:
chatMessage
:
'++id, content, from, uuid, state, uploadProgress, type, datetime, hideDatetime, logid, masterId, readed'
,
'++id, content, from, uuid, state, uploadProgress, type, datetime, hideDatetime, logid, masterId, readed'
,
chatListCard
:
'++id, masterId, targetId, unreadMsgCount, content, inChat'
,
chatListCard
:
'++id, masterId, targetId, unreadMsgCount, content, inChat
, isRobootCard
'
,
contactPerson
:
'++id, addr, bank, phone, user_name, out_let_name'
,
contactPerson
:
'++id, addr, bank, phone, user_name, out_let_name'
,
userInfo
:
'++id, created_at, phone, remark, user_name, uuid, addr'
,
userInfo
:
'++id, created_at, phone, remark, user_name, uuid, addr'
,
})
})
...
...
src/router/navigate.ts
0 → 100644
View file @
23d14d85
import
router
from
'.'
export
function
goToChatWithOutletRoboot
(
data
:
{
outletId
:
number
})
{
router
.
push
({
name
:
'Chat'
,
query
:
{
targetId
:
data
.
outletId
,
outlet
:
'true'
,
},
})
}
export
function
gotoChatWithStaff
(
data
:
{
address
:
string
;
beginChat
?:
boolean
})
{
router
.
push
({
name
:
'Chat'
,
query
:
{
targetId
:
data
.
address
,
beginChat
:
data
.
beginChat
?
'true'
:
undefined
,
},
})
}
src/service/AddressService/index.ts
View file @
23d14d85
import
{
Toast
}
from
'vant'
import
{
Toast
}
from
'vant'
import
baseAxios
,
{
iRet
}
from
'../index'
import
baseAxios
,
{
iRet
}
from
'../index'
import
{
iNearbyOutLet
}
from
'./types'
import
{
iNearbyOutLet
,
iOutLetDetail
}
from
'./types'
import
Bridge
from
'@/utils/jsBridge2'
import
Bridge
from
'@/utils/jsBridge2'
class
AddressService
{
class
AddressService
{
static
instance
:
AddressService
static
instance
:
AddressService
...
@@ -80,6 +80,22 @@ class AddressService {
...
@@ -80,6 +80,22 @@ class AddressService {
data
,
data
,
})
})
}
}
getOutlet
(
data
:
{
outlet_name
?:
string
;
id
?:
number
})
{
let
theData
=
{
bank_code
:
Number
(
process
.
env
.
VUE_APP_BANK_CODE
)
}
as
any
if
(
data
.
outlet_name
)
{
theData
.
outlet_name
=
data
.
outlet_name
}
else
if
(
data
.
id
!==
undefined
)
{
theData
.
id
=
data
.
id
}
return
baseAxios
<
iOutLetDetail
>
({
url
:
'/address/getOutlet'
,
method
:
'post'
,
data
:
theData
,
})
}
}
}
export
default
AddressService
export
default
AddressService
src/service/AddressService/types.ts
View file @
23d14d85
...
@@ -13,3 +13,18 @@ export interface iNearbyOutLet {
...
@@ -13,3 +13,18 @@ export interface iNearbyOutLet {
export
interface
errorInfo
{
export
interface
errorInfo
{
note
:
string
note
:
string
}
}
export
interface
iOutLetDetail
{
id
:
number
city_name
:
string
is_normal_work
:
boolean
latitude
:
string
location
:
string
longitude
:
string
opening_hours
:
string
outlet_name
:
string
region_name
:
string
weekend_status
:
number
province_name
:
string
}
\ No newline at end of file
src/service/index.ts
View file @
23d14d85
...
@@ -16,6 +16,8 @@ baseAxios.interceptors.response.use(
...
@@ -16,6 +16,8 @@ baseAxios.interceptors.response.use(
router
.
push
({
router
.
push
({
name
:
'Login'
,
name
:
'Login'
,
})
})
}
else
if
(
ret
.
code
===
1000
)
{
Toast
(
'您好,非常抱歉,该网点暂无营业人员。'
)
}
else
if
(
ret
.
code
!==
200
)
{
}
else
if
(
ret
.
code
!==
200
)
{
Toast
.
fail
(
ret
.
msg
)
Toast
.
fail
(
ret
.
msg
)
}
}
...
...
src/store/messagesStore.ts
View file @
23d14d85
...
@@ -104,7 +104,7 @@ class MessageStore {
...
@@ -104,7 +104,7 @@ class MessageStore {
* @param content 消息内容,需根据类型填写对应字段
* @param content 消息内容,需根据类型填写对应字段
* @param uuid 如果传入 uuid 则说明是重新发送之前失败的消息
* @param uuid 如果传入 uuid 则说明是重新发送之前失败的消息
*/
*/
sendMessage
({
async
sendMessage
({
type
,
type
,
content
,
content
,
target
,
target
,
...
@@ -151,7 +151,7 @@ class MessageStore {
...
@@ -151,7 +151,7 @@ class MessageStore {
type
===
ChatMessageTypes
.
Image
&&
type
===
ChatMessageTypes
.
Image
&&
(
<
dtalk
.
proto
.
IAudioMsg
>
content
).
mediaUrl
(
<
dtalk
.
proto
.
IAudioMsg
>
content
).
mediaUrl
)
)
this
.
send
(
type
,
content
,
_uuid
,
message
,
target
)
await
this
.
send
(
type
,
content
,
_uuid
,
message
,
target
)
return
return
}
}
...
@@ -187,7 +187,7 @@ class MessageStore {
...
@@ -187,7 +187,7 @@ class MessageStore {
}
}
// 文本类消息,不需要上传 OSS,直接发送
// 文本类消息,不需要上传 OSS,直接发送
else
{
else
{
ChatDBService
.
getInstance
().
handleEveryReceive
({
await
ChatDBService
.
getInstance
().
handleEveryReceive
({
msg
:
message
,
msg
:
message
,
masterId
:
getMasterIdFromDisplayMsg
(
message
),
masterId
:
getMasterIdFromDisplayMsg
(
message
),
isChattingWithTargetId
:
isChattingWith
(
isChattingWithTargetId
:
isChattingWith
(
...
@@ -293,6 +293,8 @@ class MessageStore {
...
@@ -293,6 +293,8 @@ class MessageStore {
uuid
,
uuid
,
})
})
.
then
(()
=>
{
.
then
(()
=>
{
console
.
log
(
'send success'
);
message
.
state
=
'success'
message
.
state
=
'success'
ChatMessageDB
.
getInstance
().
updateMsg
(
ChatMessageDB
.
getInstance
().
updateMsg
(
...
...
src/utils/displayName.ts
View file @
23d14d85
import
{
iChatListCard
}
from
'@/db'
import
ContactPersonService
from
'@/db/ContactPersonService'
import
ContactPersonService
from
'@/db/ContactPersonService'
import
UserInfoDBService
from
'@/db/UserInfoService'
import
UserInfoDBService
from
'@/db/UserInfoService'
import
AddressService
from
'@/service/AddressService'
import
UserService
from
'@/service/UserService'
import
UserService
from
'@/service/UserService'
import
{
iContact
}
from
'@/service/UserService/types'
import
{
iContact
}
from
'@/service/UserService/types'
import
{
eRole
}
from
'@/types/roleType'
import
{
eRole
}
from
'@/types/roleType'
import
{
getUserMsg
}
from
'./userMsg'
import
{
getUserMsg
}
from
'./userMsg'
/* 拿到地址对应的用户昵称 */
export
const
getDisplayNamesFromAddress
=
async
(
export
const
getDisplayNamesFromAddress
=
async
(
addressList
:
string
[],
addressList
:
string
[],
):
Promise
<
string
[]
>
=>
{
):
Promise
<
string
[]
>
=>
{
...
@@ -51,13 +54,44 @@ export const getDisplayNamesFromAddress = async (
...
@@ -51,13 +54,44 @@ export const getDisplayNamesFromAddress = async (
return
addressList
.
map
((
item
)
=>
{
return
addressList
.
map
((
item
)
=>
{
const
msg
=
fullList
.
find
((
i
:
any
)
=>
i
?.
addr
===
item
)
const
msg
=
fullList
.
find
((
i
:
any
)
=>
i
?.
addr
===
item
)
if
(
msg
?.
out_let_name
)
{
if
(
msg
?.
out_let_name
)
{
return
msg
?.
out_let_name
+
msg
.
user_name
return
msg
?.
out_let_name
+
msg
.
user_name
}
else
{
}
else
{
return
msg
?.
phone
return
msg
?.
phone
}
}
})
})
}
}
/* 获取网点名称 */
export
const
getDisplayNamesFromOutletId
=
async
(
outletids
:
number
[])
=>
{
const
promiseList
=
outletids
.
map
((
id
)
=>
{
return
AddressService
.
getInstance
()
.
getOutlet
({
id
,
})
.
then
((
ret
)
=>
{
if
(
ret
.
code
===
200
)
{
return
ret
.
data
.
outlet_name
}
})
})
const
list
=
await
Promise
.
all
(
promiseList
)
return
list
}
export
const
getDisplayNames
=
async
(
list
:
{
outletId
?:
number
;
address
?:
string
}[],
)
=>
{
const
promiseList
=
list
.
map
((
i
)
=>
{
if
(
i
.
outletId
!==
undefined
)
{
return
getDisplayNamesFromOutletId
([
i
.
outletId
]).
then
((
ret
)
=>
ret
[
0
])
}
else
if
(
i
.
address
!==
undefined
)
{
return
getDisplayNamesFromAddress
([
i
.
address
]).
then
((
ret
)
=>
ret
[
0
])
}
else
return
''
})
return
Promise
.
all
(
promiseList
)
}
export
const
getMsgFromAddress
=
async
(
export
const
getMsgFromAddress
=
async
(
addressList
:
string
[],
addressList
:
string
[],
):
Promise
<
any
[]
>
=>
{
):
Promise
<
any
[]
>
=>
{
...
...
src/views/Auth/PwdSetting/index.vue
View file @
23d14d85
<
template
>
<
template
>
<div
class=
"px-5"
>
<div
class=
"px-5"
>
<pwd-setting
<pwd-setting
:phone=
"
$route.query.phone
"
:phone=
"
Phone()
"
:sendSmsFunc=
"sendSmsFunc"
:sendSmsFunc=
"sendSmsFunc"
:setPwdFunc=
"setPwdFunc"
:setPwdFunc=
"setPwdFunc"
/>
/>
...
@@ -11,9 +11,20 @@
...
@@ -11,9 +11,20 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
PwdSetting
from
"./PwdSetting.vue"
;
import
PwdSetting
from
"./PwdSetting.vue"
;
import
{
defineComponent
}
from
"vue"
;
import
{
defineComponent
}
from
"vue"
;
import
{
getUserMsg
}
from
'@/utils/userMsg'
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
PwdSetting
},
components
:
{
PwdSetting
},
inject
:
[
"sendSmsFunc"
,
"setPwdFunc"
],
inject
:
[
"sendSmsFunc"
,
"setPwdFunc"
],
methods
:
{},
created
(){
console
.
log
(
this
.
$route
.
query
.
phone
,
'router'
);
this
.
Phone
()
},
methods
:
{
Phone
(){
const
phone
=
getUserMsg
()?.
userInfo
.
phone
+
''
console
.
log
(
phone
,
'phone'
);
return
phone
}
},
});
});
</
script
>
</
script
>
src/views/Chat/Chat.vue
View file @
23d14d85
...
@@ -12,20 +12,20 @@
...
@@ -12,20 +12,20 @@
<ServiceRating
:setSelectedRate=
"handleSelect"
:selected=
"selected"
v-if=
"showServiceRating"
/>
<ServiceRating
:setSelectedRate=
"handleSelect"
:selected=
"selected"
v-if=
"showServiceRating"
/>
<ChatOption>
<ChatOption>
<ChatOptionItemVue
<ChatOptionItemVue
v-if=
"isUser"
v-if=
"isUser
&& isChatWithRoboot
"
:selected=
"questionSelected"
:selected=
"questionSelected"
@
click=
"handleClickQuestionOption"
@
click=
"handleClickQuestionOption"
value=
"常用问题"
value=
"常用问题"
/>
/>
<ChatOptionItemVue
<ChatOptionItemVue
v-if=
"isUser"
v-if=
"isUser
&& isChatWithRoboot
"
:selected=
"serviceSelected"
:selected=
"serviceSelected"
:value=
"serviceShowValue"
:value=
"serviceShowValue"
@
click=
"handleClickService"
@
click=
"handleClickService"
/>
/>
<ChatOptionItemVue
:selected=
"false"
value=
"电话联系"
@
click=
"handleClickCall"
/>
<ChatOptionItemVue
:selected=
"false"
value=
"电话联系"
@
click=
"handleClickCall"
/>
</ChatOption>
</ChatOption>
<ChatInputVue
:serviceShowValue=
"serviceShowValue"
/>
<ChatInputVue
:serviceShowValue=
"serviceShowValue"
/>
<CommonUseSentence
<CommonUseSentence
class=
"transition-all h-0"
class=
"transition-all h-0"
:class=
"
{ 'h-40': showShortSentences }"
:class=
"
{ 'h-40': showShortSentences }"
...
@@ -52,13 +52,17 @@ import { v4 as uuidv4 } from 'uuid'
...
@@ -52,13 +52,17 @@ import { v4 as uuidv4 } from 'uuid'
import
{
ChatMessageTypes
}
from
"@/types/chatMessageTypes"
;
import
{
ChatMessageTypes
}
from
"@/types/chatMessageTypes"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
queryFaqAnswer
,
queryFaqList
}
from
"@/service/FaqService"
;
import
{
queryFaqAnswer
,
queryFaqList
}
from
"@/service/FaqService"
;
import
{
getDisplayNamesFromAddress
,
getMsgFromAddress
}
from
"@/utils/displayName"
;
import
{
getDisplayNames
,
getDisplayNames
FromAddress
,
getMsgFromAddress
}
from
"@/utils/displayName"
;
import
{
MessageContent
}
from
"@/types/chat-message"
;
import
{
MessageContent
}
from
"@/types/chat-message"
;
import
{
CONST_END_CHAT
,
CONST_START_CHAT
}
from
"@/config/chat"
;
import
{
CONST_END_CHAT
,
CONST_START_CHAT
,
CONST_WARNING
}
from
"@/config/chat"
;
import
ChatOptionItemVue
from
"@/components/ChatOptions/ChatOptionItem.vue"
;
import
ChatOptionItemVue
from
"@/components/ChatOptions/ChatOptionItem.vue"
;
import
ShowCall
from
"@/components/showCall/index.vue"
import
ShowCall
from
"@/components/showCall/index.vue"
import
{
getUserMsg
}
from
"@/utils/userMsg"
;
import
{
getUserMsg
}
from
"@/utils/userMsg"
;
import
{
eRole
}
from
"@/types/roleType"
;
import
{
eRole
}
from
"@/types/roleType"
;
import
ChatDBService
from
"@/db/ChatDBService"
;
import
UserService
from
"@/service/UserService"
;
import
{
gotoChatWithStaff
}
from
"@/router/navigate"
;
import
{
Toast
}
from
"vant"
;
export
default
defineComponent
({
export
default
defineComponent
({
...
@@ -78,6 +82,7 @@ export default defineComponent({
...
@@ -78,6 +82,7 @@ export default defineComponent({
const
handleClickQuestionOption
=
()
=>
{
const
handleClickQuestionOption
=
()
=>
{
questionSelected
.
value
=
!
questionSelected
.
value
questionSelected
.
value
=
!
questionSelected
.
value
}
}
watch
(
questionSelected
,
()
=>
{
watch
(
questionSelected
,
()
=>
{
setShowSentences
(
questionSelected
.
value
)
setShowSentences
(
questionSelected
.
value
)
sentensesLoading
.
value
=
true
;
sentensesLoading
.
value
=
true
;
...
@@ -91,23 +96,42 @@ export default defineComponent({
...
@@ -91,23 +96,42 @@ export default defineComponent({
const
serviceSelected
=
ref
(
false
);
const
serviceSelected
=
ref
(
false
);
const
serviceShowValue
=
ref
(
'人工服务'
)
const
serviceShowValue
=
ref
(
'人工服务'
)
const
handleClickService
=
()
=>
{
const
sendChatMessage
=
(
payload
:
{
const
sendChatMessage
=
(
payload
:
{
type
:
ChatMessageTypes
;
type
:
ChatMessageTypes
;
content
:
MessageContent
;
content
:
MessageContent
;
})
=>
{
target
?:
string
;
messageStore
.
sendMessage
({
type
:
payload
.
type
,
content
:
payload
.
content
,
target
:
route
.
query
.
targetId
as
string
});
})
=>
{
};
return
messageStore
.
sendMessage
({
type
:
payload
.
type
,
content
:
payload
.
content
,
target
:
payload
.
target
||
route
.
query
.
targetId
as
string
});
};
const
handleClickService
=
async
()
=>
{
if
(
serviceShowValue
.
value
===
'人工服务'
)
{
if
(
serviceShowValue
.
value
===
'人工服务'
)
{
sendChatMessage
({
questionSelected
.
value
=
false
;
type
:
ChatMessageTypes
.
Card
,
const
ret
=
await
UserService
.
getInstance
().
contact_custom_service
({
content
:
{
outLetID
:
Number
(
route
.
query
.
targetId
)
as
number
bank
:
CONST_START_CHAT
.
user
.
id
,
name
:
CONST_START_CHAT
.
staff
.
id
,
account
:
''
,
}
as
MessageContent
})
})
serviceShowValue
.
value
=
'结束服务'
if
(
ret
.
code
===
200
)
{
gotoChatWithStaff
({
address
:
ret
.
data
.
addr
,
beginChat
:
true
});
}
else
{
// await sendChatMessage({
// type: ChatMessageTypes.Card,
// content: {
// bank: CONST_WARNING.user.id,
// name: CONST_WARNING.staff.id,
// account: '',
// } as MessageContent,
// target: route.query.targetId as string
// })
return
;
}
}
else
if
(
serviceShowValue
.
value
===
'结束服务'
)
{
}
else
if
(
serviceShowValue
.
value
===
'结束服务'
)
{
serviceShowValue
.
value
=
'人工服务'
serviceShowValue
.
value
=
'人工服务'
sendChatMessage
({
sendChatMessage
({
...
@@ -118,15 +142,8 @@ export default defineComponent({
...
@@ -118,15 +142,8 @@ export default defineComponent({
account
:
''
,
account
:
''
,
}
as
MessageContent
}
as
MessageContent
})
})
// showServiceRating.value = true;
}
}
}
}
onMounted
(
async
()
=>
{
const
inChat
=
await
ChatListCardDB
.
getInstance
().
getChatStatus
(
getFromId
()
as
string
,
target
)
serviceShowValue
.
value
=
inChat
?
'结束服务'
:
'人工服务'
})
const
initError
=
ref
(
false
);
const
initError
=
ref
(
false
);
const
showServiceRating
=
ref
(
false
);
const
showServiceRating
=
ref
(
false
);
...
@@ -145,12 +162,25 @@ export default defineComponent({
...
@@ -145,12 +162,25 @@ export default defineComponent({
const
handleClickCall
=
()
=>
{
const
handleClickCall
=
async
()
=>
{
if
(
isChatWithRoboot
.
value
)
{
const
ret
=
await
UserService
.
getInstance
().
contact_custom_service
({
outLetID
:
Number
(
target
)
as
number
})
if
(
ret
.
code
===
200
)
{
callPhone
.
value
=
ret
.
data
.
phone
;
}
else
{
return
;
}
}
else
{
const
ret
=
await
getMsgFromAddress
([
target
])
callPhone
.
value
=
ret
[
0
].
phone
;
}
showCall
.
value
=
true
;
showCall
.
value
=
true
;
}
}
const
useSentence
=
(
content
:
string
)
=>
{
const
useSentence
=
async
(
content
:
string
)
=>
{
/* 问 */
/* 问 */
messageStore
.
displayNewMessage
({
messageStore
.
displayNewMessage
({
content
:
{
content
:
{
...
@@ -164,6 +194,23 @@ export default defineComponent({
...
@@ -164,6 +194,23 @@ export default defineComponent({
type
:
ChatMessageTypes
.
robot
,
type
:
ChatMessageTypes
.
robot
,
})
})
await
ChatDBService
.
getInstance
().
handleEveryReceive
({
msg
:
{
content
:
{
content
:
content
},
from
:
getFromId
()
as
string
,
target
:
target
,
uuid
:
uuidv4
(),
state
:
'success'
,
datetime
:
new
Date
().
getTime
(),
type
:
ChatMessageTypes
.
robot
,
},
masterId
:
getFromId
()
as
string
,
isChattingWithTargetId
:
true
,
isRoboot
:
true
,
})
queryFaqAnswer
({
queryFaqAnswer
({
question
:
content
question
:
content
}).
then
((
ret
)
=>
{
}).
then
((
ret
)
=>
{
...
@@ -177,20 +224,32 @@ export default defineComponent({
...
@@ -177,20 +224,32 @@ export default defineComponent({
from
:
target
,
from
:
target
,
target
:
getFromId
(),
target
:
getFromId
(),
uuid
:
uuidv4
(),
uuid
:
uuidv4
(),
state
:
'success'
,
state
:
null
,
datetime
:
new
Date
().
getTime
(),
datetime
:
new
Date
().
getTime
(),
type
:
ChatMessageTypes
.
robot
,
type
:
ChatMessageTypes
.
robot
,
})
})
ChatDBService
.
getInstance
().
handleEveryReceive
({
msg
:
{
content
:
{
content
:
ret
.
data
},
from
:
target
as
string
,
target
:
getFromId
(),
uuid
:
uuidv4
(),
state
:
null
,
datetime
:
new
Date
().
getTime
(),
type
:
ChatMessageTypes
.
robot
,
},
masterId
:
getFromId
()
as
string
,
isChattingWithTargetId
:
true
,
isRoboot
:
true
,
})
}
}
})
})
}
}
onMounted
(
async
()
=>
{
messageStore
.
messages
.
splice
(
0
,
messageStore
.
messages
.
length
);
const
messageList
=
await
ChatMessageDB
.
getInstance
().
getMessage
(
getFromId
()
as
string
,
target
);
messageStore
.
messages
.
push
(...
messageList
);
ChatListCardDB
.
getInstance
().
readMsg
(
getFromId
()
as
string
,
target
)
})
watch
(
chatCardTimeStamp
,
async
()
=>
{
watch
(
chatCardTimeStamp
,
async
()
=>
{
const
messageList
=
await
ChatMessageDB
.
getInstance
().
getMessage
(
getFromId
()
as
string
,
target
);
const
messageList
=
await
ChatMessageDB
.
getInstance
().
getMessage
(
getFromId
()
as
string
,
target
);
...
@@ -199,14 +258,60 @@ export default defineComponent({
...
@@ -199,14 +258,60 @@ export default defineComponent({
})
})
const
title
=
ref
(
''
)
const
title
=
ref
(
''
)
const
isChatWithRoboot
=
computed
(()
=>
{
return
route
.
query
.
outlet
!==
undefined
})
const
initTitle
=
async
()
=>
{
console
.
log
(
isChatWithRoboot
.
value
,
"show isChatWithRoboot"
)
if
(
isChatWithRoboot
.
value
)
{
const
list
=
await
getDisplayNames
([{
outletId
:
Number
(
route
.
query
.
targetId
)
}])
title
.
value
=
list
[
0
]
as
string
;
}
else
{
const
list
=
await
getDisplayNames
([{
address
:
route
.
query
.
targetId
as
string
}])
title
.
value
=
list
[
0
]
as
string
;
}
}
const
initMessageList
=
async
()
=>
{
messageStore
.
messages
.
splice
(
0
,
messageStore
.
messages
.
length
);
const
messageList
=
await
ChatMessageDB
.
getInstance
().
getMessage
(
getFromId
()
as
string
,
route
.
query
.
targetId
as
string
);
messageStore
.
messages
.
push
(...
messageList
);
ChatListCardDB
.
getInstance
().
readMsg
(
getFromId
()
as
string
,
target
)
}
const
notifyUserAndStaffTheChatBegin
=
async
()
=>
{
await
sendChatMessage
({
type
:
ChatMessageTypes
.
Card
,
content
:
{
bank
:
CONST_START_CHAT
.
user
.
id
,
name
:
CONST_START_CHAT
.
staff
.
id
,
account
:
''
,
}
as
MessageContent
,
target
:
route
.
query
.
targetId
as
string
})
}
watch
(()
=>
route
.
query
.
targetId
,
async
()
=>
{
await
initMessageList
();
await
initTitle
();
if
(
!
isChatWithRoboot
.
value
&&
route
.
query
.
beginChat
!==
undefined
)
{
setTimeout
(()
=>
{
if
(
!
isChatWithRoboot
.
value
)
{
notifyUserAndStaffTheChatBegin
()
}
},
1000
)
}
})
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
const
list
=
await
getDisplayNamesFromAddress
([
target
])
initMessageList
();
title
.
value
=
list
[
0
];
initTitle
();
const
ret
=
await
getMsgFromAddress
([
target
])
serviceShowValue
.
value
=
'人工服务'
callPhone
.
value
=
ret
[
0
].
phone
;
})
})
const
showCall
=
ref
(
false
)
const
showCall
=
ref
(
false
)
const
callPhone
=
ref
(
''
)
const
callPhone
=
ref
(
''
)
...
@@ -215,6 +320,8 @@ export default defineComponent({
...
@@ -215,6 +320,8 @@ export default defineComponent({
})
})
return
{
return
{
connectionState
,
connectionState
,
selected
,
selected
,
...
@@ -233,6 +340,7 @@ export default defineComponent({
...
@@ -233,6 +340,7 @@ export default defineComponent({
handleClickCall
,
handleClickCall
,
showCall
,
showCall
,
callPhone
,
callPhone
,
isChatWithRoboot
,
isUser
isUser
};
};
},
},
...
...
src/views/Chat/ChatContentMessage.vue
View file @
23d14d85
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
computed
,
defineComponent
,
ref
}
from
"vue"
;
import
{
computed
,
defineComponent
,
ref
,
PropType
}
from
"vue"
;
import
default_avatar_url
from
"@/assets/user_avatar.png"
;
import
default_avatar_url
from
"@/assets/user_avatar.png"
;
import
{
messageStore
}
from
"@/store/messagesStore"
;
import
{
messageStore
}
from
"@/store/messagesStore"
;
import
ChatContentMessageTextVue
from
"./ChatContentMessageText.vue"
;
import
ChatContentMessageTextVue
from
"./ChatContentMessageText.vue"
;
...
@@ -121,7 +121,7 @@ export default defineComponent({
...
@@ -121,7 +121,7 @@ export default defineComponent({
content
:
{
type
:
Object
,
required
:
true
},
content
:
{
type
:
Object
,
required
:
true
},
type
:
{
type
:
Number
,
required
:
true
},
type
:
{
type
:
Number
,
required
:
true
},
time
:
String
,
time
:
String
,
state
:
String
,
state
:
String
as
PropType
<
string
|
null
|
undefined
>
,
uuid
:
{
type
:
String
,
required
:
true
},
uuid
:
{
type
:
String
,
required
:
true
},
hideDatetime
:
Boolean
,
hideDatetime
:
Boolean
,
uploadProgress
:
Object
,
uploadProgress
:
Object
,
...
...
src/views/Chat/ChatInput.vue
View file @
23d14d85
...
@@ -51,7 +51,7 @@ import { MessageContent } from "@/types/chat-message";
...
@@ -51,7 +51,7 @@ import { MessageContent } from "@/types/chat-message";
import
ChatInputTextVue
from
"./ChatInputText.vue"
;
import
ChatInputTextVue
from
"./ChatInputText.vue"
;
import
ChatInputAlbumVue
from
"./ChatInputAlbum.vue"
;
import
ChatInputAlbumVue
from
"./ChatInputAlbum.vue"
;
import
ChatInputCameraVue
from
"./ChatInputCamera.vue"
;
import
ChatInputCameraVue
from
"./ChatInputCamera.vue"
;
import
{
getFromId
,
target
}
from
"@/store/appCallerStore"
;
import
{
getFromId
}
from
"@/store/appCallerStore"
;
import
{
textInputStore
}
from
"@/store/textInputStore"
;
import
{
textInputStore
}
from
"@/store/textInputStore"
;
import
{
v4
as
uuidv4
}
from
'uuid'
import
{
v4
as
uuidv4
}
from
'uuid'
import
Icon
from
"@/components/common/Icon.vue"
;
import
Icon
from
"@/components/common/Icon.vue"
;
...
@@ -78,6 +78,8 @@ export default defineComponent({
...
@@ -78,6 +78,8 @@ export default defineComponent({
voice
,
voice
,
}
}
const
target
=
route
.
query
.
targetId
as
string
/** 输入框类型,文本 or 语音 */
/** 输入框类型,文本 or 语音 */
const
inputType
=
ref
(
InputType
.
text
);
const
inputType
=
ref
(
InputType
.
text
);
...
@@ -119,7 +121,10 @@ export default defineComponent({
...
@@ -119,7 +121,10 @@ export default defineComponent({
const
isStaff
=
getUserMsg
()?.
role
===
eRole
.
staff
;
const
isStaff
=
getUserMsg
()?.
role
===
eRole
.
staff
;
const
isUser
=
getUserMsg
()?.
role
===
eRole
.
user
;
const
isUser
=
getUserMsg
()?.
role
===
eRole
.
user
;
if
(
isUser
&&
props
.
serviceShowValue
===
"人工服务"
)
{
if
(
isUser
&&
route
.
query
.
outlet
!==
undefined
)
{
/* 当前角色是客户,
并且和网点机器人进行聊天
*/
messageStore
.
displayNewMessage
({
messageStore
.
displayNewMessage
({
content
:
{
content
:
{
content
:
inputText
.
value
content
:
inputText
.
value
...
@@ -145,6 +150,7 @@ export default defineComponent({
...
@@ -145,6 +150,7 @@ export default defineComponent({
},
},
masterId
:
getFromId
()
as
string
,
masterId
:
getFromId
()
as
string
,
isChattingWithTargetId
:
true
,
isChattingWithTargetId
:
true
,
isRoboot
:
true
,
})
})
textInputStore
.
clearTextMessage
();
textInputStore
.
clearTextMessage
();
}
else
{
}
else
{
...
...
src/views/LoanDetail/index.vue
View file @
23d14d85
...
@@ -16,6 +16,7 @@ import { iNearbyOutLet } from "@/service/AddressService/types"
...
@@ -16,6 +16,7 @@ import { iNearbyOutLet } from "@/service/AddressService/types"
import
AddressService
from
"@/service/AddressService"
import
AddressService
from
"@/service/AddressService"
import
router
from
"@/router"
;
import
router
from
"@/router"
;
import
UserService
from
"@/service/UserService"
;
import
UserService
from
"@/service/UserService"
;
import
{
goToChatWithOutletRoboot
}
from
"@/router/navigate"
;
function
isInViewPort
(
element
:
HTMLElement
,
barHeight
:
number
)
{
function
isInViewPort
(
element
:
HTMLElement
,
barHeight
:
number
)
{
const
viewWidth
=
window
.
innerWidth
||
document
.
documentElement
.
clientWidth
;
const
viewWidth
=
window
.
innerWidth
||
document
.
documentElement
.
clientWidth
;
...
@@ -125,17 +126,9 @@ export default defineComponent({
...
@@ -125,17 +126,9 @@ export default defineComponent({
number
:
1
,
number
:
1
,
})
})
if
(
ret
.
code
===
200
)
{
if
(
ret
.
code
===
200
)
{
const
ret2
=
await
UserService
.
getInstance
().
contact_custom_service
({
goToChatWithOutletRoboot
({
out
LetID
:
ret
.
data
[
0
].
outlet_id
as
number
out
letId
:
ret
.
data
[
0
].
outlet_id
})
})
if
(
ret2
.
code
==
200
)
{
router
.
push
({
name
:
'Chat'
,
query
:
{
target
:
ret2
.
data
.
addr
}
})
}
}
}
}
}
...
@@ -234,30 +227,30 @@ export default defineComponent({
...
@@ -234,30 +227,30 @@ export default defineComponent({
<
img
class
=
"label6"
src
=
{
leftBg
}
/
>
<
img
class
=
"label6"
src
=
{
leftBg
}
/
>
<
/div
>
<
/div
>
<
div
class
=
" bg-white mx-5 rounded-2xl overflow-hidden mt-5"
>
<
div
class
=
" bg-white mx-5 rounded-2xl overflow-hidden mt-5"
>
<
div
class
=
"flex justify-between text-sm text-gray-800 border-b border-product-detail-bg"
>
<
div
class
=
"flex justify-between text-sm text-gray-800 border-b border-product-detail-bg"
>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款机构
<
/span>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款机构
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
inst_name
.
value
}
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
inst_name
.
value
}
<
/span
>
<
/div
>
<
/div
>
<
div
class
=
"flex justify-between text-sm text-gray-800 border-b border-product-detail-bg"
>
<
div
class
=
"flex justify-between text-sm text-gray-800 border-b border-product-detail-bg"
>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
产品名称
<
/span
>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
产品名称
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
product_name
.
value
}
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
product_name
.
value
}
<
/span
>
<
/div
>
<
/div
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款利率
<
/span>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款利率
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
rate_lower
.
value
}
%~
{
rate_upper
.
value
}
%<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
rate_lower
.
value
}
%~
{
rate_upper
.
value
}
%<
/span
>
<
/div
>
<
/div
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款额度
<
/span>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款额度
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
min_amount
.
value
}
万
~
{
max_amount
.
value
}
万
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
min_amount
.
value
}
万
~
{
max_amount
.
value
}
万
<
/span
>
<
/div
>
<
/div
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款期限
<
/span>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
贷款期限
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
min_date
.
value
}
个月
~
{
max_date
.
value
}
个月
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
min_date
.
value
}
个月
~
{
max_date
.
value
}
个月
<
/span
>
<
/div
>
<
/div
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
div
class
=
"flex text-sm text-gray-800 border-b border-product-detail-bg justify-between"
>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
担保方式
<
/span>
<
span
class
=
" w-100 align-center bg-product-detail-bg py-4 inline-block text-center"
>
担保方式
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
filterGuaranteeType
(
guarantee_type
.
value
)}
<
/span
>
<
span
class
=
" w-235 py-4 pr-5 inline-block break-words text-right"
>
{
filterGuaranteeType
(
guarantee_type
.
value
)}
<
/span
>
<
/div>
<
/div
>
<
/div
>
<
/div
>
<
LoanDetailDescribe
class
=
" mt-5"
products
=
{
products
.
value
}
features
=
{
features
.
value
}
apply_to
=
{
apply_to
.
value
}
apply_cond
=
{
apply_cond
.
value
}
submit_cond
=
{
submit_cond
.
value
}
/
>
<
LoanDetailDescribe
class
=
" mt-5"
products
=
{
products
.
value
}
features
=
{
features
.
value
}
apply_to
=
{
apply_to
.
value
}
apply_cond
=
{
apply_cond
.
value
}
submit_cond
=
{
submit_cond
.
value
}
/
>
<
div
class
=
"title mx-5 mt-5"
>
营业网点
<
/div
>
<
div
class
=
"title mx-5 mt-5"
>
营业网点
<
/div
>
...
@@ -314,10 +307,10 @@ export default defineComponent({
...
@@ -314,10 +307,10 @@ export default defineComponent({
color: #ffffff;
color: #ffffff;
}
}
.w-100{
.w-100
{
width:100px;
width:
100px;
}
}
.w-235{
.w-235
{
width:235px;
width:
235px;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/views/News/NewsList/index.vue
View file @
23d14d85
<
template
>
<
template
>
<div
@
click=
"$router.push(
{path: 'NewsDetail', query: { uuid: info.uuid, type: 'news' }})" class=" border-b border-gray-200 py-5">
<div
@
click=
"$router.push(
{path: 'NewsDetail', query: { uuid: info.uuid, type: 'news' }})" class=" border-b border-gray-200 py-5">
<div
class=
" text-base text-gray-900 font-semibold"
>
{{
info
.
title
}}
</div>
<div
class=
" text-base text-gray-900 font-semibold
news-title
"
>
{{
info
.
title
}}
</div>
<div
class=
" text-xs text-gray-800 pt-3"
>
{{
info
.
desc
}}
</div>
<div
class=
" text-xs text-gray-800 pt-3
news-info
"
>
{{
info
.
desc
}}
</div>
<div
<div
v-if=
"showImg"
v-if=
"showImg"
class=
" h-32 bg-app-blue mt-2 bg-cover bg-center bg-no-repeat"
class=
" h-32 bg-app-blue mt-2 bg-cover bg-center bg-no-repeat"
...
@@ -36,5 +36,16 @@ export default defineComponent({
...
@@ -36,5 +36,16 @@ export default defineComponent({
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.news-title
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
}
.news-info
{
display
:
-webkit-box
;
overflow
:
hidden
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
word-break
:
break-all
;
}
</
style
>
</
style
>
\ No newline at end of file
src/views/withMenu/ChatList/index.vue
View file @
23d14d85
<
template
>
<
template
>
<Navbar
<Navbar
:title=
"navBarTitle"
:showBackIcon=
"false"
/>
:title=
"navBarTitle"
:showBackIcon=
"false"
/>
<div
class=
"mx-5"
>
<div
class=
"mx-5"
>
<div
<div
v-for=
"(item, index) in cardList"
v-for=
"(item, index) in cardList"
...
@@ -26,10 +23,10 @@
...
@@ -26,10 +23,10 @@
</div>
</div>
</div>
</div>
<div
<div
v-if=
"isChatListEmpty"
v-if=
"
!cardListLoading &&
isChatListEmpty"
class=
"empty text-center fixed w-full top-1/2 transform -translate-y-1/2 -mt-6"
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"
/>
<img
src=
"@/assets/img/empty.png"
class=
"mb-5"
/>
<div
class=
"no-chat mb-2.5"
>
暂无聊天
</div>
<div
class=
"no-chat mb-2.5"
>
暂无聊天
</div>
<div
v-if=
"userType === eRole.user"
class=
"tip"
>
咨询客户经理后,可以在这里快捷查看消息哦!
</div>
<div
v-if=
"userType === eRole.user"
class=
"tip"
>
咨询客户经理后,可以在这里快捷查看消息哦!
</div>
<div
v-else-if=
"userType === eRole.staff"
class=
"tip"
>
客户咨询后,可以在这里快捷查看消息哦!
</div>
<div
v-else-if=
"userType === eRole.staff"
class=
"tip"
>
客户咨询后,可以在这里快捷查看消息哦!
</div>
...
@@ -47,25 +44,44 @@ import { getUserMsg } from "@/utils/userMsg";
...
@@ -47,25 +44,44 @@ import { getUserMsg } from "@/utils/userMsg";
import
{
eRole
}
from
"@/types/roleType"
;
import
{
eRole
}
from
"@/types/roleType"
;
import
ChatMessageDB
from
"@/db/ChatMessageDB"
;
import
ChatMessageDB
from
"@/db/ChatMessageDB"
;
import
router
from
"@/router"
;
import
router
from
"@/router"
;
import
UserService
from
"@/service/UserService"
;
import
{
getDisplayNames
,
getDisplayNamesFromAddress
,
getDisplayNamesFromOutletId
}
from
"@/utils/displayName"
;
import
{
getDisplayNamesFromAddress
}
from
"@/utils/displayName"
;
const
cardList
=
ref
<
(
iChatListCard
&
{
displayName
?:
string
})[]
>
([]);
const
cardList
=
ref
<
(
iChatListCard
&
{
displayName
?:
string
})[]
>
([]);
const
showList
=
ref
<
boolean
[]
>
([]);
const
showList
=
ref
<
boolean
[]
>
([]);
const
selectedIndex
=
ref
<
number
>
()
const
selectedIndex
=
ref
<
number
>
()
const
cardListLoading
=
ref
(
false
);
const
renderList
=
async
()
=>
{
const
renderList
=
async
()
=>
{
cardListLoading
.
value
=
true
;
const
list
=
await
ChatListCardDB
.
getInstance
().
getCardList
(
getFromId
()
as
string
)
const
list
=
await
ChatListCardDB
.
getInstance
().
getCardList
(
getFromId
()
as
string
)
const
addressList
=
list
.
map
(
i
=>
i
.
targetId
);
const
addressList
=
list
.
map
(
i
=>
i
.
targetId
);
cardList
.
value
=
list
;
cardList
.
value
=
list
;
const
displayNames
=
await
getDisplayNamesFromAddress
(
addressList
)
const
reqlist
=
list
.
map
(
i
=>
{
if
(
i
.
isRobootCard
)
{
return
{
outletId
:
Number
(
i
.
targetId
),
}
}
else
{
return
{
address
:
i
.
targetId
,
}
}
})
const
displayNames
=
await
getDisplayNames
(
reqlist
)
// const displayNames = await getDisplayNamesFromAddress(addressList)
// await getDisplayNamesFromOutletId(list)
cardList
.
value
=
list
.
map
((
item
,
index
)
=>
{
cardList
.
value
=
list
.
map
((
item
,
index
)
=>
{
return
{
return
{
...
item
,
...
item
,
displayName
:
displayNames
[
index
]
displayName
:
displayNames
[
index
]
}
}
})
})
cardListLoading
.
value
=
false
;
}
}
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
...
@@ -120,6 +136,7 @@ function handleClickItem(index: number, item: iChatListCard) {
...
@@ -120,6 +136,7 @@ function handleClickItem(index: number, item: iChatListCard) {
name
:
'Chat'
,
name
:
'Chat'
,
query
:
{
query
:
{
targetId
:
item
.
targetId
,
targetId
:
item
.
targetId
,
outlet
:
item
.
isRobootCard
?
'true'
:
undefined
}
}
})
})
}
}
...
...
src/views/withMenu/Home/appList.ts
View file @
23d14d85
import
Bridge
from
"@/utils/jsBridge2"
import
Bridge
from
"@/utils/jsBridge2"
export
default
[
export
default
[
{
{
name
:
'贷款服务'
,
name
:
'贷款服务'
,
...
@@ -41,7 +42,10 @@ export default [
...
@@ -41,7 +42,10 @@ export default [
icon
:
'icon-jingcaizhibo'
,
icon
:
'icon-jingcaizhibo'
,
color
:
'#0FCBA5'
,
color
:
'#0FCBA5'
,
cb
(){
cb
(){
new
Bridge
().
bridge_live
()
new
Bridge
().
bridge_live
({
phone
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'USER_MSG'
)
as
string
)?.
userInfo
.
phone
,
avatar
:
window
.
location
.
host
+
require
(
'../../../assets/icons/avatar.png'
)
})
},
},
},
},
{
{
...
...
src/views/withMenu/Mine/branch.vue
View file @
23d14d85
<
template
>
<
template
>
<div
class=
"pb-5"
>
<div
class=
"pb-5
min-h-screen overflow-scroll mb-8
"
>
<nav-bar
<nav-bar
title=
"网点服务"
title=
"网点服务"
:style=
"
{ 'background-color': '#2C3C92 !important', 'color': 'white' }"
:style=
"
{ 'background-color': '#2C3C92 !important', 'color': 'white' }"
...
@@ -23,29 +23,30 @@
...
@@ -23,29 +23,30 @@
class=
"mt-3 shadow-sm"
class=
"mt-3 shadow-sm"
/>
/>
</Skeleton>
</Skeleton>
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"mt-5"
>
<div
class=
"overflow-scroll -mt-8 pb-5"
>
<p
class=
"mt-12 mb-3 text-base font-semibold text-gray-800"
>
附近的网点
</p>
<branch
v-for=
"(item, index) in result.lists"
:key=
"index"
:name=
"item.name"
:distance=
"item.distance"
:is_normal_work=
"item.is_normal_work"
:latitude=
"item.latitude"
:location=
"item.location"
:longitude=
"item.longitude"
:opening_hours=
"item.opening_hours"
:weekend_status=
"item.weekend_status"
:outlet_id=
"item.outlet_id"
class=
"mt-3 shadow-sm"
/>
<!--
<branch
:isOpen=
"false"
class=
"mt-3 shadow-sm"
/>
-->
</div>
</Skeleton>
</div>
</div>
<!-- 附近网点 -->
<!-- 附近网点 -->
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"-mt-20 mb-10"
></Skeleton>
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"-mt-20 mb-10"
></Skeleton>
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"mt-5"
>
<div
class=
"px-4 overflow-scroll -mt-8"
>
<p
class=
"mt-12 mb-3 text-base font-semibold text-gray-800"
>
附近的网点
</p>
<branch
v-for=
"(item, index) in result.lists"
:key=
"index"
:name=
"item.name"
:distance=
"item.distance"
:is_normal_work=
"item.is_normal_work"
:latitude=
"item.latitude"
:location=
"item.location"
:longitude=
"item.longitude"
:opening_hours=
"item.opening_hours"
:weekend_status=
"item.weekend_status"
:outlet_id=
"item.outlet_id"
class=
"mt-3 shadow-sm"
/>
<!--
<branch
:isOpen=
"false"
class=
"mt-3 shadow-sm"
/>
-->
</div>
</Skeleton>
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"mt-10"
></Skeleton>
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"mt-10"
></Skeleton>
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"mt-10"
></Skeleton>
<Skeleton
:row=
"3"
:loading=
"result.loading"
class=
"mt-10"
></Skeleton>
</div>
</div>
...
...
src/views/withMenu/Mine/setting.vue
View file @
23d14d85
...
@@ -15,12 +15,11 @@
...
@@ -15,12 +15,11 @@
<div
class=
"px-5 py-2 items-center border-b border-gray-200"
>
<div
class=
"px-5 py-2 items-center border-b border-gray-200"
>
<div
class=
"flex justify-between items-center"
>
<div
class=
"flex justify-between items-center"
>
<div>
<div>
<div
class=
" text-sm font-semibold"
>
登陆
密码
</div>
<div
class=
" text-sm font-semibold"
>
设置
密码
</div>
<div
class=
" text-xs text-gray-400 pt-1"
>
保障账户登录安全
</div>
<div
class=
" text-xs text-gray-400 pt-1"
>
保障账户登录安全
</div>
</div>
</div>
<div
class=
"flex items-center text-xs h-1 text-right"
>
<div
class=
"flex items-center text-xs h-1 text-right"
>
<span
v-if=
"hasPassword == 3"
@
click=
"pushRouter"
>
设置
</span>
<span
@
click=
"pushRouter"
>
设置
</span>
<span
v-else-if=
"hasPassword == 2"
@
click=
"pushRouter"
>
修改
</span>
<icon
<icon
name=
"icon-gengduo"
name=
"icon-gengduo"
color=
"#8E92A3"
color=
"#8E92A3"
...
@@ -43,14 +42,16 @@ import { deleteUserMsg, getUserMsg } from '@/utils/userMsg'
...
@@ -43,14 +42,16 @@ import { deleteUserMsg, getUserMsg } from '@/utils/userMsg'
import
filter
from
"@/filter"
import
filter
from
"@/filter"
import
router
from
'@/router'
import
router
from
'@/router'
import
{
userLogout
}
from
'@/service/UserManagementService'
import
{
userLogout
}
from
'@/service/UserManagementService'
import
{
userChangePwd
,
userLogin
}
from
'@/service/UserManagementService'
import
{
eSmsType
,
sendVerifyCode
}
from
'@/service/VerificationService'
import
set
from
'@/views/Auth/PwdSetting/index.vue'
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
NavBar
,
Icon
,
set
},
components
:
{
NavBar
,
Icon
},
data
(){
return
{
role
:
''
}
},
computed
:
{
computed
:
{
hasPassword
():
eAccountType
{
hasPassword
():
eAccountType
{
return
eAccountType
.
REG_
PDSET
return
eAccountType
.
REG_
NOPD
},
},
getPhone
(){
getPhone
(){
const
phone
=
getUserMsg
()?.
userInfo
.
phone
+
''
const
phone
=
getUserMsg
()?.
userInfo
.
phone
+
''
...
@@ -74,16 +75,9 @@ export default defineComponent({
...
@@ -74,16 +75,9 @@ export default defineComponent({
},
},
methods
:{
methods
:{
pushRouter
(){
pushRouter
(){
console
.
log
(
'123'
);
if
(
this
.
hasPassword
==
3
){
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'PwdSetting'
name
:
'PwdSetting'
})
})
}
else
if
(
this
.
hasPassword
==
2
){
this
.
$router
.
push
({
name
:
'PwdModify'
})
}
},
},
}
}
})
})
...
...
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