Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
mallapp
Commits
d2f50880
Commit
d2f50880
authored
Aug 25, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改显示
parent
e847eef4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
share.vue
pages/live/share.vue
+26
-4
index.vue
pages/share/index/index.vue
+4
-1
No files found.
pages/live/share.vue
View file @
d2f50880
...
...
@@ -21,7 +21,12 @@ export default {
UserInfo
:
""
,
tempPic
:
""
,
bgPic
:
""
,
qrCodeConfig
:{},
//二维码配置
qrCodeSize
:
126
,
//二维码宽高
qrCodeLeft
:
595
,
//二维码左边距
qrCodeTop
:
1200
,
//二维码上边距
halfCode
:
63
//二维码一半高度
};
},
created
()
{
...
...
@@ -31,6 +36,20 @@ export default {
this
.
UserInfo
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
)
:
{};
this
.
qrCodeConfig
=
uni
.
getStorageSync
(
'basedata'
)
?
uni
.
getStorageSync
(
'basedata'
).
liveConfig
:
{};
if
(
this
.
qrCodeConfig
){
if
(
this
.
qrCodeConfig
.
LiveQrCodePaddingLeft
){
this
.
qrCodeLeft
=
this
.
qrCodeConfig
.
LiveQrCodePaddingLeft
;
}
if
(
this
.
qrCodeConfig
.
LiveQrCodePaddingTop
){
this
.
qrCodeTop
=
this
.
qrCodeConfig
.
LiveQrCodePaddingTop
;
}
if
(
this
.
qrCodeConfig
.
LiveQrCodeSize
){
this
.
qrCodeSize
=
this
.
qrCodeConfig
.
LiveQrCodeSize
;
this
.
halfCode
=
parseInt
(
this
.
qrCodeConfig
.
LiveQrCodeSize
/
2
);
}
}
},
onLoad
(
option
)
{
this
.
bgPic
=
...
...
@@ -93,7 +112,7 @@ export default {
title
:
"正在生成"
,
});
let
ctx
=
uni
.
createCanvasContext
(
"firstCanvas"
,
this
);
let
that
=
this
;
let
that
=
this
;
uni
.
getImageInfo
({
src
:
that
.
bgPic
,
success
:
function
(
image
)
{
...
...
@@ -105,11 +124,13 @@ export default {
success
:
function
(
image
)
{
ctx
.
save
();
ctx
.
beginPath
();
ctx
.
arc
(
595
+
63
,
1200
+
63
,
63
,
0
,
Math
.
PI
*
2
);
// ctx.arc(595 + 63, 1200 + 63, 63, 0, Math.PI * 2);
ctx
.
arc
(
that
.
qrCodeLeft
+
that
.
halfCode
,
that
.
qrCodeTop
+
that
.
halfCode
,
that
.
halfCode
,
0
,
Math
.
PI
*
2
);
ctx
.
setFillStyle
(
"#ffffff"
);
ctx
.
fill
();
ctx
.
clip
();
ctx
.
drawImage
(
image
.
path
,
595
,
1200
,
126
,
126
);
//绘制头像
// ctx.drawImage(image.path, 595, 1200, 126, 126); //绘制头像
ctx
.
drawImage
(
image
.
path
,
that
.
qrCodeLeft
,
that
.
qrCodeTop
,
that
.
qrCodeSize
,
that
.
qrCodeSize
);
//绘制头像
that
.
drawQrCode
(
ctx
);
},
});
...
...
@@ -207,6 +228,7 @@ export default {
success
:
(
res
)
=>
{
uni
.
hideLoading
();
that
.
tempPic
=
res
.
tempFilePath
;
console
.
log
(
res
,
'res'
);
},
fail
(
e
)
{
console
.
log
(
e
);
...
...
pages/share/index/index.vue
View file @
d2f50880
...
...
@@ -86,7 +86,10 @@
</view>
<Text
style=
'font-size: 12px;margin-top: 5px;'
>
{{
sharedata
.
CustomModel
.
ReferrerName
}}
:
{{
sharedata
.
UserInfo
.
SuperiorName
!=
''
&&
sharedata
.
UserInfo
.
SuperiorName
!=
null
?
sharedata
.
UserInfo
.
SuperiorName
:
'总部'
}}
</Text>
<Text
style=
'font-size: 12px;margin-top: 5px;'
>
等级:
{{
sharedata
.
UserInfo
.
GradeName
}}
</Text>
<view
style=
"display:flex;align-items: center;margin-top: 5px;"
>
<Text
style=
'font-size: 12px;'
>
等级:
</Text>
<image
:src=
"sharedata.UserInfo.GradeIcon"
style=
"width:67px;height:22px;"
></image>
</view>
<Text
style=
'font-size: 12px;margin-top: 5px;height:19px;'
>
{{
sharedata
.
UserInfo
.
IsEnableFXGrade
==
1
&&
sharedata
.
UserInfo
.
IsVip
==
1
?
'会员日期:'
+
sharedata
.
UserInfo
.
VipExpiryDate
:
''
}}
</Text>
</view>
...
...
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