//获取应用实例
const app = getApp()
Component({
  properties: {
    num: { //购物车数量
      type: Number,
      value: 1
    },
    disabled: { //输入框是否可编辑
      type: Boolean,
      value: false
    }
  },
  data: {
    cantMinus: true, //减号是否可以点击
  },
  methods: {
    //购物车加
    add() {
      let addEventDetail = {}
      let addEventOption = {}
      this.triggerEvent('add', addEventDetail, addEventOption)
    },
    //购物车减
    minus() {
      let minusEventDetail = {}
      let minusEventOption = {}
      this.triggerEvent('minus', minusEventDetail, minusEventOption)
    },
    //输入框
    setInput(e) {
      let value = e.detail.value
      this.triggerEvent('setInput', value)
    }
  }
})