请问小程序在分享页面到好友或者工具调试时,在 onShareAppMessage 设定一个 imageUrl,为何根本不起作用呢?
还需要什么地方特别设置吗?
onShareAppMessage:function (e) {
console.log(e);
if(e.from =='button'){
return {
title: app.globalData.username,
desc: app.globalData.username,
imageUrl:head_image,
path: '/pages/index/index?getId='+app.globalData.uid
}
}
imageUrl:head_image,这里的图片是正确的jpg或者png图片,就是始终不显示,始终显示的是当前屏幕的截图

官方文档:Page({onShareAppMessage: function (res) {if (res.from === 'button') { // 来自页面内转发按钮console.log(res.target)}return {title: '自定义转发标题',path: '/page/user?id=123',imgUrl: '',success: function(res) { // 转发成功 }, fail: function(res) { // 转发失败 } } } })楼主,你解决了么?同碰上,imageUrl/ imgUrl 设置不生效
好的