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
1f7c7ff4
authored
Jan 06, 2022
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
职位消息薪资显示
parent
b8911ba3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
4 deletions
components/message-item/position-message.vue
xim/models/chat.ts
components/message-item/position-message.vue
View file @
1f7c7ff4
<
template
>
<div
class=
"position-message"
@
click=
"openPosition"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<span
class=
"d-flex align-items-center"
>
<span
class=
"title"
>
{{
title
}}
</span>
<span
class=
"d-flex align-items-center
flex-fill
"
>
<span
class=
"title
flex-fill
"
>
{{
title
}}
</span>
<span
v-for=
"item in tags"
:key=
"item.title"
...
...
@@ -46,7 +46,43 @@
}
private
get
salary
()
{
return
this
.
positionData
.
salary
;
const
max
=
this
.
positionData
.
max_salary
;
const
min
=
this
.
positionData
.
min_salary
;
const
formatSalary
=
(
v
:
number
,
type
?:
"Y"
|
"K"
)
=>
{
if
(
type
===
"K"
)
{
return
{
v
:
parseFloat
((
v
/
1000
).
toFixed
(
2
)),
unit
:
"K"
,
};
}
if
(
+
v
<
1000
)
{
return
{
v
,
unit
:
""
,
};
}
else
{
return
{
v
:
parseFloat
((
v
/
1000
).
toFixed
(
2
)),
unit
:
"K"
,
};
}
};
if
(
!
max
&&
!
min
)
{
return
"面议"
;
}
if
(
+
min
>=
+
max
)
{
const
v
=
formatSalary
(
min
);
return
`
${
v
.
v
}${
v
.
unit
}
`
;
}
const
formatMin
=
formatSalary
(
min
);
const
formatMax
=
formatSalary
(
max
);
if
(
formatMin
.
unit
===
formatMax
.
unit
)
{
return
`
${
formatMin
.
v
}
-
${
formatMax
.
v
}
${
formatMax
.
unit
}
`
;
}
else
{
const
formatMin
=
formatSalary
(
min
,
"K"
);
const
formatMax
=
formatSalary
(
max
,
"K"
);
return
`
${
formatMin
.
v
}
-
${
formatMax
.
v
}
K`
;
}
}
private
get
positionBody
()
{
...
...
@@ -64,7 +100,9 @@
private
get
tail
()
{
return
[
this
.
positionData
.
company_name
,
this
.
positionData
.
business_scope
,
this
.
positionData
.
business_scope
!==
'0'
?
this
.
positionData
.
business_scope
:
""
,
];
}
...
...
xim/models/chat.ts
View file @
1f7c7ff4
...
...
@@ -230,6 +230,8 @@ export interface PositionMessage {
company_name
:
string
;
business_scope
:
string
;
post_id
:
number
;
max_salary
:
number
;
min_salary
:
number
;
}
export
interface
CsUser
{
...
...
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