Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-community-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
6 years ago
Commit
1982954ba24dad320d220acbbb2e1c97dd21aaec
1 parent
e08220bd
fix share
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
apps/plugins/share.js
apps/plugins/share.js
View file @
1982954
...
...
@@ -14,6 +14,14 @@ let jsApiList = [
'onMenuShareQZone'
];
const
setWxShareData
=
function
()
{
window
.
wx
.
onMenuShareTimeline
(
shareData
);
window
.
wx
.
onMenuShareAppMessage
(
shareData
);
window
.
wx
.
onMenuShareQQ
(
shareData
);
window
.
wx
.
onMenuShareQZone
(
shareData
);
window
.
wx
.
onMenuShareWeibo
(
shareData
);
};
function
loadScript
(
url
,
success
)
{
const
head
=
document
.
getElementsByTagName
(
'head'
)[
0
];
let
script
=
document
.
createElement
(
'script'
);
...
...
@@ -80,6 +88,10 @@ function init(qs) {
signature
:
res
.
signature
,
jsApiList
:
jsApiList
});
window
.
wx
.
ready
(
function
()
{
setWxShareData
();
});
}
})
});
...
...
@@ -103,12 +115,18 @@ export default {
setShareInfo
(
data
)
{
Object
.
assign
(
shareData
,
data
);
shareData
.
link
=
shareData
.
link
||
location
.
href
;
if
(
window
.
wx
)
{
setWxShareData
();
}
setTimeout
(
function
()
{
window
.
setShareInfo
({
title
:
shareData
.
title
,
summary
:
shareData
.
desc
,
pic
:
shareData
.
imgUrl
,
url
:
shareData
.
link
||
location
.
href
url
:
shareData
.
link
});
},
window
.
setShareInfo
?
0
:
300
);
}
...
...
Please
register
or
login
to post a comment