抖音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.

49 lines
1.1 KiB

  1. let config = require("../../config/config.js");
  2. const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync().extConfig : {}
  3. let configUrls = extConfig.attr.configUrl;
  4. let app = getApp();
  5. var ttParse = require('./ttParse/wxParse.js');
  6. Page({
  7. data: {
  8. nodeData: "",
  9. date: "",
  10. mallTenantId: ""
  11. },
  12. onLoad: function (options) {
  13. const that = this
  14. const date = new Date()
  15. that.setData({
  16. date,
  17. mallTenantId: tt.getStorageSync('mallTenantId') || ""
  18. })
  19. if (options.id) {
  20. that.getHtmlData(options.id)
  21. }
  22. },
  23. getHtmlData(id) {
  24. const that = this
  25. tt.request({
  26. url: configUrls + config.api.printHtmlById,
  27. data: {
  28. token: app.globalData.token,
  29. id,
  30. date: that.data.date,
  31. mallTenantId: that.data.mallTenantId
  32. },
  33. header: {
  34. 'content-type': 'application/html'
  35. },
  36. success: function (res) {
  37. console.log(res, 'res');
  38. if (res.data) {
  39. console.log(res.data, 'html');
  40. var temp = ttParse.wxParse('article', 'html', res.data, that, 5);
  41. }
  42. }
  43. })
  44. }
  45. })