const app = getApp(); Page({ /** * 页面的初始数据 */ data: { id:0, info:{}, content: '', }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { let id = options.id; this.setData({id:id}); this.getInfo(); }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { let info = this.data.info return { title: info.title, path: "/pages/article/detail/detail?id="+info.id, imageUrl: info.main_image, }; }, //详情 getInfo() { let self = this; app.get('portal/articles/'+this.data.id,function(res){ self.setData({info:res}); self.setData({ content: res.post_content.replace(/\