register.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import {
  2. iactivity
  3. } from '../../../api/api.js'
  4. const app = getApp()
  5. Page({
  6. data: {
  7. gender: '男',
  8. age_range: ''
  9. },
  10. clickRegister() {
  11. if (!this.data.realname) {
  12. return wx.showToast({
  13. icon: 'loading',
  14. title: '请填写姓名!'
  15. })
  16. }
  17. if (!this.data.age_range) {
  18. return wx.showToast({
  19. icon: 'loading',
  20. title: '请选择年龄段!'
  21. })
  22. }
  23. if (!this.data.mobile || this.data.mobile.length != 11) {
  24. return wx.showToast({
  25. icon: 'loading',
  26. title: '请正确填写手机号!'
  27. })
  28. }
  29. if (!this.data.address) {
  30. return wx.showToast({
  31. icon: 'loading',
  32. title: '请填写地址!'
  33. })
  34. }
  35. delete this.data.showAgegroup
  36. delete this.data.__webviewId__
  37. iactivity.loadJoinin(this.data, r => {
  38. app.data.nav.joininActivityInfo = r.info
  39. wx.navigateTo({
  40. url: '../registerDone/registerDone'
  41. })
  42. })
  43. },
  44. clickRadio(e) {
  45. this.setData({
  46. gender: e.currentTarget.dataset.v
  47. })
  48. },
  49. clickAgegroup(e) {
  50. this.setData({
  51. showAgegroupModal: true
  52. })
  53. },
  54. clickAgegroupModalCancel() {
  55. this.setData({
  56. showAgegroupModal: false
  57. })
  58. },
  59. clickAgegroupItem(e) {
  60. this.setData({
  61. age_range: e.currentTarget.dataset.agegroup,
  62. showAgegroupModal: false
  63. })
  64. },
  65. inputName(e) {
  66. this.setData({
  67. realname: e.detail.value
  68. })
  69. },
  70. inputPhoneno(e) {
  71. this.setData({
  72. mobile: e.detail.value
  73. })
  74. },
  75. inputAddress(e) {
  76. this.setData({
  77. address: e.detail.value
  78. })
  79. },
  80. onLoad(opts) {
  81. this.setData({
  82. event_id: opts.id
  83. })
  84. }
  85. })