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
154f1e5e
Commit
154f1e5e
authored
Nov 03, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复头像问题
parent
55c700e5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
89 additions
and
28 deletions
+89
-28
staff.png
src/assets/icons/staff.png
+0
-0
ChatListItem.vue
src/components/ChatList/ChatListItem.vue
+17
-1
userMsg.ts
src/utils/userMsg.ts
+14
-1
ChatContentMessage.vue
src/views/Chat/ChatContentMessage.vue
+23
-2
index.vue
src/views/withMenu/ChatList/index.vue
+1
-0
index.vue
src/views/withMenu/Loan/index.vue
+1
-1
index.vue
src/views/withMenu/Mine/index.vue
+28
-20
setting.vue
src/views/withMenu/Mine/setting.vue
+5
-3
No files found.
src/assets/icons/staff.png
0 → 100644
View file @
154f1e5e
7.03 KB
src/components/ChatList/ChatListItem.vue
View file @
154f1e5e
<
template
>
<div
class=
"flex chatlistitem relative -mr-1"
>
<div
class=
"self-center mr-4 flex-shrink-0"
>
<img
class=
"w-10 h-10 rounded-md object-cover"
src=
"@/assets/icons/avatar.png"
alt=
"avatar"
/>
<img
v-if=
"userType === eRole.staff"
class=
"w-10 h-10 rounded-md object-cover"
src=
"@/assets/icons/avatar.png"
alt=
"avatar"
/>
<img
v-else
class=
"w-10 h-10 rounded-md object-contain"
src=
"@/assets/icons/staff.png"
alt=
"avatar"
/>
</div>
<div
class=
"flex-grow right-box overflow-hidden pr-1"
>
<div
class=
"flex justify-between mt-5"
>
...
...
@@ -25,7 +36,9 @@
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
eRole
}
from
"@/types/roleType"
;
import
{
timestampFormat2
}
from
"@/utils/time"
;
import
{
PropType
}
from
"@vue/runtime-core"
;
const
props
=
defineProps
({
avatar_url
:
{
type
:
String
,
default
:
'--'
},
...
...
@@ -38,6 +51,9 @@ const props = defineProps({
displayName
:
String
,
datetime
:
{
type
:
Number
,
},
userType
:
{
type
:
Number
as
PropType
<
eRole
>
}
})
...
...
src/utils/userMsg.ts
View file @
154f1e5e
import
{
dispatchLoginAction
}
from
'@/store/chatStore'
import
{
iUserMsg
}
from
'@/types/userMsg'
import
Bridge
from
'@/utils/jsBridge2'
;
import
Bridge
from
'@/utils/jsBridge2'
import
userAvatarUrl
from
'@/assets/icons/avatar.png'
import
staffAvatarUrl
from
'@/assets/icons/staff.png'
import
{
eRole
}
from
'@/types/roleType'
const
USER_MSG
=
'USER_MSG'
...
...
@@ -23,3 +26,13 @@ export function deleteUserMsg() {
dispatchLoginAction
(
'logout'
)
localStorage
.
removeItem
(
USER_MSG
)
}
export
function
getCurrentUserAvatarUrl
()
{
if
(
getUserMsg
()?.
role
===
eRole
.
staff
)
{
return
staffAvatarUrl
}
else
if
(
getUserMsg
()?.
role
===
eRole
.
user
)
{
return
userAvatarUrl
}
else
{
return
userAvatarUrl
;
}
}
src/views/Chat/ChatContentMessage.vue
View file @
154f1e5e
...
...
@@ -9,10 +9,21 @@
>
<!-- 头像 -->
<q-avatar
class=
"mx-4 min-w-chat-msg-avatar
w-chat-msg-avatar h-chat-msg-avatar !rounded-md
"
class=
"mx-4 min-w-chat-msg-avatar
!rounded-md !w-10 !h-10
"
v-if=
"type !== 6"
>
<img
:src=
"default_avatar_url"
/>
<img
v-if=
"fromMyself && userType === eRole.user"
:src=
"userAvatarUrl"
/>
<img
v-if=
"fromMyself && userType === eRole.staff"
:src=
"staffAvatarUrl"
class=
"object-contain"
/>
<img
v-else-if=
"!fromMyself && userType === eRole.user"
:src=
"staffAvatarUrl"
class=
"object-contain"
/>
<img
v-else-if=
"!fromMyself && userType === eRole.staff"
:src=
"userAvatarUrl"
/>
</q-avatar>
<!-- 消息气泡 -->
...
...
@@ -95,6 +106,8 @@ import default_avatar_url from "@/assets/user_avatar.png";
import
{
messageStore
}
from
"@/store/messagesStore"
;
import
ChatContentMessageTextVue
from
"./ChatContentMessageText.vue"
;
import
ChatContentMessageCardVue
from
"./ChatContentMessageCard.vue"
;
import
userAvatarUrl
from
"@/assets/icons/avatar.png"
import
staffAvatarUrl
from
"@/assets/icons/staff.png"
;
// import ChatContentMessageImageVue from "./ChatContentMessageImage.vue";
import
{
ChatMessageTypes
}
from
"@/types/chatMessageTypes"
;
// import ChatContentMessageVideoVue from "./ChatContentMessageVideo.vue";
...
...
@@ -104,6 +117,8 @@ import { Toast } from "vant";
import
ChatMessageDB
from
"@/db/ChatMessageDB"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
clipboardValue
}
from
"@/store/AppStore"
;
import
{
getUserMsg
}
from
"@/utils/userMsg"
;
import
{
eRole
}
from
"@/types/roleType"
;
export
default
defineComponent
({
...
...
@@ -134,6 +149,8 @@ export default defineComponent({
messageStore
.
sendMessage
({
type
:
props
.
type
,
content
:
props
.
content
,
uuid
:
props
.
uuid
,
target
:
route
.
query
.
targetId
as
string
});
};
const
userType
=
getUserMsg
()?.
role
const
abort
=
()
=>
{
messageStore
.
abortSendingMessage
(
props
.
uuid
,
...
...
@@ -187,6 +204,10 @@ export default defineComponent({
textMsgActions
,
showPopOver
,
clickItem
,
eRole
,
userType
,
userAvatarUrl
,
staffAvatarUrl
,
};
},
});
...
...
src/views/withMenu/ChatList/index.vue
View file @
154f1e5e
...
...
@@ -15,6 +15,7 @@
:id=
"item.targetId"
:displayName=
"item.displayName"
:latest_msg_content=
"item.content"
:userType=
"userType"
:datetime=
"item.datetime"
></ChatListItem>
</
template
>
...
...
src/views/withMenu/Loan/index.vue
View file @
154f1e5e
...
...
@@ -104,7 +104,7 @@
/>
<Skeleton
:loading=
"skeLoading"
:row=
"3"
class=
"mt-2"
>
<img
class=
"mx-5 w-83 h-22 mt-5 rounded-lg"
class=
"mx-5 w-83 h-22 mt-5 rounded-lg
mx-auto
"
:src=
"src"
v-if=
"src"
@
click=
"
...
...
src/views/withMenu/Mine/index.vue
View file @
154f1e5e
<
template
>
<div
class=
"
min-h-screen"
style=
"background:#F8F8FA"
>
<div
class=
"min-h-screen"
style=
"background:#F8F8FA"
>
<!-- top -->
<div
class=
"top bg-center bg-no-repeat bg-cover"
>
<div
class=
"w-full text-center text-white text-base pt-14"
>
我的
</div>
<div
class=
"flex w-full pb-7 justify-between"
>
<div
class=
"mt-8 ml-5"
>
<img
src=
"../../../assets/icons/avatar.png"
class=
"w-12 h-12 inline-block
"
/>
<img
:src=
"avatarUrl"
class=
"w-12 h-12 inline-block object-contain
"
/>
<div
class=
"text-white ml-3 inline-block"
>
<span
v-if=
"isLogin"
>
{{
filter
.
filterPhone
(
userMsg
?.
userInfo
.
phone
)
}}
</span>
<span
v-else
>
未登录
</span>
...
...
@@ -37,11 +37,16 @@
/>
</div>
<!-- 我的网点 -->
<GroupTitle
title=
"我的网点"
@
seeMore=
"$router.push('branch')"
class=
"mt-5"
:iconName=
"(isUser || !isLogin)?'icon-gengduo':''"
/>
<GroupTitle
title=
"我的网点"
@
seeMore=
"$router.push('branch')"
class=
"mt-5"
:iconName=
"(isUser || !isLogin) ? 'icon-gengduo' : ''"
/>
<Skeleton
:loading=
"state.loading"
:row=
"4"
class=
"mt-2"
>
<branch
class=
"mt-3 mx-5"
v-if=
"state.branchinfo
||
!isUser"
v-if=
"state.branchinfo
||
!isUser"
:name=
"state.branchinfo.name"
:distance=
"state.branchinfo.distance"
:is_normal_work=
"state.branchinfo.is_normal_work"
...
...
@@ -62,7 +67,7 @@ import Icon from "@/components/common/Icon.vue"
import
Service
from
'@/components/Mine/Service/index.vue'
import
Branch
from
'@/components/Mine/Branch/branch.vue'
import
GroupTitle
from
"@/components/GroupTitle/index.vue"
import
{
getUserMsg
}
from
"@/utils/userMsg"
import
{
get
CurrentUserAvatarUrl
,
get
UserMsg
}
from
"@/utils/userMsg"
import
filter
from
"@/filter"
import
AddressService
from
"@/service/AddressService"
import
{
iNearbyOutLet
}
from
"@/service/AddressService/types"
...
...
@@ -85,16 +90,18 @@ export default defineComponent({
},
},
setup
(
props
,
context
)
{
const
avatarUrl
=
getCurrentUserAvatarUrl
()
const
state
=
reactive
({
branchinfo
:{}
as
iNearbyOutLet
,
branchinfo
:
{}
as
iNearbyOutLet
,
loading
:
false
,
})
const
userMsg
=
computed
(()
=>
{
const
userMsg
=
computed
(()
=>
{
return
getUserMsg
()
})
const
isUser
=
computed
(()
=>
{
console
.
log
(
'isuser'
,
userMsg
?.
value
?.
role
==
eRole
.
user
);
const
isUser
=
computed
(()
=>
{
console
.
log
(
'isuser'
,
userMsg
?.
value
?.
role
==
eRole
.
user
);
return
userMsg
?.
value
?.
role
==
eRole
.
user
})
let
branchinfo
=
reactive
({}
as
iNearbyOutLet
)
...
...
@@ -102,7 +109,7 @@ export default defineComponent({
onMounted
(
async
()
=>
{
state
.
loading
=
true
;
// const isUser = userMsg?.value?.role2 == eRole.user
if
(
isUser
)
{
if
(
isUser
)
{
const
ret
=
await
AddressService
.
getInstance
().
getNearby
({
bank_code
:
Number
(
process
.
env
.
VUE_APP_BANK_CODE
),
number
:
1
,
...
...
@@ -110,28 +117,29 @@ export default defineComponent({
if
(
ret
.
code
===
200
)
{
state
.
branchinfo
=
ret
.
data
[
0
];
}
}
else
{
}
else
{
const
ret
=
await
AddressService
.
getInstance
().
getStaffOutlet
()
if
(
ret
.
code
==
200
)
{
if
(
ret
.
code
==
200
)
{
const
ssid
=
ret
.
data
.
ss_id
AddressService
.
getInstance
().
getOutlets
({
id
:
ssid
,
level
:
4
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
state
.
branchinfo
=
res
.
data
id
:
ssid
,
level
:
4
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
state
.
branchinfo
=
res
.
data
}
})
}
}
console
.
log
(
'info'
,
branchinfo
);
console
.
log
(
'info'
,
branchinfo
);
state
.
loading
=
false
;
})
return
{
filter
,
state
,
isUser
,
userMsg
userMsg
,
avatarUrl
}
},
computed
:
{
...
...
src/views/withMenu/Mine/setting.vue
View file @
154f1e5e
...
...
@@ -4,7 +4,7 @@
<!-- 头像 -->
<div
class=
"px-5 py-3 flex justify-between items-center border-b border-gray-200"
>
<span
class=
"text-sm font-semibold"
>
头像
</span>
<img
src=
"../../../assets/icons/avatar.png"
class=
"w-12 h-12 rounded-full
"
/>
<img
:src=
"avatarUrl"
class=
"w-12 h-12 rounded-full object-contain
"
/>
</div>
<!-- 手机号码 -->
<div
class=
"px-5 py-5 flex justify-between items-center border-b border-gray-200"
>
...
...
@@ -38,7 +38,7 @@ import { defineComponent } from 'vue'
import
NavBar
from
"@/components/NavBar/index.vue"
import
Icon
from
"@/components/common/Icon.vue"
import
{
eAccountType
}
from
"@/views/Auth/Login/types"
import
{
deleteUserMsg
,
getUserMsg
}
from
'@/utils/userMsg'
import
{
deleteUserMsg
,
get
CurrentUserAvatarUrl
,
get
UserMsg
}
from
'@/utils/userMsg'
import
filter
from
"@/filter"
import
router
from
'@/router'
import
{
userLogout
}
from
'@/service/UserManagementService'
...
...
@@ -60,6 +60,7 @@ export default defineComponent({
}
},
setup
()
{
const
avatarUrl
=
getCurrentUserAvatarUrl
()
const
clickLogout
=
()
=>
{
userLogout
();
deleteUserMsg
();
...
...
@@ -70,7 +71,8 @@ export default defineComponent({
return
{
userMsg
:
getUserMsg
(),
filter
,
clickLogout
clickLogout
,
avatarUrl
}
},
methods
:
{
...
...
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