// components/ticket-zs/ticket-zs.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    list: [{
        value: 0,
        selected: true,
        text: '普通征税'
      }
      /* , {
            value: 2,
            selected: false,
            text: '差额征税'
          } */
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    select(e) {
      let index = Number(e.currentTarget.dataset.index)
      let list = this.data.list
      for (let i = 0; i < list.length; i++) {
        list[i].selected = false
      }
      list[index].selected = true
      this.setData({
        list
      })
      let value = list[index].value
      this.triggerEvent('select', {
        value
      })
    }
  }
})