This commit is contained in:
18631081161 2024-07-25 14:49:26 +08:00
commit c47bdf8d8b

View File

@ -463,27 +463,30 @@ export default {
if (res.status == 1) {
let _data = res.data;
wx.config({
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来若要查看传入的参数可以在pc端打开参数信息会通过log打出仅在pc端时才会打印。
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来若要查看传入的参数可以在pc端打开参数信息会通过log打出仅在pc端时才会打印。
appId: _data.appId,
timestamp: _data.timestamp,
nonceStr: _data.noncestr,
signature: _data.signature,
jsApiList: [
'checkJsApi',
'showMenuItems',
'updateAppMessageShareData',
'onMenuShareTimeline',
]
});
wx.ready(function() {
wx.checkJsApi({
jsApiList: [
'openAddress',
'onMenuShareTimeline',
],
success: function(res) {
if (link.indexOf('http:') < 0 && link.indexOf(
'https:') < 0) {
link = location.href.split('#')[0] + link;
if (link.indexOf('http:') < 0 &&
link.indexOf('https:') < 0) {
link = location.href.split('#')[0] + "#" + link;
}
// alert('a')
wx.updateAppMessageShareData({
title: title, // 分享标题
desc: desc, // 分享描述
@ -493,6 +496,27 @@ export default {
// 设置成功
}
})
uni.setClipboardData({
data: `${link}`
})
// alert('a1')
// wx.showMenuItems({
// menuList: [
// "menuItem:share:appMessage",
// "menuItem:share:timeline",
// "menuItem:share:qq",
// ] // 要显示的菜单项所有menu项见附录3
// });
// alert('a3')
// wx.onMenuShareTimeline({
// title: title, // 分享标题
// link: link, // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
// imgUrl: image, // 分享图标
// success: function() {
// // 用户点击了分享后执行的回调函数
// alert('用户点击了分享后执行的回调函数')
// }
// })
}
});