Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-06-14 18:49:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ab81358495f15b7635c2f6db7cd150ae6e341886
ab813584
1 parent
de8ce26a
测试
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
src/composables/useShare.js
src/composables/useShare.js
View file @
ab81358
/*
* @Date: 2022-06-13 17:42:32
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-06-14 18:
29:43
* @LastEditTime: 2022-06-14 18:
47:36
* @FilePath: /tswj/src/composables/useShare.js
* @Description: 文件描述
*/
import
wx
from
'weixin-js-sdk'
;
// import { Toast } from 'vant';
export
const
sharePage
=
({
title
=
'童声无界'
,
desc
=
'共读一本书,传递一份爱。'
,
imgUrl
=
'http://voice.onwall.cn/f/voice/images/weixin_logo.jpg'
})
=>
{
const
shareData
=
{
...
...
@@ -14,12 +15,7 @@ export const sharePage = ({title = '童声无界', desc = '共读一本书,传
link
:
location
.
origin
+
location
.
pathname
+
location
.
hash
,
// 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
imgUrl
,
// 分享图标
success
:
function
()
{
// 用户确认分享后执行的回调函数
console
.
warn
(
'分享成功'
);
},
cancel
:
function
()
{
// 用户取消分享后执行的回调函数
console
.
warn
(
'分享已取消'
);
// console.warn('设置成功');
}
}
// 分享好友(微信好友或qq好友)
...
...
@@ -28,4 +24,11 @@ export const sharePage = ({title = '童声无界', desc = '共读一本书,传
wx
.
updateTimelineShareData
(
shareData
);
// 分享到腾讯微博
wx
.
onMenuShareWeibo
(
shareData
);
// // 获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃)
// wx.onMenuShareAppMessage(shareData);
// // 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃)
// wx.onMenuShareTimeline(shareData);
// // 获取“分享到QQ”按钮点击状态及自定义分享内容接口(即将废弃)
// wx.onMenuShareQQ(shareData);
}
...
...
Please
register
or
login
to post a comment