C端小程序
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

107 行
2.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. 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&&options.id){
  26. that.setData({
  27. activityId: options.id
  28. })
  29. that.findById(options.id);
  30. }
  31. },
  32. findById(id) {
  33. let that = this;
  34. Http.get({
  35. url: config.api.acfindById,
  36. data: {
  37. id: id
  38. }
  39. }).then(res => {
  40. that.setData({
  41. status: res.data.status
  42. });
  43. if (res && res.data && res.data.activity) {
  44. that.setData({
  45. data: res.data.activity
  46. })
  47. that.setData({
  48. activityStartTime: util.formatTime(res.data.activity.activityStartTime, "yyyy-MM-dd hh:mm:ss"),
  49. activityEndTime: util.formatTime(res.data.activity.activityEndTime, "yyyy-MM-dd hh:mm:ss"),
  50. startTime: util.formatTime(res.data.activity.startTime, "yyyy-MM-dd hh:mm:ss"),
  51. endTime: util.formatTime(res.data.activity.endTime, "yyyy-MM-dd hh:mm:ss")
  52. })
  53. if (res.data.activity.type == 2) {
  54. var temp = WxParse.wxParse('article', 'html', res.data.activity.html, that, 5);
  55. }
  56. }
  57. }).catch(err => {
  58. wx.showToast({
  59. title: err.errMsg,
  60. icon: 'none',
  61. duration: 2000,
  62. mask: false
  63. })
  64. })
  65. },
  66. //跳转到报名详情页
  67. goSignUp(e) {
  68. wx.showLoading({
  69. title: '报名中...',
  70. })
  71. let activityId = e.currentTarget.dataset.activityid;
  72. this.checkUserStatus(activityId);
  73. },
  74. checkUserStatus(activityId){
  75. let that = this;
  76. Http.get({
  77. url: config.api.checkPhoneStatus,
  78. data: {}
  79. }).then(res=>{
  80. wx.hideLoading()
  81. wx.navigateTo({
  82. url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`,
  83. })
  84. }).catch(err=>{
  85. wx.hideLoading()
  86. wx.navigateTo({
  87. url: `/pages/getphoneInfo/index?signActivity=${activityId}`,
  88. })
  89. })
  90. },
  91. goback: function() {
  92. wx.switchTab({
  93. url: '/pages/main/index',
  94. })
  95. },
  96. gotoactdetail: function() {
  97. let that = this;
  98. console.log(that.data.data.detail)
  99. wx.navigateTo({
  100. url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
  101. })
  102. }
  103. });