与牧同行-兽医端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

37 lines
901 B

import http from '../../../utils/api'
const baseUrl = require('../../../utils/baseUrl')
Page({
data: {
id: '', // 文章ID
baseUrl:baseUrl,
detail: {}, // 文章详情数据
tags:[]
},
onLoad(options) {
this.getexperienceDetails(options)
},
// 经验分享详情
getexperienceDetails(options){
http.experienceDetails({
data:{
id:options.id
},
success:res=>{
console.log(1111,res);
const tag = res.data.tags.split(',')
var ch ='<img src="/dev-api'
const mmg = res.data.content.replace(new RegExp(ch, 'g'), '<img src="' + baseUrl)
const images = mmg.replace(/\<img/g, '<img style="width:100%;display:block; border-radius:3px;"');
this.setData({
detail:res.data,
content:images,
tags:tag
})
}
})
},
})