Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
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 63e468b1
authored
Sep 28, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
5258c71a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
components/Poster/poster/index.js
pages/tab/index/index.js
components/Poster/poster/index.js
View file @
63e468b
...
@@ -70,8 +70,7 @@ Component({
...
@@ -70,8 +70,7 @@ Component({
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
!
this
.
data
.
hideLoading
&&
wx
.
hideLoading
();
!
this
.
data
.
hideLoading
&&
wx
.
hideLoading
();
wx
.
showToast
({
icon
:
'none'
,
title
:
err
.
errMsg
||
'生成失败'
});
// wx.showToast({ icon: 'none', title: err.errMsg || '生成失败' });
console
.
error
(
err
);
this
.
triggerEvent
(
'fail'
,
err
);
this
.
triggerEvent
(
'fail'
,
err
);
})
})
},
},
...
...
pages/tab/index/index.js
View file @
63e468b
...
@@ -222,17 +222,18 @@ Page({
...
@@ -222,17 +222,18 @@ Page({
const
canvasWidth
=
208
,
const
canvasWidth
=
208
,
canvasHeight
=
166
,
canvasHeight
=
166
,
textBaseline
=
"top"
;
textBaseline
=
"top"
;
// const draw_function = new Draw(this, {
const
draw_function
=
new
Draw
(
this
,
{
// width: canvasWidth,
width
:
canvasWidth
,
// height: canvasHeight,
height
:
canvasHeight
,
// // pixelRatio: 2,
// pixelRatio: 2,
// // backgroundColor: '#096'
// backgroundColor: '#096'
// });
});
const
x
=
draw_function
.
getTextWidth
(
data
.
staffName
,
14
)
+
22
const
drawCard
=
(
callBack
)
=>
{
const
drawCard
=
(
callBack
)
=>
{
// let index = 0;
// let index = 0;
const
canvasWidth
=
208
,
//
const canvasWidth = 208,
canvasHeight
=
166
,
//
canvasHeight = 166,
textBaseline
=
"top"
;
//
textBaseline = "top";
const
iconWidth
=
9
,
const
iconWidth
=
9
,
iconHeight
=
9
,
iconHeight
=
9
,
iconX
=
18
,
iconX
=
18
,
...
@@ -294,7 +295,7 @@ Page({
...
@@ -294,7 +295,7 @@ Page({
},
},
{
{
text
:
data
.
operation
,
text
:
data
.
operation
,
x
:
51
,
//+ draw_function.getTextWidth(data.staffName, 14)
,
x
:
x
,
y
:
50
,
y
:
50
,
color
:
"#6E6E7A"
,
color
:
"#6E6E7A"
,
fontWeight
:
400
,
fontWeight
:
400
,
...
@@ -314,12 +315,14 @@ Page({
...
@@ -314,12 +315,14 @@ Page({
color
:
"#6E6E7A"
,
color
:
"#6E6E7A"
,
fontSize
:
7
,
fontSize
:
7
,
lineNum
:
2
,
lineNum
:
2
,
width
:
185
,
width
:
324
,
lineHeight
:
9
,
lineHeight
:
9
,
},
},
];
];
this
.
setData
({
posterConfig
:
{
width
:
208
,
const
width
=
208
height
:
166
,
texts
:
textList
,
images
:
imgList
}
},
()
=>
{
const
height
=
166
this
.
setData
({
posterConfig
:
{
width
,
height
,
texts
:
textList
,
images
:
imgList
,
pixelRatio
:
2
}
},
()
=>
{
Poster
.
create
();
Poster
.
create
();
});
});
// const drawImages = (callBack) => {
// const drawImages = (callBack) => {
...
@@ -356,6 +359,7 @@ Page({
...
@@ -356,6 +359,7 @@ Page({
*/
*/
onPosterSuccess
(
src
)
{
onPosterSuccess
(
src
)
{
const
{
detail
}
=
src
;
const
{
detail
}
=
src
;
console
.
log
(
detail
)
this
.
setData
({
this
.
setData
({
shareImg
:
detail
,
shareImg
:
detail
,
},()
=>
{
},()
=>
{
...
...
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