直接进入主题
对于要分享的页面,在js中的onShareAppMessage方法中设置
onShareAppMessage(res) { if (res.from === 'button') { // 来自页面内转发按钮 //可以针对不同的来源,作不同的处理 console.log(res.target) } return { title: '转发标题', // 分享后打开的页面 path: 'pages/index/index', imageUrl: '转发时显示的图片' } }
直接进入主题
对于要分享的页面,在js中的onShareAppMessage方法中设置
onShareAppMessage(res) { if (res.from === 'button') { // 来自页面内转发按钮 //可以针对不同的来源,作不同的处理 console.log(res.target) } return { title: '转发标题', // 分享后打开的页面 path: 'pages/index/index', imageUrl: '转发时显示的图片' } }
本文链接:小程序自定义分享格式 ,花了好多脑细胞写的,转载请注明链接喔~~