const app = getApp() Page({ data: { postId:0, info:{}, content:'' }, onLoad: function (options) { let postId = +options.postId||7356; this.setData({postId}) }, onShow: function(){ this.loadData() }, loadData(){ let postId = this.data.postId app.formPost( "Post.getPostInfo", {postId}).then( res=>{ if( res.code == 200 ){ let info = res.data this.setData({info}) } }) }, onShareAppMessage: function () { let {postId, title} = this.data.info; return { title: title, path: `/pages/post/post?postId=${postId}` } } })