💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
`PHP`文件中设置 ~~~ //分享设置 $shareCon = array( 'title' => '分享标题', 'desc' => '分享描述', 'imgUrl' => __DIR__ . '/../../img/share_img.jpg', ); $signPackage = $_W['account']['jssdkconfig']; ~~~ 前端或模版文件中加入 ~~~ <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> ~~~ 同时在前端中加入对应的`javascript`代码块 ~~~ <script> wx.config({ debug: false, appId: '{$signPackage["appId"]}', timestamp: '{$signPackage["timestamp"]}', nonceStr: '{$signPackage["nonceStr"]}', signature: '{$signPackage["signature"]}', jsApiList: [ 'checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone' ] }); wx.ready(function(){ // 分享朋友圈 wx.onMenuShareTimeline({ title:'{$shareCon["title"]}', link:window.location.href, imgUrl:'{php echo tomedia($shareCon["imgUrl"]);}', success:function(){ //发送成功的方法 // alert('已分享'); }, cancel:function(){ //发送取消的方法 // alert('已取消'); } }); // 分享给朋友 wx.onMenuShareAppMessage({ title:'{$shareCon["title"]}', desc:'{$shareCon["desc"]}', link:window.location.href, imgUrl:'{php echo tomedia($shareCon["imgUrl"]);}', success:function(){ //发送成功的方法 // alert('已分享'); }, cancel:function(){ //发送取消的方法 // alert('已取消'); } }); }) </script> ~~~