Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1cf286b0
authored
May 08, 2024
by
JJBoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修复】商城管理首页统计数据显示问题
(cherry picked from commit 78dd2fa38a2d040c1c97d70cababc4f9265ac705)
parent
6c179809
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/utils/index.ts
+1
-1
src/views/mall/home/components/TradeTrendCard.vue
+1
-1
No files found.
src/utils/index.ts
View file @
1cf286b0
...
@@ -313,7 +313,7 @@ export const fenToYuan = (price: string | number): string => {
...
@@ -313,7 +313,7 @@ export const fenToYuan = (price: string | number): string => {
*/
*/
export
const
calculateRelativeRate
=
(
value
?:
number
,
reference
?:
number
)
=>
{
export
const
calculateRelativeRate
=
(
value
?:
number
,
reference
?:
number
)
=>
{
// 防止除0
// 防止除0
if
(
!
reference
)
return
0
if
(
!
reference
||
reference
==
0
)
return
0
return
((
100
*
((
value
||
0
)
-
reference
))
/
reference
).
toFixed
(
0
)
return
((
100
*
((
value
||
0
)
-
reference
))
/
reference
).
toFixed
(
0
)
}
}
...
...
src/views/mall/home/components/TradeTrendCard.vue
View file @
1cf286b0
...
@@ -186,7 +186,7 @@ const getOrderCountTrendComparison = async (
...
@@ -186,7 +186,7 @@ const getOrderCountTrendComparison = async (
dates
.
push
(
item
.
value
.
date
)
dates
.
push
(
item
.
value
.
date
)
if
(
series
.
length
===
2
)
{
if
(
series
.
length
===
2
)
{
series
[
0
].
data
.
push
(
fenToYuan
(
item
?.
value
?.
orderPayPrice
||
0
))
// 当前金额
series
[
0
].
data
.
push
(
fenToYuan
(
item
?.
value
?.
orderPayPrice
||
0
))
// 当前金额
series
[
1
].
data
.
push
(
fenToYuan
(
item
?.
value
?.
orderPayCount
||
0
)
)
// 当前数量
series
[
1
].
data
.
push
(
item
?.
value
?.
orderPayCount
||
0
)
// 当前数量
}
else
{
}
else
{
series
[
0
].
data
.
push
(
fenToYuan
(
item
?.
reference
?.
orderPayPrice
||
0
))
// 对照金额
series
[
0
].
data
.
push
(
fenToYuan
(
item
?.
reference
?.
orderPayPrice
||
0
))
// 对照金额
series
[
1
].
data
.
push
(
fenToYuan
(
item
?.
value
?.
orderPayPrice
||
0
))
// 当前金额
series
[
1
].
data
.
push
(
fenToYuan
(
item
?.
value
?.
orderPayPrice
||
0
))
// 当前金额
...
...
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