1、首先需要下载插件wxParse
下载地址
https://github.com/ZCLegendary/WXNews
百度云盘有保存
WXML <import src="../../../wxParse/wxParse.wxml"/> <view class="wxParse"> <template is="wxParse" data="{{wxParseData:article.nodes}}"/> </view> JS var WxParse = require('/../../../wxParse/wxParse.js'); request.HttpRequst(true, app.classify.findGoodsById, json, function (res) { var content = res.goodsDescribe;//返回的参数,各种html标签 var article = content; WxParse.wxParse('article','html',article,that); })
注:须将html2json.js中的console.dir改成console.log()或者注释