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

108 行
2.7 KiB

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