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

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