Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
html
/
wanda-ball
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
15745e3a
authored
May 27, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分享到朋友圈
parent
1c4ef89b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
12 deletions
+44
-12
src/components/Detail.vue
+44
-12
src/pages/index/assets/images/Fuceng.png
+0
-0
static/shareBg.png
+0
-0
No files found.
src/components/Detail.vue
View file @
15745e3a
...
@@ -27,7 +27,8 @@
...
@@ -27,7 +27,8 @@
<p>
点击右上角“···”进行分享
</p>
<p>
点击右上角“···”进行分享
</p>
</div>
</div>
<div
class=
"shareBox"
v-show=
"shareOnoff2"
@
click=
"closeShare"
>
<div
class=
"shareBox"
v-show=
"shareOnoff2"
@
click=
"closeShare"
>
<img
:src=
"shareCode"
alt=
""
style=
"width: 100%;"
>
<img
:src=
"shareCode"
class=
"share-img"
alt=
""
>
<div
class=
"share-tips"
>
长按图片保存到相册,分享到朋友圈
</div>
</div>
</div>
<div
class=
"shareBox"
v-show=
"jinzhidianzan"
@
click=
"closeJinzhi"
>
<div
class=
"shareBox"
v-show=
"jinzhidianzan"
@
click=
"closeJinzhi"
>
<div
class=
"jinzhi"
></div>
<div
class=
"jinzhi"
></div>
...
@@ -111,7 +112,7 @@ export default {
...
@@ -111,7 +112,7 @@ export default {
},
},
activated
()
{
activated
()
{
// this.hiddenBar();
// this.hiddenBar();
// this.getCanvasDrawImage()
this
.
kongtuLock
=
false
;
this
.
kongtuLock
=
false
;
let
id
=
this
.
$route
.
query
.
id
;
let
id
=
this
.
$route
.
query
.
id
;
...
@@ -349,6 +350,29 @@ export default {
...
@@ -349,6 +350,29 @@ export default {
}
}
});
});
},
},
getCanvasDrawImage
(
img
)
{
var
_this
=
this
var
canvas
=
document
.
createElement
(
'canvas'
)
canvas
.
width
=
'960'
canvas
.
height
=
'1338'
var
ctx
=
canvas
.
getContext
(
"2d"
)
var
img
=
new
Image
()
img
.
src
=
require
(
'../../static/shareBg.png'
)
img
.
onload
=
function
(
params
)
{
ctx
.
drawImage
(
img
,
0
,
0
,
960
,
1338
)
var
img2
=
new
Image
()
img2
.
src
=
img
||
require
(
'../../static/upload.jpg'
)
img2
.
onload
=
function
(
param
)
{
ctx
.
drawImage
(
img2
,
293
,
640
,
377
,
377
)
_this
.
shareCode
=
canvas
.
toDataURL
()
_this
.
shareOnoff2
=
true
}
// document.body.appendChild(canvas)
}
},
share
()
{
share
()
{
var
_this
=
this
var
_this
=
this
alert
(
'share'
)
alert
(
'share'
)
...
@@ -359,19 +383,12 @@ export default {
...
@@ -359,19 +383,12 @@ export default {
scene
:
_this
.
$route
.
query
.
id
,
scene
:
_this
.
$route
.
query
.
id
,
pages
:
'pages/webview/webview'
pages
:
'pages/webview/webview'
}).
then
(
res
=>
{
}).
then
(
res
=>
{
_this
.
shareCode
=
res
.
data
.
data
.
weixinCode
// _this.shareCode = res.data.data.weixinCode
_this
.
getCanvasDrawImage
(
res
.
data
.
data
.
weixinCode
)
_this
.
shareOnoff2
=
true
_this
.
shareOnoff2
=
true
alert
(
JSON
.
stringify
(
res
.
data
.
data
))
alert
(
JSON
.
stringify
(
res
.
data
.
data
))
})
})
}
else
{
}
else
{
axios
.
post
(
'/weixin/getcode'
,
{
scene
:
_this
.
$route
.
query
.
id
,
pages
:
'pages/webview/webview'
}).
then
(
res
=>
{
_this
.
shareCode
=
res
.
data
.
data
.
weixinCode
_this
.
shareOnoff2
=
true
alert
(
JSON
.
stringify
(
res
.
data
.
data
))
})
_this
.
shareOnoff
=
true
;
_this
.
shareOnoff
=
true
;
}
}
})
})
...
@@ -686,9 +703,24 @@ export default {
...
@@ -686,9 +703,24 @@ export default {
bottom
:
0
;
bottom
:
0
;
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
width
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
0.8
);
background
:
rgba
(
0
,
0
,
0
,
0.8
);
z-index
:
100000
;
z-index
:
100000
;
.share-img
{
width
:
500px
;
margin
:
0
auto
;
display
:
block
;
margin-top
:
20vh
;
}
.share-tips
{
width
:
500px
;
padding-top
:
30px
;
color
:
white
;
margin
:
0
auto
;
display
:
block
;
text-align
:
center
;
font-size
:
20px
;
}
p
{
p
{
color
:
white
;
color
:
white
;
font-size
:
34px
;
font-size
:
34px
;
...
...
src/pages/index/assets/images/Fuceng.png
View file @
15745e3a
283 KB
|
W:
|
H:
77.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
static/shareBg.png
0 → 100644
View file @
15745e3a
63.8 KB
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