$wxJsApiConfig = json_encode(Yii::$app->exchange->jsApiConfig(['jsApiList' => ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ']]));
$shareUrl = isset($model) ? Url::to(['photo', 'id' => $model->id], true) : Url::home(true);
$shareDesc = '万年备胎转正的机会就在眼前,快来参加我的后宫大选吧!';
$shareImgUrl = Asset::getAssetUrl('images/share-image.jpg');
$shareTitle = '给我一个翻你牌子的机会';
$js = <<
wx.config({$wxJsApiConfig});
wx.ready(function () {
// 在这里调用 API
wx.onMenuShareTimeline({
title: '{$shareTitle}', // 分享标题
link: '{$shareUrl}', // 分享链接
imgUrl: '{$shareImgUrl}', // 分享图标
success: function () {
if($('.harem .invite-friend')is(':visible')){
$('.harem .invite-friend').hide()
$('.harem .opportunities').show()
}
else{
$('.harem .share-shade').hide()
$('.harem .opportunities').show()
}
},
});
wx.onMenuShareAppMessage({
title: '{$shareTitle}', // 分享标题
link: '{$shareUrl}', // 分享链接
imgUrl: '{$shareImgUrl}', // 分享图标
desc:'{$shareDesc}',
success: function () {
if($('.harem .invite-friend')is(':visible')){
$('.harem .invite-friend').hide()
$('.harem .opportunities').show()
}
else{
$('.harem .share-shade').hide()
$('.harem .opportunities').show()
}
},
});
wx.onMenuShareQQ({
title: '{$shareTitle}', // 分享标题
link: '{$shareUrl}', // 分享链接
imgUrl: '{$shareImgUrl}', // 分享图标
desc:'{$shareDesc}',
success: function () {
if($('.harem .invite-friend')is(':visible')){
$('.harem .invite-friend').hide()
$('.harem .opportunities').show()
}
else{
$('.harem .share-shade').hide()
$('.harem .opportunities').show()
}
},
});
});
现在写了这个但是在本地看不到分享设置的文字图片
也不知道成没成功
请问怎么能在本地调试jssdk呢 希望能说的详细点