微信扫描app里面的二维码网址进入这个页面,然后把这个页面分享出去。安卓这边一切正常,不管是分享朋友圈还是好友,如果从安卓分享给ios,ios也是正常显示。但是ios直接进入网页分享出去就会没有伸缩图和描述。。。百度的以前ios有版本问题但是感觉已经修复了,不知道为何现在出现这种效果
function initWeixin() {
var share = {
title: '你的好友正在弹一弹里等你来挑战',
desc: '大眼睛陪练-专注为4-12岁琴童提供专业化和智能化的4对1练琴服务。',
link: `https://wap.raintai.com/webapp/iphoneshare.html?avatar=${imgSrc}&name=${playName}&score=${playScore}&beatPerson=${beatPerson}`,
imgUrl: 'https://wap.raintai.com/webapp/img/share/share.png',
success: function () {
}
};
$.ajax({
url: url,
type: 'GET',
data: { 'url': location.href },
async: true,
dataType: 'json',
success: function (data) {
// console.log(data)
// console.log(1)
wx.config({
debug: false,
appId: data.appId,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,
jsApiList: [
'hideMenuItems',
'onMenuShareTimeline',
'onMenuShareAppMessage'
]
});
wx.error(function (res) {
alert(res);
});
wx.ready(function () {
wx.hideMenuItems({
menuList: ["menuItem:copyUrl", "menuItem:openWithQQBrowser", "menuItem:openWithSafari"] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
});
wx.onMenuShareTimeline(share);
wx.onMenuShareAppMessage(share);
});
},
error:function (error){
alert(error)
}
});
}
我用ios访问分享正常,一般出现这种情况主要是
1.该域名被加入wx黑名单
2.wx.config没成功,可以看下服务器或前端的log