|
- let app = getApp();
- const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
- var WxParse = require('../../wxParse/wxParse.js');
- const config = require("../../config/config");
- const Http = require("../../utils/HttpBasics");
- const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
- let configUrls = extConfig.attr.configUrl;
- console.log(configUrls)
-
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- navigationBarHeight,
- url: config.url,
- token: app.globalData.token,
- id:'',
- date:new Date()
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- const that = this;
- that.setData({
- url: config.url,
- id:options.id,
- token: app.globalData.token
- })
- if (options&&options.id){
- wx.request({
- url: configUrls + config.api.printHtmlById,
- data: {
- token: app.globalData.token,
- id: options.id,
- date: new Date()
- },
- header: {
- 'content-type': 'application/html'
- },
- success: function (res) {
- var temp = WxParse.wxParse('article', 'html', res.data, that, 5);
- }
- })
- }
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.setData({
- date:new Date()
- })
- }
- })
|