您好解决了吗
h5分享只展示标题,不展示描述和图片?[图片] 代码效果如上图,内容如下图,结果就是有标题,但是描述 和 图片都不展示,上午还能正常展示,下午就GG了, wx.config({ debug: true, // 开启调试模式。 appId: obj.appId, // 必填,公众号的唯一标识 timestamp: obj.timestamp, // 必填,生成签名的时间戳 nonceStr: obj.nonceStr, // 必填,生成签名的随机串 signature: obj.signature, // 必填,签名 jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData']// 必填,需要使用的JS接口列表 }); wx.checkJsApi({ jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2, success(res) { if (res.checkResult.getLocation === false) { const message = '你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!' reject(message); } else { const message = 'js-sdk检查成功'; console.log(message); // resolve(message); } }, fail(res) { const message = 'checkJsApi fail=' + JSON.stringify(res); console.log(message); // reject(message); } }); //需在用户可能点击分享按钮前就先调用 wx.ready(function () { // 自定义“分享给朋友”及“分享到QQ”按钮的分享内容 wx.updateAppMessageShareData({ title: shareTitle, // 分享标题 link: shareUrl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: shareImage, // 分享图标 desc: shareDes, // 分享描述 success: function () {// 设置成功 } }); // 自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容 wx.updateTimelineShareData({ title: shareTitle, // 分享标题 link: shareUrl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: shareImage, // 分享图标 success: function () {// 设置成功 } }) }); wx.error(function (res) { console.log("err: " + res) // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 }); }).catch(function (ex) { console.log('failed', ex) });、
2023-12-15