Bootstrap

富文本编辑器--商品详情照片100%

github上面的wxparse

小程序

onLoad: function (options) {
this.setData({
  idd:options.id
})
    let {arr,show1} = this.data
    
 Gooddetail({id:options.id}).then(res=>{
  this.setData({
    arr:res.data,
    shopid:options.id
  })
  var body=res.data.content.replace(/<img /g,'<img class="img-ks-lazyload"')
  wxParse.wxParse('body','html',body,this,1)
  kshou({token:wx.getStorageSync('token'),goodsId:res.data.basicInfo.id,type:res.data.basicInfo.type}).then(res=>{
    console.log(res);
    if(res.code==-1){
      this.setData({
        show1:false
      })
    }else{
      this.setData({
        show1:true
      })
    }
  })
})

  },

;