let config = require("../../config/config.js"); const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync().extConfig : {} let configUrls = extConfig.attr.configUrl; let app = getApp(); var ttParse = require('./ttParse/wxParse.js'); Page({ data: { nodeData: "", date: "", mallTenantId: "" }, onLoad: function (options) { const that = this const date = new Date() that.setData({ date, mallTenantId: tt.getStorageSync('mallTenantId') || "" }) if (options.id) { that.getHtmlData(options.id) } }, getHtmlData(id) { const that = this tt.request({ url: configUrls + config.api.printHtmlById, data: { token: app.globalData.token, id, date: that.data.date, mallTenantId: that.data.mallTenantId }, header: { 'content-type': 'application/html' }, success: function (res) { console.log(res, 'res'); if (res.data) { console.log(res.data, 'html'); var temp = ttParse.wxParse('article', 'html', res.data, that, 5); } } }) } })