C端小程序
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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