C端小程序
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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