Component({
  data: {},
  props: {
    times: [],
    totalStock: 0,
    selectedIndex: 0,
    onChange: () => null
  },
  methods: {
    onItemTap({
      currentTarget
    }) {
      const {
        times
      } = this.props;
      const {
        value
      } = currentTarget.dataset;
      const {
        stock = 0,
        disabled
      } = times[value] || {};
      if (!+stock || disabled) return;
      this.props.onChange(value);
    }

  }
});