C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 rivejä
1.7 KiB

  1. let app = getApp();
  2. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  3. var WxParse = require('../../wxParse/wxParse.js');
  4. const config = require("../../config/config");
  5. const Http = require("../../utils/HttpBasics");
  6. const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
  7. let configUrls = extConfig.attr.configUrl;
  8. console.log(configUrls)
  9. Page({
  10. /**
  11. * 页面的初始数据
  12. */
  13. data: {
  14. navigationBarHeight,
  15. url: config.url,
  16. token: app.globalData.token,
  17. id:'',
  18. date:new Date()
  19. },
  20. /**
  21. * 生命周期函数--监听页面加载
  22. */
  23. onLoad: function (options) {
  24. const that = this;
  25. that.setData({
  26. url: config.url,
  27. id:options.id,
  28. token: app.globalData.token
  29. })
  30. wx.request({
  31. url: configUrls + config.api.printHtmlById,
  32. data: {
  33. token: app.globalData.token,
  34. id: options.id,
  35. date: new Date()
  36. },
  37. header: {
  38. 'content-type': 'application/html'
  39. },
  40. success: function (res) {
  41. var temp = WxParse.wxParse('article', 'html',res.data, that, 5);
  42. }
  43. })
  44. },
  45. /**
  46. * 生命周期函数--监听页面初次渲染完成
  47. */
  48. onReady: function () {
  49. },
  50. /**
  51. * 生命周期函数--监听页面显示
  52. */
  53. onShow: function () {
  54. this.setData({
  55. date:new Date()
  56. })
  57. },
  58. /**
  59. * 生命周期函数--监听页面隐藏
  60. */
  61. onHide: function () {
  62. },
  63. /**
  64. * 生命周期函数--监听页面卸载
  65. */
  66. onUnload: function () {
  67. },
  68. /**
  69. * 页面相关事件处理函数--监听用户下拉动作
  70. */
  71. onPullDownRefresh: function () {
  72. },
  73. /**
  74. * 页面上拉触底事件的处理函数
  75. */
  76. onReachBottom: function () {
  77. },
  78. })