Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
zhiliang-light-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
77cbd926
authored
2019-11-04 12:02:05 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
0be20de2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
src/config.js
src/pages/my-qrcode/my-qrcode.js
src/config.js
View file @
77cbd92
...
...
@@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index');
const
APPID
=
''
/** ====每次发布版本记得修改此环境配置==== */
const
ENV
=
'
Prod
'
;
// Dev Prod
const
ENV
=
'
Dev
'
;
// Dev Prod
const
NET_CONFIG
=
ENV_CONFIG
[
ENV
];
const
MOCKAPI
=
ENV_CONFIG
.
mockApi
;
...
...
src/pages/my-qrcode/my-qrcode.js
View file @
77cbd92
...
...
@@ -60,13 +60,24 @@ Page({
// 获取海报数据
getPosterConfig
()
{
let
qrCodeWid
=
340
;
let
avatarWid
=
56
;
let
qrCodeWid
=
300
;
let
avatarSpace
=
5
;
let
avatarWidBlock
=
300
*
0.3
;
let
avatarWid
=
avatarWidBlock
-
(
avatarSpace
*
2
);
let
qrTop
=
360
;
// 合成图片需要的数据
let
{
userInfo
}
=
this
.
data
;
let
blocks
=
[]
let
blocks
=
[{
x
:
(
690
-
avatarWidBlock
)
*
.
5
,
y
:
qrTop
+
(
qrCodeWid
*
.
5
)
-
(
avatarWidBlock
*
.
5
),
width
:
avatarWidBlock
,
height
:
avatarWidBlock
,
backgroundColor
:
"#ffffff"
,
borderRadius
:
10
,
zIndex
:
21
,
}]
let
images
=
[
// 背景图
{
...
...
@@ -79,7 +90,7 @@ Page({
// 二维码
{
x
:
(
690
-
qrCodeWid
)
*
.
5
,
y
:
340
,
y
:
qrTop
,
width
:
qrCodeWid
,
height
:
qrCodeWid
,
zIndex
:
11
,
...
...
@@ -88,28 +99,29 @@ Page({
// 头像
{
x
:
(
690
-
avatarWid
)
*
.
5
,
y
:
480
,
y
:
qrTop
+
(
qrCodeWid
*
.
5
),
y
:
qrTop
+
((
qrCodeWid
-
avatarWidBlock
)
*
.
5
)
+
avatarSpace
,
width
:
avatarWid
,
height
:
avatarWid
,
borderRadius
:
12
,
zIndex
:
11
,
zIndex
:
22
,
url
:
userInfo
.
avatar
,
}
];
let
lines
=
[];
let
texts
=
[{
x
:
690
/
2
,
y
:
686
,
width
:
6
90
,
fontSize
:
2
4
,
color
:
"#
333333
"
,
y
:
700
,
width
:
6
88
,
fontSize
:
2
6
,
color
:
"#
000000
"
,
textAlign
:
"center"
,
zIndex
:
11
,
text
:
userInfo
.
nickname
,
},
{
x
:
690
/
2
,
y
:
7
20
,
y
:
7
32
,
width
:
690
,
fontSize
:
18
,
color
:
"#666666"
,
...
...
Please
register
or
sign in
to post a comment