下载wxParse https://download.csdn.net/download/qq_38651504/10908178
<import src="../../../wxParse/wxParse.wxml" /> <view class='details_box'> <template is="wxParse" data="{{wxParseData:article.nodes}}" /> </view> const WxParse = require('../../../wxParse/wxParse.js'); Page({ /** * 页面的初始数据 */ data: {}, onLoad: function (options) { var that = this; wx.request({ url: ‘*******’, data: {}, success: function (res) { console.log(res); if (res.data.data.commentlist!=null){ for (let i = 0; i < res.data.data.commentlist.length; i++) { res.data.data.commentlist[i]['add_time'] = util.js_date_time(res.data.data.commentlist[i]["add_time"]) } } WxParse.wxParse('article', 'html', res.data.data.goods_content, that, 5); that.setData({ imgUrls: res.data.data.goods_images_list, list: res.data.data, spec: res.data.data.filter_spec, price: res.data.data.spec_goods_price, is_vip:res.data.data.is_vip }) }, fail: function (res) { wx.showToast({ title: '失败,请检查网络', duration: 2000, icon: 'none' }) } }) } })