Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 707d3dc0
authored
Aug 15, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改样式
1 parent
0cf1dfcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
src/utils/draw.js
src/views/crowdfunding/components/createOrderImg.vue
src/utils/draw.js
View file @
707d3dc
...
@@ -78,6 +78,7 @@ class Draw {
...
@@ -78,6 +78,7 @@ class Draw {
textWidth
,
textWidth
,
maxWidth
,
maxWidth
,
fontSize
,
fontSize
,
lastFont
,
opacity
,
opacity
,
lineNum
,
lineNum
,
width
,
width
,
...
@@ -134,16 +135,19 @@ class Draw {
...
@@ -134,16 +135,19 @@ class Draw {
this
[
_ctx_
].
textAlign
=
textAlign
this
[
_ctx_
].
textAlign
=
textAlign
this
[
_ctx_
].
lineWidth
=
this
.
toRpx
(
2
)
this
[
_ctx_
].
lineWidth
=
this
.
toRpx
(
2
)
const
drawOneLineText
=
()
=>
{
const
drawOneLineText
=
()
=>
{
let
textArr
=
text
.
split
(
''
)
let
textArr
=
text
.
split
(
''
),
let
newText
=
''
newText
=
''
,
ellipsis
=
false
try
{
try
{
textArr
.
map
(
e
=>
{
textArr
.
map
(
e
=>
{
newText
+=
e
newText
+=
e
if
(
this
.
getTextWidth
(
newText
)
>
width
-
fontX
)
throw
newText
if
(
this
.
getTextWidth
(
newText
)
>
width
-
fontX
)
throw
true
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
newText
=
`
${
error
}
…`
ellipsis
=
error
}
}
if
(
ellipsis
)
newText
+=
'…'
if
(
lastFont
)
newText
+=
lastFont
this
[
_ctx_
].
fillText
(
newText
,
x
,
y
,
maxWidth
)
this
[
_ctx_
].
fillText
(
newText
,
x
,
y
,
maxWidth
)
if
(
checkTextDecoration
(
textDecoration
))
{
if
(
checkTextDecoration
(
textDecoration
))
{
this
.
drawDecoration
({
this
.
drawDecoration
({
...
@@ -182,11 +186,11 @@ class Draw {
...
@@ -182,11 +186,11 @@ class Draw {
if
(
this
.
getTextWidth
(
lastText
)
>
width
-
fontX
-
this
.
getTextWidth
(
'…'
))
throw
lastText
if
(
this
.
getTextWidth
(
lastText
)
>
width
-
fontX
-
this
.
getTextWidth
(
'…'
))
throw
lastText
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
let
{
lastFont
}
=
textParams
if
(
lastFont
)
e
=
`
${
error
.
substring
(
0
,
error
.
length
-
lastFont
.
length
)}
…
${
lastFont
}
`
if
(
lastFont
)
e
=
`
${
error
.
substring
(
0
,
error
.
length
-
lastFont
.
length
)}
…
${
lastFont
}
`
else
e
=
`
${
error
}
…`
else
e
=
`
${
error
}
…`
}
}
}
}
if
(
lastFont
&&
e
.
indexOf
(
lastFont
)
==
-
1
&&
textRowArr
.
length
<
2
)
e
=
`
${
e
.
substring
(
0
,
e
.
length
-
lastFont
.
length
)}
…
${
lastFont
}
`
let
textHeight
=
y
+
index
*
(
lineHeight
||
fontSize
)
let
textHeight
=
y
+
index
*
(
lineHeight
||
fontSize
)
this
[
_ctx_
].
fillText
(
e
,
x
,
textHeight
,
maxWidth
)
this
[
_ctx_
].
fillText
(
e
,
x
,
textHeight
,
maxWidth
)
if
(
checkTextDecoration
(
textDecoration
))
{
if
(
checkTextDecoration
(
textDecoration
))
{
...
...
src/views/crowdfunding/components/createOrderImg.vue
View file @
707d3dc
...
@@ -85,12 +85,10 @@ export default {
...
@@ -85,12 +85,10 @@ export default {
labelList
=
[...
labelList
,
'商品名称:'
,
'支付时间:'
]
labelList
=
[...
labelList
,
'商品名称:'
,
'支付时间:'
]
valueList
=
[...
valueList
,
goodsName
,
new
Date
(
createdDate
).
format
(
'yyyy年M月d日 hh:mm:ss'
)]
valueList
=
[...
valueList
,
goodsName
,
new
Date
(
createdDate
).
format
(
'yyyy年M月d日 hh:mm:ss'
)]
if
(
formContentFirst
)
{
if
(
formContentFirst
)
{
if
(
formDescribeFirst
.
length
<
5
)
formDescribeFirst
+=
':'
labelList
.
push
(
formDescribeFirst
)
labelList
.
push
(
formDescribeFirst
)
valueList
.
push
(
formContentFirst
)
valueList
.
push
(
formContentFirst
)
}
}
if
(
formContentSecond
)
{
if
(
formContentSecond
)
{
if
(
formDescribeSecond
.
length
<
5
)
formDescribeSecond
+=
':'
labelList
.
push
(
formDescribeSecond
)
labelList
.
push
(
formDescribeSecond
)
valueList
.
push
(
formContentSecond
)
valueList
.
push
(
formContentSecond
)
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment