页面中配置了分享相关的内容,实际分享时,分享出去的卡片并不是配置的内容,而是展示了当前页面的导航标题。要怎么变成我配置的标题和图片?
async onReady() {
const that = this
const { data } = await reqWxConfig()
wx.config({
debug: true,
appId: data.appId,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,
jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData']
});
wx.ready(function() {
wx.updateAppMessageShareData({
title: '【搭搭陪伴】真颜值,好服务,有保障',
desc: '【搭搭陪伴】真颜值,好服务,有保障',
link: `${config.codeUrl}pages/index/detail?id=${id}`,
success: () => {}
})
wx.updateTimelineShareData({
title: '【搭搭陪伴】真颜值,好服务,有保障',
desc: '【搭搭陪伴】真颜值,好服务,有保障',
link: `${config.codeUrl}pages/index/detail?id=${id}`,
imgUrl: this.service.cover,
success: () => {}
})
})
wx.error(function(res) {
console.error('微信配置错误:', res);
});
},