// pages/applicationForm/applicationForm.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    region: [],
    show: false,
    pxtext: '选择工作岗位',
    pxlxArr: '选择培训类型',
    htArr: [{
      name: '买卖合同'
    }, {
      name: '赠与合同'
    }, {
      name: '借款合同'
    }, {
      name: '租赁合同'
    }, {
      name: '承揽合同'
    }, {
      name: '运输合同'
    }],
    text: '选择合同类型',
    pxArr: [{
      name: '买卖合同'
    }, {
      name: '赠与合同'
    }, {
      name: '借款合同'
    }, {
      name: '租赁合同'
    }, {
      name: '承揽合同'
    }, {
      name: '运输合同'
    }],
    pxlxArr: [{
      name: '买卖合同'
    }, {
      name: '赠与合同'
    }, {
      name: '借款合同'
    }, {
      name: '租赁合同'
    }, {
      name: '承揽合同'
    }, {
      name: '运输合同'
    }],
    items: [{
      name: "女",
      value: 0,
      checked: 0
    }, {
      name: "男",
      value: 1,
      checked: 1
    }],
    items2: [{
      name: "是",
      value: 0,
      checked: 0
    }, {
      name: "否",
      value: 1,
      checked: 1
    }],
    items3: [{
      name: "是",
      value: 0,
      checked: 0
    }, {
      name: "否",
      value: 1,
      checked: 1
    }]
  },
  radioChange(e) {
    console.log('radio发生change事件，携带value值为：', e.detail.value)
    if (e.detail.value == 0) {
      this.setData({
        items: [{
          name: "女",
          value: 0,
          checked: 0
        }, {
          name: "男",
          value: 1,
          checked: 1
        }]
      })
    } else {
      this.setData({
        items: [{
          name: "女",
          value: 0,
          checked: 1
        }, {
          name: "男",
          value: 1,
          checked: 0
        }]
      })
    }
  },
  radioChange2(e) {
    console.log('radio发生change事件，携带value值为：', e.detail.value)
    if (e.detail.value == 0) {
      this.setData({
        items2: [{
          name: "是",
          value: 0,
          checked: 0
        }, {
          name: "否",
          value: 1,
          checked: 1
        }],
      })
    } else {
      this.setData({
        items2: [{
          name: "是",
          value: 0,
          checked: 1
        }, {
          name: "否",
          value: 1,
          checked: 0
        }],
      })
    }
  },
  radioChange3(e) {
    console.log('radio发生change事件，携带value值为：', e.detail.value)
    if (e.detail.value == 0) {
      this.setData({
        items3: [{
          name: "是",
          value: 0,
          checked: 0
        }, {
          name: "否",
          value: 1,
          checked: 1
        }],
      })
    } else {
      this.setData({
        items3: [{
          name: "是",
          value: 0,
          checked: 1
        }, {
          name: "否",
          value: 1,
          checked: 0
        }],
      })
    }
  },

  changeZone: function (e) {
    this.setData({
      region: e.detail.value
    })
  },
  htChange(e) {
    this.setData({
      htindex: e.detail.value,
      text: '',
    })
  },
  submitInfo() {
    this.setData({
      show: true
    })
   
  },
  sure() {
    this.setData({
      show: false
    })
    wx.switchTab({
      url: '/pages/ServiceCenter/ServiceCenter',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      currentName: options.name
    })
  },
  pxChange(e) {
    this.setData({
      pxindex: e.detail.value,
      pxtext: '',
    })
  },
  pxlxChange(e) {
    this.setData({
      pxlxindex: e.detail.value,
      pxlxtext: '',
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})