微信小程序转发功能
不确定是不是bug。感觉分享时候页面显示的内容不是预期的内容。
- 当前 Bug 的表现(可附上截图)
页面上<button open-type=“share”>邀请好友</button>
js文件:
/** * 用户点击右上角分享 */ onShareAppMessage: function (res) { if (res.from == 'button' ) { return { title: '' , path: '/pages/sm/sm' , success: function (res) { console.log(res); }, fail: function (res) { console.log(res); } } } } |

点击button后,出现如下界面。

发送至好友,会话页面显示的是

但是我的path指向的是’pages/sm/sm’。如图:

- 预期表现
在微信会话页面应该显示path页面的内容。
在转发提示页面应该显示path页面的内容。
- 复现路径
无
- 提供一个最简复现 Demo
转发页:
wxml:
<button open-type=“share”>邀请好友</button>
js:
/** * 用户点击右上角分享 */ onShareAppMessage: function (res) { if (res.from == 'button' ) { return { title: '' , path: '/pages/sm/sm' , success: function (res) { console.log(res); }, fail: function (res) { console.log(res); } } } } |
目标页:
< view > 测试分享页面 </ view > |