123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- import {
- iactivity
- } from '../../../api/api.js'
- const app = getApp()
- Page({
- data: {
- gender: 1,
- age_range: ''
- },
- clickRegister() {
- if (!this.data.realname) {
- return wx.showToast({
- icon: 'loading',
- title: '请填写姓名!'
- })
- }
- if (!this.data.age_range) {
- return wx.showToast({
- icon: 'loading',
- title: '请选择年龄段!'
- })
- }
- if (!this.data.mobile || this.data.mobile.length != 11) {
- return wx.showToast({
- icon: 'loading',
- title: '请正确填写手机号!'
- })
- }
- if (!this.data.address) {
- return wx.showToast({
- icon: 'loading',
- title: '请填写地址!'
- })
- }
-
-
-
-
-
-
-
- let {event_id,address,age_range,mobile,gender,realname} = this.data
- iactivity.loadSaveApply({
- reqdata: {
- activityId: event_id-0,
- address: address,
- generation: age_range,
- phone: mobile,
- sex: gender,
- userId: wx.getStorageSync('id'),
- username: realname
- }
- }, r => {
- wx.reLaunch({
- url: '/pages/home/home',
- success: () => {
- wx.showToast({
- title: '参加活动成功!',
- icon: 'none'
- })
- }
- })
- })
- },
- clickRadio(e) {
- this.setData({
- gender: e.currentTarget.dataset.v
- })
- },
- clickAgegroup(e) {
- this.setData({
- showAgegroupModal: true
- })
- },
- clickAgegroupModalCancel() {
- this.setData({
- showAgegroupModal: false
- })
- },
- clickAgegroupItem(e) {
- this.setData({
- age_range: e.currentTarget.dataset.agegroup,
- showAgegroupModal: false
- })
- },
- inputName(e) {
- this.setData({
- realname: e.detail.value
- })
- },
- inputPhoneno(e) {
- this.setData({
- mobile: e.detail.value
- })
- },
- inputAddress(e) {
- this.setData({
- address: e.detail.value
- })
- },
- onLoad(opts) {
- this.setData({
- event_id: opts.id
- })
- }
- })
|