C端小程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

110 linhas
2.8 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. const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
  9. let configUrls = extConfig.attr.configUrl;
  10. Page({
  11. data: {
  12. navigationBarHeight,
  13. data: {},
  14. status: 1,
  15. couponId: null,
  16. orderId: "",
  17. question: [],
  18. day: "",
  19. hour: "",
  20. activityId: "",
  21. homeSelectedO: imgurl.homeSelectedO.url,
  22. wmhome: imgurl.wmhome.url,
  23. minute: "",
  24. nodes: ''
  25. },
  26. onLoad(options) {
  27. let that = this;
  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: '/pages/main/index',
  97. })
  98. },
  99. gotoactdetail: function() {
  100. let that = this;
  101. console.log(that.data.data.detail)
  102. wx.navigateTo({
  103. url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
  104. })
  105. }
  106. });