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

111 行
2.9 KiB

  1. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px';
  2. let config = require("../../config/config.js");
  3. let app = getApp();
  4. const Http = require("../../utils/HttpBasics");
  5. const util = require("../../utils/util");
  6. var WxParse = require('../../wxParse/wxParse.js');
  7. const imgurl = require("../../utils/imgurl");
  8. Page({
  9. data: {
  10. fenxiang: imgurl.fenxiang1.url,
  11. navigationBarHeight,
  12. data: {},
  13. status: 1,
  14. couponId: null,
  15. orderId: "",
  16. question: [],
  17. day: "",
  18. hour: "",
  19. activityId: "",
  20. homeSelectedO: imgurl.homeSelectedO.url,
  21. wmhome: imgurl.wmhome.url,
  22. minute: "",
  23. nodes: '',
  24. },
  25. onLoad(options) {
  26. let that = this;
  27. wx.hideShareMenu();
  28. if(options&&options.id){
  29. that.setData({
  30. activityId: options.id
  31. })
  32. that.findById(options.id);
  33. }
  34. },
  35. findById(id) {
  36. let that = this;
  37. Http.get({
  38. url: config.api.acfindById,
  39. data: {
  40. id: id
  41. }
  42. }).then(res => {
  43. that.setData({
  44. status: res.data.status
  45. });
  46. if (res && res.data && res.data.activity) {
  47. that.setData({
  48. data: res.data.activity
  49. })
  50. that.setData({
  51. activityStartTime: util.formatTime(res.data.activity.activityStartTime, "yyyy-MM-dd hh:mm:ss"),
  52. activityEndTime: util.formatTime(res.data.activity.activityEndTime, "yyyy-MM-dd hh:mm:ss"),
  53. startTime: util.formatTime(res.data.activity.startTime, "yyyy-MM-dd hh:mm:ss"),
  54. endTime: util.formatTime(res.data.activity.endTime, "yyyy-MM-dd hh:mm:ss")
  55. })
  56. if (res.data.activity.type == 2) {
  57. var temp = WxParse.wxParse('article', 'html', res.data.activity.html, that, 5);
  58. }
  59. }
  60. }).catch(err => {
  61. wx.showToast({
  62. title: err.errMsg,
  63. icon: 'none',
  64. duration: 2000,
  65. mask: false
  66. })
  67. })
  68. },
  69. //跳转到报名详情页
  70. goSignUp(e) {
  71. wx.showLoading({
  72. title: '报名中...',
  73. })
  74. let activityId = e.currentTarget.dataset.activityid;
  75. this.checkUserStatus(activityId);
  76. },
  77. checkUserStatus(activityId){
  78. let that = this;
  79. Http.get({
  80. url: config.api.checkPhoneStatus,
  81. data: {}
  82. }).then(res=>{
  83. wx.hideLoading()
  84. wx.navigateTo({
  85. url: `/pages/radetail/joinActivity/edit?activityId=${activityId}`,
  86. })
  87. }).catch(err=>{
  88. wx.hideLoading()
  89. wx.navigateTo({
  90. url: `/pages/getphoneInfo/index?signActivity=${activityId}`,
  91. })
  92. })
  93. },
  94. goback: function() {
  95. wx.switchTab({
  96. url: '/index/index',
  97. })
  98. },
  99. onShareAppMessage: function (options) {
  100. var that = this;
  101. let shareObj = {};
  102. // 来自页面内的按钮的转发
  103. if (options.from == 'button') {
  104. var eData = options.target.dataset.id;
  105. shareObj.path = `/pages/index/index?id=${eData}&type=ra` + (wx.getStorageSync('tenantId') ? '&tenantId=' + wx.getStorageSync('tenantId') : '');
  106. }
  107. return shareObj;
  108. },
  109. });