C端小程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

98 строки
2.4 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. const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
  8. let configUrls = extConfig.attr.configUrl;
  9. Page({
  10. data: {
  11. data: {},
  12. status:1,
  13. couponId: null,
  14. orderId: "",
  15. question:[],
  16. day: "",
  17. hour: "",
  18. activityId:"",
  19. wmhome: imgurl.wmhome.url,
  20. minute: "",
  21. nodes: ''
  22. },
  23. onLoad(options) {
  24. let that = this;
  25. if (options.id){
  26. that.setData({
  27. activityId: options.id
  28. })
  29. Http.get({
  30. url: config.api.acfindById,
  31. data: {
  32. id: options.id
  33. }
  34. }).then(res => {
  35. if (res && res.data && res.data.activity){
  36. that.setData({
  37. data: res.data.activity
  38. })
  39. if (res.data && res.data.activity && res.data.activity.question){
  40. that.setData({
  41. question: JSON.parse(res.data.activity.question)
  42. })
  43. }
  44. if (res.data.activity.type == 2) {
  45. wx.request({
  46. url: configUrls + config.api.acPrintHtmlById,
  47. data: {
  48. id: options.id,
  49. date: new Date(),
  50. token: app.globalData.token,
  51. },
  52. header: {
  53. 'content-type': 'application/html'
  54. },
  55. success: function (res) {
  56. var temp = WxParse.wxParse('article', 'html', res.data, that, 5);
  57. }
  58. })
  59. }
  60. }
  61. if (res && res.data && res.data.status) {
  62. that.setData({
  63. status: res.data.status
  64. });
  65. }
  66. }).catch(err => {
  67. wx.showToast({
  68. title: err.errMsg,
  69. icon: 'none',
  70. duration: 2000,
  71. mask: false
  72. })
  73. })
  74. }
  75. },
  76. //跳转到报名详情页
  77. goSignUp(e){
  78. let activityId = e.currentTarget.dataset.activityid;
  79. wx.navigateTo({
  80. url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`,
  81. })
  82. },
  83. goback: function () {
  84. wx.switchTab({
  85. url: '/pages/main/index',
  86. })
  87. },
  88. gotoactdetail:function(){
  89. let that = this;
  90. console.log(that.data.data.detail)
  91. wx.navigateTo({
  92. url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
  93. })
  94. }
  95. });