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 f46871a8
authored
Aug 15, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
707d3dc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
src/views/crowdfunding/components/createOrderImg.vue
src/views/crowdfunding/components/createOrderImg.vue
View file @
f46871a
...
@@ -54,8 +54,8 @@ export default {
...
@@ -54,8 +54,8 @@ export default {
this
.
ctx
=
document
.
getElementById
(
this
.
canvasId
)
this
.
ctx
=
document
.
getElementById
(
this
.
canvasId
)
let
valueX
=
95
,
let
valueX
=
95
,
labelX
=
17
,
labelX
=
17
,
valueEndX
=
320
-
7
,
fontSize
=
14
,
fontSize
=
14
,
valueEndX
=
320
-
fontSize
/
2
,
textBaseline
=
'top'
,
textBaseline
=
'top'
,
canvasWidth
=
337
,
canvasWidth
=
337
,
canvasHeight
=
521
,
canvasHeight
=
521
,
...
@@ -63,7 +63,9 @@ export default {
...
@@ -63,7 +63,9 @@ export default {
labelList
=
[
'姓名:'
,
'手机:'
],
labelList
=
[
'姓名:'
,
'手机:'
],
spacing
=
0
,
spacing
=
0
,
textYList
=
[],
textYList
=
[],
labelEndX
=
80
labelEndX
=
80
,
lineNum
=
2
,
lineHeight
=
24
const
draw
=
new
Draw
(
this
,
{
const
draw
=
new
Draw
(
this
,
{
width
:
canvasWidth
,
width
:
canvasWidth
,
height
:
canvasHeight
,
height
:
canvasHeight
,
...
@@ -95,8 +97,8 @@ export default {
...
@@ -95,8 +97,8 @@ export default {
labelList
.
push
(
'支付定金'
)
labelList
.
push
(
'支付定金'
)
valueList
.
push
(
`
${
payPrice
}
元`
)
valueList
.
push
(
`
${
payPrice
}
元`
)
labelList
.
map
((
e
,
index
)
=>
{
labelList
.
map
((
e
,
index
)
=>
{
if
(
e
==
'商品名称:'
&&
draw
.
getTextWidth
(
carText
,
fontSize
)
>
valueEndX
-
valueX
)
spacing
=
24
if
(
e
==
'商品名称:'
&&
draw
.
getTextWidth
(
carText
,
fontSize
)
>
valueEndX
-
valueX
)
spacing
=
lineHeight
if
((
e
==
formDescribeSecond
&&
draw
.
getTextWidth
(
formContentFirst
,
fontSize
)
>
valueEndX
-
valueX
)
||
e
===
formDescribeSecond
&&
(
draw
.
getTextWidth
(
formDescribeFirst
,
fontSize
)
>
labelEndX
-
labelX
))
spacing
=
48
if
((
e
==
formDescribeSecond
&&
draw
.
getTextWidth
(
formContentFirst
,
fontSize
)
>
valueEndX
-
valueX
)
||
e
===
formDescribeSecond
&&
(
draw
.
getTextWidth
(
formDescribeFirst
,
fontSize
)
>
labelEndX
-
labelX
))
spacing
=
lineHeight
*
2
if
(
index
==
labelList
.
length
-
1
)
textYList
.
push
(
452
)
if
(
index
==
labelList
.
length
-
1
)
textYList
.
push
(
452
)
else
textYList
.
push
(
index
*
32
+
109
+
spacing
)
else
textYList
.
push
(
index
*
32
+
109
+
spacing
)
})
})
...
@@ -108,7 +110,7 @@ export default {
...
@@ -108,7 +110,7 @@ export default {
height
:
canvasHeight
,
height
:
canvasHeight
,
},
()
=>
{
},
()
=>
{
labelList
&&
labelList
.
length
>
0
&&
(
labelList
.
map
((
e
,
index
)
=>
{
labelList
&&
labelList
.
length
>
0
&&
(
labelList
.
map
((
e
,
index
)
=>
{
let
y
=
textYList
[
index
]
+
7
let
y
=
textYList
[
index
]
+
fontSize
/
2
let
label
=
{
let
label
=
{
text
:
e
,
text
:
e
,
x
:
labelX
,
x
:
labelX
,
...
@@ -132,11 +134,11 @@ export default {
...
@@ -132,11 +134,11 @@ export default {
// value.background = '#FFF9F7'
// value.background = '#FFF9F7'
}
}
if
((
formDescribeFirst
&&
e
===
formDescribeFirst
)
||
(
formDescribeSecond
&&
e
===
formDescribeSecond
)
||
(
e
===
'品牌车型:'
))
{
if
((
formDescribeFirst
&&
e
===
formDescribeFirst
)
||
(
formDescribeSecond
&&
e
===
formDescribeSecond
)
||
(
e
===
'品牌车型:'
))
{
value
.
lineNum
=
2
value
.
lineNum
=
lineNum
value
.
lineHeight
=
24
value
.
lineHeight
=
lineHeight
if
((
formDescribeFirst
&&
e
===
formDescribeFirst
)
||
(
formDescribeSecond
&&
e
===
formDescribeSecond
))
{
if
((
formDescribeFirst
&&
e
===
formDescribeFirst
)
||
(
formDescribeSecond
&&
e
===
formDescribeSecond
))
{
label
.
lineNum
=
2
label
.
lineNum
=
lineNum
label
.
lineHeight
=
24
label
.
lineHeight
=
lineHeight
label
.
width
=
labelEndX
label
.
width
=
labelEndX
label
.
lastFont
=
':'
label
.
lastFont
=
':'
}
}
...
...
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