第一种方法:接口里给img标签加样式(后台PHP)
$info['contents'] = str_replace("<img ", "<img style='max-width:100%;height:auto;'", $info['contents']);
第二种方法:小程序里给img标签加样式(前端小程序里 推荐!!!)
that.setData({
//富文本内容
nodes:res.data.data.ginfo.introduce.replace(/\<img/gi, '<img style="max-width:100%;height:auto"'),
})