|
|
@@ -246,6 +246,12 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ replaceImg(html){
|
|
|
+ let result = html.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match,capture) {
|
|
|
+ return '<img src=' + getApp().globalData.shareUrl + capture +' style="max-width:100%;height:auto;display:block;margin:10px 0;"/>';
|
|
|
+ });
|
|
|
+ return result
|
|
|
+ },
|
|
|
getRich() {
|
|
|
uni.request({
|
|
|
url:
|
|
|
@@ -258,7 +264,7 @@ export default {
|
|
|
|
|
|
success: (res) => {
|
|
|
if (res.statusCode === 200) {
|
|
|
- this.textModel.text = res.data;
|
|
|
+ this.textModel.text = this.replaceImg(res.data);
|
|
|
}
|
|
|
},
|
|
|
fail: () => {
|