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.

63 line
1.3 KiB

  1. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  2. const util = require("../../utils/util.js");
  3. const Http = require("../../utils/HttpBasics");
  4. const config = require("../../config/config");
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. navigationBarHeight,
  11. showPage: false,
  12. showPage1:false
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. let that = this;
  19. if(options&&options.id){
  20. that.signIn(options.id);
  21. that.setData({
  22. id:options.id
  23. })
  24. }
  25. },
  26. signIn(id){
  27. let that = this;
  28. Http.post({
  29. url: config.api.activitySign,
  30. data: {
  31. activityId:id
  32. }
  33. }).then(res => {
  34. console.log(res)
  35. that.setData({
  36. showPage:true
  37. })
  38. }).catch(err=>{
  39. console.log(err);
  40. that.setData({
  41. showPage1: true
  42. })
  43. })
  44. },
  45. //跳转到报名详情页
  46. goSignUp(e) {
  47. let activityId = e.currentTarget.dataset.id;
  48. if (activityId){
  49. wx.navigateTo({
  50. url: `/pages/radetail/index?id=${activityId}`,
  51. })
  52. }else{
  53. wx.showToast({
  54. title: '此活动报名已结束',
  55. })
  56. }
  57. },
  58. goback: function () {
  59. wx.switchTab({
  60. url: '/index/index',
  61. })
  62. }
  63. })