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.

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