ios微信分享失效

编程入门 行业动态 更新时间:2024-10-13 22:19:21

<a href=https://www.elefans.com/category/jswz/34/1770014.html style=ios微信分享失效"/>

ios微信分享失效

<script src=".0.0.js"></script>

<script>

wx.config({

debug: false,

appId: '<?php echo $signPackage["appid"];?>',

timestamp: '<?php echo $signPackage["timestamp"];?>',

nonceStr: '<?php echo $signPackage["noncestr"];?>',

signature: '<?php echo $signPackage["signature"];?>',

jsApiList: [

'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'hideAllNonBaseMenuItem'

]

});

</script>

<script>

{if !empty($share_data)}

wx.ready(function () {

// 在这里调用 API

wx.onMenuShareTimeline({

title: '<?php echo $share_data["title"];?>', // 分享标题

desc: '<?php echo $share_data["desc"];?>', // 分享描述

link: '<?php echo $share_data["url"];?>', // 分享链接

imgUrl: '<?php echo $share_data["imgurl"];?>', // 分享图标

success: function () {

//                if (share_success != undefined) {

share_success();

//                }

},

cancel: function () {

//                if (share_cancel != undefined) {

share_cancel();

//                }

}

});

wx.onMenuShareAppMessage({

title: '<?php echo $share_data["title"];?>', // 分享标题

desc: '<?php echo $share_data["desc"];?>', // 分享描述

link: '<?php echo $share_data["url"];?>', // 分享链接

imgUrl: '<?php echo $share_data["imgurl"];?>', // 分享图标

type: 'link', // 分享类型,music、video或link,不填默认为link

dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空

success: function () {

//                if (share_success != undefined) {

share_success();

//                }

},

cancel: function () {

//                if (share_cancel != undefined) {

share_cancel();

//                }

}

});

wx.onMenuShareQQ({

title: '<?php echo $share_data["title"];?>', // 分享标题

desc: '<?php echo $share_data["desc"];?>', // 分享描述

link: '<?php echo $share_data["url"];?>', // 分享链接

imgUrl: '<?php echo $share_data["imgurl"];?>', // 分享图标

type: 'link', // 分享类型,music、video或link,不填默认为link

dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空

success: function () {

//                if (share_success != undefined) {

share_success();

//                }

},

cancel: function () {

//                if (share_cancel != undefined) {

share_cancel();

//                }

}

});

});

wx.error(function (res) {

//        alert(res.errMsg);

});

{else}

wx.ready(function () {

wx.hideAllNonBaseMenuItem();

});

{/if}

</script>

更多推荐

ios微信分享失效

本文发布于:2024-02-12 16:28:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1688553.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ios

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!