// package_first/pages/announceDetail/index.js
Page({
/**
* 页面的初始数据
*/
data: {
dataSource: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options) {
const dataSource = JSON.parse(decodeURIComponent(options.data))
let imgs=dataSource.content.match(//g);
if(!imgs){
this.setData({dataSource})
} else {
for(let img of imgs){
let temp
temp=img.replace(/(width=".*?"|height=".*?")/g,"");
if(/style="(.*?)"/.test(temp)){
temp=temp.replace(RegExp.$1,RegExp.$1+"width:100% !important;height:auto;display:block")
}else{
temp=temp.replace(/