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.

71 lines
1.7 KiB

  1. let config = require("../../config/config.js");
  2. let app = getApp();
  3. const Http = require("../../utils/HttpBasics");
  4. const util = require("../../utils/util");
  5. var WxParse = require('../../wxParse/wxParse.js');
  6. const imgurl = require("../../utils/imgurl");
  7. Page({
  8. data: {
  9. data: {},
  10. couponId: null,
  11. orderId: "",
  12. day: "",
  13. hour: "",
  14. wmhome: imgurl.wmhome.url,
  15. minute: "",
  16. nodes: ''
  17. },
  18. onLoad(options) {
  19. let that = this;
  20. console.log(options)
  21. if (options.id){
  22. Http.get({
  23. url: config.api.acfindById,
  24. data: {
  25. id: options.id
  26. }
  27. }).then(res => {
  28. that.setData({
  29. data: res.data.activity
  30. });
  31. if (res.data.activity.type == 2 ){
  32. wx.request({
  33. url: 'https://ciformall.youlane.cn/C/api' + config.api.acPrintHtmlById,
  34. data: {
  35. id: options.id,
  36. date: new Date(),
  37. token: app.globalData.token,
  38. },
  39. header: {
  40. 'content-type': 'application/html'
  41. },
  42. success: function (res) {
  43. var temp = WxParse.wxParse('article', 'html', res.data, that, 5);
  44. }
  45. })
  46. }
  47. }).catch(err => {
  48. wx.showToast({
  49. title: err.errMsg,
  50. icon: 'none',
  51. duration: 2000,
  52. mask: false
  53. })
  54. })
  55. }
  56. },
  57. goback: function () {
  58. wx.switchTab({
  59. url: '/pages/main/index',
  60. })
  61. },
  62. gotoactdetail:function(){
  63. let that = this;
  64. console.log(that.data.data.detail)
  65. wx.navigateTo({
  66. url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
  67. })
  68. }
  69. });